diff --git a/DEPS b/DEPS
index 43268be..09a13c8 100644
--- a/DEPS
+++ b/DEPS
@@ -111,11 +111,11 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '14768f64fba34ab6b7bc0ed853c9cfdb1ab965ca',
+  'skia_revision': '52a715455181a491d895dc4f3bf700c93dda3851',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling V8
   # and whatever else without interference from each other.
-  'v8_revision': '004565cfcf3a22345724c297dade0a983b7c7b20',
+  'v8_revision': '600998aa2d5e92302fc8974ee10f7b53c80d23b8',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling swarming_client
   # and whatever else without interference from each other.
@@ -123,7 +123,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling ANGLE
   # and whatever else without interference from each other.
-  'angle_revision': '3420dcb0cff13ac7aef8f512ca5becc9679aeb76',
+  'angle_revision': '7cba6be85a1468b113f64c5a8beff4dde4ae8217',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling build tools
   # and whatever else without interference from each other.
@@ -171,7 +171,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling catapult
   # and whatever else without interference from each other.
-  'catapult_revision': '36a23a7b2851af59ed8734145c92a2bb2eb243f2',
+  'catapult_revision': '5e1c1c293b07ef04a247dd8dff50972d207663a4',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libFuzzer
   # and whatever else without interference from each other.
@@ -675,7 +675,7 @@
   },
 
   'src/third_party/depot_tools':
-    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '46f20cd3905595b7485388f743613ed685c1bd89',
+    Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + 'f170af48e4490633334a300bbcb65d50fab09537',
 
   'src/third_party/devtools-node-modules':
     Var('chromium_git') + '/external/github.com/ChromeDevTools/devtools-node-modules' + '@' + Var('devtools_node_modules_revision'),
@@ -1004,7 +1004,7 @@
   },
 
   'src/third_party/perfetto':
-    Var('android_git') + '/platform/external/perfetto.git' + '@' +  'dc38c5209303e595a5bf8a81a5c8d80adda94e5b',
+    Var('android_git') + '/platform/external/perfetto.git' + '@' +  'dfe69cae695eee13453b8a30b0b88ed24f86bb83',
 
   'src/third_party/perl': {
       'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + 'ac0d98b5cee6c024b0cffeb4f8f45b6fc5ccdb78',
@@ -1060,7 +1060,7 @@
   },
 
   'src/third_party/re2/src':
-    Var('chromium_git') + '/external/github.com/google/re2.git' + '@' + '89528a380a7e9722dbf7b5a817251049eab355fb',
+    Var('chromium_git') + '/external/github.com/google/re2.git' + '@' + '22caec62055a7707cf5801bebb6028d06220f2b6',
 
   'src/third_party/r8': {
       'packages': [
@@ -1187,7 +1187,7 @@
     Var('chromium_git') + '/v8/v8.git' + '@' +  Var('v8_revision'),
 
   'src-internal': {
-    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@6f01f2f2b42fd3ab2941e1a76f05ba78d65a2fa2',
+    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@15a8883b4d7ddc424fba989c7b8c4c5d34c94131',
     'condition': 'checkout_src_internal',
   },
 
diff --git a/WATCHLISTS b/WATCHLISTS
index a7187be..6c33209 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -35,7 +35,8 @@
     'android_crash_reporting': {
       'filepath': 'chrome/android/java/src/org/chromium/chrome/browser/crash/' \
                   'chrome/browser/android/crash/' \
-                  'components/crash/android/'
+                  'components/crash/android/' \
+                  'components/minidump_uploader/'
     },
     'android_crazy_linker': {
       'filepath': 'third_party/android_crazy_linker/'
diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc
index 467a5845..730e0623 100644
--- a/android_webview/browser/hardware_renderer.cc
+++ b/android_webview/browser/hardware_renderer.cc
@@ -164,7 +164,8 @@
 
 void HardwareRenderer::AllocateSurface() {
   DCHECK(!child_id_.is_valid());
-  child_id_ = parent_local_surface_id_allocator_->GenerateId();
+  parent_local_surface_id_allocator_->GenerateId();
+  child_id_ = parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId();
   surfaces_->AddChildId(viz::SurfaceId(frame_sink_id_, child_id_));
 }
 
diff --git a/android_webview/browser/surfaces_instance.cc b/android_webview/browser/surfaces_instance.cc
index 24237157..89f331d 100644
--- a/android_webview/browser/surfaces_instance.cc
+++ b/android_webview/browser/surfaces_instance.cc
@@ -156,7 +156,8 @@
 
   if (!root_id_.is_valid() || viewport != surface_size_ ||
       device_scale_factor != device_scale_factor_) {
-    root_id_ = parent_local_surface_id_allocator_->GenerateId();
+    parent_local_surface_id_allocator_->GenerateId();
+    root_id_ = parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId();
     surface_size_ = viewport;
     device_scale_factor_ = device_scale_factor;
     display_->SetLocalSurfaceId(root_id_, device_scale_factor);
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsStaticsTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsStaticsTest.java
index f58c6ec..872d796 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsStaticsTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsStaticsTest.java
@@ -7,21 +7,39 @@
 import android.support.test.InstrumentationRegistry;
 import android.support.test.filters.SmallTest;
 
+import org.junit.Assert;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 
+import org.chromium.android_webview.AwContents;
 import org.chromium.android_webview.AwContentsStatics;
+import org.chromium.android_webview.ErrorCodeConversionHelper;
+import org.chromium.android_webview.test.TestAwContentsClient.OnReceivedError2Helper;
 import org.chromium.base.test.util.CallbackHelper;
 import org.chromium.base.test.util.Feature;
+import org.chromium.net.AndroidNetworkLibraryTestUtil;
+import org.chromium.net.test.EmbeddedTestServer;
 
 /**
  * AwContentsStatics tests.
  */
 @RunWith(AwJUnit4ClassRunner.class)
 public class AwContentsStaticsTest {
+    private AwContents mAwContents;
+    private AwTestContainerView mTestContainer;
+    private TestAwContentsClient mContentsClient;
+
     @Rule
-    public AwActivityTestRule mActivityTestRule = new AwActivityTestRule();
+    public AwActivityTestRule mActivityTestRule = new AwActivityTestRule() {
+        /**
+         * This is necessary so we can set the cleartext setting before browser startup.
+         */
+        @Override
+        public boolean needsBrowserProcessStarted() {
+            return false;
+        }
+    };
 
     private static class ClearClientCertCallbackHelper extends CallbackHelper
             implements Runnable {
@@ -35,6 +53,7 @@
     @Feature({"AndroidWebView"})
     @SmallTest
     public void testClearClientCertPreferences() throws Throwable {
+        mActivityTestRule.startBrowserProcess();
         final ClearClientCertCallbackHelper callbackHelper = new ClearClientCertCallbackHelper();
         int currentCallCount = callbackHelper.getCallCount();
         InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
@@ -45,4 +64,70 @@
         });
         callbackHelper.waitForCallback(currentCallCount);
     }
+
+    private void createContainerView() throws Exception {
+        mContentsClient = new TestAwContentsClient();
+        mTestContainer = mActivityTestRule.createAwTestContainerViewOnMainSync(mContentsClient);
+        mAwContents = mTestContainer.getAwContents();
+    }
+
+    @Test
+    @Feature({"AndroidWebView"})
+    @SmallTest
+    public void testSetCheckClearTextPermittedTrue() throws Throwable {
+        // Note: must setCheckClearTextPermitted() before starting browser process.
+        AwContentsStatics.setCheckClearTextPermitted(true);
+        mActivityTestRule.startBrowserProcess();
+
+        // Set the policy to reject cleartext, otherwise there's nothing to validate.
+        AndroidNetworkLibraryTestUtil.setUpSecurityPolicyForTesting(false);
+
+        createContainerView();
+
+        EmbeddedTestServer testServer = EmbeddedTestServer.createAndStartServer(
+                InstrumentationRegistry.getInstrumentation().getContext());
+        try {
+            String url = testServer.getURL("/android_webview/test/data/hello_world.html");
+            OnReceivedError2Helper errorHelper = mContentsClient.getOnReceivedError2Helper();
+            int errorCount = errorHelper.getCallCount();
+            mActivityTestRule.loadUrlSync(
+                    mAwContents, mContentsClient.getOnPageFinishedHelper(), url);
+            Assert.assertEquals("onReceivedError should be called.", errorCount + 1,
+                    errorHelper.getCallCount());
+            Assert.assertEquals("Incorrect network error code.",
+                    ErrorCodeConversionHelper.ERROR_UNKNOWN, errorHelper.getError().errorCode);
+            Assert.assertEquals("onReceivedError was called for the wrong URL.", url,
+                    errorHelper.getRequest().url);
+        } finally {
+            testServer.stopAndDestroyServer();
+        }
+    }
+
+    @Test
+    @Feature({"AndroidWebView"})
+    @SmallTest
+    public void testSetCheckClearTextPermittedFalse() throws Throwable {
+        // Note: must setCheckClearTextPermitted() before starting browser process.
+        AwContentsStatics.setCheckClearTextPermitted(false);
+        mActivityTestRule.startBrowserProcess();
+
+        // Set the policy to reject cleartext, otherwise there's nothing to validate.
+        AndroidNetworkLibraryTestUtil.setUpSecurityPolicyForTesting(false);
+
+        createContainerView();
+
+        EmbeddedTestServer testServer = EmbeddedTestServer.createAndStartServer(
+                InstrumentationRegistry.getInstrumentation().getContext());
+        try {
+            String url = testServer.getURL("/android_webview/test/data/hello_world.html");
+            OnReceivedError2Helper errorHelper = mContentsClient.getOnReceivedError2Helper();
+            int errorCount = errorHelper.getCallCount();
+            mActivityTestRule.loadUrlSync(
+                    mAwContents, mContentsClient.getOnPageFinishedHelper(), url);
+            Assert.assertEquals("onReceivedError should not be called.", errorCount,
+                    errorHelper.getCallCount());
+        } finally {
+            testServer.stopAndDestroyServer();
+        }
+    }
 }
diff --git a/android_webview/test/BUILD.gn b/android_webview/test/BUILD.gn
index c102635..1a21e3a 100644
--- a/android_webview/test/BUILD.gn
+++ b/android_webview/test/BUILD.gn
@@ -165,6 +165,7 @@
     "//mojo/public/java:bindings_java",
     "//net/android:net_java",
     "//net/android:net_java_test_support",
+    "//net/android:net_javatests",
     "//services/device/public/java:geolocation_java",
     "//services/device/public/java:geolocation_java_test_support",
     "//third_party/android_support_test_runner:rules_java",
diff --git a/ash/app_list/resources/BUILD.gn b/ash/app_list/resources/BUILD.gn
index d42b3e7..030e69a8 100644
--- a/ash/app_list/resources/BUILD.gn
+++ b/ash/app_list/resources/BUILD.gn
@@ -15,8 +15,6 @@
   source = "app_list_resources.grd"
   outputs = [
     "grit/app_list_resources.h",
-    "grit/app_list_resources_map.cc",
-    "grit/app_list_resources_map.h",
     "app_list_resources_100_percent.pak",
     "app_list_resources_200_percent.pak",
     "app_list_resources_300_percent.pak",
diff --git a/ash/app_list/resources/app_list_resources.grd b/ash/app_list/resources/app_list_resources.grd
index d9eb0be9..7ff114d 100644
--- a/ash/app_list/resources/app_list_resources.grd
+++ b/ash/app_list/resources/app_list_resources.grd
@@ -4,8 +4,6 @@
     <output filename="grit/app_list_resources.h" type="rc_header" context="default_100_percent">
       <emit emit_type='prepend'></emit>
     </output>
-    <output filename="grit/app_list_resources_map.cc" type="resource_map_source" context="default_100_percent" />
-    <output filename="grit/app_list_resources_map.h" type="resource_map_header" context="default_100_percent" />
     <output filename="app_list_resources_100_percent.pak" type="data_package" context="default_100_percent" />
     <output filename="app_list_resources_200_percent.pak" type="data_package" context="default_200_percent" />
     <output filename="app_list_resources_300_percent.pak" type="data_package" context="default_300_percent" />
diff --git a/ash/system/message_center/unified_message_list_view.cc b/ash/system/message_center/unified_message_list_view.cc
index 0e5d6cf..afb40d8 100644
--- a/ash/system/message_center/unified_message_list_view.cc
+++ b/ash/system/message_center/unified_message_list_view.cc
@@ -273,7 +273,7 @@
   ResetBounds();
 }
 
-void UnifiedMessageListView::OnSlideChanged(
+void UnifiedMessageListView::OnSlideStarted(
     const std::string& notification_id) {
   // When the swipe control for |notification_id| is shown, hide all other swipe
   // controls.
diff --git a/ash/system/message_center/unified_message_list_view.h b/ash/system/message_center/unified_message_list_view.h
index 6331e71..97ef28a2 100644
--- a/ash/system/message_center/unified_message_list_view.h
+++ b/ash/system/message_center/unified_message_list_view.h
@@ -62,7 +62,7 @@
   void OnNotificationUpdated(const std::string& id) override;
 
   // message_center::MessageView::SlideObserver:
-  void OnSlideChanged(const std::string& notification_id) override;
+  void OnSlideStarted(const std::string& notification_id) override;
 
   // gfx::AnimationDelegate:
   void AnimationEnded(const gfx::Animation* animation) override;
diff --git a/base/android/jni_generator/BUILD.gn b/base/android/jni_generator/BUILD.gn
index e67e7639..3639eab 100644
--- a/base/android/jni_generator/BUILD.gn
+++ b/base/android/jni_generator/BUILD.gn
@@ -8,17 +8,24 @@
 
 generate_jni("jni_sample_header") {
   sources = [
+    "java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java",
     "java/src/org/chromium/example/jni_generator/SampleForTests.java",
   ]
   jni_package = "example"
 }
 
 android_library("jni_sample_java") {
-  java_files =
-      [ "java/src/org/chromium/example/jni_generator/SampleForTests.java" ]
+  java_files = [
+    "java/src/org/chromium/example/jni_generator/SampleForTests.java",
+    "java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java",
+  ]
+
   deps = [
     "//base:base_java",
+    "//base:jni_processor_annotations_java",
   ]
+
+  annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ]
 }
 
 android_library("jni_annotation_sample_java") {
diff --git a/base/android/jni_generator/HashedSampleForAnnotationProcessor_jni.golden b/base/android/jni_generator/HashedSampleForAnnotationProcessor_jni.golden
new file mode 100644
index 0000000..af3fe48
--- /dev/null
+++ b/base/android/jni_generator/HashedSampleForAnnotationProcessor_jni.golden
@@ -0,0 +1,98 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// This file is autogenerated by
+//     base/android/jni_generator/jni_generator.py
+// For
+//     org/chromium/example/jni_generator/SampleForAnnotationProcessor
+
+#ifndef org_chromium_example_jni_generator_SampleForAnnotationProcessor_JNI
+#define org_chromium_example_jni_generator_SampleForAnnotationProcessor_JNI
+
+#include <jni.h>
+
+#include "base/android/jni_generator/jni_generator_helper.h"
+
+
+// Step 1: Forward declarations.
+
+
+// Step 2: Constants (optional).
+
+
+// Step 3: Method stubs.
+static void JNI_SampleForAnnotationProcessor_Foo(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT void Java_org_chromium_base_natives_GEN_1JNI_MygCV2jQ(
+    JNIEnv* env,
+    jclass jcaller) {
+  return JNI_SampleForAnnotationProcessor_Foo(env, base::android::JavaParamRef<jclass>(env,
+      jcaller));
+}
+
+static base::android::ScopedJavaLocalRef<jobject> JNI_SampleForAnnotationProcessor_Bar(JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobject>& sample);
+
+JNI_GENERATOR_EXPORT jobject Java_org_chromium_base_natives_GEN_1JNI_MHuqnmXT(
+    JNIEnv* env,
+    jclass jcaller,
+    jobject sample) {
+  return JNI_SampleForAnnotationProcessor_Bar(env, base::android::JavaParamRef<jclass>(env,
+      jcaller), base::android::JavaParamRef<jobject>(env, sample)).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jstring> JNI_SampleForAnnotationProcessor_RevString(JNIEnv*
+    env, const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jstring>& stringToReverse);
+
+JNI_GENERATOR_EXPORT jstring Java_org_chromium_base_natives_GEN_1JNI_MM5Xkwyy(
+    JNIEnv* env,
+    jclass jcaller,
+    jstring stringToReverse) {
+  return JNI_SampleForAnnotationProcessor_RevString(env, base::android::JavaParamRef<jclass>(env,
+      jcaller), base::android::JavaParamRef<jstring>(env, stringToReverse)).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray>
+    JNI_SampleForAnnotationProcessor_SendToNative(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& strs);
+
+JNI_GENERATOR_EXPORT jobjectArray Java_org_chromium_base_natives_GEN_1JNI_MAC2QhR9(
+    JNIEnv* env,
+    jclass jcaller,
+    jobjectArray strs) {
+  return JNI_SampleForAnnotationProcessor_SendToNative(env, base::android::JavaParamRef<jclass>(env,
+      jcaller), base::android::JavaParamRef<jobjectArray>(env, strs)).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray>
+    JNI_SampleForAnnotationProcessor_SendSamplesToNative(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& strs);
+
+JNI_GENERATOR_EXPORT jobjectArray Java_org_chromium_base_natives_GEN_1JNI_MGhRh4Nd(
+    JNIEnv* env,
+    jclass jcaller,
+    jobjectArray strs) {
+  return JNI_SampleForAnnotationProcessor_SendSamplesToNative(env,
+      base::android::JavaParamRef<jclass>(env, jcaller),
+      base::android::JavaParamRef<jobjectArray>(env, strs)).Release();
+}
+
+static jboolean JNI_SampleForAnnotationProcessor_HasPhalange(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT jboolean Java_org_chromium_base_natives_GEN_1JNI_MW0aEs4h(
+    JNIEnv* env,
+    jclass jcaller) {
+  return JNI_SampleForAnnotationProcessor_HasPhalange(env, base::android::JavaParamRef<jclass>(env,
+      jcaller));
+}
+
+
+#endif  // org_chromium_example_jni_generator_SampleForAnnotationProcessor_JNI
diff --git a/base/android/jni_generator/SampleForAnnotationProcessor_jni.golden b/base/android/jni_generator/SampleForAnnotationProcessor_jni.golden
new file mode 100644
index 0000000..caa74fe
--- /dev/null
+++ b/base/android/jni_generator/SampleForAnnotationProcessor_jni.golden
@@ -0,0 +1,104 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// This file is autogenerated by
+//     base/android/jni_generator/jni_generator.py
+// For
+//     org/chromium/example/jni_generator/SampleForAnnotationProcessor
+
+#ifndef org_chromium_example_jni_generator_SampleForAnnotationProcessor_JNI
+#define org_chromium_example_jni_generator_SampleForAnnotationProcessor_JNI
+
+#include <jni.h>
+
+#include "base/android/jni_generator/jni_generator_helper.h"
+
+
+// Step 1: Forward declarations.
+
+
+// Step 2: Constants (optional).
+
+
+// Step 3: Method stubs.
+static void JNI_SampleForAnnotationProcessor_Foo(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT void
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1jni_11generator_1SampleForAnnotationProcessor_1foo(
+    JNIEnv* env,
+    jclass jcaller) {
+  return JNI_SampleForAnnotationProcessor_Foo(env, base::android::JavaParamRef<jclass>(env,
+      jcaller));
+}
+
+static base::android::ScopedJavaLocalRef<jobject> JNI_SampleForAnnotationProcessor_Bar(JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobject>& sample);
+
+JNI_GENERATOR_EXPORT jobject
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1jni_11generator_1SampleForAnnotationProcessor_1bar(
+    JNIEnv* env,
+    jclass jcaller,
+    jobject sample) {
+  return JNI_SampleForAnnotationProcessor_Bar(env, base::android::JavaParamRef<jclass>(env,
+      jcaller), base::android::JavaParamRef<jobject>(env, sample)).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jstring> JNI_SampleForAnnotationProcessor_RevString(JNIEnv*
+    env, const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jstring>& stringToReverse);
+
+JNI_GENERATOR_EXPORT jstring
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1jni_11generator_1SampleForAnnotationProcessor_1revString(
+    JNIEnv* env,
+    jclass jcaller,
+    jstring stringToReverse) {
+  return JNI_SampleForAnnotationProcessor_RevString(env, base::android::JavaParamRef<jclass>(env,
+      jcaller), base::android::JavaParamRef<jstring>(env, stringToReverse)).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray>
+    JNI_SampleForAnnotationProcessor_SendToNative(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& strs);
+
+JNI_GENERATOR_EXPORT jobjectArray
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1jni_11generator_1SampleForAnnotationProcessor_1sendToNative(
+    JNIEnv* env,
+    jclass jcaller,
+    jobjectArray strs) {
+  return JNI_SampleForAnnotationProcessor_SendToNative(env, base::android::JavaParamRef<jclass>(env,
+      jcaller), base::android::JavaParamRef<jobjectArray>(env, strs)).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray>
+    JNI_SampleForAnnotationProcessor_SendSamplesToNative(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& strs);
+
+JNI_GENERATOR_EXPORT jobjectArray
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1jni_11generator_1SampleForAnnotationProcessor_1sendSamplesToNative(
+    JNIEnv* env,
+    jclass jcaller,
+    jobjectArray strs) {
+  return JNI_SampleForAnnotationProcessor_SendSamplesToNative(env,
+      base::android::JavaParamRef<jclass>(env, jcaller),
+      base::android::JavaParamRef<jobjectArray>(env, strs)).Release();
+}
+
+static jboolean JNI_SampleForAnnotationProcessor_HasPhalange(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT jboolean
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1jni_11generator_1SampleForAnnotationProcessor_1hasPhalange(
+    JNIEnv* env,
+    jclass jcaller) {
+  return JNI_SampleForAnnotationProcessor_HasPhalange(env, base::android::JavaParamRef<jclass>(env,
+      jcaller));
+}
+
+
+#endif  // org_chromium_example_jni_generator_SampleForAnnotationProcessor_JNI
diff --git a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java
index 97095a4..96d18427 100644
--- a/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java
+++ b/base/android/jni_generator/java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java
@@ -20,7 +20,7 @@
      */
     @JniStaticNatives
     interface Natives {
-        void foo(String a, int b, char c, int[] d);
+        void foo();
         SampleForAnnotationProcessor bar(SampleForAnnotationProcessor sample);
         String revString(String stringToReverse);
         String[] sendToNative(String[] strs);
@@ -38,7 +38,7 @@
         samples = SampleForAnnotationProcessorJni.get().sendSamplesToNative(samples);
 
         // Instance of Natives accessed through (classname + "Jni").get().
-        SampleForAnnotationProcessorJni.get().foo("Test", 5, 'c', x);
+        SampleForAnnotationProcessorJni.get().foo();
         SampleForAnnotationProcessor sample = SampleForAnnotationProcessorJni.get().bar(this);
         boolean hasPhalange = SampleForAnnotationProcessorJni.get().hasPhalange();
         String s = SampleForAnnotationProcessorJni.get().revString("abcd");
diff --git a/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java b/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java
index 42d20199..c1dd499d 100644
--- a/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java
+++ b/base/android/jni_generator/java/src/org/chromium/jni_generator/JniProcessor.java
@@ -73,7 +73,7 @@
     private static MessageDigest sNativeMethodHashFunction;
 
     // If true, native methods in GEN_JNI will be named as a hash of their descriptor.
-    private static final boolean USE_HASH_FOR_METHODS = true;
+    private static final boolean USE_HASH_FOR_METHODS = false;
 
     // Limits the number characters of the Base64 encoded hash
     // of the method descriptor used as name of the generated
diff --git a/base/android/jni_generator/jni_generator.py b/base/android/jni_generator/jni_generator.py
index 4f14628..2f210bb5 100755
--- a/base/android/jni_generator/jni_generator.py
+++ b/base/android/jni_generator/jni_generator.py
@@ -6,8 +6,10 @@
 """Extracts native methods from a Java file and generates the JNI bindings.
 If you change this, please run and update the tests."""
 
+import base64
 import collections
 import errno
+import md5
 import optparse
 import os
 import re
@@ -26,7 +28,6 @@
 
 from util import build_utils
 
-
 # Match single line comments, multiline comments, character literals, and
 # double-quoted strings.
 _COMMENT_REMOVER_REGEX = re.compile(
@@ -45,6 +46,34 @@
     r'^\s*(?:@(?:\w+\.)*\w+\s+)*@MainDex\b',
     re.MULTILINE)
 
+# 'Proxy' native methods are declared in an @JniStaticNatives interface without
+# a native qualifier and indicate that the JNI annotation processor should
+# generate code to link between the equivalent native method as if it were
+# declared statically.
+# Under the hood the annotation processor generates the actual native method
+# declaration in another another class (org.chromium.base.natives.GEN_JNI)
+# but generates wrapper code so it can be called through the declaring class.
+NATIVE_PROXY_CLASS_NAME = 'GEN_JNI'
+NATIVE_PROXY_PACKAGE_NAME = 'org/chromium/base/natives'
+NATIVE_PROXY_QUALIFIED_NAME = '%s/%s' % (NATIVE_PROXY_PACKAGE_NAME,
+                                         NATIVE_PROXY_CLASS_NAME)
+
+# Matches on method declarations unlike _EXTRACT_NATIVES_REGEX
+# doesn't require name to be prefixed with native, and does not
+# require a native qualifier.
+_EXTRACT_METHODS_REGEX = re.compile(
+    r'(?P<qualifiers>'
+    r'((public|private|static|final|abstract|protected|native)\s*)*)\s+'
+    r'(?P<return_type>\S*)\s+'
+    r'(?P<name>\w+)\((?P<params>.*?)\);',
+    flags=re.MULTILINE)
+
+_NATIVE_PROXY_EXTRACTION_REGEX = re.compile(
+    r'@JniStaticNatives\s*interface\s*'
+    r'(?P<interface_name>\w*)\s*(?P<interface_body>{(\s*.*)+?\s*})')
+
+
+
 # Use 100 columns rather than 80 because it makes many lines more readable.
 _WRAP_LINE_LENGTH = 100
 # WrapOutput() is fairly slow. Pre-creating TextWrappers helps a bit.
@@ -86,6 +115,8 @@
     self.return_type = kwargs['return_type']
     self.name = kwargs['name']
     self.params = kwargs['params']
+    self.is_proxy = kwargs.get('is_proxy', False)
+    self.proxy_name = kwargs.get('proxy_name', self.name)
     if self.params:
       assert type(self.params) is list
       assert type(self.params[0]) is Param
@@ -489,15 +520,14 @@
   return bool(_MAIN_DEX_REGEX.search(contents))
 
 
-def GetBinaryClassName(fully_qualified_class):
-  """Returns a string concatenating the Java package and class."""
+def EscapeClassName(fully_qualified_class):
+  """Returns an escaped string concatenating the Java package and class."""
   escaped = fully_qualified_class.replace('_', '_1')
   return escaped.replace('/', '_').replace('$', '_00024')
 
-
 def GetRegistrationFunctionName(fully_qualified_class):
   """Returns the register name with a given class."""
-  return 'RegisterNative_' + GetBinaryClassName(fully_qualified_class)
+  return 'RegisterNative_' + EscapeClassName(fully_qualified_class)
 
 
 def GetStaticCastForReturnType(return_type):
@@ -776,6 +806,65 @@
     return jni_from_javap
 
 
+class NativeProxyHelpers(object):
+  MAX_CHARS_FOR_HASHED_NATIVE_METHODS = 8
+  ESCAPED_NATIVE_PROXY_CLASS = EscapeClassName(NATIVE_PROXY_QUALIFIED_NAME)
+
+  @staticmethod
+  def CreateHashedMethodName(fully_qualified_class_name, method_name):
+    m = md5.new()
+    descriptor = EscapeClassName(fully_qualified_class_name + '/' + method_name)
+
+    m.update(descriptor)
+    hash = m.digest()
+    hashed_name = ('M' + base64.b64encode(hash, altchars='$_')).rstrip('=')
+    return hashed_name[0:NativeProxyHelpers.MAX_CHARS_FOR_HASHED_NATIVE_METHODS]
+
+  @staticmethod
+  def CreateProxyMethodName(fully_qualified_class, old_name, use_hash=False):
+    """Returns the literal method name for the corresponding proxy method"""
+    if use_hash:
+      hashed_name = NativeProxyHelpers.CreateHashedMethodName(
+          fully_qualified_class, old_name)
+      return EscapeClassName(hashed_name)
+
+    # The annotation processor currently uses a method name
+    # org_chromium_example_foo_method_1name escaping _ to _1
+    # and then using the appending the method name to the qualified
+    # class. Since we need to escape underscores for jni to work
+    # we need to double escape _1 to _11
+    # This is the literal name of the GEN_JNI it still needs to be escaped once.
+    return EscapeClassName(fully_qualified_class + '/' + old_name)
+
+  @staticmethod
+  def ExtractStaticProxyNatives(fully_qualified_class,
+                                contents,
+                                ptr_type,
+                                use_hash=False):
+    methods = []
+    for match in _NATIVE_PROXY_EXTRACTION_REGEX.finditer(contents):
+      interface_body = match.group('interface_body')
+      for method in _EXTRACT_METHODS_REGEX.finditer(interface_body):
+        name = method.group('name')
+        params = JniParams.Parse(method.group('params'))
+        return_type = method.group('return_type')
+
+        unescaped_proxy_name = NativeProxyHelpers.CreateProxyMethodName(
+            fully_qualified_class, name, use_hash)
+        native = NativeMethod(
+            static=True,
+            java_class_name=None,
+            return_type=return_type,
+            name=name,
+            params=params,
+            is_proxy=True,
+            proxy_name=unescaped_proxy_name,
+            ptr_type=ptr_type)
+        methods.append(native)
+
+    return methods
+
+
 class JNIFromJavaSource(object):
   """Uses the given java source file to generate the JNI header file."""
 
@@ -786,6 +875,11 @@
     jni_namespace = ExtractJNINamespace(contents) or options.namespace
     natives = ExtractNatives(contents, options.ptr_type)
     called_by_natives = ExtractCalledByNatives(self.jni_params, contents)
+
+    natives += NativeProxyHelpers.ExtractStaticProxyNatives(
+        fully_qualified_class, contents, options.ptr_type,
+        options.use_proxy_hash)
+
     if len(natives) == 0 and len(called_by_natives) == 0:
       raise SyntaxError('Unable to find any JNI methods for %s.' %
                         fully_qualified_class)
@@ -821,19 +915,28 @@
     Returns:
       A string with the stub function name (used by the JVM).
     """
-    template = Template("Java_${JAVA_NAME}_native${NAME}")
+    if native.is_proxy:
+      method_name = EscapeClassName(native.proxy_name)
+      return 'Java_%s_%s' % (EscapeClassName(NATIVE_PROXY_QUALIFIED_NAME),
+                             method_name)
+
+    template = Template('Java_${JAVA_NAME}_native${NAME}')
 
     java_name = self.fully_qualified_class
     if native.java_class_name:
       java_name += '$' + native.java_class_name
 
-    values = {'NAME': native.name,
-              'JAVA_NAME': GetBinaryClassName(java_name)}
+    values = {'NAME': native.name, 'JAVA_NAME': EscapeClassName(java_name)}
     return template.substitute(values)
 
   def GetUniqueClasses(self, origin):
-    ret = {self.class_name: self.fully_qualified_class}
+    ret = {}
     for entry in origin:
+      if isinstance(entry, NativeMethod) and entry.is_proxy:
+        ret[NATIVE_PROXY_CLASS_NAME] = NATIVE_PROXY_QUALIFIED_NAME
+        continue
+      ret[self.class_name] = self.fully_qualified_class
+
       class_name = self.class_name
       jni_class_path = self.fully_qualified_class
       if entry.java_class_name:
@@ -858,10 +961,13 @@
 
     for full_clazz in classes.itervalues():
       values = {
-          'JAVA_CLASS': GetBinaryClassName(full_clazz),
+          'JAVA_CLASS': EscapeClassName(full_clazz),
           'JNI_CLASS_PATH': full_clazz,
       }
-      ret += [template.substitute(values)]
+      # Since all proxy methods use the same class, defining this in every
+      # header file would result in duplicated extern initializations.
+      if full_clazz != NATIVE_PROXY_QUALIFIED_NAME:
+        ret += [template.substitute(values)]
 
     class_getter = """\
 #ifndef ${JAVA_CLASS}_clazz_defined
@@ -884,9 +990,12 @@
 
     for full_clazz in classes.itervalues():
       values = {
-          'JAVA_CLASS': GetBinaryClassName(full_clazz),
+          'JAVA_CLASS': EscapeClassName(full_clazz),
       }
-      ret += [template.substitute(values)]
+      # Since all proxy methods use the same class, defining this in every
+      # header file would result in duplicated extern initializations.
+      if full_clazz != NATIVE_PROXY_QUALIFIED_NAME:
+        ret += [template.substitute(values)]
 
     return ''.join(ret)
 
@@ -1032,7 +1141,15 @@
     if native.java_class_name is not None:
       # Inner class
       class_name = native.java_class_name
-    return "JNI_%s_%s" % (class_name, native.name)
+
+    method_name = native.name
+    if native.is_proxy:
+      # proxy methods don't have a native prefix so the first letter is
+      # lowercase. But we still want the CPP declaration to use upper camel case
+      # for the method name.
+      method_name = method_name[0].upper() + method_name[1:]
+
+    return 'JNI_%s_%s' % (class_name, method_name)
 
   def GetNativeStub(self, native):
     is_method = native.type == 'method'
@@ -1059,6 +1176,7 @@
     profiling_entered_native = ''
     if self.options.enable_profiling:
       profiling_entered_native = '  JNI_LINK_SAVED_FRAME_POINTER;\n'
+
     values = {
         'RETURN': return_type,
         'RETURN_DECLARATION': return_declaration,
@@ -1188,7 +1306,7 @@
     java_name_full = java_class.replace('/', '.') + '.' + jni_name
     return {
         'JAVA_CLASS_ONLY': java_class_only,
-        'JAVA_CLASS': GetBinaryClassName(java_class),
+        'JAVA_CLASS': EscapeClassName(java_class),
         'RETURN_TYPE': return_type,
         'OPTIONAL_ERROR_RETURN': optional_error_return,
         'RETURN_DECLARATION': return_declaration,
@@ -1390,6 +1508,11 @@
                            help='Add additional profiling instrumentation.')
   option_parser.add_option('--enable_tracing', action='store_true',
                            help='Add TRACE_EVENTs to generated functions.')
+  option_parser.add_option(
+      '--use_proxy_hash',
+      action='store_true',
+      help='Hashes the native declaration of methods used '
+      'in an @JniNatives interface')
   options, args = option_parser.parse_args(argv)
   if options.jar_file:
     input_file = ExtractJarInputFile(options.jar_file, options.input_file,
diff --git a/base/android/jni_generator/jni_generator_tests.py b/base/android/jni_generator/jni_generator_tests.py
index 62ee862..ad77bbd 100755
--- a/base/android/jni_generator/jni_generator_tests.py
+++ b/base/android/jni_generator/jni_generator_tests.py
@@ -47,6 +47,8 @@
     self.native_exports_optional = True
     self.enable_profiling = False
     self.enable_tracing = False
+    self.use_proxy_hash = False
+
 
 class TestGenerator(unittest.TestCase):
   def assertObjEquals(self, first, second):
@@ -101,14 +103,23 @@
     with file(golden_file, 'r') as f:
       return f.read()
 
-  def assertGoldenTextEquals(self, generated_text, suffix=''):
+  def assertGoldenTextEquals(self, generated_text, suffix='', golden_file=None):
+    """Compares generated text with the corresponding golden_file
+
+    By default compares generated_text with the file at
+    script_dir/{caller_name}[suffix].golden. If the parameter golden_file is
+    provided it will instead compare the generated text with
+    script_dir/golden_file."""
     script_dir = os.path.dirname(sys.argv[0])
     # This is the caller test method.
     caller = inspect.stack()[1][3]
-    self.assertTrue(caller.startswith('test'),
-                    'assertGoldenTextEquals can only be called from a '
-                    'test* method, not %s' % caller)
-    golden_file = os.path.join(script_dir, '%s%s.golden' % (caller, suffix))
+
+    if golden_file is None:
+      self.assertTrue(
+          caller.startswith('test'),
+          'assertGoldenTextEquals can only be called from a '
+          'test* method, not %s' % caller)
+      golden_file = os.path.join(script_dir, '%s%s.golden' % (caller, suffix))
     golden_text = self._ReadGoldenFile(golden_file)
     if os.environ.get(REBASELINE_ENV):
       if golden_text != generated_text:
@@ -123,6 +134,135 @@
       self.assertGoldenTextEquals('')
     self.assertRaises(AssertionError, willRaise)
 
+  def testEscapingProxyNatives(self):
+    test_data = """
+    class SampleProxyJni {
+      @JniStaticNatives
+      interface Natives {
+        void foo_bar();
+        void foo__bar();
+      }
+    }
+    """
+    qualified_clazz = 'org/chromium/example/SampleProxyJni'
+
+    natives = jni_generator.NativeProxyHelpers.ExtractStaticProxyNatives(
+        qualified_clazz, test_data, 'long')
+
+    golden_natives = [
+        NativeMethod(
+            return_type='void',
+            static=True,
+            name='foo_bar',
+            params=[],
+            java_class_name=None,
+            is_proxy=True,
+            proxy_name='org_chromium_example_SampleProxyJni_foo_1bar',
+            type='function'),
+        NativeMethod(
+            return_type='void',
+            static=True,
+            name='foo__bar',
+            params=[],
+            java_class_name=None,
+            is_proxy=True,
+            proxy_name='org_chromium_example_SampleProxyJni_foo_1_1bar',
+            type='function'),
+    ]
+
+    self.assertListEquals(natives, golden_natives)
+
+  def testProxyNatives(self):
+    test_data = """
+    class SampleProxyJni {
+      private void do_not_match();
+      @JniStaticNatives
+      interface Natives {
+        void foo();
+        int bar(int x, int y);
+        String foobar(String x, String y);
+      }
+      void dontmatchme();
+      public static void metoo();
+      public static native void this_is_a_non_proxy_native();
+    }
+    """
+
+    bad_spaced_test_data = """
+    class SampleProxyJni{
+      @JniStaticNatives interface 
+      Natives 
+      
+      
+      { void     foo(); 
+      int              bar(int        x,  int y); String    
+        foobar(String x, String y); 
+      }
+
+    }
+    """
+
+    qualified_clazz = 'org/chromium/example/SampleProxyJni'
+
+    natives = jni_generator.NativeProxyHelpers.ExtractStaticProxyNatives(
+        qualified_clazz, test_data, 'long')
+    bad_spacing_natives = jni_generator.NativeProxyHelpers\
+      .ExtractStaticProxyNatives(qualified_clazz, bad_spaced_test_data, 'long')
+    golden_natives = [
+        NativeMethod(
+            return_type='void',
+            static=True,
+            name='foo',
+            params=[],
+            java_class_name=None,
+            is_proxy=True,
+            proxy_name='org_chromium_example_SampleProxyJni_foo',
+            type='function'),
+        NativeMethod(
+            return_type='int',
+            static=True,
+            name='bar',
+            params=[
+                Param(datatype='int', name='x'),
+                Param(datatype='int', name='y')
+            ],
+            java_class_name=None,
+            is_proxy=True,
+            proxy_name='org_chromium_example_SampleProxyJni_bar',
+            type='function'),
+        NativeMethod(
+            return_type='String',
+            static=True,
+            name='foobar',
+            params=[
+                Param(datatype='String', name='x'),
+                Param(datatype='String', name='y')
+            ],
+            java_class_name=None,
+            is_proxy=True,
+            proxy_name='org_chromium_example_SampleProxyJni_foobar',
+            type='function'),
+    ]
+
+    self.assertListEquals(golden_natives, natives)
+    self.assertListEquals(golden_natives, bad_spacing_natives)
+
+    jni_params = jni_generator.JniParams(qualified_clazz)
+    h1 = jni_generator.InlHeaderFileGenerator('', qualified_clazz, natives, [],
+                                              [], jni_params, TestOptions())
+    self.assertGoldenTextEquals(h1.GetContent())
+    h2 = jni_registration_generator.HeaderGenerator('', qualified_clazz,
+                                                    natives, jni_params, True)
+    content = h2.Generate()
+    for k in jni_registration_generator.MERGEABLE_KEYS:
+      content[k] = content.get(k, '')
+    content['HEADER_GUARD'] = 'HEADER_GUARD'
+    content['NAMESPACE'] = 'test'
+
+    self.assertGoldenTextEquals(
+        jni_registration_generator.CreateFromDict(content),
+        suffix='Registrations')
+
   def testNatives(self):
     test_data = """"
     import android.graphics.Bitmap;
@@ -875,23 +1015,40 @@
                       jni_generator.JNIFromJavaSource,
                       test_data, 'foo/bar', TestOptions())
 
-  def testJniSelfDocumentingExample(self):
+  def _createJniHeaderFromFile(self, fname, qualified_clazz, options=None):
     script_dir = os.path.dirname(sys.argv[0])
-    content = file(os.path.join(script_dir,
-        'java/src/org/chromium/example/jni_generator/SampleForTests.java')
-        ).read()
-    golden_file = os.path.join(script_dir, 'SampleForTests_jni.golden')
-    golden_content = file(golden_file).read()
-    jni_from_java = jni_generator.JNIFromJavaSource(
-        content, 'org/chromium/example/jni_generator/SampleForTests',
-        TestOptions())
-    generated_text = jni_from_java.GetContent()
-    if not self.compareText(golden_content, generated_text):
-      if os.environ.get(REBASELINE_ENV):
-        with file(golden_file, 'w') as f:
-          f.write(generated_text)
-        return
-      self.fail('testJniSelfDocumentingExample')
+    content = file(os.path.join(script_dir, fname)).read()
+    opts = options
+    if opts is None:
+      opts = TestOptions()
+
+    jni_from_java = jni_generator.JNIFromJavaSource(content, qualified_clazz,
+                                                    opts)
+    return jni_from_java.GetContent()
+
+  def testHashedProxyExample(self):
+    opts = TestOptions()
+    opts.use_proxy_hash = True
+    generated_text = self._createJniHeaderFromFile(
+        'java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java',
+        'org/chromium/example/jni_generator/SampleForAnnotationProcessor', opts)
+    self.assertGoldenTextEquals(
+        generated_text,
+        golden_file="HashedSampleForAnnotationProcessor_jni.golden")
+
+  def testJniProxyExample(self):
+    generated_text = self._createJniHeaderFromFile(
+        'java/src/org/chromium/example/jni_generator/SampleForAnnotationProcessor.java',
+        'org/chromium/example/jni_generator/SampleForAnnotationProcessor')
+    self.assertGoldenTextEquals(
+        generated_text, golden_file="SampleForAnnotationProcessor_jni.golden")
+
+  def testJniSelfDocumentingExample(self):
+    generated_text = self._createJniHeaderFromFile(
+        'java/src/org/chromium/example/jni_generator/SampleForTests.java',
+        'org/chromium/example/jni_generator/SampleForTests')
+    self.assertGoldenTextEquals(
+        generated_text, golden_file="SampleForTests_jni.golden")
 
   def testNoWrappingPreprocessorLines(self):
     test_data = """
@@ -1135,6 +1292,34 @@
                                                     TestOptions())
     self.assertGoldenTextEquals(jni_from_java.GetContent())
 
+  def testProxyNativesWithNatives(self):
+    test_data = """
+    package org.chromium.foo;
+
+    class Foo {
+
+    @JniStaticNatives
+    interface Natives {
+       void foo();
+       String bar(String s, int y, char x, short z);
+       String[] foobar(String[] a);
+    }
+
+    void justARegularFunction();
+
+    native void nativeInstanceMethod(long nativeInstance);
+    static native void nativeStaticMethod();
+
+    }
+    """
+    options_with_tracing = TestOptions()
+    options_with_tracing.enable_tracing = True
+    jni_from_java = jni_generator.JNIFromJavaSource(
+        test_data, 'org/chromium/foo/Foo', options_with_tracing)
+    self.assertGoldenTextEquals(jni_from_java.GetContent())
+
+
+
   def testTracing(self):
     test_data = """
     package org.chromium.foo;
diff --git a/base/android/jni_generator/jni_registration_generator.py b/base/android/jni_generator/jni_registration_generator.py
index 44f97df..f498a1786 100755
--- a/base/android/jni_generator/jni_registration_generator.py
+++ b/base/android/jni_generator/jni_registration_generator.py
@@ -24,6 +24,7 @@
     'FORWARD_DECLARATIONS',
     'JNI_NATIVE_METHOD',
     'JNI_NATIVE_METHOD_ARRAY',
+    'PROXY_NATIVE_METHOD_ARRAY',
     'REGISTER_MAIN_DEX_NATIVES',
     'REGISTER_NON_MAIN_DEX_NATIVES',
 ]
@@ -69,12 +70,14 @@
 def _DictForPath(path):
   with open(path) as f:
     contents = jni_generator.RemoveComments(f.read())
+  fully_qualified_class = jni_generator.ExtractFullyQualifiedJavaClassName(
+      path, contents)
   natives = jni_generator.ExtractNatives(contents, 'long')
+  natives += jni_generator.NativeProxyHelpers.ExtractStaticProxyNatives(
+      fully_qualified_class, contents, 'long')
   if len(natives) == 0:
     return None
   namespace = jni_generator.ExtractJNINamespace(contents)
-  fully_qualified_class = jni_generator.ExtractFullyQualifiedJavaClassName(
-      path, contents)
   jni_params = jni_generator.JniParams(fully_qualified_class)
   jni_params.ExtractImportsAndInnerClasses(contents)
   main_dex = jni_generator.IsMainDexJavaClass(contents)
@@ -83,6 +86,60 @@
   return header_generator.Generate()
 
 
+def _SetProxyRegistrationFields(registration_dict):
+  if registration_dict['PROXY_NATIVE_METHOD_ARRAY']:
+    registration_name = jni_generator.GetRegistrationFunctionName(
+        jni_generator.NATIVE_PROXY_QUALIFIED_NAME)
+    proxy_native_array = string.Template("""\
+
+static const JNINativeMethod kMethods_${ESCAPED_PROXY_CLASS}[] = {
+${KMETHODS}
+};
+
+JNI_REGISTRATION_EXPORT bool ${REGISTRATION_NAME}(JNIEnv* env) {
+  const int number_of_methods = arraysize(kMethods_${ESCAPED_PROXY_CLASS});
+
+  base::android::ScopedJavaLocalRef<jclass> native_clazz = base::android::GetClass(env, "${PROXY_CLASS}");
+  if (env->RegisterNatives(
+      native_clazz.obj(),
+      kMethods_${ESCAPED_PROXY_CLASS},
+      number_of_methods) < 0) {
+
+    jni_generator::HandleRegistrationError(env, native_clazz.obj(), __FILE__);
+    return false;
+  }
+
+  return true;
+}
+    """).substitute({
+        'ESCAPED_PROXY_CLASS':
+            jni_generator.NativeProxyHelpers.ESCAPED_NATIVE_PROXY_CLASS,
+        'PROXY_CLASS':
+            jni_generator.NATIVE_PROXY_QUALIFIED_NAME,
+        'KMETHODS':
+            registration_dict['PROXY_NATIVE_METHOD_ARRAY'],
+        'REGISTRATION_NAME':
+            registration_name
+    })
+
+    proxy_natives_registration = string.Template("""\
+
+// Register natives in a proxy.
+if (!${REGISTRATION_NAME}(env)) {
+  return false;
+}
+    """).substitute({
+        'REGISTRATION_NAME': registration_name
+    })
+
+  else:
+    proxy_native_array = ''
+    proxy_natives_registration = ''
+
+  registration_dict['PROXY_NATIVE_METHOD_ARRAY'] = proxy_native_array
+  registration_dict['REGISTER_PROXY_NATIVES'] = proxy_natives_registration
+
+
 def CreateFromDict(registration_dict):
   """Returns the content of the header file."""
 
@@ -114,7 +171,9 @@
 
 // Step 3: Method declarations.
 
-${JNI_NATIVE_METHOD_ARRAY}
+${JNI_NATIVE_METHOD_ARRAY}\
+${PROXY_NATIVE_METHOD_ARRAY}\
+
 ${JNI_NATIVE_METHOD}
 // Step 4: Main dex and non-main dex registration functions.
 
@@ -125,7 +184,8 @@
   return true;
 }
 
-bool RegisterNonMainDexNatives(JNIEnv* env) {
+bool RegisterNonMainDexNatives(JNIEnv* env) {\
+${REGISTER_PROXY_NATIVES}
 ${REGISTER_NON_MAIN_DEX_NATIVES}
   return true;
 }
@@ -134,6 +194,8 @@
 
 #endif  // ${HEADER_GUARD}
 """)
+  _SetProxyRegistrationFields(registration_dict)
+
   if len(registration_dict['FORWARD_DECLARATIONS']) == 0:
     return ''
 
@@ -160,6 +222,7 @@
     self._AddClassPathDeclarations()
     self._AddForwardDeclaration()
     self._AddJNINativeMethodsArrays()
+    self._AddProxyNativeMethodKStrings()
     self._AddRegisterNativesCalls()
     self._AddRegisterNativesFunctions()
     return self.registration_dict
@@ -191,6 +254,11 @@
 
   def _AddRegisterNativesCalls(self):
     """Add the body of the RegisterNativesImpl method to the dictionary."""
+
+    # Only register if there is at least 1 non-proxy native
+    if all(native.is_proxy for native in self.natives):
+      return ''
+
     template = string.Template("""\
   if (!${REGISTER_NAME}(env))
     return false;
@@ -231,37 +299,72 @@
   def _GetKMethodsString(self, clazz):
     ret = []
     for native in self.natives:
+      if native.is_proxy:
+        # Proxy natives are registered for the native proxy class.
+        if clazz == jni_generator.NATIVE_PROXY_CLASS_NAME:
+          ret += [self._GetKMethodArrayEntry(native)]
+        continue
       if (native.java_class_name == clazz or
           (not native.java_class_name and clazz == self.class_name)):
         ret += [self._GetKMethodArrayEntry(native)]
     return '\n'.join(ret)
 
   def _GetKMethodArrayEntry(self, native):
-    template = string.Template('    { "native${NAME}", ${JNI_SIGNATURE}, ' +
+    template = string.Template('    { "${NAME}", ${JNI_SIGNATURE}, ' +
                                'reinterpret_cast<void*>(${STUB_NAME}) },')
+
+    name = 'native' + native.name
+    if native.is_proxy:
+      # Literal name of the native method in the class that contains the actual
+      # native declaration.
+      name = native.proxy_name
     values = {
-        'NAME': native.name,
-        'JNI_SIGNATURE': self.jni_params.Signature(
-            native.params, native.return_type),
-        'STUB_NAME': self.helper.GetStubName(native)
+        'NAME':
+            name,
+        'JNI_SIGNATURE':
+            self.jni_params.Signature(native.params, native.return_type),
+        'STUB_NAME':
+            self.helper.GetStubName(native)
     }
     return template.substitute(values)
 
-  def _SubstituteNativeMethods(self, template):
+  def _AddProxyNativeMethodKStrings(self):
+    """Returns KMethodString for wrapped native methods in all_classes """
+
+    all_classes = self.helper.GetUniqueClasses(self.natives)
+    all_classes[self.class_name] = self.fully_qualified_class
+
+    wrapped_native_methods = ''
+
+    for clazz in all_classes:
+      if clazz != jni_generator.NATIVE_PROXY_CLASS_NAME:
+        continue
+      wrapped_native_methods += self._GetKMethodsString(clazz)
+
+    self._SetDictValue('PROXY_NATIVE_METHOD_ARRAY', wrapped_native_methods)
+
+  def _SubstituteNativeMethods(self, template, sub_proxy=False):
     """Substitutes NAMESPACE, JAVA_CLASS and KMETHODS in the provided
     template."""
     ret = []
     all_classes = self.helper.GetUniqueClasses(self.natives)
     all_classes[self.class_name] = self.fully_qualified_class
+
     for clazz, full_clazz in all_classes.iteritems():
+      if not sub_proxy:
+        if clazz == jni_generator.NATIVE_PROXY_CLASS_NAME:
+          continue
+
       kmethods = self._GetKMethodsString(clazz)
       namespace_str = ''
       if self.namespace:
         namespace_str = self.namespace + '::'
       if kmethods:
-        values = {'NAMESPACE': namespace_str,
-                  'JAVA_CLASS': jni_generator.GetBinaryClassName(full_clazz),
-                  'KMETHODS': kmethods}
+        values = {
+            'NAMESPACE': namespace_str,
+            'JAVA_CLASS': jni_generator.EscapeClassName(full_clazz),
+            'KMETHODS': kmethods
+        }
         ret += [template.substitute(values)]
     if not ret: return ''
     return '\n'.join(ret)
@@ -311,7 +414,12 @@
   }
 
 """)
-    return self._SubstituteNativeMethods(template)
+    # Only register if there is a native method not in a proxy,
+    # since all the proxies will be registered together.
+    for n in self.natives:
+      if not n.is_proxy:
+        return self._SubstituteNativeMethods(template)
+    return ''
 
 
 def main(argv):
diff --git a/base/android/jni_generator/sample_for_tests.cc b/base/android/jni_generator/sample_for_tests.cc
index 890103ee..b66f57f 100644
--- a/base/android/jni_generator/sample_for_tests.cc
+++ b/base/android/jni_generator/sample_for_tests.cc
@@ -12,7 +12,8 @@
 // Generated file for JNI bindings from C++ to Java @CalledByNative methods.
 // Only to be included in one .cc file.
 // Name is based on the java file name: *.java -> jni/*_jni.h
-#include "jni/SampleForTests_jni.h"  // Generated by JNI.
+#include "jni/SampleForAnnotationProcessor_jni.h"  // Generated by JNI.
+#include "jni/SampleForTests_jni.h"                // Generated by JNI.
 
 using base::android::AttachCurrentThread;
 using base::android::ConvertJavaStringToUTF8;
@@ -100,6 +101,18 @@
   return ScopedJavaLocalRef<jobject>();
 }
 
+static ScopedJavaLocalRef<jstring> JNI_SampleForTests_GetNonPODDatatype(
+    JNIEnv*,
+    const JavaParamRef<jstring>&) {
+  return ScopedJavaLocalRef<jstring>();
+}
+
+static ScopedJavaLocalRef<jobjectArray> JNI_SampleForTests_GetNonPODDatatype(
+    JNIEnv*,
+    const JavaParamRef<jobjectArray>&) {
+  return ScopedJavaLocalRef<jobjectArray>();
+}
+
 static jint JNI_InnerClass_GetInnerIntFunction(JNIEnv*,
                                                const JavaParamRef<jclass>&) {
   return 0;
@@ -108,6 +121,49 @@
 } // namespace android
 } // namespace base
 
+// Proxy natives.
+static void JNI_SampleForAnnotationProcessor_Foo(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller) {}
+
+static base::android::ScopedJavaLocalRef<jobject>
+JNI_SampleForAnnotationProcessor_Bar(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobject>& sample) {
+  return JNI_SampleForTests_GetNonPODDatatype(env, sample);
+}
+
+static base::android::ScopedJavaLocalRef<jstring>
+JNI_SampleForAnnotationProcessor_RevString(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jstring>& stringToReverse) {
+  return JNI_SampleForTests_GetNonPODDatatype(env, stringToReverse);
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray>
+JNI_SampleForAnnotationProcessor_SendToNative(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& strs) {
+  return JNI_SampleForTests_GetNonPODDatatype(env, strs);
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray>
+JNI_SampleForAnnotationProcessor_SendSamplesToNative(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& strs) {
+  return JNI_SampleForTests_GetNonPODDatatype(env, strs);
+}
+
+static jboolean JNI_SampleForAnnotationProcessor_HasPhalange(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller) {
+  return jboolean(true);
+}
+
 int main() {
   // On a regular application, you'd call AttachCurrentThread(). This sample is
   // not yet linking with all the libraries.
diff --git a/base/android/jni_generator/testProxyNatives.golden b/base/android/jni_generator/testProxyNatives.golden
new file mode 100644
index 0000000..e63ed6a1
--- /dev/null
+++ b/base/android/jni_generator/testProxyNatives.golden
@@ -0,0 +1,65 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// This file is autogenerated by
+//     base/android/jni_generator/jni_generator.py
+// For
+//     org/chromium/example/SampleProxyJni
+
+#ifndef org_chromium_example_SampleProxyJni_JNI
+#define org_chromium_example_SampleProxyJni_JNI
+
+#include <jni.h>
+
+#include "base/android/jni_generator/jni_generator_helper.h"
+
+
+// Step 1: Forward declarations.
+
+
+// Step 2: Constants (optional).
+
+
+// Step 3: Method stubs.
+static void JNI_SampleProxyJni_Foo(JNIEnv* env, const base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT void
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foo(
+    JNIEnv* env,
+    jclass jcaller) {
+  return JNI_SampleProxyJni_Foo(env, base::android::JavaParamRef<jclass>(env, jcaller));
+}
+
+static jint JNI_SampleProxyJni_Bar(JNIEnv* env, const base::android::JavaParamRef<jclass>& jcaller,
+    jint x,
+    jint y);
+
+JNI_GENERATOR_EXPORT jint
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1bar(
+    JNIEnv* env,
+    jclass jcaller,
+    jint x,
+    jint y) {
+  return JNI_SampleProxyJni_Bar(env, base::android::JavaParamRef<jclass>(env, jcaller), x, y);
+}
+
+static base::android::ScopedJavaLocalRef<jstring> JNI_SampleProxyJni_Foobar(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jstring>& x,
+    const base::android::JavaParamRef<jstring>& y);
+
+JNI_GENERATOR_EXPORT jstring
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foobar(
+    JNIEnv* env,
+    jclass jcaller,
+    jstring x,
+    jstring y) {
+  return JNI_SampleProxyJni_Foobar(env, base::android::JavaParamRef<jclass>(env, jcaller),
+      base::android::JavaParamRef<jstring>(env, x), base::android::JavaParamRef<jstring>(env,
+      y)).Release();
+}
+
+
+#endif  // org_chromium_example_SampleProxyJni_JNI
diff --git a/base/android/jni_generator/testProxyNativesRegistrations.golden b/base/android/jni_generator/testProxyNativesRegistrations.golden
new file mode 100644
index 0000000..f705c17c
--- /dev/null
+++ b/base/android/jni_generator/testProxyNativesRegistrations.golden
@@ -0,0 +1,97 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// This file is autogenerated by
+//     base/android/jni_generator/jni_registration_generator.py
+// Please do not change its content.
+
+#ifndef HEADER_GUARD
+#define HEADER_GUARD
+
+#include <jni.h>
+
+#include "base/android/jni_generator/jni_generator_helper.h"
+#include "base/android/jni_int_wrapper.h"
+
+
+// Step 1: Forward declarations (classes).
+
+
+// Step 2: Forward declarations (methods).
+
+JNI_GENERATOR_EXPORT void
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foo(
+    JNIEnv* env,
+    jclass jcaller);
+JNI_GENERATOR_EXPORT jint
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1bar(
+    JNIEnv* env,
+    jclass jcaller,
+    jint x,
+    jint y);
+JNI_GENERATOR_EXPORT jstring
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foobar(
+    JNIEnv* env,
+    jclass jcaller,
+    jstring x,
+    jstring y);
+
+
+// Step 3: Method declarations.
+
+
+static const JNINativeMethod kMethods_org_chromium_base_natives_GEN_1JNI[] = {
+    { "org_chromium_example_SampleProxyJni_foo", "()V",
+        reinterpret_cast<void*>(Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foo)
+        },
+    { "org_chromium_example_SampleProxyJni_bar", "(II)I",
+        reinterpret_cast<void*>(Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1bar)
+        },
+    { "org_chromium_example_SampleProxyJni_foobar",
+        "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;",
+        reinterpret_cast<void*>(Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1example_1SampleProxyJni_1foobar)
+        },
+
+};
+
+JNI_REGISTRATION_EXPORT bool RegisterNative_org_chromium_base_natives_GEN_1JNI(JNIEnv* env) {
+  const int number_of_methods = arraysize(kMethods_org_chromium_base_natives_GEN_1JNI);
+
+  base::android::ScopedJavaLocalRef<jclass> native_clazz = base::android::GetClass(env, "org/chromium/base/natives/GEN_JNI");
+  if (env->RegisterNatives(
+      native_clazz.obj(),
+      kMethods_org_chromium_base_natives_GEN_1JNI,
+      number_of_methods) < 0) {
+
+    jni_generator::HandleRegistrationError(env, native_clazz.obj(), __FILE__);
+    return false;
+  }
+
+  return true;
+}
+    
+
+// Step 4: Main dex and non-main dex registration functions.
+
+namespace test {
+
+bool RegisterMainDexNatives(JNIEnv* env) {
+
+  return true;
+}
+
+bool RegisterNonMainDexNatives(JNIEnv* env) {
+// Register natives in a proxy.
+if (!RegisterNative_org_chromium_base_natives_GEN_1JNI(env)) {
+  return false;
+}
+    
+
+  return true;
+}
+
+}  // namespace test
+
+#endif  // HEADER_GUARD
diff --git a/base/android/jni_generator/testProxyNativesWithNatives.golden b/base/android/jni_generator/testProxyNativesWithNatives.golden
new file mode 100644
index 0000000..af19451
--- /dev/null
+++ b/base/android/jni_generator/testProxyNativesWithNatives.golden
@@ -0,0 +1,100 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+// This file is autogenerated by
+//     base/android/jni_generator/jni_generator.py
+// For
+//     org/chromium/foo/Foo
+
+#ifndef org_chromium_foo_Foo_JNI
+#define org_chromium_foo_Foo_JNI
+
+#include <jni.h>
+
+#include "base/android/jni_generator/jni_generator_helper.h"
+
+
+// Step 1: Forward declarations.
+
+JNI_REGISTRATION_EXPORT extern const char kClassPath_org_chromium_foo_Foo[];
+const char kClassPath_org_chromium_foo_Foo[] = "org/chromium/foo/Foo";
+// Leaking this jclass as we cannot use LazyInstance from some threads.
+JNI_REGISTRATION_EXPORT std::atomic<jclass> g_org_chromium_foo_Foo_clazz(nullptr);
+#ifndef org_chromium_foo_Foo_clazz_defined
+#define org_chromium_foo_Foo_clazz_defined
+inline jclass org_chromium_foo_Foo_clazz(JNIEnv* env) {
+  return base::android::LazyGetClass(env, kClassPath_org_chromium_foo_Foo,
+      &g_org_chromium_foo_Foo_clazz);
+}
+#endif
+
+
+// Step 2: Constants (optional).
+
+
+// Step 3: Method stubs.
+JNI_GENERATOR_EXPORT void Java_org_chromium_foo_Foo_nativeInstanceMethod(
+    JNIEnv* env,
+    jobject jcaller,
+    jlong nativeInstance) {
+  TRACE_EVENT0("jni", "Instance::InstanceMethod");
+  Instance* native = reinterpret_cast<Instance*>(nativeInstance);
+  CHECK_NATIVE_PTR(env, jcaller, native, "InstanceMethod");
+  return native->InstanceMethod(env, base::android::JavaParamRef<jobject>(env, jcaller));
+}
+
+static void JNI_Foo_StaticMethod(JNIEnv* env, const base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT void Java_org_chromium_foo_Foo_nativeStaticMethod(
+    JNIEnv* env,
+    jclass jcaller) {
+  TRACE_EVENT0("jni", "JNI_Foo_StaticMethod");
+  return JNI_Foo_StaticMethod(env, base::android::JavaParamRef<jclass>(env, jcaller));
+}
+
+static void JNI_Foo_Foo(JNIEnv* env, const base::android::JavaParamRef<jclass>& jcaller);
+
+JNI_GENERATOR_EXPORT void Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1foo_1Foo_1foo(
+    JNIEnv* env,
+    jclass jcaller) {
+  TRACE_EVENT0("jni", "JNI_Foo_Foo");
+  return JNI_Foo_Foo(env, base::android::JavaParamRef<jclass>(env, jcaller));
+}
+
+static base::android::ScopedJavaLocalRef<jstring> JNI_Foo_Bar(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jstring>& s,
+    jint y,
+    jchar x,
+    jshort z);
+
+JNI_GENERATOR_EXPORT jstring Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1foo_1Foo_1bar(
+    JNIEnv* env,
+    jclass jcaller,
+    jstring s,
+    jint y,
+    jchar x,
+    jshort z) {
+  TRACE_EVENT0("jni", "JNI_Foo_Bar");
+  return JNI_Foo_Bar(env, base::android::JavaParamRef<jclass>(env, jcaller),
+      base::android::JavaParamRef<jstring>(env, s), y, x, z).Release();
+}
+
+static base::android::ScopedJavaLocalRef<jobjectArray> JNI_Foo_Foobar(JNIEnv* env, const
+    base::android::JavaParamRef<jclass>& jcaller,
+    const base::android::JavaParamRef<jobjectArray>& a);
+
+JNI_GENERATOR_EXPORT jobjectArray
+    Java_org_chromium_base_natives_GEN_1JNI_org_1chromium_1foo_1Foo_1foobar(
+    JNIEnv* env,
+    jclass jcaller,
+    jobjectArray a) {
+  TRACE_EVENT0("jni", "JNI_Foo_Foobar");
+  return JNI_Foo_Foobar(env, base::android::JavaParamRef<jclass>(env, jcaller),
+      base::android::JavaParamRef<jobjectArray>(env, a)).Release();
+}
+
+
+#endif  // org_chromium_foo_Foo_JNI
diff --git a/base/task/sequence_manager/sequence_manager_perftest.cc b/base/task/sequence_manager/sequence_manager_perftest.cc
index 579ec28..66056a9 100644
--- a/base/task/sequence_manager/sequence_manager_perftest.cc
+++ b/base/task/sequence_manager/sequence_manager_perftest.cc
@@ -27,6 +27,7 @@
 #include "base/threading/thread.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/default_tick_clock.h"
+#include "build/build_config.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/perf/perf_test.h"
 
@@ -62,8 +63,14 @@
 enum class PerfTestType : int {
   kUseSequenceManagerWithMessageLoop = 0,
   kUseSequenceManagerWithMessagePump = 1,
-  kUseMessageLoop = 2,
-  kUseSingleThreadInWorkerPool = 3,
+  kUseSequenceManagerWithUIMessageLoop = 2,
+  kUseSequenceManagerWithUIMessagePump = 3,
+  kUseSequenceManagerWithIOMessageLoop = 4,
+  kUseSequenceManagerWithIOMessagePump = 5,
+  kUseMessageLoop = 6,
+  kUseUIMessageLoop = 7,
+  kUseIOMessageLoop = 8,
+  kUseSingleThreadInWorkerPool = 9,
 };
 
 class SequenceManagerPerfTest : public testing::TestWithParam<PerfTestType> {
@@ -88,13 +95,38 @@
 
     switch (GetParam()) {
       case PerfTestType::kUseSequenceManagerWithMessageLoop:
-        CreateSequenceManagerWithMessageLoop();
+        CreateSequenceManagerWithMessageLoop(std::make_unique<MessageLoop>());
         break;
       case PerfTestType::kUseSequenceManagerWithMessagePump:
-        CreateSequenceManagerWithMessagePump();
+        CreateSequenceManagerWithMessagePump(
+            std::make_unique<MessagePumpDefault>());
+        break;
+      case PerfTestType::kUseSequenceManagerWithUIMessageLoop:
+        CreateSequenceManagerWithMessageLoop(
+            std::make_unique<MessageLoopForUI>());
+        break;
+      case PerfTestType::kUseSequenceManagerWithUIMessagePump:
+#if !defined(OS_IOS) && !defined(OS_MACOSX)
+        CreateSequenceManagerWithMessagePump(
+            std::make_unique<MessagePumpForUI>());
+#endif
+        break;
+      case PerfTestType::kUseSequenceManagerWithIOMessageLoop:
+        CreateSequenceManagerWithMessageLoop(
+            std::make_unique<MessageLoopForIO>());
+        break;
+      case PerfTestType::kUseSequenceManagerWithIOMessagePump:
+        CreateSequenceManagerWithMessagePump(
+            std::make_unique<MessagePumpForIO>());
         break;
       case PerfTestType::kUseMessageLoop:
-        CreateMessageLoop();
+        CreateMessageLoop(std::make_unique<MessageLoop>());
+        break;
+      case PerfTestType::kUseUIMessageLoop:
+        CreateMessageLoop(std::make_unique<MessageLoopForUI>());
+        break;
+      case PerfTestType::kUseIOMessageLoop:
+        CreateMessageLoop(std::make_unique<MessageLoopForIO>());
         break;
       case PerfTestType::kUseSingleThreadInWorkerPool:
         CreateTaskScheduler();
@@ -107,18 +139,19 @@
     }
   }
 
-  void CreateSequenceManagerWithMessageLoop() {
-    message_loop_ = std::make_unique<MessageLoop>();
+  void CreateSequenceManagerWithMessageLoop(
+      std::unique_ptr<MessageLoop> message_loop) {
+    message_loop_ = std::move(message_loop);
     manager_ = SequenceManagerForTest::Create(message_loop_.get(),
                                               message_loop_->task_runner(),
                                               DefaultTickClock::GetInstance());
   }
 
-  void CreateSequenceManagerWithMessagePump() {
+  void CreateSequenceManagerWithMessagePump(
+      std::unique_ptr<MessagePump> message_pump) {
     manager_ = SequenceManagerForTest::Create(
         std::make_unique<internal::ThreadControllerWithMessagePumpImpl>(
-            std::make_unique<MessagePumpDefault>(),
-            DefaultTickClock::GetInstance()));
+            std::move(message_pump), DefaultTickClock::GetInstance()));
     // ThreadControllerWithMessagePumpImpl doesn't provide a default task
     // runner.
     scoped_refptr<TaskQueue> default_task_queue =
@@ -126,7 +159,9 @@
     manager_->SetDefaultTaskRunner(default_task_queue->task_runner());
   }
 
-  void CreateMessageLoop() { message_loop_ = std::make_unique<MessageLoop>(); }
+  void CreateMessageLoop(std::unique_ptr<MessageLoop> message_loop) {
+    message_loop_ = std::move(message_loop);
+  }
 
   void CreateTaskScheduler() {
     TaskScheduler::SetInstance(
@@ -149,7 +184,11 @@
   scoped_refptr<TaskRunner> CreateTaskRunner() {
     switch (GetParam()) {
       case PerfTestType::kUseSequenceManagerWithMessageLoop:
-      case PerfTestType::kUseSequenceManagerWithMessagePump: {
+      case PerfTestType::kUseSequenceManagerWithMessagePump:
+      case PerfTestType::kUseSequenceManagerWithUIMessageLoop:
+      case PerfTestType::kUseSequenceManagerWithUIMessagePump:
+      case PerfTestType::kUseSequenceManagerWithIOMessageLoop:
+      case PerfTestType::kUseSequenceManagerWithIOMessagePump: {
         scoped_refptr<TestTaskQueue> task_queue =
             manager_->CreateTaskQueue<TestTaskQueue>(
                 TaskQueue::Spec("test").SetTimeDomain(time_domain_.get()));
@@ -158,6 +197,8 @@
       }
 
       case PerfTestType::kUseMessageLoop:
+      case PerfTestType::kUseUIMessageLoop:
+      case PerfTestType::kUseIOMessageLoop:
         return message_loop_->task_runner();
 
       case PerfTestType::kUseSingleThreadInWorkerPool:
@@ -178,7 +219,13 @@
     switch (GetParam()) {
       case PerfTestType::kUseSequenceManagerWithMessageLoop:
       case PerfTestType::kUseSequenceManagerWithMessagePump:
+      case PerfTestType::kUseSequenceManagerWithUIMessageLoop:
+      case PerfTestType::kUseSequenceManagerWithUIMessagePump:
+      case PerfTestType::kUseSequenceManagerWithIOMessageLoop:
+      case PerfTestType::kUseSequenceManagerWithIOMessagePump:
       case PerfTestType::kUseMessageLoop:
+      case PerfTestType::kUseUIMessageLoop:
+      case PerfTestType::kUseIOMessageLoop:
         run_loop_.reset(new RunLoop());
         run_loop_->Run();
         break;
@@ -194,7 +241,13 @@
     switch (GetParam()) {
       case PerfTestType::kUseSequenceManagerWithMessageLoop:
       case PerfTestType::kUseSequenceManagerWithMessagePump:
+      case PerfTestType::kUseSequenceManagerWithUIMessageLoop:
+      case PerfTestType::kUseSequenceManagerWithUIMessagePump:
+      case PerfTestType::kUseSequenceManagerWithIOMessageLoop:
+      case PerfTestType::kUseSequenceManagerWithIOMessagePump:
       case PerfTestType::kUseMessageLoop:
+      case PerfTestType::kUseUIMessageLoop:
+      case PerfTestType::kUseIOMessageLoop:
         run_loop_->Quit();
         break;
       case PerfTestType::kUseSingleThreadInWorkerPool: {
@@ -297,16 +350,34 @@
     std::string trace_suffix;
     switch (GetParam()) {
       case PerfTestType::kUseSequenceManagerWithMessageLoop:
-        trace_suffix = " SequenceManager with message loop";
+        trace_suffix = " SequenceManager with message loop ";
         break;
       case PerfTestType::kUseSequenceManagerWithMessagePump:
-        trace_suffix = " SequenceManager with message pump";
+        trace_suffix = " SequenceManager with message pump ";
+        break;
+      case PerfTestType::kUseSequenceManagerWithUIMessageLoop:
+        trace_suffix = " SequenceManager with UI message loop ";
+        break;
+      case PerfTestType::kUseSequenceManagerWithUIMessagePump:
+        trace_suffix = " SequenceManager with UI message pump ";
+        break;
+      case PerfTestType::kUseSequenceManagerWithIOMessageLoop:
+        trace_suffix = " SequenceManager with IO message loop ";
+        break;
+      case PerfTestType::kUseSequenceManagerWithIOMessagePump:
+        trace_suffix = " SequenceManager with IO message pump ";
         break;
       case PerfTestType::kUseMessageLoop:
-        trace_suffix = " message loop";
+        trace_suffix = " message loop ";
+        break;
+      case PerfTestType::kUseUIMessageLoop:
+        trace_suffix = " message loop for UI ";
+        break;
+      case PerfTestType::kUseIOMessageLoop:
+        trace_suffix = " message loop for IO ";
         break;
       case PerfTestType::kUseSingleThreadInWorkerPool:
-        trace_suffix = " single thread in WorkerPool";
+        trace_suffix = " single thread in WorkerPool ";
         break;
     }
 
@@ -342,7 +413,15 @@
     SequenceManagerPerfTest,
     testing::Values(PerfTestType::kUseSequenceManagerWithMessageLoop,
                     PerfTestType::kUseSequenceManagerWithMessagePump,
+                    PerfTestType::kUseSequenceManagerWithUIMessageLoop,
+#if !defined(OS_IOS) && !defined(OS_MACOSX)
+                    PerfTestType::kUseSequenceManagerWithUIMessagePump,
+#endif
+                    PerfTestType::kUseSequenceManagerWithIOMessageLoop,
+                    PerfTestType::kUseSequenceManagerWithIOMessagePump,
                     PerfTestType::kUseMessageLoop,
+                    PerfTestType::kUseUIMessageLoop,
+                    PerfTestType::kUseIOMessageLoop,
                     PerfTestType::kUseSingleThreadInWorkerPool));
 
 TEST_P(SequenceManagerPerfTest, RunTenThousandDelayedTasks_OneQueue) {
@@ -352,6 +431,8 @@
   switch (GetParam()) {
     // Virtual time is not supported for MessageLoop or WorkerPool.
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
     case PerfTestType::kUseSingleThreadInWorkerPool:
       LOG(INFO) << "Unsupported";
       return;
@@ -375,6 +456,8 @@
   switch (GetParam()) {
     // Virtual time is not supported for MessageLoop or WorkerPool.
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
     case PerfTestType::kUseSingleThreadInWorkerPool:
       LOG(INFO) << "Unsupported";
       return;
@@ -398,6 +481,8 @@
   switch (GetParam()) {
     // Virtual time is not supported for MessageLoop or WorkerPool.
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
     case PerfTestType::kUseSingleThreadInWorkerPool:
       LOG(INFO) << "Unsupported";
       return;
@@ -420,6 +505,8 @@
 
   switch (GetParam()) {
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
     case PerfTestType::kUseSingleThreadInWorkerPool:
       LOG(INFO) << "Unsupported";
       return;
@@ -455,6 +542,8 @@
   switch (GetParam()) {
     // We only support a single queue on the MessageLoop.
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
       LOG(INFO) << "Unsupported";
       return;
 
@@ -478,6 +567,8 @@
   switch (GetParam()) {
     // We only support a single queue on the MessageLoop.
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
       LOG(INFO) << "Unsupported";
       return;
 
@@ -500,6 +591,8 @@
   switch (GetParam()) {
     // We only support a single queue on the MessageLoop.
     case PerfTestType::kUseMessageLoop:
+    case PerfTestType::kUseUIMessageLoop:
+    case PerfTestType::kUseIOMessageLoop:
       LOG(INFO) << "Unsupported";
       return;
 
diff --git a/build/android/gyp/create_app_bundle.py b/build/android/gyp/create_app_bundle.py
index d58bf30..8f24717 100755
--- a/build/android/gyp/create_app_bundle.py
+++ b/build/android/gyp/create_app_bundle.py
@@ -50,6 +50,10 @@
                       help='Output bundle zip archive.')
   parser.add_argument('--module-zips', required=True,
                       help='GN-list of module zip archives.')
+  parser.add_argument(
+      '--rtxt-in-paths', action='append', help='GN-list of module R.txt files.')
+  parser.add_argument(
+      '--rtxt-out-path', help='Path to combined R.txt file for bundle.')
   parser.add_argument('--uncompressed-assets', action='append',
                       help='GN-list of uncompressed assets.')
   parser.add_argument('--uncompress-shared-libraries', action='append',
@@ -63,6 +67,7 @@
 
   options = parser.parse_args(args)
   options.module_zips = build_utils.ParseGnList(options.module_zips)
+  options.rtxt_in_paths = build_utils.ExpandFileArgs(options.rtxt_in_paths)
 
   if len(options.module_zips) == 0:
     raise Exception('The module zip list cannot be empty.')
@@ -285,6 +290,14 @@
 
     shutil.move(tmp_bundle, options.out_bundle)
 
+  if options.rtxt_out_path:
+    with open(options.rtxt_out_path, 'w') as rtxt_out:
+      for rtxt_in_path in options.rtxt_in_paths:
+        with open(rtxt_in_path, 'r') as rtxt_in:
+          rtxt_out.write('-- Contents of {}\n'.format(
+              os.path.basename(rtxt_in_path)))
+          rtxt_out.write(rtxt_in.read())
+
 
 if __name__ == '__main__':
   main(sys.argv[1:])
diff --git a/build/android/gyp/write_build_config.py b/build/android/gyp/write_build_config.py
index f4d25bf..b87e551c 100755
--- a/build/android/gyp/write_build_config.py
+++ b/build/android/gyp/write_build_config.py
@@ -348,6 +348,10 @@
 The path of an zip archive containing the APK's resources compiled to the
 protocol buffer format (instead of regular binary xml + resources.arsc).
 
+* `deps_info['module_rtxt_path']`:
+The path of the R.txt file generated when compiling the resources for the bundle
+module.
+
 * `native['libraries']`
 List of native libraries for the primary ABI to be embedded in this APK.
 E.g. [ "libchrome.so" ] (i.e. this doesn't include any ABI sub-directory
@@ -871,6 +875,9 @@
   parser.add_option('--apk-proto-resources',
                     help='Path to resources compiled in protocol buffer format '
                          ' for this apk.')
+  parser.add_option(
+      '--module-rtxt-path',
+      help='Path to R.txt file for resources in a bundle module.')
 
   parser.add_option('--generate-markdown-format-doc', action='store_true',
                     help='Dump the Markdown .build_config format documentation '
@@ -884,7 +891,7 @@
   if options.generate_markdown_format_doc:
     doc_lines = _ExtractMarkdownDocumentation(__doc__)
     for line in doc_lines:
-        print(line)
+      print(line)
     return 0
 
   if options.fail:
@@ -919,6 +926,10 @@
     if options.type != 'android_app_bundle_module':
       raise Exception('--apk-proto-resources can only be used with '
                       '--type=android_app_bundle_module')
+  if options.module_rtxt_path:
+    if options.type != 'android_app_bundle_module':
+      raise Exception('--module-rxt-path can only be used with '
+                      '--type=android_app_bundle_module')
 
   is_apk_or_module_target = options.type in ('android_apk',
       'android_app_bundle_module')
@@ -1028,6 +1039,9 @@
     if options.apk_proto_resources:
       deps_info['proto_resources_path'] = options.apk_proto_resources
 
+    if options.module_rtxt_path:
+      deps_info['module_rtxt_path'] = options.module_rtxt_path
+
   if is_java_target:
     deps_info['requires_android'] = bool(options.requires_android)
     deps_info['supports_android'] = bool(options.supports_android)
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 1250e05f..6ed937ae 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -320,6 +320,11 @@
       args += [ "--apk-proto-resources=$_rebased_proto_resources" ]
     }
 
+    if (defined(invoker.module_rtxt_path)) {
+      _rebased_rtxt_path = rebase_path(invoker.module_rtxt_path, root_build_dir)
+      args += [ "--module-rtxt-path=$_rebased_rtxt_path" ]
+    }
+
     if (defined(invoker.shared_libraries_runtime_deps_file)) {
       # Don't list shared_libraries_runtime_deps_file as an input in order to
       # avoid having to depend on the runtime_deps target. See comment in
@@ -2891,7 +2896,7 @@
   #  jar_included_patterns: Optional list of .class file patterns to include
   #    in the final .jar file. jar_excluded_patterns take precedence over this.
   #
-  # For 'android_apk' targets only:
+  # For 'android_apk' and 'android_app_bundle_module' targets only:
   #
   #  apk_path: Path to the final APK file.
   #  android_manifest: Path to AndroidManifest.xml file for the APK.
@@ -2913,6 +2918,11 @@
   #    be stored in the APK.
   #  uncompress_shared_libraries: Optional. True to store native shared
   #    libraries uncompressed and page-aligned.
+  #  proto_resources_path: The path of an zip archive containing the APK's
+  #    resources compiled to the protocol buffer format (instead of regular
+  #    binary xml + resources.arsc).
+  #  module_rtxt_path: The path of the R.txt file generated when compiling the
+  #    resources for the bundle module.
   #
   # For 'java_binary' and 'junit_binary' targets only. Ignored by others:
   #
@@ -3129,7 +3139,11 @@
                                ])
       }
       if (type == "android_app_bundle_module") {
-        forward_variables_from(invoker, [ "proto_resources_path" ])
+        forward_variables_from(invoker,
+                               [
+                                 "proto_resources_path",
+                                 "module_rtxt_path",
+                               ])
       }
       build_config = _build_config
       is_prebuilt = _is_prebuilt
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index d7e92f0a..44e016d3 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -1913,10 +1913,11 @@
 
     if (defined(invoker.final_apk_path)) {
       _final_apk_path = invoker.final_apk_path
-    } else if (!_is_bundle_module) {
-      _final_apk_path = "$root_build_dir/apks/${invoker.name}.apk"
     } else {
-      _final_apk_path = "$root_build_dir/bundle_modules/${invoker.name}"
+      _final_apk_path = "$root_build_dir/apks/${invoker.name}.apk"
+    }
+    if (!_is_bundle_module) {
+      _final_rtxt_path = "${_final_apk_path}.R.txt"
     }
     _final_apk_path_no_ext_list =
         process_file_template([ _final_apk_path ],
@@ -2124,6 +2125,8 @@
     }
 
     _compile_resources_target = "${_template_name}__compile_resources"
+    _compile_resources_rtxt_out =
+        "${target_gen_dir}/${_compile_resources_target}_R.txt"
     compile_resources(_compile_resources_target) {
       forward_variables_from(invoker,
                              [
@@ -2144,7 +2147,7 @@
         post_process_script = invoker.post_process_package_resources_script
       }
       srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
-      r_text_out_path = "${target_gen_dir}/${target_name}_R.txt"
+      r_text_out_path = _compile_resources_rtxt_out
       proguard_file = _generated_proguard_config
       if (_enable_multidex) {
         proguard_file_main_dex = _generated_proguard_main_dex_config
@@ -2182,6 +2185,28 @@
       }
     }
 
+    if (!_is_bundle_module) {
+      # Output the R.txt file to a more easily discoverable location for
+      # archiving. This is necessary when stripping resource names so that we
+      # have an archive of resource names to ids for shipped apks (for
+      # debugging purposes). We copy the file rather than change the location
+      # of the original because other targets rely on the location of the R.txt
+      # file.
+      _copy_rtxt_target = "${_template_name}__copy_rtxt"
+      copy(_copy_rtxt_target) {
+        deps = [
+          ":$_compile_resources_target",
+        ]
+        sources = [
+          _compile_resources_rtxt_out,
+        ]
+        outputs = [
+          _final_rtxt_path,
+        ]
+      }
+      _final_deps += [ ":$_copy_rtxt_target" ]
+    }
+
     if (_is_base_module && _is_bundle_module) {
       # Bundle modules have to reference resources from the base module.
       # However, to compile the bundle module's resources we have to give it an
@@ -2365,6 +2390,7 @@
 
       if (_is_bundle_module) {
         proto_resources_path = _packaged_resources_path
+        module_rtxt_path = _compile_resources_rtxt_out
       }
 
       if (!_is_bundle_module) {
@@ -3856,6 +3882,7 @@
       _all_create_module_targets += [
         ":$_create_module_target",
         _module_build_config_target,
+        "${_module_target}__compile_resources",
       ]
       _all_module_zip_paths += [ _module_zip_path ]
       _all_module_build_configs += [ _module_build_config ]
@@ -3914,6 +3941,7 @@
       deps = _all_create_module_targets + [ ":$_build_config_target" ]
       args = [
         "--out-bundle=$_rebased_bundle_path",
+        "--rtxt-out-path=$_rebased_bundle_path.R.txt",
         "--module-zips=$_all_rebased_module_zip_paths",
       ]
       if (_sign_bundle) {
@@ -3936,6 +3964,8 @@
               "$_rebased_build_config:uncompressed_assets)",
           "--uncompress-shared-libraries=@FileArg(" +
               "$_rebased_build_config:native:uncompress_shared_libraries)",
+          "--rtxt-in-paths=@FileArg(" +
+              "$_rebased_build_config:deps_info:module_rtxt_path)",
         ]
       }
     }
diff --git a/build/config/ios/ios_sdk_overrides.gni b/build/config/ios/ios_sdk_overrides.gni
index 00105af..5699ebe 100644
--- a/build/config/ios/ios_sdk_overrides.gni
+++ b/build/config/ios/ios_sdk_overrides.gni
@@ -7,11 +7,11 @@
 
 declare_args() {
   # Version of iOS that we're targeting.
-  ios_deployment_target = "10.0"
+  ios_deployment_target = "11.0"
 }
 
 # Always assert that ios_deployment_target is used on non-iOS platforms to
 # prevent unused args warnings.
 if (!is_ios) {
-  assert(ios_deployment_target == "10.0" || true)
+  assert(ios_deployment_target == "11.0" || true)
 }
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index 722468c..4eac9f4 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -207,13 +207,25 @@
     }
 
     tool("asm") {
-      if (toolchain_args.current_cpu == "x64") {
-        ml = "ml64.exe /nologo"
-      } else if (toolchain_args.current_cpu == "arm64") {
+      if (toolchain_args.current_cpu == "arm64") {
         prefix = rebase_path("$clang_base_path/bin", root_build_dir)
         ml = "${goma_prefix}${prefix}/${clang_cl} --target=arm64-windows"
       } else {
-        ml = "ml.exe /nologo"
+        if (toolchain_args.current_cpu == "x64") {
+          ml = "ml64.exe /nologo"
+        } else {
+          ml = "ml.exe /nologo"
+        }
+        if (use_lld) {
+          # Wrap ml(64).exe with a script that makes its output deterministic.
+          # It's lld only because the script zaps obj Timestamp which
+          # link.exe /incremental looks at.
+          # TODO(https://crbug.com/762167): If we end up writing an llvm-ml64,
+          # make sure it has deterministic output (maybe with /Brepro or
+          # something) and remove this wrapper.
+          ml_py = rebase_path("ml.py", root_build_dir)
+          ml = "$python_path $ml_py $ml"
+        }
       }
       command = "$python_path $tool_wrapper_path asm-wrapper $env $ml {{defines}} {{include_dirs}} {{asmflags}} "
       if (toolchain_args.current_cpu == "arm64") {
diff --git a/build/toolchain/win/ml.py b/build/toolchain/win/ml.py
new file mode 100755
index 0000000..877c584
--- /dev/null
+++ b/build/toolchain/win/ml.py
@@ -0,0 +1,287 @@
+#!/usr/bin/env python
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Wraps ml.exe or ml64.exe and postprocesses the output to be deterministic.
+Sets timestamp in .obj file to 0, hence incompatible with link.exe /incremental.
+
+Use by prefixing the ml(64).exe invocation with this script:
+    python ml.py ml.exe [args...]"""
+
+import array
+import collections
+import struct
+import subprocess
+import sys
+
+
+class Struct(object):
+  """A thin wrapper around the struct module that returns a namedtuple"""
+  def __init__(self, name, *args):
+    """Pass the name of the return type, and then an interleaved list of
+    format strings as used by the struct module and of field names."""
+    self.fmt = '<' + ''.join(args[0::2])
+    self.type = collections.namedtuple(name, args[1::2])
+
+  def pack_into(self, buffer, offset, data):
+    return struct.pack_into(self.fmt, buffer, offset, *data)
+
+  def unpack_from(self, buffer, offset=0):
+    return self.type(*struct.unpack_from(self.fmt, buffer, offset))
+
+  def size(self):
+    return struct.calcsize(self.fmt)
+
+
+def Subtract(nt, **kwargs):
+  """Subtract(nt, f=2) returns a new namedtuple with 2 subtracted from nt.f"""
+  return nt._replace(**{k: getattr(nt, k) - v for k, v in kwargs.iteritems()})
+
+
+def MakeDeterministic(objdata):
+  # Takes data produced by ml(64).exe (without any special flags) and
+  # 1. Sets the timestamp to 0
+  # 2. Strips the .debug$S section (which contains an unwanted absolute path)
+
+  # This makes several assumptions about ml's output:
+  # - Section data is in the same order as the corresponding section headers:
+  #   section headers preceeding the .debug$S section header have their data
+  #   preceeding the .debug$S section data; likewise for section headers
+  #   following the .debug$S section.
+  # - The .debug$S section contains only the absolute path to the obj file and
+  #   nothing else, in particular there's only a single entry in the symbol
+  #   table refering to the .debug$S section.
+  # - There are no COFF line number entries.
+  # - There's no IMAGE_SYM_CLASS_CLR_TOKEN symbol.
+  # These seem to hold in practice; if they stop holding this script needs to
+  # become smarter.
+
+  objdata = array.array('c', objdata)  # Writable, e.g. via struct.pack_into.
+
+  # Read coff header.
+  COFFHEADER = Struct('COFFHEADER',
+                      'H', 'Machine',
+                      'H', 'NumberOfSections',
+                      'I', 'TimeDateStamp',
+                      'I', 'PointerToSymbolTable',
+                      'I', 'NumberOfSymbols',
+
+                      'H', 'SizeOfOptionalHeader',
+                      'H', 'Characteristics')
+  coff_header = COFFHEADER.unpack_from(objdata)
+  assert coff_header.SizeOfOptionalHeader == 0  # Only set for binaries.
+
+  # Read section headers following coff header.
+  SECTIONHEADER = Struct('SECTIONHEADER',
+                         '8s', 'Name',
+                         'I', 'VirtualSize',
+                         'I', 'VirtualAddress',
+
+                         'I', 'SizeOfRawData',
+                         'I', 'PointerToRawData',
+                         'I', 'PointerToRelocations',
+                         'I', 'PointerToLineNumbers',
+
+                         'H', 'NumberOfRelocations',
+                         'H', 'NumberOfLineNumbers',
+                         'I', 'Characteristics')
+  section_headers = []
+  debug_section_index = -1
+  for i in range(0, coff_header.NumberOfSections):
+    section_header = SECTIONHEADER.unpack_from(
+        objdata, offset=COFFHEADER.size() + i * SECTIONHEADER.size())
+    assert not section_header[0].startswith('/')  # Support short names only.
+    section_headers.append(section_header)
+
+    if section_header.Name == '.debug$S':
+      assert debug_section_index == -1
+      debug_section_index = i
+  assert debug_section_index != -1
+
+  data_start = COFFHEADER.size() + len(section_headers) * SECTIONHEADER.size()
+
+  # Verify the .debug$S section looks like we expect.
+  assert section_headers[debug_section_index].Name == '.debug$S'
+  assert section_headers[debug_section_index].VirtualSize == 0
+  assert section_headers[debug_section_index].VirtualAddress == 0
+  debug_size = section_headers[debug_section_index].SizeOfRawData
+  debug_offset = section_headers[debug_section_index].PointerToRawData
+  assert section_headers[debug_section_index].PointerToRelocations == 0
+  assert section_headers[debug_section_index].PointerToLineNumbers == 0
+  assert section_headers[debug_section_index].NumberOfRelocations == 0
+  assert section_headers[debug_section_index].NumberOfLineNumbers == 0
+
+  # Make sure sections in front of .debug$S have their data preceeding it.
+  for header in section_headers[:debug_section_index]:
+    assert header.PointerToRawData < debug_offset
+    assert header.PointerToRelocations < debug_offset
+    assert header.PointerToLineNumbers < debug_offset
+
+  # Make sure sections after of .debug$S have their data following it.
+  for header in section_headers[debug_section_index + 1:]:
+    # Make sure the .debug$S data is at the very end of section data:
+    assert header.PointerToRawData > debug_offset
+    assert header.PointerToRelocations == 0
+    assert header.PointerToLineNumbers == 0
+
+  # Make sure the first non-empty section's data starts right after the section
+  # headers.
+  for section_header in section_headers:
+    if section_header.PointerToRawData == 0:
+      assert section_header.PointerToRelocations == 0
+      assert section_header.PointerToLineNumbers == 0
+      continue
+    assert section_header.PointerToRawData == data_start
+    break
+
+  # Make sure the symbol table (and hence, string table) appear after the last
+  # section:
+  assert (coff_header.PointerToSymbolTable >=
+      section_headers[-1].PointerToRawData + section_headers[-1].SizeOfRawData)
+
+  # The symbol table contains a symbol for the no-longer-present .debug$S
+  # section. If we leave it there, lld-link will complain:
+  #
+  #    lld-link: error: .debug$S should not refer to non-existent section 5
+  #
+  # so we need to remove that symbol table entry as well. This shifts symbol
+  # entries around and we need to update symbol table indices in:
+  # - relocations
+  # - line number records (never present)
+  # - one aux symbol entries (never present in ml output)
+  SYM = Struct('SYM',
+               '8s', 'Name',
+               'I', 'Value',
+               'h', 'SectionNumber',  # Note: Signed!
+               'H', 'Type',
+
+               'B', 'StorageClass',
+               'B', 'NumberOfAuxSymbols')
+  i = 0
+  debug_sym = -1
+  while i < coff_header.NumberOfSymbols:
+    sym_offset = coff_header.PointerToSymbolTable + i * SYM.size()
+    sym = SYM.unpack_from(objdata, sym_offset)
+
+    # 107 is IMAGE_SYM_CLASS_CLR_TOKEN, which has aux entry "CLR Token
+    # Definition", which contains a symbol index. Check it's never present.
+    assert sym.StorageClass != 107
+
+    # Note: sym.SectionNumber is 1-based, debug_section_index is 0-based.
+    if sym.SectionNumber - 1 == debug_section_index:
+      assert debug_sym == -1, 'more than one .debug$S symbol found'
+      debug_sym = i
+      # Make sure the .debug$S symbol looks like we expect.
+      # In particular, it should have exactly one aux symbol.
+      assert sym.Name == '.debug$S'
+      assert sym.Value == 0
+      assert sym.Type == 0
+      assert sym.StorageClass == 3
+      assert sym.NumberOfAuxSymbols == 1
+    elif sym.SectionNumber > debug_section_index:
+      sym = Subtract(sym, SectionNumber=1)
+      SYM.pack_into(objdata, sym_offset, sym)
+    i += 1 + sym.NumberOfAuxSymbols
+  assert debug_sym != -1, '.debug$S symbol not found'
+
+  # Note: Usually the .debug$S section is the last, but for files saying
+  # `includelib foo.lib`, like safe_terminate_process.asm in 32-bit builds,
+  # this isn't true: .drectve is after .debug$S.
+
+  # Update symbol table indices in relocations.
+  # There are a few processor types that have one or two relocation types
+  # where SymbolTableIndex has a different meaning, but not for x86.
+  REL = Struct('REL',
+               'I', 'VirtualAddress',
+               'I', 'SymbolTableIndex',
+               'H', 'Type')
+  for header in section_headers[0:debug_section_index]:
+    for j in range(0, header.NumberOfRelocations):
+      rel_offset = header.PointerToRelocations + j * REL.size()
+      rel = REL.unpack_from(objdata, rel_offset)
+      assert rel.SymbolTableIndex != debug_sym
+      if rel.SymbolTableIndex > debug_sym:
+        rel = Subtract(rel, SymbolTableIndex=2)
+        REL.pack_into(objdata, rel_offset, rel)
+
+  # Update symbol table indices in line numbers -- just check they don't exist.
+  for header in section_headers:
+    assert header.NumberOfLineNumbers == 0
+
+  # Now that all indices are updated, remove the symbol table entry refering to
+  # .debug$S and its aux entry.
+  del objdata[coff_header.PointerToSymbolTable + debug_sym * SYM.size():
+              coff_header.PointerToSymbolTable + (debug_sym + 2) * SYM.size()]
+
+  # Now we know that it's safe to write out the input data, with just the
+  # timestamp overwritten to 0, the last section header cut out (and the
+  # offsets of all other section headers decremented by the size of that
+  # one section header), and the last section's data cut out. The symbol
+  # table offset needs to be reduced by one section header and the size of
+  # the missing section.
+  # (The COFF spec only requires on-disk sections to be aligned in image files,
+  # for obj files it's not required. If that wasn't the case, deleting slices
+  # if data would not generally be safe.)
+
+  # Update section offsets and remove .debug$S section data.
+  for i in range(0, debug_section_index):
+    header = section_headers[i]
+    if header.SizeOfRawData:
+      header = Subtract(header, PointerToRawData=SECTIONHEADER.size())
+    if header.NumberOfRelocations:
+      header = Subtract(header, PointerToRelocations=SECTIONHEADER.size())
+    if header.NumberOfLineNumbers:
+      header = Subtract(header, PointerToLineNumbers=SECTIONHEADER.size())
+    SECTIONHEADER.pack_into(
+        objdata, COFFHEADER.size() + i * SECTIONHEADER.size(), header)
+  for i in range(debug_section_index + 1, len(section_headers)):
+    header = section_headers[i]
+    shift = SECTIONHEADER.size() + debug_size
+    if header.SizeOfRawData:
+      header = Subtract(header, PointerToRawData=shift)
+    if header.NumberOfRelocations:
+      header = Subtract(header, PointerToRelocations=shift)
+    if header.NumberOfLineNumbers:
+      header = Subtract(header, PointerToLineNumbers=shift)
+    SECTIONHEADER.pack_into(
+        objdata, COFFHEADER.size() + i * SECTIONHEADER.size(), header)
+
+  del objdata[debug_offset:debug_offset + debug_size]
+
+  # Finally, remove .debug$S section header and update coff header.
+  coff_header = coff_header._replace(TimeDateStamp=0)
+  coff_header = Subtract(coff_header,
+                         NumberOfSections=1,
+                         PointerToSymbolTable=SECTIONHEADER.size() + debug_size,
+                         NumberOfSymbols=2)
+  COFFHEADER.pack_into(objdata, 0, coff_header)
+
+  del objdata[
+      COFFHEADER.size() + debug_section_index * SECTIONHEADER.size():
+      COFFHEADER.size() + (debug_section_index + 1) * SECTIONHEADER.size()]
+
+  # All done!
+  return objdata.tostring()
+
+
+def main():
+  ml_result = subprocess.call(sys.argv[1:])
+  if ml_result != 0:
+    return ml_result
+
+  objfile = None
+  for i in range(1, len(sys.argv)):
+    if sys.argv[i].startswith('/Fo'):
+      objfile = sys.argv[i][len('/Fo'):]
+  assert objfile, 'failed to find ml output'
+
+  with open(objfile, 'rb') as f:
+    objdata = f.read()
+  objdata = MakeDeterministic(objdata)
+  with open(objfile, 'wb') as f:
+    f.write(objdata)
+
+
+if __name__ == '__main__':
+  sys.exit(main())
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index d2dbd42..f976fa6 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -53,6 +53,7 @@
       sorting_context_id(0),
       use_parent_backface_visibility(false),
       background_color(0),
+      backdrop_filter_quality(1.0f),
       scrollable(false),
       is_scrollbar(false),
       user_scrollable_horizontal(true),
@@ -554,6 +555,10 @@
   SetNeedsCommit();
 }
 
+void Layer::SetBackdropFilterQuality(const float quality) {
+  inputs_.backdrop_filter_quality = quality;
+}
+
 void Layer::SetFiltersOrigin(const gfx::PointF& filters_origin) {
   DCHECK(IsPropertyChangeAllowed());
   if (inputs_.filters_origin == filters_origin)
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 8a4094ca..b90f455 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -283,6 +283,11 @@
     return inputs_.backdrop_filters;
   }
 
+  void SetBackdropFilterQuality(const float quality);
+  float backdrop_filter_quality() const {
+    return inputs_.backdrop_filter_quality;
+  }
+
   // Set or get an optimization hint that the contents of this layer are fully
   // opaque or not. If true, every pixel of content inside the layer's bounds
   // must be opaque or visual errors can occur. This applies only to this layer
@@ -897,6 +902,7 @@
     FilterOperations filters;
     FilterOperations backdrop_filters;
     gfx::PointF filters_origin;
+    float backdrop_filter_quality;
 
     gfx::ScrollOffset scroll_offset;
 
diff --git a/cc/layers/layer_impl_test_properties.h b/cc/layers/layer_impl_test_properties.h
index 31cebf4..c931d45 100644
--- a/cc/layers/layer_impl_test_properties.h
+++ b/cc/layers/layer_impl_test_properties.h
@@ -48,6 +48,7 @@
   float opacity;
   FilterOperations filters;
   FilterOperations backdrop_filters;
+  float backdrop_filter_quality;
   gfx::PointF filters_origin;
   SkBlendMode blend_mode;
   LayerPositionConstraint position_constraint;
diff --git a/cc/layers/render_surface_impl.cc b/cc/layers/render_surface_impl.cc
index 4e90999..d4a0e72f 100644
--- a/cc/layers/render_surface_impl.cc
+++ b/cc/layers/render_surface_impl.cc
@@ -464,7 +464,8 @@
   quad->SetNew(shared_quad_state, content_rect(), unoccluded_content_rect, id(),
                mask_resource_id, mask_uv_rect, mask_texture_size,
                surface_contents_scale, FiltersOrigin(), tex_coord_rect,
-               !layer_tree_impl_->settings().enable_edge_anti_aliasing);
+               !layer_tree_impl_->settings().enable_edge_anti_aliasing,
+               OwningEffectNode()->backdrop_filter_quality);
 }
 
 void RenderSurfaceImpl::TileMaskLayer(
@@ -576,6 +577,7 @@
         quad_space_to_surface_space_transform, gfx::RectF(quad_rect));
     tex_coord_rect.Offset(-content_rect().OffsetFromOrigin());
 
+    constexpr float backdrop_filter_quality = 1.0;
     switch (temp_quad->material) {
       case viz::DrawQuad::TILED_CONTENT: {
         DCHECK_EQ(1U, temp_quad->resources.count);
@@ -623,7 +625,8 @@
                      temp_quad->resources.ids[0], mask_uv_rect,
                      mask_texture_size, owning_layer_to_surface_contents_scale,
                      FiltersOrigin(), tex_coord_rect,
-                     !layer_tree_impl_->settings().enable_edge_anti_aliasing);
+                     !layer_tree_impl_->settings().enable_edge_anti_aliasing,
+                     backdrop_filter_quality);
       } break;
       case viz::DrawQuad::SOLID_COLOR: {
         SkColor temp_color =
@@ -642,7 +645,8 @@
                      gfx::RectF(), gfx::Size(),
                      owning_layer_to_surface_contents_scale, FiltersOrigin(),
                      tex_coord_rect,
-                     !layer_tree_impl_->settings().enable_edge_anti_aliasing);
+                     !layer_tree_impl_->settings().enable_edge_anti_aliasing,
+                     backdrop_filter_quality);
       } break;
       case viz::DrawQuad::DEBUG_BORDER:
         NOTIMPLEMENTED();
diff --git a/cc/resources/resource_pool.cc b/cc/resources/resource_pool.cc
index 1dfbe0a..2e2fd3f 100644
--- a/cc/resources/resource_pool.cc
+++ b/cc/resources/resource_pool.cc
@@ -16,6 +16,7 @@
 #include "base/single_thread_task_runner.h"
 #include "base/strings/stringprintf.h"
 #include "base/threading/thread_task_runner_handle.h"
+#include "base/time/default_tick_clock.h"
 #include "base/trace_event/memory_dump_manager.h"
 #include "build/build_config.h"
 #include "cc/base/container_util.h"
@@ -97,6 +98,7 @@
       disallow_non_exact_reuse_(disallow_non_exact_reuse),
       tracing_id_(g_next_tracing_id.GetNext()),
       flush_evicted_resources_deadline_(base::TimeTicks::Max()),
+      clock_(base::DefaultTickClock::GetInstance()),
       weak_ptr_factory_(this) {
   base::trace_event::MemoryDumpManager::GetInstance()->RegisterDumpProvider(
       this, "cc::ResourcePool", task_runner_.get());
@@ -388,7 +390,7 @@
   // crbug.com/598286.
   CHECK(it->second.get());
 
-  pool_resource->set_last_usage(base::TimeTicks::Now());
+  pool_resource->set_last_usage(clock_->NowTicks());
   in_use_memory_usage_bytes_ -=
       viz::ResourceSizes::UncheckedSizeInBytes<size_t>(pool_resource->size(),
                                                        pool_resource->format());
@@ -468,7 +470,7 @@
   --total_resource_count_;
   if (flush_evicted_resources_deadline_ == base::TimeTicks::Max()) {
     flush_evicted_resources_deadline_ =
-        base::TimeTicks::Now() + kDefaultMaxFlushDelay;
+        clock_->NowTicks() + kDefaultMaxFlushDelay;
   }
 }
 
@@ -505,31 +507,27 @@
 
 void ResourcePool::EvictExpiredResources() {
   evict_expired_resources_pending_ = false;
-  base::TimeTicks current_time = base::TimeTicks::Now();
+  base::TimeTicks current_time = clock_->NowTicks();
 
   EvictResourcesNotUsedSince(current_time - resource_expiration_delay_);
 
   if (unused_resources_.empty() ||
-      flush_evicted_resources_deadline_ < current_time) {
-    flush_evicted_resources_deadline_ = base::TimeTicks::Max();
+      flush_evicted_resources_deadline_ <= current_time) {
     // If nothing is evictable, we have deleted one (and possibly more)
     // resources without any new activity. Flush to ensure these deletions are
     // processed.
-    if (context_provider_) {
-      // Flush any ContextGL work as well as any SharedImageInterface work.
-      context_provider_->ContextGL()->OrderingBarrierCHROMIUM();
-      context_provider_->ContextSupport()->FlushPendingWork();
-    }
-    return;
+    FlushEvictedResources();
   }
 
-  // If we still have evictable resources, schedule a call to
-  // EvictExpiredResources for either (a) the time when the LRU buffer expires
-  // or (b) the deadline to explicitly flush previously evicted resources.
-  ScheduleEvictExpiredResourcesIn(
-      std::min(GetUsageTimeForLRUResource() + resource_expiration_delay_,
-               flush_evicted_resources_deadline_) -
-      current_time);
+  if (!unused_resources_.empty()) {
+    // If we still have evictable resources, schedule a call to
+    // EvictExpiredResources for either (a) the time when the LRU buffer expires
+    // or (b) the deadline to explicitly flush previously evicted resources.
+    ScheduleEvictExpiredResourcesIn(
+        std::min(GetUsageTimeForLRUResource() + resource_expiration_delay_,
+                 flush_evicted_resources_deadline_) -
+        current_time);
+  }
 }
 
 void ResourcePool::EvictResourcesNotUsedSince(base::TimeTicks time_limit) {
@@ -555,6 +553,15 @@
   return busy_resources_.back()->last_usage();
 }
 
+void ResourcePool::FlushEvictedResources() {
+  flush_evicted_resources_deadline_ = base::TimeTicks::Max();
+  if (context_provider_) {
+    // Flush any ContextGL work as well as any SharedImageInterface work.
+    context_provider_->ContextGL()->OrderingBarrierCHROMIUM();
+    context_provider_->ContextSupport()->FlushPendingWork();
+  }
+}
+
 bool ResourcePool::OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
                                 base::trace_event::ProcessMemoryDump* pmd) {
   if (args.level_of_detail == MemoryDumpLevelOfDetail::BACKGROUND) {
@@ -589,6 +596,7 @@
       break;
     case base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
       EvictResourcesNotUsedSince(base::TimeTicks() + base::TimeDelta::Max());
+      FlushEvictedResources();
       break;
   }
 }
diff --git a/cc/resources/resource_pool.h b/cc/resources/resource_pool.h
index 31708ce6..cd72eb84 100644
--- a/cc/resources/resource_pool.h
+++ b/cc/resources/resource_pool.h
@@ -16,6 +16,7 @@
 #include "base/memory/memory_pressure_listener.h"
 #include "base/memory/weak_ptr.h"
 #include "base/optional.h"
+#include "base/time/tick_clock.h"
 #include "base/trace_event/memory_allocator_dump_guid.h"
 #include "base/trace_event/memory_dump_provider.h"
 #include "base/unguessable_token.h"
@@ -264,6 +265,9 @@
     return !disallow_non_exact_reuse_;
   }
 
+  // Overrides internal clock for testing purposes.
+  void SetClockForTesting(const base::TickClock* clock) { clock_ = clock; }
+
  private:
   FRIEND_TEST_ALL_PREFIXES(ResourcePoolTest, ReuseResource);
   FRIEND_TEST_ALL_PREFIXES(ResourcePoolTest, ExactRequestsRespected);
@@ -371,6 +375,7 @@
   void EvictResourcesNotUsedSince(base::TimeTicks time_limit);
   bool HasEvictableResources() const;
   base::TimeTicks GetUsageTimeForLRUResource() const;
+  void FlushEvictedResources();
 
   viz::ClientResourceProvider* const resource_provider_;
   viz::ContextProvider* const context_provider_;
@@ -399,6 +404,8 @@
 
   base::TimeTicks flush_evicted_resources_deadline_;
 
+  const base::TickClock* clock_;
+
   base::WeakPtrFactory<ResourcePool> weak_ptr_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(ResourcePool);
diff --git a/cc/resources/resource_pool_unittest.cc b/cc/resources/resource_pool_unittest.cc
index 36d1e9b..5f15954 100644
--- a/cc/resources/resource_pool_unittest.cc
+++ b/cc/resources/resource_pool_unittest.cc
@@ -6,14 +6,16 @@
 
 #include <stddef.h>
 
-#include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
+#include "base/test/test_mock_time_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "components/viz/client/client_resource_provider.h"
 #include "components/viz/common/resources/resource_sizes.h"
 #include "components/viz/common/resources/returned_resource.h"
 #include "components/viz/test/test_context_provider.h"
+#include "components/viz/test/test_context_support.h"
 #include "components/viz/test/test_shared_bitmap_manager.h"
+#include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace cc {
@@ -21,13 +23,17 @@
 class ResourcePoolTest : public testing::Test {
  public:
   void SetUp() override {
-    context_provider_ = viz::TestContextProvider::Create();
+    auto context_support = std::make_unique<MockContextSupport>();
+    context_support_ = context_support.get();
+    context_provider_ =
+        viz::TestContextProvider::Create(std::move(context_support));
     context_provider_->BindToCurrentThread();
     resource_provider_ = std::make_unique<viz::ClientResourceProvider>(true);
-    task_runner_ = base::ThreadTaskRunnerHandle::Get();
+    test_task_runner_ = base::MakeRefCounted<base::TestMockTimeTaskRunner>();
     resource_pool_ = std::make_unique<ResourcePool>(
-        resource_provider_.get(), context_provider_.get(), task_runner_,
+        resource_provider_.get(), context_provider_.get(), test_task_runner_,
         ResourcePool::kDefaultExpirationDelay, false);
+    resource_pool_->SetClockForTesting(test_task_runner_->GetMockTickClock());
   }
 
   void TearDown() override {
@@ -35,6 +41,12 @@
   }
 
  protected:
+  class MockContextSupport : public viz::TestContextSupport {
+   public:
+    MockContextSupport() = default;
+    MOCK_METHOD0(FlushPendingWork, void());
+  };
+
   class StubGpuBacking : public ResourcePool::GpuBacking {
    public:
     void OnMemoryDump(
@@ -58,9 +70,10 @@
   }
 
   viz::TestSharedBitmapManager shared_bitmap_manager_;
+  MockContextSupport* context_support_;
   scoped_refptr<viz::TestContextProvider> context_provider_;
   std::unique_ptr<viz::ClientResourceProvider> resource_provider_;
-  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+  scoped_refptr<base::TestMockTimeTaskRunner> test_task_runner_;
   std::unique_ptr<ResourcePool> resource_pool_;
 };
 
@@ -77,6 +90,67 @@
   resource_pool_->ReleaseResource(std::move(resource));
 }
 
+TEST_F(ResourcePoolTest, EventuallyEvictAndFlush) {
+  gfx::Size size(100, 100);
+  viz::ResourceFormat format = viz::RGBA_8888;
+  gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB();
+  ResourcePool::InUsePoolResource resource =
+      resource_pool_->AcquireResource(size, format, color_space);
+  resource_pool_->ReleaseResource(std::move(resource));
+  EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting());
+
+  // Expect flush after eviction and flush delay.
+  EXPECT_CALL(*context_support_, FlushPendingWork()).Times(testing::AtLeast(1));
+  test_task_runner_->FastForwardBy(ResourcePool::kDefaultExpirationDelay +
+                                   ResourcePool::kDefaultMaxFlushDelay);
+  EXPECT_EQ(0u, resource_pool_->GetTotalResourceCountForTesting());
+}
+
+TEST_F(ResourcePoolTest, FlushEvenIfMoreUnusedToEvict) {
+  gfx::Size size(100, 100);
+  viz::ResourceFormat format = viz::RGBA_8888;
+  gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB();
+  ResourcePool::InUsePoolResource resource1 =
+      resource_pool_->AcquireResource(size, format, color_space);
+  ResourcePool::InUsePoolResource resource2 =
+      resource_pool_->AcquireResource(size, format, color_space);
+
+  // Time 0: No resources evicted yet.
+  EXPECT_EQ(2u, resource_pool_->GetTotalResourceCountForTesting());
+
+  // Space the resource last_usage out so that they don't expire at the same
+  // time. resource1 last used at time 0 (expires kDefaultExpirationDelay) and
+  // resource2 last used at last_usage_gap (expires kDefaultExpireationDelay +
+  // last_usage_gap).
+  const base::TimeDelta last_usage_gap =
+      ResourcePool::kDefaultMaxFlushDelay * 2;
+  resource_pool_->ReleaseResource(std::move(resource1));
+  test_task_runner_->FastForwardBy(last_usage_gap);
+  resource_pool_->ReleaseResource(std::move(resource2));
+
+  // Time |last_usage_gap|: No resources evicted yet.
+  EXPECT_EQ(2u, resource_pool_->GetTotalResourceCountForTesting());
+
+  // Time |kDefaultExpirationDelay|: resource1 evicted, but not resource2 yet.
+  test_task_runner_->FastForwardBy(ResourcePool::kDefaultExpirationDelay -
+                                   last_usage_gap);
+  EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting());
+
+  // Expect at least one flush kDefaultMaxFlushDelay after an eviction.
+  EXPECT_CALL(*context_support_, FlushPendingWork()).Times(testing::AtLeast(1));
+  test_task_runner_->FastForwardBy(ResourcePool::kDefaultMaxFlushDelay);
+
+  // Time |kDefaultExpirationDelay + kDefaultMaxFlushDelay|:
+  // Check that flush was called and resource2 still not evicted.
+  testing::Mock::VerifyAndClearExpectations(context_support_);
+  EXPECT_EQ(1u, resource_pool_->GetTotalResourceCountForTesting());
+
+  // Wait a long time and resource2 should get evicted and flushed.
+  EXPECT_CALL(*context_support_, FlushPendingWork()).Times(testing::AtLeast(1));
+  test_task_runner_->FastForwardBy(ResourcePool::kDefaultExpirationDelay * 100);
+  EXPECT_EQ(0u, resource_pool_->GetTotalResourceCountForTesting());
+}
+
 TEST_F(ResourcePoolTest, AccountingSingleResource) {
   // Limits high enough to not be hit by this test.
   size_t bytes_limit = 10 * 1024 * 1024;
@@ -184,12 +258,6 @@
 }
 
 TEST_F(ResourcePoolTest, BusyResourcesNotFreed) {
-  // Set a quick resource expiration delay so that this test doesn't take long
-  // to run.
-  resource_pool_ = std::make_unique<ResourcePool>(
-      resource_provider_.get(), context_provider_.get(), task_runner_,
-      base::TimeDelta::FromMilliseconds(10), false);
-
   // Limits high enough to not be hit by this test.
   size_t bytes_limit = 10 * 1024 * 1024;
   size_t count_limit = 100;
@@ -216,12 +284,9 @@
   EXPECT_EQ(0u, resource_pool_->memory_usage_bytes());
   EXPECT_EQ(1u, resource_pool_->GetBusyResourceCountForTesting());
 
-  // Wait for our resource pool to evict resources. We expect resources to be
-  // released within 10 ms, give the thread up to 200.
-  base::RunLoop run_loop;
-  task_runner_->PostDelayedTask(FROM_HERE, run_loop.QuitClosure(),
-                                base::TimeDelta::FromMillisecondsD(200));
-  run_loop.Run();
+  // Wait for our resource pool to evict resources. Wait 10x the expiration
+  // delay.
+  test_task_runner_->FastForwardBy(ResourcePool::kDefaultExpirationDelay * 10);
 
   // Busy resources are still held, since they may be in flight to the display
   // compositor and should not be freed.
@@ -231,12 +296,6 @@
 }
 
 TEST_F(ResourcePoolTest, UnusedResourcesEventuallyFreed) {
-  // Set a quick resource expiration delay so that this test doesn't take long
-  // to run.
-  resource_pool_ = std::make_unique<ResourcePool>(
-      resource_provider_.get(), context_provider_.get(), task_runner_,
-      base::TimeDelta::FromMilliseconds(100), false);
-
   // Limits high enough to not be hit by this test.
   size_t bytes_limit = 10 * 1024 * 1024;
   size_t count_limit = 100;
@@ -274,12 +333,9 @@
   EXPECT_EQ(0u, resource_pool_->resource_count());
   EXPECT_EQ(0u, resource_pool_->GetBusyResourceCountForTesting());
 
-  // Wait for our resource pool to evict resources. We expect resources to be
-  // released within 100 ms, give the thread up to 200.
-  base::RunLoop run_loop;
-  task_runner_->PostDelayedTask(FROM_HERE, run_loop.QuitClosure(),
-                                base::TimeDelta::FromMillisecondsD(200));
-  run_loop.Run();
+  // Wait for our resource pool to evict resources. Wait 10x the expiration
+  // delay.
+  test_task_runner_->FastForwardBy(ResourcePool::kDefaultExpirationDelay * 10);
 
   EXPECT_EQ(0u, resource_pool_->GetTotalMemoryUsageForTesting());
 }
@@ -583,8 +639,8 @@
   gfx::ColorSpace color_space = gfx::ColorSpace::CreateSRGB();
 
   resource_pool_ = std::make_unique<ResourcePool>(
-      resource_provider_.get(), context_provider_.get(), task_runner_,
-      base::TimeDelta::FromMilliseconds(100), true);
+      resource_provider_.get(), context_provider_.get(), test_task_runner_,
+      ResourcePool::kDefaultExpirationDelay, true);
 
   // Create unused resource with size 100x100.
   CheckAndReturnResource(resource_pool_->AcquireResource(gfx::Size(100, 100),
diff --git a/cc/test/render_pass_test_utils.cc b/cc/test/render_pass_test_utils.cc
index e1f83fa..17a2047 100644
--- a/cc/test/render_pass_test_utils.cc
+++ b/cc/test/render_pass_test_utils.cc
@@ -114,7 +114,7 @@
   auto* quad = to_pass->CreateAndAppendDrawQuad<viz::RenderPassDrawQuad>();
   quad->SetNew(shared_state, output_rect, output_rect, contributing_pass->id, 0,
                gfx::RectF(), gfx::Size(), gfx::Vector2dF(), gfx::PointF(),
-               gfx::RectF(), false);
+               gfx::RectF(), false, 1.0f);
 }
 
 void AddRenderPassQuad(viz::RenderPass* to_pass,
@@ -132,7 +132,7 @@
   quad->SetNew(shared_state, output_rect, output_rect, contributing_pass->id,
                mask_resource_id, gfx::RectF(output_rect),
                arbitrary_nonzero_size, gfx::Vector2dF(), gfx::PointF(),
-               gfx::RectF(), false);
+               gfx::RectF(), false, 1.0f);
 }
 
 std::vector<viz::ResourceId> AddOneOfEveryQuadType(
@@ -184,7 +184,7 @@
     render_pass_quad->SetNew(shared_state, rect, visible_rect, child_pass_id,
                              resource5, gfx::RectF(rect), gfx::Size(73, 26),
                              gfx::Vector2dF(), gfx::PointF(), gfx::RectF(),
-                             false);
+                             false, 1.0f);
   }
 
   auto* solid_color_quad =
@@ -360,7 +360,7 @@
     render_pass_quad->SetNew(shared_state, rect, visible_rect, child_pass_id,
                              mapped_resource5, gfx::RectF(rect),
                              gfx::Size(73, 26), gfx::Vector2dF(), gfx::PointF(),
-                             gfx::RectF(), false);
+                             gfx::RectF(), false, 1.0f);
   }
 
   viz::SolidColorDrawQuad* solid_color_quad =
diff --git a/cc/trees/effect_node.cc b/cc/trees/effect_node.cc
index b9480610..b0138a1 100644
--- a/cc/trees/effect_node.cc
+++ b/cc/trees/effect_node.cc
@@ -15,6 +15,7 @@
       stable_id(INVALID_STABLE_ID),
       opacity(1.f),
       screen_space_opacity(1.f),
+      backdrop_filter_quality(1.f),
       blend_mode(SkBlendMode::kSrcOver),
       has_render_surface(false),
       cache_render_surface(false),
@@ -44,6 +45,7 @@
   return id == other.id && parent_id == other.parent_id &&
          stable_id == other.stable_id && opacity == other.opacity &&
          screen_space_opacity == other.screen_space_opacity &&
+         backdrop_filter_quality == other.backdrop_filter_quality &&
          has_render_surface == other.has_render_surface &&
          cache_render_surface == other.cache_render_surface &&
          has_copy_request == other.has_copy_request &&
@@ -80,6 +82,7 @@
   value->SetInteger("parent_id", parent_id);
   value->SetInteger("stable_id", stable_id);
   value->SetDouble("opacity", opacity);
+  value->SetDouble("backdrop_filter_quality", backdrop_filter_quality);
   value->SetString("blend_mode", SkBlendMode_Name(blend_mode));
   value->SetBoolean("has_render_surface", has_render_surface);
   value->SetBoolean("cache_render_surface", cache_render_surface);
diff --git a/cc/trees/effect_node.h b/cc/trees/effect_node.h
index 61fb30a..0f8bf33 100644
--- a/cc/trees/effect_node.h
+++ b/cc/trees/effect_node.h
@@ -40,6 +40,7 @@
 
   FilterOperations filters;
   FilterOperations backdrop_filters;
+  float backdrop_filter_quality;
   gfx::PointF filters_origin;
 
   SkBlendMode blend_mode;
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index 223c0dd..ccf659c 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -3607,7 +3607,8 @@
   void BeginTest() override { PostSetNeedsCommitToMainThread(); }
 
   void AllowCommits() override {
-    local_surface_id_ = allocator_.GenerateId();
+    allocator_.GenerateId();
+    local_surface_id_ = allocator_.GetCurrentLocalSurfaceId();
     PostSetLocalSurfaceIdToMainThread(local_surface_id_);
   }
 
@@ -8887,14 +8888,16 @@
     layer_tree_host()->SetViewportSizeAndScale(
         gfx::Size(10, 10), 1.f, viz::LocalSurfaceId(), base::TimeTicks());
     layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10));
-    local_surface_id_ = allocator_.GenerateId();
+    allocator_.GenerateId();
+    local_surface_id_ = allocator_.GetCurrentLocalSurfaceId();
     PostSetLocalSurfaceIdToMainThread(local_surface_id_);
   }
 
   void DidReceiveCompositorFrameAck() override {
     switch (layer_tree_host()->SourceFrameNumber()) {
       case 1:
-        local_surface_id_ = allocator_.GenerateId();
+        allocator_.GenerateId();
+        local_surface_id_ = allocator_.GetCurrentLocalSurfaceId();
         PostSetLocalSurfaceIdToMainThread(local_surface_id_);
         break;
       case 2:
diff --git a/cc/trees/property_tree_builder.cc b/cc/trees/property_tree_builder.cc
index cf98d8e8..674b121 100644
--- a/cc/trees/property_tree_builder.cc
+++ b/cc/trees/property_tree_builder.cc
@@ -748,6 +748,14 @@
   return layer->test_properties()->backdrop_filters;
 }
 
+static inline float BackdropFilterQuality(Layer* layer) {
+  return layer->backdrop_filter_quality();
+}
+
+static inline float BackdropFilterQuality(LayerImpl* layer) {
+  return layer->test_properties()->backdrop_filter_quality;
+}
+
 static inline bool HideLayerAndSubtree(Layer* layer) {
   return layer->hide_layer_and_subtree();
 }
@@ -984,6 +992,7 @@
   node->has_copy_request = HasCopyRequest(layer);
   node->filters = Filters(layer);
   node->backdrop_filters = BackdropFilters(layer);
+  node->backdrop_filter_quality = BackdropFilterQuality(layer);
   node->filters_origin = FiltersOrigin(layer);
   node->trilinear_filtering = TrilinearFiltering(layer);
   node->has_potential_opacity_animation = has_potential_opacity_animation;
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 0b561c8..88419e0 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -228,6 +228,16 @@
   ]
 }
 
+java_cpp_template("vr_build_config") {
+  package_path = "org/chromium/chrome/browser/vr"
+  sources = [
+    "//chrome/android/java/src/org/chromium/chrome/browser/vr/VrBuildConfig.template",
+  ]
+  if (enable_vr) {
+    defines = [ "ENABLE_VR" ]
+  }
+}
+
 android_library("chrome_java") {
   deps = [
     ":chrome_app_java_resources",
@@ -379,6 +389,7 @@
     "//components/signin/core/browser:investigated_scenario_java",
     "//components/supervised_user_error_page:enums_srcjar",
     "//components/ui_metrics:ui_metrics_enums_java",
+    ":vr_build_config",
   ]
 
   android_manifest_for_lint = chrome_public_android_manifest
diff --git a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java
index 2b1bd37..926f85f 100644
--- a/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java
+++ b/chrome/android/feed/core/java/src/org/chromium/chrome/browser/feed/FeedNewTabPage.java
@@ -197,7 +197,8 @@
 
         @Override
         public boolean onInterceptTouchEvent(MotionEvent ev) {
-            return !mMediator.getTouchEnabled() || mFakeboxDelegate.isUrlBarFocused()
+            return (mMediator != null && !mMediator.getTouchEnabled())
+                    || (mFakeboxDelegate != null && mFakeboxDelegate.isUrlBarFocused())
                     || super.onInterceptTouchEvent(ev);
         }
     }
diff --git a/chrome/android/java/res/layout/password_accessory_sheet_divider.xml b/chrome/android/java/res/layout/password_accessory_sheet_divider.xml
index 22ae257b..117e37a1 100644
--- a/chrome/android/java/res/layout/password_accessory_sheet_divider.xml
+++ b/chrome/android/java/res/layout/password_accessory_sheet_divider.xml
@@ -5,5 +5,5 @@
 
 <View style="@style/HorizontalDivider"
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:paddingTop="8dp"
-    android:paddingBottom="8dp" />
\ No newline at end of file
+    android:layout_marginTop="8dp"
+    android:layout_marginBottom="8dp" />
\ No newline at end of file
diff --git a/chrome/android/java/res/layout/password_accessory_sheet_label.xml b/chrome/android/java/res/layout/password_accessory_sheet_label.xml
index 213f9b7..0dda63d 100644
--- a/chrome/android/java/res/layout/password_accessory_sheet_label.xml
+++ b/chrome/android/java/res/layout/password_accessory_sheet_label.xml
@@ -3,13 +3,17 @@
      Use of this source code is governed by a BSD-style license that can be
      found in the LICENSE file. -->
 
-<TextView
+<org.chromium.ui.widget.TextViewWithLeading
     xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:paddingStart="16dp"
     android:paddingEnd="16dp"
     android:fillViewport="true"
     android:gravity="center_vertical|start"
     android:textAppearance="@style/BlackHint1"
     android:minHeight="48dp"
+    app:leading="@dimen/text_size_large_leading"
+    android:paddingTop="12dp"
+    android:paddingBottom="12dp"
     android:layout_height="wrap_content"
     android:layout_width="match_parent"/>
diff --git a/chrome/android/java/res/layout/password_accessory_sheet_top_divider.xml b/chrome/android/java/res/layout/password_accessory_sheet_top_divider.xml
index e329eeba..b7d5a8e 100644
--- a/chrome/android/java/res/layout/password_accessory_sheet_top_divider.xml
+++ b/chrome/android/java/res/layout/password_accessory_sheet_top_divider.xml
@@ -5,4 +5,4 @@
 
 <View style="@style/HorizontalDivider"
       xmlns:android="http://schemas.android.com/apk/res/android"
-      android:paddingBottom="8dp"/>
\ No newline at end of file
+      android:layout_marginBottom="8dp"/>
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
index 924ade8..ab58aab9 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
@@ -1424,6 +1424,7 @@
         maybeRemoveWindowBackground();
         DownloadManagerService.getDownloadManagerService().onActivityLaunched();
 
+        VrModuleProvider.maybeInit();
         VrModuleProvider.getDelegate().onNativeLibraryAvailable();
         if (getSavedInstanceState() == null && getIntent() != null) {
             VrModuleProvider.getDelegate().onNewIntentWithNative(this, getIntent());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java
index c39d7543..3b84999 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java
@@ -291,7 +291,7 @@
         }
         mKeyboardAccessory.requestShowing();
         mKeyboardExtensionSizeManager.setKeyboardExtensionHeight(calculateAccessoryBarHeight());
-        mKeyboardAccessory.closeActiveTab();
+        if (mAccessorySheet.isShown()) mKeyboardAccessory.closeActiveTab();
         mKeyboardAccessory.setBottomOffset(0);
         mAccessorySheet.hide();
     }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ClusterList.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ClusterList.java
index aed226ee..4638ee48 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ClusterList.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ClusterList.java
@@ -4,6 +4,7 @@
 
 package org.chromium.chrome.browser.contextual_suggestions;
 
+import org.chromium.base.VisibleForTesting;
 import org.chromium.chrome.browser.modelutil.RecyclerViewAdapter;
 import org.chromium.chrome.browser.ntp.cards.InnerNode;
 import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder;
@@ -41,4 +42,9 @@
             ((ContextualSuggestionsCluster) c).destroy();
         }
     }
+
+    @VisibleForTesting
+    public ContextualSuggestionsCluster getClusterForTesting(int index) {
+        return (ContextualSuggestionsCluster) getChildren().get(index);
+    }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsCluster.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsCluster.java
index c7da280..0b0e860 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsCluster.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsCluster.java
@@ -59,15 +59,18 @@
     /**
      * Called to build the tree node's children. Should be called after all suggestions have been
      * added.
+     *
+     * @param globalIndexOffset The index offset for setting global suggestion rank. This should be
+     *                          the total number of suggestions displayed before this cluster.
      */
-    void buildChildren() {
+    void buildChildren(int globalIndexOffset) {
         if (mShouldShowTitle) {
             mHeader = new SectionHeader(mTitle);
             addChildren(mHeader);
         }
 
         mSuggestionsList = new SuggestionsList();
-        mSuggestionsList.addAll(mSuggestions);
+        mSuggestionsList.addAll(mSuggestions, globalIndexOffset);
         addChildren(mSuggestionsList);
 
         // Only add observer after suggestions have been added to the cluster node to avoid
@@ -120,10 +123,13 @@
             return mSuggestions.get(position);
         }
 
-        public void addAll(List<SnippetArticle> suggestions) {
+        public void addAll(List<SnippetArticle> suggestions, int globalIndexOffset) {
             if (suggestions.isEmpty()) return;
 
             int insertionPointIndex = mSuggestions.size();
+            for (int i = 0; i < suggestions.size(); i++) {
+                suggestions.get(i).setRank(i, i + globalIndexOffset);
+            }
             mSuggestions.addAll(suggestions);
             notifyItemRangeInserted(insertionPointIndex, suggestions.size());
         }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsEventReporter.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsEventReporter.java
index 1516bc5..019dc90 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsEventReporter.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsEventReporter.java
@@ -4,6 +4,7 @@
 
 package org.chromium.chrome.browser.contextual_suggestions;
 
+import org.chromium.base.metrics.RecordHistogram;
 import org.chromium.chrome.browser.ntp.cards.ActionItem;
 import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
 import org.chromium.chrome.browser.suggestions.SuggestionsEventReporter;
@@ -45,6 +46,12 @@
                 ? ContextualSuggestionsEvent.SUGGESTION_DOWNLOADED
                 : ContextualSuggestionsEvent.SUGGESTION_CLICKED;
         mSuggestionSource.reportEvent(mTabModelSelector.getCurrentTab().getWebContents(), eventId);
+
+        RecordHistogram.recordSparseSlowlyHistogram(
+                "ContextualSuggestions.SuggestionClickPosition.Global", suggestion.getGlobalRank());
+        RecordHistogram.recordSparseSlowlyHistogram(
+                "ContextualSuggestions.SuggestionClickPosition.Cluster",
+                suggestion.getPerSectionRank());
     }
 
     @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java
index 44ac8f1..29efe635 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsMediator.java
@@ -273,8 +273,10 @@
 
             if (clusters.isEmpty() || clusters.get(0).getSuggestions().isEmpty()) return;
 
+            int globalSuggestionsCount = 0;
             for (ContextualSuggestionsCluster cluster : clusters) {
-                cluster.buildChildren();
+                cluster.buildChildren(globalSuggestionsCount);
+                globalSuggestionsCount += cluster.getSuggestions().size();
             }
 
             prepareModel(clusters, suggestionsResult.getPeekText());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/NotificationsPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/NotificationsPreferences.java
index 7a42cb1..10c03cd0 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/NotificationsPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/NotificationsPreferences.java
@@ -10,6 +10,7 @@
 import android.preference.PreferenceFragment;
 
 import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeFeatureList;
 import org.chromium.chrome.browser.ContentSettingsType;
 import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
 import org.chromium.chrome.browser.preferences.website.ContentSettingsResources;
@@ -27,9 +28,12 @@
     static final String PREF_FROM_WEBSITES = "from_websites";
     static final String PREF_SUGGESTIONS = "content_suggestions";
 
-    private ChromeSwitchPreference mSuggestionsPref;
     private Preference mFromWebsitesPref;
-    private SnippetsBridge mSnippetsBridge;
+
+    // The following fields are only set if Feed is disabled, and should be null checked before
+    // being used.
+    private ChromeSwitchPreference mSuggestionsPref;
+    private SnippetsBridge mSnippetsBridge = null;
 
     @Override
     public void onCreate(Bundle savedInstanceState) {
@@ -37,20 +41,22 @@
             : "NotificationsPreferences should only be used pre-O.";
 
         super.onCreate(savedInstanceState);
-
-        mSnippetsBridge = new SnippetsBridge(Profile.getLastUsedProfile());
-
         PreferenceUtils.addPreferencesFromResource(this, R.xml.notifications_preferences);
         getActivity().setTitle(R.string.prefs_notifications);
 
-        mSuggestionsPref = (ChromeSwitchPreference) findPreference(PREF_SUGGESTIONS);
-        mSuggestionsPref.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {
-            @Override
-            public boolean onPreferenceChange(Preference preference, Object newValue) {
+        if (!ChromeFeatureList.isEnabled(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)) {
+            mSnippetsBridge = new SnippetsBridge(Profile.getLastUsedProfile());
+
+            mSuggestionsPref = (ChromeSwitchPreference) findPreference(PREF_SUGGESTIONS);
+            mSuggestionsPref.setOnPreferenceChangeListener((Preference preference,
+                                                                   Object newValue) -> {
                 SnippetsBridge.setContentSuggestionsNotificationsEnabled((boolean) newValue);
                 return true;
-            }
-        });
+            });
+        } else {
+            // This preference is not applicable, does not currently affect Feed.
+            getPreferenceScreen().removePreference(findPreference(PREF_SUGGESTIONS));
+        }
 
         mFromWebsitesPref = findPreference(PREF_FROM_WEBSITES);
         mFromWebsitesPref.getExtras().putString(SingleCategoryPreferences.EXTRA_CATEGORY,
@@ -66,20 +72,26 @@
     @Override
     public void onDestroy() {
         super.onDestroy();
-        mSnippetsBridge.destroy();
+        if (mSnippetsBridge != null) {
+            mSnippetsBridge.destroy();
+        }
     }
 
     /**
      * Updates the state of displayed preferences.
      */
     private void update() {
-        boolean suggestionsEnabled = mSnippetsBridge.areRemoteSuggestionsEnabled();
-        mSuggestionsPref.setChecked(
-                suggestionsEnabled && SnippetsBridge.areContentSuggestionsNotificationsEnabled());
-        mSuggestionsPref.setEnabled(suggestionsEnabled);
-        mSuggestionsPref.setSummary(suggestionsEnabled
-                        ? R.string.notifications_content_suggestions_summary
-                        : R.string.notifications_content_suggestions_summary_disabled);
+        if (mSuggestionsPref != null) {
+            mSuggestionsPref.setShouldDisableView(mSnippetsBridge == null);
+            boolean suggestionsEnabled =
+                    mSnippetsBridge != null && mSnippetsBridge.areRemoteSuggestionsEnabled();
+            mSuggestionsPref.setChecked(suggestionsEnabled
+                    && SnippetsBridge.areContentSuggestionsNotificationsEnabled());
+            mSuggestionsPref.setEnabled(suggestionsEnabled);
+            mSuggestionsPref.setSummary(suggestionsEnabled
+                            ? R.string.notifications_content_suggestions_summary
+                            : R.string.notifications_content_suggestions_summary_disabled);
+        }
 
         mFromWebsitesPref.setSummary(ContentSettingsResources.getCategorySummary(
                 ContentSettingsType.CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr/SilenceLintErrors.java b/chrome/android/java/src/org/chromium/chrome/browser/vr/SilenceLintErrors.java
index 4ee896eb..4f48faf 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr/SilenceLintErrors.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr/SilenceLintErrors.java
@@ -16,8 +16,7 @@
             R.string.vr_services_check_infobar_update_text,
             R.string.vr_services_check_infobar_install_button,
             R.string.vr_services_check_infobar_update_button, R.anim.stay_hidden,
-            R.drawable.vr_services, R.string.vr_module_title, R.string.vr_module_install_start_text,
-            R.string.vr_module_install_success_text, R.string.vr_module_install_failure_text,
+            R.drawable.vr_services, R.string.vr_module_title,
     };
 
     private SilenceLintErrors() {}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrBuildConfig.template b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrBuildConfig.template
new file mode 100644
index 0000000..cf88b81
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrBuildConfig.template
@@ -0,0 +1,16 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.vr;
+
+/** Build config for VR */
+public class VrBuildConfig {
+
+#if defined(ENABLE_VR)
+    public static final boolean IS_VR_ENABLED = true;
+#else
+    public static final boolean IS_VR_ENABLED = false;
+#endif
+
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrModuleProvider.java b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrModuleProvider.java
index 6ba6418..9bccc06 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/vr/VrModuleProvider.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/vr/VrModuleProvider.java
@@ -4,7 +4,12 @@
 
 package org.chromium.chrome.browser.vr;
 
+import org.chromium.base.ContextUtils;
+import org.chromium.base.annotations.CalledByNative;
 import org.chromium.base.annotations.JNINamespace;
+import org.chromium.chrome.R;
+import org.chromium.components.module_installer.ModuleInstaller;
+import org.chromium.ui.widget.Toast;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -18,6 +23,18 @@
     private static VrDelegateProvider sDelegateProvider;
     private static final List<VrModeObserver> sVrModeObservers = new ArrayList<>();
 
+    private long mNativeVrModuleProvider;
+
+    /**
+     * Need to be called after native libraries are available. Has no effect if VR is not compiled
+     * into Chrome.
+     **/
+    public static void maybeInit() {
+        if (VrBuildConfig.IS_VR_ENABLED) {
+            nativeInit();
+        }
+    }
+
     public static VrDelegate getDelegate() {
         return getDelegateProvider().getDelegate();
     }
@@ -60,6 +77,8 @@
 
     private static VrDelegateProvider getDelegateProvider() {
         if (sDelegateProvider == null) {
+            // Need to be called before trying to access the VR module.
+            ModuleInstaller.init();
             try {
                 sDelegateProvider =
                         (VrDelegateProvider) Class
@@ -73,7 +92,54 @@
         return sDelegateProvider;
     }
 
-    private VrModuleProvider() {}
+    @CalledByNative
+    private static VrModuleProvider create(long nativeVrModuleProvider) {
+        return new VrModuleProvider(nativeVrModuleProvider);
+    }
 
+    @CalledByNative
+    private static boolean isModuleInstalled() {
+        return !(getDelegateProvider() instanceof VrDelegateProviderFallback);
+    }
+
+    private VrModuleProvider(long nativeVrModuleProvider) {
+        mNativeVrModuleProvider = nativeVrModuleProvider;
+    }
+
+    @CalledByNative
+    private void onNativeDestroy() {
+        mNativeVrModuleProvider = 0;
+    }
+
+    @CalledByNative
+    private void installModule() {
+        assert !isModuleInstalled();
+
+        // TODO(crbug.com/863064): This is a placeholder UI. Replace once proper UI is spec'd.
+        Toast.makeText(ContextUtils.getApplicationContext(), R.string.vr_module_install_start_text,
+                     Toast.LENGTH_SHORT)
+                .show();
+
+        ModuleInstaller.install("vr", (success) -> {
+            if (success) {
+                // Re-create delegate provider.
+                sDelegateProvider = null;
+                VrDelegate delegate = getDelegate();
+                assert !(delegate instanceof VrDelegateFallback);
+                delegate.onNativeLibraryAvailable();
+            }
+            // TODO(crbug.com/863064): This is a placeholder UI. Replace once proper UI is spec'd.
+            int mToastTextRes = success ? R.string.vr_module_install_success_text
+                                        : R.string.vr_module_install_failure_text;
+            Toast.makeText(ContextUtils.getApplicationContext(), mToastTextRes, Toast.LENGTH_SHORT)
+                    .show();
+            if (mNativeVrModuleProvider != 0) {
+                nativeOnInstalledModule(mNativeVrModuleProvider, success);
+            }
+        });
+    }
+
+    private static native void nativeInit();
     private static native void nativeRegisterJni();
+    private native void nativeOnInstalledModule(long nativeVrModuleProvider, boolean success);
 }
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
index 2d5844d..4e6db8e6 100644
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -3719,17 +3719,19 @@
         <message name="IDS_VR_MODULE_TITLE" desc="Title of the Virtual Reality (VR) dynamic feature module. Used, for instance, in the text of dialogs confirming to download the module.">
           VR
         </message>
-        <message name="IDS_VR_MODULE_INSTALL_START_TEXT" desc="Text shown on a toast when Chrome starts to download the VR dynamic feature module.">
-          Installing VR module...
-        </message>
-        <message name="IDS_VR_MODULE_INSTALL_SUCCESS_TEXT" desc="Text shown on a toast when Chrome successfully installed the VR dynamic feature module.">
-          Installed VR module
-        </message>
-        <message name="IDS_VR_MODULE_INSTALL_FAILURE_TEXT" desc="Text shown on a toast when Chrome failed to install the VR dynamic feature module.">
-          Failed to install VR module
-        </message>
       </if>
 
+      <!-- VR module -->
+      <message name="IDS_VR_MODULE_INSTALL_START_TEXT" desc="Text shown on a toast when Chrome starts to download the VR dynamic feature module.">
+        Installing VR module...
+      </message>
+      <message name="IDS_VR_MODULE_INSTALL_SUCCESS_TEXT" desc="Text shown on a toast when Chrome successfully installed the VR dynamic feature module.">
+        Installed VR module
+      </message>
+      <message name="IDS_VR_MODULE_INSTALL_FAILURE_TEXT" desc="Text shown on a toast when Chrome failed to install the VR dynamic feature module.">
+        Failed to install VR module
+      </message>
+
       <if expr="enable_arcore">
         <!-- ARCore check infobar -->
         <message name="IDS_AR_CORE_CHECK_INFOBAR_INSTALL_TEXT" desc="Text to be displayed in the ARCore check infobar. When a WebXR page is loaded, if ARCore is needed to display AR content and it is not installed, an infobar will be shown to the user prompting them to install ARCore.">
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsTest.java
index bdb8e791..0c0b44d0 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextual_suggestions/ContextualSuggestionsTest.java
@@ -46,6 +46,7 @@
 import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
 import org.chromium.chrome.browser.native_page.ContextMenuManager;
 import org.chromium.chrome.browser.ntp.cards.NewTabPageViewHolder.PartialBindCallback;
+import org.chromium.chrome.browser.ntp.snippets.SnippetArticle;
 import org.chromium.chrome.browser.ntp.snippets.SnippetArticleViewHolder;
 import org.chromium.chrome.browser.profiles.Profile;
 import org.chromium.chrome.browser.tabmodel.TabModel;
@@ -561,6 +562,31 @@
                 "Toolbar button should be visible", View.VISIBLE, toolbarButton.getVisibility());
     }
 
+    @Test
+    @MediumTest
+    @Feature({"ContextualSuggestions"})
+    public void testSuggestionRanking() throws Exception {
+        ClusterList clusters = mModel.getClusterList();
+
+        ContextualSuggestionsCluster cluster1 = clusters.getClusterForTesting(0);
+        for (int i = 0; i < cluster1.getSuggestions().size(); i++) {
+            SnippetArticle article = cluster1.getSuggestions().get(i);
+            assertEquals("Cluster rank incorrect for item " + i + " in cluster1", i,
+                    article.getPerSectionRank());
+            assertEquals("Global rank incorrect for item " + i + " in cluster1", i,
+                    article.getGlobalRank());
+        }
+
+        ContextualSuggestionsCluster cluster2 = clusters.getClusterForTesting(1);
+        for (int i = 0; i < cluster2.getSuggestions().size(); i++) {
+            SnippetArticle article = cluster2.getSuggestions().get(i);
+            assertEquals("Cluster rank incorrect for item " + i + " in cluster2", i,
+                    article.getPerSectionRank());
+            assertEquals("Global rank incorrect for item " + i + " in cluster2",
+                    i + cluster1.getSuggestions().size(), article.getGlobalRank());
+        }
+    }
+
     private void simulateClickOnCloseButton() {
         ThreadUtils.runOnUiThreadBlocking(() -> {
             mBottomSheet.getCurrentSheetContent()
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
index ace862b7..a5d55a37 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageTest.java
@@ -139,7 +139,8 @@
     private static final String TEST_FEED =
             UrlUtils.getIsolatedTestFilePath("/chrome/test/data/android/feed/hello_world.gcl.bin");
 
-    private boolean mInterestFeedEnabled;
+    // Anything not parameterized runs with Feed disabled.
+    private boolean mInterestFeedEnabled = false;
     private Tab mTab;
     private NewTabPage mNtp;
     private View mFakebox;
@@ -151,19 +152,17 @@
     @ParameterAnnotations.UseMethodParameterBefore(InterestFeedParams.class)
     public void setupInterestFeed(boolean interestFeedEnabled) {
         mInterestFeedEnabled = interestFeedEnabled;
-        if (mInterestFeedEnabled) {
-            Features.getInstance().enable(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS);
-        } else {
-            Features.getInstance().disable(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS);
-        }
     }
 
     @Before
     public void setUp() throws Exception {
         if (mInterestFeedEnabled) {
+            Features.getInstance().enable(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS);
             TestNetworkClient client = new TestNetworkClient();
             client.setNetworkResponseFile(TEST_FEED);
             FeedProcessScopeFactory.setTestNetworkClient(client);
+        } else {
+            Features.getInstance().disable(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS);
         }
         mActivityTestRule.startMainActivityWithURL("about:blank");
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageUiCaptureTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageUiCaptureTest.java
index 43399cf4..9c7bc837 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageUiCaptureTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/NewTabPageUiCaptureTest.java
@@ -18,6 +18,7 @@
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Feature;
+import org.chromium.chrome.browser.ChromeFeatureList;
 import org.chromium.chrome.browser.ChromeSwitches;
 import org.chromium.chrome.browser.UrlConstants;
 import org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView;
@@ -26,6 +27,7 @@
 import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.chrome.test.util.NewTabPageTestUtils;
+import org.chromium.chrome.test.util.browser.Features;
 import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
 import org.chromium.chrome.test.util.browser.compositor.layouts.DisableChromeAnimations;
 import org.chromium.chrome.test.util.browser.suggestions.SuggestionsDependenciesRule;
@@ -33,11 +35,14 @@
 /**
  * Capture the New Tab Page UI for UX review.
  */
+// TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+// clang-format off
 @RunWith(ChromeJUnit4ClassRunner.class)
-@CommandLineFlags.Add({
-        ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE,
-})
+@CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
+@Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
 public class NewTabPageUiCaptureTest {
+    // clang-format on
+
     @Rule
     public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
     @Rule
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java
index 613c655..3663fda 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/NewTabPageRecyclerViewTest.java
@@ -27,6 +27,7 @@
 import org.chromium.base.test.util.Restriction;
 import org.chromium.base.test.util.RetryOnFailure;
 import org.chromium.chrome.R;
+import org.chromium.chrome.browser.ChromeFeatureList;
 import org.chromium.chrome.browser.ChromeSwitches;
 import org.chromium.chrome.browser.UrlConstants;
 import org.chromium.chrome.browser.native_page.ContextMenuManager;
@@ -43,6 +44,7 @@
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.chrome.test.util.ChromeTabUtils;
 import org.chromium.chrome.test.util.NewTabPageTestUtils;
+import org.chromium.chrome.test.util.browser.Features;
 import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
 import org.chromium.chrome.test.util.browser.suggestions.FakeMostVisitedSites;
 import org.chromium.chrome.test.util.browser.suggestions.FakeSuggestionsSource;
@@ -61,10 +63,15 @@
 /**
  * Instrumentation tests for {@link NewTabPageRecyclerView}.
  */
+// TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+// clang-format off
 @RunWith(ChromeJUnit4ClassRunner.class)
 @CommandLineFlags.Add(ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE)
+@Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
 @RetryOnFailure
 public class NewTabPageRecyclerViewTest {
+    // clang-format on
+
     @Rule
     public ChromeTabbedActivityTestRule mActivityTestRule = new ChromeTabbedActivityTestRule();
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/NotificationsPreferencesTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/NotificationsPreferencesTest.java
index 798bdf3..4bfaa4ef 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/NotificationsPreferencesTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/NotificationsPreferencesTest.java
@@ -22,6 +22,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.Feature;
+import org.chromium.chrome.browser.ChromeFeatureList;
 import org.chromium.chrome.browser.ContentSettingsType;
 import org.chromium.chrome.browser.ntp.snippets.SnippetsBridge;
 import org.chromium.chrome.browser.preferences.website.ContentSettingsResources;
@@ -30,6 +31,7 @@
 import org.chromium.chrome.browser.test.ChromeBrowserTestRule;
 import org.chromium.chrome.browser.test.ScreenShooter;
 import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
+import org.chromium.chrome.test.util.browser.Features;
 import org.chromium.content_public.browser.test.util.Criteria;
 import org.chromium.content_public.browser.test.util.CriteriaHelper;
 
@@ -51,12 +53,17 @@
                 NotificationsPreferences.class.getName());
     }
 
+    // TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+    // clang-format off
     @Test
     @SmallTest
     @Feature({"Preferences", "UiCatalogue"})
-    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N)
+    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N_MR1)
     @CommandLineFlags.Add("enable-features=ContentSuggestionsNotifications")
+    @Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
     public void testContentSuggestionsToggle() {
+        // clang-format on
+
         final PreferenceFragment fragment = (PreferenceFragment) mActivity.getFragmentForTest();
         final ChromeSwitchPreference toggle = (ChromeSwitchPreference) fragment.findPreference(
                 NotificationsPreferences.PREF_SUGGESTIONS);
@@ -89,12 +96,17 @@
         mScreenShooter.shoot("ContentSuggestionsToggle");
     }
 
+    // TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+    // clang-format off
     @Test
     @SmallTest
     @Feature({"Preferences", "UiCatalogue"})
-    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N)
+    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N_MR1)
     @CommandLineFlags.Add("disable-features=NTPArticleSuggestions")
+    @Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
     public void testToggleDisabledWhenSuggestionsDisabled() {
+        // clang-format on
+
         PreferenceFragment fragment = (PreferenceFragment) mActivity.getFragmentForTest();
         ChromeSwitchPreference toggle = (ChromeSwitchPreference) fragment.findPreference(
                 NotificationsPreferences.PREF_SUGGESTIONS);
@@ -105,12 +117,16 @@
         mScreenShooter.shoot("ToggleDisabledWhenSuggestionsDisabled");
     }
 
-
+    // TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+    // clang-format off
     @Test
     @SmallTest
     @Feature({"Preferences", "UiCatalogue"})
-    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N)
+    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N_MR1)
+    @Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
     public void testLinkToWebsiteNotifications() {
+        // clang-format on
+
         ThreadUtils.runOnUiThreadBlocking(new Runnable() {
             @Override
             public void run() {
@@ -142,11 +158,16 @@
         return preferences.getFragmentForTest();
     }
 
+    // TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+    // clang-format off
     @Test
     @SmallTest
     @Feature({"Preferences"})
-    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N)
+    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N_MR1)
+    @Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
     public void testWebsiteNotificationsSummary() {
+        // clang-format on
+
         final PreferenceFragment fragment = (PreferenceFragment) mActivity.getFragmentForTest();
         final Preference fromWebsites =
                 fragment.findPreference(NotificationsPreferences.PREF_FROM_WEBSITES);
@@ -167,6 +188,20 @@
         });
     }
 
+    // TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+    // clang-format off
+    @Test
+    @SmallTest
+    @Feature({"Preferences"})
+    @DisableIf.Build(sdk_is_greater_than = Build.VERSION_CODES.N_MR1)
+    @Features.EnableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
+    public void prefHiddenWhenOnFeed() {
+        // clang-format on
+
+        final PreferenceFragment fragment = (PreferenceFragment) mActivity.getFragmentForTest();
+        Assert.assertNull(fragment.findPreference(NotificationsPreferences.PREF_SUGGESTIONS));
+    }
+
     /** Gets the summary text that should be used for site specific notifications. */
     private String getNotificationsSummary(boolean enabled) {
         return mActivity.getResources().getString(ContentSettingsResources.getCategorySummary(
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsTest.java
index b5ba65d..7c90c25 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/ContentSuggestionsTest.java
@@ -16,6 +16,7 @@
 import org.chromium.base.test.util.CommandLineFlags;
 import org.chromium.base.test.util.Feature;
 import org.chromium.chrome.browser.ChromeActivity;
+import org.chromium.chrome.browser.ChromeFeatureList;
 import org.chromium.chrome.browser.ChromeSwitches;
 import org.chromium.chrome.browser.UrlConstants;
 import org.chromium.chrome.browser.ntp.NewTabPage;
@@ -28,13 +29,19 @@
 import org.chromium.chrome.test.ChromeActivityTestRule;
 import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
 import org.chromium.chrome.test.util.NewTabPageTestUtils;
+import org.chromium.chrome.test.util.browser.Features;
 
 /**
  * Misc. Content Suggestions instrumentation tests.
  */
+// TODO(https://crbug.com/894334): Remove format suppression once formatting bug is fixed.
+// clang-format off
 @RunWith(ChromeJUnit4ClassRunner.class)
 @CommandLineFlags.Add({ChromeSwitches.DISABLE_FIRST_RUN_EXPERIENCE})
+@Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_CONTENT_SUGGESTIONS)
 public class ContentSuggestionsTest {
+    // clang-format on
+
     @Rule
     public ChromeActivityTestRule<ChromeActivity> mActivityTestRule =
             new ChromeActivityTestRule<>(ChromeActivity.class);
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java
index 28ee9dd7..40f2292 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGridLayoutTest.java
@@ -17,6 +17,7 @@
 import android.content.pm.ActivityInfo;
 import android.content.res.Configuration;
 import android.support.annotation.Nullable;
+import android.support.test.espresso.matcher.ViewMatchers;
 import android.support.test.filters.MediumTest;
 import android.view.View;
 import android.view.ViewGroup;
@@ -48,7 +49,6 @@
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.chrome.test.util.NewTabPageTestUtils;
 import org.chromium.chrome.test.util.RenderTestRule;
-import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
 import org.chromium.chrome.test.util.browser.offlinepages.FakeOfflinePageBridge;
 import org.chromium.chrome.test.util.browser.suggestions.FakeMostVisitedSites;
 import org.chromium.chrome.test.util.browser.suggestions.FakeSuggestionsSource;
@@ -188,7 +188,9 @@
         assertTrue(mTab.getNativePage() instanceof NewTabPage);
         NewTabPage ntp = (NewTabPage) mTab.getNativePage();
 
-        RecyclerViewTestUtils.waitForStableRecyclerView(ntp.getNewTabPageView().getRecyclerView());
+        org.chromium.chrome.test.util.ViewUtils.waitForView(
+                (ViewGroup) ntp.getView(), ViewMatchers.withId(R.id.tile_grid_layout));
+
         return ntp;
     }
 
@@ -229,7 +231,7 @@
     }
 
     private TileGridLayout getTileGridLayout(NewTabPage ntp) {
-        TileGridLayout tileGridLayout = ntp.getNewTabPageView().findViewById(R.id.tile_grid_layout);
+        TileGridLayout tileGridLayout = ntp.getView().findViewById(R.id.tile_grid_layout);
         assertNotNull("Unable to retrieve the TileGridLayout.", tileGridLayout);
         return tileGridLayout;
     }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
index c539e42..2b5764f 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/suggestions/TileGroupTest.java
@@ -5,6 +5,7 @@
 package org.chromium.chrome.browser.suggestions;
 
 import android.support.test.InstrumentationRegistry;
+import android.support.test.espresso.matcher.ViewMatchers;
 import android.support.test.filters.MediumTest;
 import android.view.View;
 import android.view.ViewGroup;
@@ -34,7 +35,7 @@
 import org.chromium.chrome.test.ChromeJUnit4ClassRunner;
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.chrome.test.util.NewTabPageTestUtils;
-import org.chromium.chrome.test.util.browser.RecyclerViewTestUtils;
+import org.chromium.chrome.test.util.ViewUtils;
 import org.chromium.chrome.test.util.browser.suggestions.FakeMostVisitedSites;
 import org.chromium.chrome.test.util.browser.suggestions.FakeSuggestionsSource;
 import org.chromium.chrome.test.util.browser.suggestions.SuggestionsDependenciesRule;
@@ -88,7 +89,8 @@
         Assert.assertTrue(mTab.getNativePage() instanceof NewTabPage);
         mNtp = (NewTabPage) mTab.getNativePage();
 
-        RecyclerViewTestUtils.waitForStableRecyclerView(getRecyclerView());
+        ViewUtils.waitForView(
+                (ViewGroup) mNtp.getView(), ViewMatchers.withId(R.id.tile_grid_layout));
     }
 
     @After
diff --git a/chrome/android/modules/vr/AndroidManifest.xml b/chrome/android/modules/vr/AndroidManifest.xml
index 4be5316..02e07a6 100644
--- a/chrome/android/modules/vr/AndroidManifest.xml
+++ b/chrome/android/modules/vr/AndroidManifest.xml
@@ -7,15 +7,13 @@
     xmlns:dist="http://schemas.android.com/apk/distribution"
     package="{{manifest_package}}">
 
-    <!-- Chrome VR is only supported on Android L+. -->
+    <!-- The VR module is only supported on Android L+. -->
     <uses-sdk
         android:minSdkVersion="21"
         android:targetSdkVersion="{{target_sdk_version}}" />
 
-    <!-- TODO(crbug.com/862689): Set dist:onDemand="true" once we can on-demand
-         install modules. -->
     <dist:module
-        dist:onDemand="false"
+        dist:onDemand="true"
         dist:title="@string/vr_module_title">
         <dist:fusing dist:include="false" />
     </dist:module>
diff --git a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java
index 3d82320..8dc9042 100644
--- a/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java
+++ b/chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/SyncCustomizationFragmentTest.java
@@ -7,6 +7,7 @@
 import android.annotation.SuppressLint;
 import android.app.Dialog;
 import android.app.FragmentTransaction;
+import android.os.Build;
 import android.preference.CheckBoxPreference;
 import android.preference.Preference;
 import android.preference.SwitchPreference;
@@ -27,6 +28,7 @@
 
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisableIf;
 import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.chrome.R;
@@ -340,6 +342,7 @@
     @Test
     @SmallTest
     @Feature({"Sync"})
+    @DisableIf.Build(message = "crbug.com/899989 ", sdk_is_less_than = Build.VERSION_CODES.M)
     public void testPaymentsIntegrationCheckboxEnablesPaymentsIntegration() {
         mSyncTestRule.setUpTestAccountAndSignIn();
 
@@ -581,6 +584,7 @@
     @Test
     @SmallTest
     @Feature({"Sync"})
+    @DisableIf.Build(message = "crbug.com/899989 ", sdk_is_less_than = Build.VERSION_CODES.M)
     public void testPassphraseCreation() {
         mSyncTestRule.setUpTestAccountAndSignIn();
         SyncTestUtil.waitForSyncActive();
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 7fb5ff7..9c36d57 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -4448,6 +4448,13 @@
      FEATURE_VALUE_TYPE(ash::features::kNotificationExpansionAnimation)},
 
 #endif  // defined(OS_CHROMEOS)
+
+    {"enable-data-reduction-proxy-with-network-service",
+     flag_descriptions::kEnableDataReductionProxyNetworkServiceName,
+     flag_descriptions::kEnableDataReductionProxyNetworkServiceDescription,
+     kOsAll,
+     FEATURE_VALUE_TYPE(data_reduction_proxy::features::
+                            kDataReductionProxyEnabledWithNetworkService)},
 };
 
 class FlagsStateSingleton {
diff --git a/chrome/browser/accessibility/accessibility_extension_api.cc b/chrome/browser/accessibility/accessibility_extension_api.cc
index ca6f52a..4ae3575 100644
--- a/chrome/browser/accessibility/accessibility_extension_api.cc
+++ b/chrome/browser/accessibility/accessibility_extension_api.cc
@@ -278,7 +278,7 @@
       content::ServiceManagerConnection::GetForProcess();
   connection->GetConnector()->BindInterface(ws::mojom::kServiceName,
                                             &event_injector_ptr);
-  event_injector_ptr->InjectEventNoAck(
+  event_injector_ptr->InjectEventNoAckNoRewriters(
       display::Screen::GetScreen()->GetPrimaryDisplay().id(),
       std::move(synthetic_key_event));
 
@@ -287,7 +287,6 @@
 
 ExtensionFunction::ResponseAction
 AccessibilityPrivateEnableChromeVoxMouseEventsFunction::Run() {
-#if defined(OS_CHROMEOS)
   bool enabled = false;
   EXTENSION_FUNCTION_VALIDATE(args_->GetBoolean(0, &enabled));
   ash::mojom::EventRewriterControllerPtr event_rewriter_controller_ptr;
@@ -297,9 +296,6 @@
                                             &event_rewriter_controller_ptr);
   event_rewriter_controller_ptr->SetSendMouseEventsToDelegate(enabled);
   return RespondNow(NoArguments());
-#else
-  return RespondNow(Error(kErrorNotSupported));
-#endif
 }
 
 ExtensionFunction::ResponseAction
@@ -352,8 +348,8 @@
       content::ServiceManagerConnection::GetForProcess();
   connection->GetConnector()->BindInterface(ws::mojom::kServiceName,
                                             &event_injector_ptr);
-  event_injector_ptr->InjectEventNoAck(display.id(),
-                                       std::move(synthetic_mouse_event));
+  event_injector_ptr->InjectEventNoAckNoRewriters(
+      display.id(), std::move(synthetic_mouse_event));
 
   return RespondNow(NoArguments());
 }
diff --git a/chrome/browser/android/vr/BUILD.gn b/chrome/browser/android/vr/BUILD.gn
index 127c2ae..4a563ae6 100644
--- a/chrome/browser/android/vr/BUILD.gn
+++ b/chrome/browser/android/vr/BUILD.gn
@@ -51,6 +51,7 @@
     "vr_input_connection.cc",
     "vr_input_connection.h",
     "vr_module_provider.cc",
+    "vr_module_provider.h",
     "vr_shell.cc",
     "vr_shell.h",
     "vr_shell_delegate.cc",
diff --git a/chrome/browser/android/vr/vr_module_provider.cc b/chrome/browser/android/vr/vr_module_provider.cc
index 15e49ba..738d156 100644
--- a/chrome/browser/android/vr/vr_module_provider.cc
+++ b/chrome/browser/android/vr/vr_module_provider.cc
@@ -2,11 +2,64 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "chrome/browser/android/vr/vr_module_provider.h"
+
 #include "chrome/browser/android/vr/register_jni.h"
+#include "chrome/browser/android/vr/vr_module_provider.h"
+#include "device/vr/android/gvr/vr_module_delegate.h"
 #include "jni/VrModuleProvider_jni.h"
 
 namespace vr {
 
+VrModuleProvider::VrModuleProvider() = default;
+
+VrModuleProvider::~VrModuleProvider() {
+  if (!j_vr_module_provider_.obj()) {
+    return;
+  }
+  Java_VrModuleProvider_onNativeDestroy(base::android::AttachCurrentThread(),
+                                        j_vr_module_provider_);
+}
+
+bool VrModuleProvider::ModuleInstalled() {
+  return Java_VrModuleProvider_isModuleInstalled(
+      base::android::AttachCurrentThread());
+}
+
+void VrModuleProvider::InstallModule(
+    base::OnceCallback<void(bool)> on_finished) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  on_finished_callbacks_.push(std::move(on_finished));
+  // Don't request VR module multiple times in parallel.
+  if (on_finished_callbacks_.size() > 1) {
+    return;
+  }
+  DCHECK(!j_vr_module_provider_.obj());
+  j_vr_module_provider_.Reset(Java_VrModuleProvider_create(
+      base::android::AttachCurrentThread(), (jlong) this));
+  Java_VrModuleProvider_installModule(base::android::AttachCurrentThread(),
+                                      j_vr_module_provider_);
+}
+
+void VrModuleProvider::OnInstalledModule(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jobject>& obj,
+    bool success) {
+  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+  DCHECK(on_finished_callbacks_.size() > 0);
+  while (!on_finished_callbacks_.empty()) {
+    std::move(on_finished_callbacks_.front()).Run(success);
+    on_finished_callbacks_.pop();
+  }
+  j_vr_module_provider_ = nullptr;
+}
+
+static void JNI_VrModuleProvider_Init(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& clazz) {
+  device::VrModuleDelegate::Set(std::make_unique<VrModuleProvider>());
+}
+
 static void JNI_VrModuleProvider_RegisterJni(
     JNIEnv* env,
     const base::android::JavaParamRef<jclass>& clazz) {
diff --git a/chrome/browser/android/vr/vr_module_provider.h b/chrome/browser/android/vr/vr_module_provider.h
new file mode 100644
index 0000000..f70c42f
--- /dev/null
+++ b/chrome/browser/android/vr/vr_module_provider.h
@@ -0,0 +1,37 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_VR_VR_MODULE_PROVIDER_H_
+#define CHROME_BROWSER_ANDROID_VR_VR_MODULE_PROVIDER_H_
+
+#include <jni.h>
+#include <queue>
+
+#include "base/android/jni_android.h"
+#include "device/vr/android/gvr/vr_module_delegate.h"
+
+namespace vr {
+
+// Installs the VR module.
+class VrModuleProvider : public device::VrModuleDelegate {
+ public:
+  VrModuleProvider();
+  ~VrModuleProvider() override;
+  bool ModuleInstalled() override;
+  void InstallModule(base::OnceCallback<void(bool)> on_finished) override;
+
+  // Called by Java.
+  void OnInstalledModule(JNIEnv* env,
+                         const base::android::JavaParamRef<jobject>& obj,
+                         bool success);
+
+ private:
+  std::queue<base::OnceCallback<void(bool)>> on_finished_callbacks_;
+  base::android::ScopedJavaGlobalRef<jobject> j_vr_module_provider_;
+  SEQUENCE_CHECKER(sequence_checker_);
+};
+
+}  // namespace vr
+
+#endif  // CHROME_BROWSER_ANDROID_VR_VR_MODULE_PROVIDER_H_
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc
index a83945a..e2e2429 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service.cc
+++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
@@ -758,6 +758,8 @@
   } else {
     RemoveDriveMountPoint();
     enabled_ = false;
+    drivefs_total_failures_count_ = 0;
+    drivefs_consecutive_failures_count_ = 0;
   }
 }
 
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.cc b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.cc
index ed82241..011e411 100644
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.cc
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.cc
@@ -381,25 +381,6 @@
       base::ThreadTaskRunnerHandle::Get().get()));
 }
 
-void EasyUnlockServiceRegular::OpenSetupAppAfterReauth(
-    const UserContext& user_context) {
-  DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
-  HandleUserReauth(user_context);
-
-  // Use this opportunity to clear the crytohome keys if it was not already
-  // cleared earlier.
-  const base::ListValue* devices = GetRemoteDevices();
-  if (!devices || devices->empty()) {
-    EasyUnlockKeyManager* key_manager =
-        UserSessionManager::GetInstance()->GetEasyUnlockKeyManager();
-    key_manager->RefreshKeys(
-        user_context, base::ListValue(),
-        base::Bind(&EasyUnlockServiceRegular::SetHardlockAfterKeyOperation,
-                   weak_ptr_factory_.GetWeakPtr(),
-                   EasyUnlockScreenlockStateHandler::NO_PAIRING));
-  }
-}
-
 void EasyUnlockServiceRegular::SetHardlockAfterKeyOperation(
     EasyUnlockScreenlockStateHandler::HardlockState state_on_success,
     bool success) {
diff --git a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h
index bbe2a5b..45a7f6a 100644
--- a/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h
+++ b/chrome/browser/chromeos/login/easy_unlock/easy_unlock_service_regular.h
@@ -164,10 +164,6 @@
   void OnTurnOffEasyUnlockSuccess();
   void OnTurnOffEasyUnlockFailure();
 
-  // Called with the user's credentials (e.g. username and password) after the
-  // user reauthenticates to begin setup.
-  void OpenSetupAppAfterReauth(const UserContext& user_context);
-
   // Called after a cryptohome RemoveKey or RefreshKey operation to set the
   // proper hardlock state if the operation is successful.
   void SetHardlockAfterKeyOperation(
diff --git a/chrome/browser/chromeos/system/timezone_util.cc b/chrome/browser/chromeos/system/timezone_util.cc
index 677f7de5..0c62a92 100644
--- a/chrome/browser/chromeos/system/timezone_util.cc
+++ b/chrome/browser/chromeos/system/timezone_util.cc
@@ -28,6 +28,7 @@
 #include "chrome/common/pref_names.h"
 #include "chrome/grit/generated_resources.h"
 #include "chromeos/chromeos_switches.h"
+#include "chromeos/settings/install_attributes.h"
 #include "chromeos/settings/timezone_settings.h"
 #include "chromeos/timezone/timezone_request.h"
 #include "components/policy/proto/chrome_device_policy.pb.h"
@@ -148,6 +149,35 @@
   return result;
 }
 
+// Returns true if the given user is allowed to set the system timezone - that
+// is, the single timezone at TimezoneSettings::GetInstance()->GetTimezone(),
+// which is also stored in a file at /var/lib/timezone/localtime.
+bool CanSetSystemTimezone(const user_manager::User* user) {
+  if (!user->is_logged_in())
+    return false;
+
+  switch (user->GetType()) {
+    case user_manager::USER_TYPE_REGULAR:
+    case user_manager::USER_TYPE_SUPERVISED:
+    case user_manager::USER_TYPE_KIOSK_APP:
+    case user_manager::USER_TYPE_ARC_KIOSK_APP:
+    case user_manager::USER_TYPE_ACTIVE_DIRECTORY:
+      return true;
+
+    case user_manager::USER_TYPE_GUEST:
+    case user_manager::USER_TYPE_PUBLIC_ACCOUNT:
+    case user_manager::USER_TYPE_CHILD:
+      return false;
+
+    case user_manager::NUM_USER_TYPES:
+      NOTREACHED();
+
+      // No default case means the compiler makes sure we handle new types.
+  }
+  NOTREACHED();
+  return false;
+}
+
 }  // namespace
 
 namespace chromeos {
@@ -171,9 +201,7 @@
 }
 
 bool HasSystemTimezonePolicy() {
-  policy::BrowserPolicyConnectorChromeOS* connector =
-      g_browser_process->platform_part()->browser_policy_connector_chromeos();
-  if (!connector->IsEnterpriseManaged())
+  if (!chromeos::InstallAttributes::Get()->IsEnterpriseManaged())
     return false;
 
   std::string policy_timezone;
@@ -297,8 +325,11 @@
                                                 value);
   }
 
-  if (user_manager->GetPrimaryUser() == user && PerUserTimezoneEnabled())
-    CrosSettings::Get()->SetString(kSystemTimezone, value);
+  if (user_manager->GetPrimaryUser() == user && PerUserTimezoneEnabled() &&
+      CanSetSystemTimezone(user)) {
+    TimezoneSettings::GetInstance()->SetTimezoneFromID(
+        base::UTF8ToUTF16(value));
+  }
 }
 
 void SetSystemAndSigninScreenTimezone(const std::string& timezone) {
@@ -311,7 +342,7 @@
   std::string current_timezone_id;
   CrosSettings::Get()->GetString(kSystemTimezone, &current_timezone_id);
   if (current_timezone_id != timezone) {
-    system::TimezoneSettings::GetInstance()->SetTimezoneFromID(
+    TimezoneSettings::GetInstance()->SetTimezoneFromID(
         base::UTF8ToUTF16(timezone));
   }
 }
@@ -322,8 +353,14 @@
 }
 
 void SetTimezoneFromUI(Profile* profile, const std::string& timezone_id) {
+  const user_manager::User* user =
+      ProfileHelper::Get()->GetUserByProfile(profile);
+
   if (!PerUserTimezoneEnabled()) {
-    CrosSettings::Get()->SetString(kSystemTimezone, timezone_id);
+    if (CanSetSystemTimezone(user)) {
+      TimezoneSettings::GetInstance()->SetTimezoneFromID(
+          base::UTF8ToUTF16(timezone_id));
+    }
     return;
   }
 
@@ -333,7 +370,10 @@
   }
 
   if (ProfileHelper::IsEphemeralUserProfile(profile)) {
-    CrosSettings::Get()->SetString(kSystemTimezone, timezone_id);
+    if (CanSetSystemTimezone(user)) {
+      TimezoneSettings::GetInstance()->SetTimezoneFromID(
+          base::UTF8ToUTF16(timezone_id));
+    }
     return;
   }
 
diff --git a/chrome/browser/extensions/api/settings_private/prefs_util.cc b/chrome/browser/extensions/api/settings_private/prefs_util.cc
index c09d0a8..f129744 100644
--- a/chrome/browser/extensions/api/settings_private/prefs_util.cc
+++ b/chrome/browser/extensions/api/settings_private/prefs_util.cc
@@ -412,6 +412,8 @@
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
   (*s_whitelist)[::ash::prefs::kUserBluetoothAdapterEnabled] =
       settings_api::PrefType::PREF_TYPE_BOOLEAN;
+  (*s_whitelist)[::prefs::kVpnConfigAllowed] =
+      settings_api::PrefType::PREF_TYPE_BOOLEAN;
 
   // Timezone settings.
   (*s_whitelist)[chromeos::kSystemTimezone] =
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc
index 6b95745..839fa12 100644
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -495,6 +495,10 @@
 const char kDataReductionProxyServerAlternative9[] = "Use alt. server config 9";
 const char kDataReductionProxyServerAlternative10[] =
     "Use alt. server config 10";
+const char kEnableDataReductionProxyNetworkServiceName[] =
+    "Data reduction proxy with network service";
+const char kEnableDataReductionProxyNetworkServiceDescription[] =
+    "Enable data reduction proxy when network service is enabled";
 const char kEnableDataReductionProxyServerExperimentName[] =
     "Use an alternative Data Saver back end configuration.";
 const char kEnableDataReductionProxyServerExperimentDescription[] =
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h
index 2b08bc02..dc709dfb 100644
--- a/chrome/browser/flag_descriptions.h
+++ b/chrome/browser/flag_descriptions.h
@@ -332,6 +332,8 @@
 extern const char kDataReductionProxyServerAlternative8[];
 extern const char kDataReductionProxyServerAlternative9[];
 extern const char kDataReductionProxyServerAlternative10[];
+extern const char kEnableDataReductionProxyNetworkServiceName[];
+extern const char kEnableDataReductionProxyNetworkServiceDescription[];
 extern const char kEnableDataReductionProxyServerExperimentName[];
 extern const char kEnableDataReductionProxyServerExperimentDescription[];
 
diff --git a/chrome/browser/no_background_tasks_browsertest.cc b/chrome/browser/no_best_effort_tasks_browsertest.cc
similarity index 79%
rename from chrome/browser/no_background_tasks_browsertest.cc
rename to chrome/browser/no_best_effort_tasks_browsertest.cc
index c750eb70..41fc615 100644
--- a/chrome/browser/no_background_tasks_browsertest.cc
+++ b/chrome/browser/no_best_effort_tasks_browsertest.cc
@@ -40,36 +40,36 @@
   DISALLOW_COPY_AND_ASSIGN(RunLoopUntilNonEmptyPaint);
 };
 
-class NoBackgroundTasksTest : public InProcessBrowserTest {
+class NoBestEffortTasksTest : public InProcessBrowserTest {
  protected:
-  NoBackgroundTasksTest() = default;
-  ~NoBackgroundTasksTest() override = default;
+  NoBestEffortTasksTest() = default;
+  ~NoBestEffortTasksTest() override = default;
 
  private:
   void SetUpCommandLine(base::CommandLine* command_line) override {
     command_line->AppendSwitch(switches::kDisableBackgroundTasks);
   }
 
-  DISALLOW_COPY_AND_ASSIGN(NoBackgroundTasksTest);
+  DISALLOW_COPY_AND_ASSIGN(NoBestEffortTasksTest);
 };
 
 }  // namespace
 
 // Verify that it is possible to get the first non-empty paint without running
-// background tasks.
+// BEST_EFFORT tasks.
 //
 // TODO(fdoray) https://crbug.com/833989:
 // - Flaky timeout on ChromeOS ASAN
 // - Consistent timeout on Win ASAN
 #if defined(ADDRESS_SANITIZER) && (defined(OS_CHROMEOS) || defined(OS_WIN))
-#define MAYBE_FirstNonEmptyPaintWithoutBackgroundTasks \
-  DISABLED_FirstNonEmptyPaintWithoutBackgroundTasks
+#define MAYBE_FirstNonEmptyPaintWithoutBestEffortTasks \
+  DISABLED_FirstNonEmptyPaintWithoutBestEffortTasks
 #else
-#define MAYBE_FirstNonEmptyPaintWithoutBackgroundTasks \
-  FirstNonEmptyPaintWithoutBackgroundTasks
+#define MAYBE_FirstNonEmptyPaintWithoutBestEffortTasks \
+  FirstNonEmptyPaintWithoutBestEffortTasks
 #endif
-IN_PROC_BROWSER_TEST_F(NoBackgroundTasksTest,
-                       MAYBE_FirstNonEmptyPaintWithoutBackgroundTasks) {
+IN_PROC_BROWSER_TEST_F(NoBestEffortTasksTest,
+                       MAYBE_FirstNonEmptyPaintWithoutBestEffortTasks) {
   RunLoopUntilNonEmptyPaint run_loop_until_non_empty_paint(
       browser()->tab_strip_model()->GetActiveWebContents());
   run_loop_until_non_empty_paint.RunUntilNonEmptyPaint();
diff --git a/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc b/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
index b8e0518..65a00c72 100644
--- a/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
+++ b/chrome/browser/renderer_context_menu/spelling_menu_observer_browsertest.cc
@@ -197,12 +197,21 @@
   EXPECT_FALSE(item.hidden);
 }
 
+// crbug.com/899935
+#if defined(OS_WIN)
+#define MAYBE_NoSpellingServiceWhenOffTheRecord \
+  DISABLED_NoSpellingServiceWhenOffTheRecord
+#else
+#define MAYBE_NoSpellingServiceWhenOffTheRecord \
+  NoSpellingServiceWhenOffTheRecord
+#endif
+
 // Test that "Ask Google For Suggestions" is grayed out when using an
 // off the record profile.
 // TODO(rlp): Include graying out of autocorrect in this test when autocorrect
 // is functional.
 IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest,
-                       NoSpellingServiceWhenOffTheRecord) {
+                       MAYBE_NoSpellingServiceWhenOffTheRecord) {
   // Create a menu in an incognito profile.
   Reset(true);
 
@@ -243,9 +252,17 @@
   EXPECT_FALSE(item.hidden);
 }
 
+// crbug.com/899935
+#if defined(OS_WIN)
+#define MAYBE_SuggestionsForceTopSeparator DISABLED_SuggestionsForceTopSeparator
+#else
+#define MAYBE_SuggestionsForceTopSeparator SuggestionsForceTopSeparator
+#endif
+
 // Test that the menu is preceeded by a separator if there are any suggestions,
 // or if the SpellingServiceClient is available
-IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest, SuggestionsForceTopSeparator) {
+IN_PROC_BROWSER_TEST_F(SpellingMenuObserverTest,
+                       MAYBE_SuggestionsForceTopSeparator) {
   menu()->GetPrefs()->SetBoolean(
       spellcheck::prefs::kSpellCheckUseSpellingService, false);
 
diff --git a/chrome/browser/resources/omnibox/omnibox.js b/chrome/browser/resources/omnibox/omnibox.js
index 7a7e1b0b..ea04322 100644
--- a/chrome/browser/resources/omnibox/omnibox.js
+++ b/chrome/browser/resources/omnibox/omnibox.js
@@ -35,58 +35,42 @@
    */
   class OutputController {
     constructor() {
-      /** @private {!Array<mojom.OmniboxResult>} */
-      this.outputResultsGroups_ = [];
+      /** @private {!Array<!mojom.OmniboxResult>} */
+      this.responses_ = [];
+      /** @private {QueryInputs} */
+      this.queryInputs_ = /** @type {QueryInputs} */ ({});
+      /** @private {DisplayInputs} */
+      this.displayInputs_ = /** @type {DisplayInputs} */ ({});
     }
 
-    clear() {
-      this.outputResultsGroups_ = [];
-      omniboxOutput.clearOutput();
+    /** @param {QueryInputs} queryInputs */
+    updateQueryInputs(queryInputs) {
+      this.queryInputs_ = queryInputs;
+      this.refresh_();
     }
 
-    /*
-     * Adds a new response to the page. If we're not displaying incomplete
-     * results, we clear the page and display only the new result. If we are
-     * displaying incomplete results, then this is more efficient than refresh,
-     * as there's no need to clear and re-add previous results.
-     */
-    /** @param {!mojom.OmniboxResult} response A response from C++ autocomplete controller */
-    add(response) {
-      this.outputResultsGroups_.push(response);
-      if (!omniboxInputs.$$('show-incomplete-results').checked)
-        omniboxOutput.clearOutput();
-      addResultToOutput(
-          this.outputResultsGroups_[this.outputResultsGroups_.length - 1]);
+    /** @param {DisplayInputs} displayInputs */
+    updateDisplayInputs(displayInputs) {
+      this.displayInputs_ = displayInputs;
+      this.refresh_();
     }
 
-    /*
-     * Refreshes all results. We only display the last (most recent) entry
-     * unless incomplete results is enabled.
-     */
-    refresh() {
-      omniboxOutput.clearOutput();
-      if (omniboxInputs.$$('show-incomplete-results').checked) {
-        this.outputResultsGroups_.forEach(addResultToOutput);
-      } else if (this.outputResultsGroups_.length) {
-        addResultToOutput(
-            this.outputResultsGroups_[this.outputResultsGroups_.length - 1]);
-      }
+    clearAutocompleteResponses() {
+      this.responses_ = [];
+      this.refresh_();
     }
-  }
 
-  /**
-   * Appends some human-readable information about the provided
-   * autocomplete result to the HTML node with id omnibox-debug-text.
-   * The current human-readable form is a few lines about general
-   * autocomplete result statistics followed by a table with one line
-   * for each autocomplete match.  The input parameter is an OmniboxResultMojo.
-   */
-  function addResultToOutput(result) {
-    const resultsGroup = new omnibox_output.OutputResultsGroup(result).render(
-        omniboxInputs.$$('show-details').checked,
-        omniboxInputs.$$('show-incomplete-results').checked,
-        omniboxInputs.$$('show-all-providers').checked);
-    omniboxOutput.addOutput(resultsGroup);
+    /** @param {!mojom.OmniboxResult} response */
+    addAutocompleteResponse(response) {
+      this.responses_.push(response);
+      this.refresh_();
+    }
+
+    /** @private */
+    refresh_() {
+      omniboxOutput.refresh(
+          this.queryInputs_, this.responses_, this.displayInputs_);
+    }
   }
 
   class BrowserProxy {
@@ -116,7 +100,6 @@
                 preventInlineAutocomplete,
                 preferKeyword,
                 pageClassification) {
-      outputController.clear();
       // Then, call chrome with a five-element list:
       // - first element: the value in the text box
       // - second element: the location of the cursor in the text box
@@ -131,8 +114,12 @@
           pageClassification);
     }
 
+    // TODO (manukh) rename method to handleNewAutocompleteResponse in order to
+    // keep terminology consistent. Result refers to a single autocomplete
+    // match. Response refers to the data returned from the C++
+    // AutocompleteController.
     handleNewAutocompleteResult(response) {
-      outputController.add(response);
+      outputController.addAutocompleteResponse(response);
     }
   }
 
@@ -149,15 +136,18 @@
     omniboxInputs = /** @type {!OmniboxInputs} */ ($('omnibox-inputs'));
     omniboxOutput =
         /** @type {!omnibox_output.OmniboxOutput} */ ($('omnibox-output'));
-    omniboxInputs.addEventListener('query-inputs-changed', event =>
-        browserProxy.makeRequest(
-            event.detail.inputText,
-            event.detail.cursorPosition,
-            event.detail.preventInlineAutocomplete,
-            event.detail.preferKeyword,
-            event.detail.pageClassification
-        ));
-    omniboxInputs.addEventListener('display-inputs-changed',
-        outputController.refresh.bind(outputController));
+    omniboxInputs.addEventListener('query-inputs-changed', event => {
+      outputController.clearAutocompleteResponses();
+      outputController.updateQueryInputs(event.detail);
+      browserProxy.makeRequest(
+          event.detail.inputText,
+          event.detail.cursorPosition,
+          event.detail.preventInlineAutocomplete,
+          event.detail.preferKeyword,
+          event.detail.pageClassification);
+    });
+    omniboxInputs.addEventListener(
+        'display-inputs-changed',
+        event => outputController.updateDisplayInputs(event.detail));
   });
 })();
diff --git a/chrome/browser/resources/omnibox/omnibox_inputs.js b/chrome/browser/resources/omnibox/omnibox_inputs.js
index 4897c62..8d86e83 100644
--- a/chrome/browser/resources/omnibox/omnibox_inputs.js
+++ b/chrome/browser/resources/omnibox/omnibox_inputs.js
@@ -2,6 +2,26 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+/**
+ * @typedef {{
+ *   inputText: string,
+ *   cursorPosition: number,
+ *   preventInlineAutocomplete: boolean,
+ *   preferKeyword: boolean,
+ *   pageClassification: number,
+ * }}
+ */
+let QueryInputs;
+
+/**
+ * @typedef {{
+ *   showIncompleteResults: boolean,
+ *   showDetails: boolean,
+ *   showAllProviders: boolean,
+ * }}
+ */
+let DisplayInputs;
+
 class OmniboxInputs extends OmniboxElement {
   /** @return {string} */
   static get is() {
@@ -20,7 +40,7 @@
   /** @private */
   setupElementListeners_() {
     const onQueryInputsChanged = this.onQueryInputsChanged_.bind(this);
-    const onDisplayInputsChagned = this.onDisplayInputsChagned_.bind(this);
+    const onDisplayInputsChanged = this.onDisplayInputsChanged_.bind(this);
 
     this.$$('input-text').addEventListener('input', onQueryInputsChanged);
     [
@@ -32,25 +52,33 @@
       this.$$('show-incomplete-results'),
       this.$$('show-details'),
       this.$$('show-all-providers'),
-    ].forEach(elem => elem.addEventListener('change', onDisplayInputsChagned));
+    ].forEach(elem => elem.addEventListener('change', onDisplayInputsChanged));
   }
 
   /** @private */
   onQueryInputsChanged_() {
-    this.dispatchEvent(new CustomEvent('query-inputs-changed', {
-      detail: {
-        inputText: this.$$('input-text').value,
-        cursorPosition: this.$$('input-text').selectionEnd,
-        preventInlineAutocomplete: this.$$('prevent-inline-autocomplete').checked,
-        preferKeyword: this.$$('prefer-keyword').checked,
-        pageClassification: this.$$('page-classification').checked,
-      }
-    }));
+    /** @type {QueryInputs} */
+    const queryInputs = {
+      inputText: this.$$('input-text').value,
+      cursorPosition: this.$$('input-text').selectionEnd,
+      preventInlineAutocomplete: this.$$('prevent-inline-autocomplete').checked,
+      preferKeyword: this.$$('prefer-keyword').checked,
+      pageClassification: this.$$('page-classification').checked,
+    };
+    this.dispatchEvent(
+        new CustomEvent('query-inputs-changed', {detail: queryInputs}));
   }
 
   /** @private */
-  onDisplayInputsChagned_() {
-    this.dispatchEvent(new CustomEvent('display-inputs-changed'));
+  onDisplayInputsChanged_() {
+    /** @type {DisplayInputs} */
+    const displayInputs = {
+      showIncompleteResults: this.$$('show-incomplete-results').checked,
+      showDetails: this.$$('show-details').checked,
+      showAllProviders: this.$$('show-all-providers').checked,
+    };
+    this.dispatchEvent(
+        new CustomEvent('display-inputs-changed', {detail: displayInputs}));
   }
 }
 
diff --git a/chrome/browser/resources/omnibox/omnibox_output.js b/chrome/browser/resources/omnibox/omnibox_output.js
index 124afdb8..c87ff0e 100644
--- a/chrome/browser/resources/omnibox/omnibox_output.js
+++ b/chrome/browser/resources/omnibox/omnibox_output.js
@@ -180,14 +180,48 @@
       super('omnibox-output-template');
     }
 
-    /** @param {Element} element the element to the output */
-    addOutput(element) {
-      this.$$('contents').appendChild(element);
+    /**
+     * @param {QueryInputs} queryInputs
+     * @param {!Array<!mojom.OmniboxResult>} responses
+     * @param {DisplayInputs} displayInputs
+     */
+    refresh(queryInputs, responses, displayInputs) {
+      /** @private {QueryInputs} */
+      this.queryInputs_ = queryInputs;
+      /** @private {!Array<mojom.OmniboxResult>} */
+      this.responses_ = responses;
+      /** @private {DisplayInputs} */
+      this.displayInputs_ = displayInputs;
+
+      this.clearOutput_();
+      if (responses.length) {
+        if (this.displayInputs_.showIncompleteResults)
+          responses.forEach(this.addOutputResultsGroup_.bind(this));
+        else
+          this.addOutputResultsGroup_(responses[responses.length - 1]);
+      }
     }
 
-    clearOutput() {
-      while (this.$$('contents').firstChild)
-        this.$$('contents').removeChild(this.$$('contents').firstChild);
+    /**
+     * @private
+     * @param {!mojom.OmniboxResult} response
+     */
+    addOutputResultsGroup_(response) {
+      this.$$('contents')
+          .appendChild(
+              new OutputResultsGroup(response, this.queryInputs_.cursorPosition)
+                  .render(
+                      this.displayInputs_.showDetails,
+                      this.displayInputs_.showIncompleteResults,
+                      this.displayInputs_.showAllProviders));
+    }
+
+    /** @private */
+    clearOutput_() {
+      let contents = this.$$('contents');
+      // Clears all children.
+      while (contents.firstChild)
+        contents.removeChild(contents.firstChild);
     }
   }
 
@@ -201,11 +235,14 @@
    * below.
    */
   class OutputResultsGroup {
-    /** @param {!mojom.OmniboxResult} resultsGroup */
-    constructor(resultsGroup) {
+    /**
+     * @param {!mojom.OmniboxResult} resultsGroup
+     * @param {number} cursorPosition
+     */
+    constructor(resultsGroup, cursorPosition) {
       /** @struct */
       this.details = {
-        cursorPosition: 0,
+        cursorPosition,
         time: resultsGroup.timeSinceOmniboxStartedMs,
         done: resultsGroup.done,
         host: resultsGroup.host,
@@ -470,6 +507,5 @@
   // https://chromium.googlesource.com/chromium/src/+/master/styleguide/web/es6.md#object-literal-extensions
   return {
     OmniboxOutput: OmniboxOutput,
-    OutputResultsGroup: OutputResultsGroup,
   };
 });
diff --git a/chrome/browser/resources/settings/controls/controlled_button.html b/chrome/browser/resources/settings/controls/controlled_button.html
index e76e3584..96fe2f6 100644
--- a/chrome/browser/resources/settings/controls/controlled_button.html
+++ b/chrome/browser/resources/settings/controls/controlled_button.html
@@ -44,7 +44,9 @@
       }
     </style>
 
-    <paper-button disabled="[[enforced_]]">[[label]]</paper-button>
+    <paper-button class$="[[getClass_(actionButton)]]" disabled="[[enforced_]]">
+      [[label]]
+    </paper-button>
 
     <template is="dom-if" if="[[hasPrefPolicyIndicator(pref.*)]]" restamp>
       <cr-policy-pref-indicator pref="[[pref]]" on-click="onIndicatorTap_"
diff --git a/chrome/browser/resources/settings/controls/controlled_button.js b/chrome/browser/resources/settings/controls/controlled_button.js
index 49d4686..3a7b172 100644
--- a/chrome/browser/resources/settings/controls/controlled_button.js
+++ b/chrome/browser/resources/settings/controls/controlled_button.js
@@ -11,6 +11,11 @@
   ],
 
   properties: {
+    actionButton: {
+      type: Boolean,
+      value: false,
+    },
+
     endJustified: {
       type: Boolean,
       value: false,
@@ -36,4 +41,13 @@
     e.preventDefault();
     e.stopPropagation();
   },
+
+  /**
+   * @param {!boolean} actionButton
+   * @return {string} Class of the paper-button.
+   * @private
+   */
+  getClass_: function(actionButton) {
+    return actionButton ? "action-button" : "";
+  },
 });
diff --git a/chrome/browser/resources/settings/controls/pref_control_behavior.js b/chrome/browser/resources/settings/controls/pref_control_behavior.js
index cf53c6d..70f6fab6 100644
--- a/chrome/browser/resources/settings/controls/pref_control_behavior.js
+++ b/chrome/browser/resources/settings/controls/pref_control_behavior.js
@@ -30,7 +30,7 @@
    */
   validatePref_: function() {
     CrSettingsPrefs.initialized.then(() => {
-      if (!this.pref) {
+      if (this.pref === undefined) {
         let error = 'Pref not found for element ' + this.tagName;
         if (this.id)
           error += '#' + this.id;
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.html b/chrome/browser/resources/settings/internet_page/internet_detail_page.html
index 7e9234e..217c99d 100644
--- a/chrome/browser/resources/settings/internet_page/internet_detail_page.html
+++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.html
@@ -19,6 +19,7 @@
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-flex-layout/iron-flex-layout-classes.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
+<link rel="import" href="../controls/controlled_button.html">
 <link rel="import" href="../controls/settings_toggle_button.html">
 <link rel="import" href="../prefs/prefs.html">
 <link rel="import" href="../route.html">
@@ -81,7 +82,9 @@
         </template>
       </div>
       <paper-button on-click="onForgetTap_"
-          hidden$="[[!showForget_(networkProperties)]]">
+          hidden$="[[!showForget_(networkProperties)]]"
+          disabled="[[disableForget_(networkProperties,
+              prefs.vpn_config_allowed)]]">
         $i18n{networkButtonForget}
       </paper-button>
       <paper-button on-click="onViewAccountTap_"
@@ -95,21 +98,26 @@
       <paper-button on-click="onConfigureTap_"
           hidden$="[[!showConfigure_(networkProperties, globalPolicy,
               managedNetworkAvailable)]]"
-          disabled="[[disableConfigure_(networkProperties)]]">
+          disabled="[[disableConfigure_(networkProperties,
+              prefs.vpn_config_allowed)]]">
         $i18n{networkButtonConfigure}
       </paper-button>
-      <paper-button class="action-button" on-click="onConnectTap_"
+      <controlled-button action-button on-click="onConnectTap_"
           hidden$="[[!showConnect_(networkProperties, globalPolicy,
               managedNetworkAvailable)]]"
           disabled="[[!enableConnect_(networkProperties, defaultNetwork,
               networkPropertiesReceived_, outOfRange_, globalPolicy,
-              managedNetworkAvailable)]]">
-        $i18n{networkButtonConnect}
-      </paper-button>
-      <paper-button class="action-button" on-click="onDisconnectTap_"
-          hidden$="[[!showDisconnect_(networkProperties)]]">
-        $i18n{networkButtonDisconnect}
-      </paper-button>
+              managedNetworkAvailable)]]"
+          label="$i18n{networkButtonConnect}"
+          pref="[[getVpnConfigPrefFromValue_(networkProperties,
+              prefs.vpn_config_allowed)]]">
+      </controlled-button>
+      <controlled-button action-button on-click="onDisconnectTap_"
+          hidden$="[[!showDisconnect_(networkProperties)]]"
+          label="$i18n{networkButtonDisconnect}"
+          pref="[[getVpnConfigPrefFromValue_(networkProperties,
+              prefs.vpn_config_allowed)]]">
+      </controlled-button>
     </div>
 
     <!-- Disabled by policy / Shared messages. -->
diff --git a/chrome/browser/resources/settings/internet_page/internet_detail_page.js b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
index a11649d..10d581a 100644
--- a/chrome/browser/resources/settings/internet_page/internet_detail_page.js
+++ b/chrome/browser/resources/settings/internet_page/internet_detail_page.js
@@ -605,10 +605,26 @@
 
   /**
    * @param {!CrOnc.NetworkProperties} networkProperties
+   * @param {!chrome.settingsPrivate.PrefObject} vpn_config_allowed
    * @return {boolean}
    * @private
    */
-  disableConfigure_: function(networkProperties) {
+  disableForget_: function(networkProperties, vpn_config_allowed) {
+    return this.isVpn_(networkProperties) && vpn_config_allowed &&
+        !vpn_config_allowed.value;
+  },
+
+  /**
+   * @param {!CrOnc.NetworkProperties} networkProperties
+   * @param {!chrome.settingsPrivate.PrefObject} vpn_config_allowed
+   * @return {boolean}
+   * @private
+   */
+  disableConfigure_: function(networkProperties, vpn_config_allowed) {
+    if (this.isVpn_(networkProperties) && vpn_config_allowed &&
+        !vpn_config_allowed.value) {
+      return true;
+    }
     return this.isPolicySource(networkProperties.Source) &&
         !this.hasRecommendedFields_(networkProperties);
   },
@@ -698,6 +714,36 @@
   },
 
   /**
+   * @param {!CrOnc.NetworkProperties} networkProperties
+   * @return {boolean} Whether or not we are looking at VPN configuration.
+   * @private
+   */
+  isVpn_: function(networkProperties) {
+    return networkProperties.Type == CrOnc.Type.VPN;
+  },
+
+  /**
+   * @param {!CrOnc.NetworkProperties} networkProperties
+   * @param {!chrome.settingsPrivate.PrefObject} prefButtonAllowed
+   * @return {Object} Fake pref that is enforced
+   * whenever the original pref is true
+   * @private
+   */
+  getVpnConfigPrefFromValue_: function(networkProperties, prefButtonAllowed) {
+    if (!this.isVpn_(networkProperties) || !prefButtonAllowed) {
+      return null;
+    }
+    let fakePref = Object.assign({}, prefButtonAllowed);
+    if (prefButtonAllowed.value) {
+      delete fakePref.enforcement;
+      delete fakePref.controlledBy;
+    } else {
+      fakePref.enforcement = chrome.settingsPrivate.Enforcement.ENFORCED;
+    }
+    return fakePref;
+  },
+
+  /**
    * @return {!TetherConnectionDialogElement}
    * @private
    */
diff --git a/chrome/browser/resources/settings/settings_shared_css.html b/chrome/browser/resources/settings/settings_shared_css.html
index a558d797..430570e 100644
--- a/chrome/browser/resources/settings/settings_shared_css.html
+++ b/chrome/browser/resources/settings/settings_shared_css.html
@@ -80,7 +80,10 @@
       }
 
       /* Space out multiple buttons in the same row. */
-      .settings-box paper-button + paper-button {
+      .settings-box paper-button + paper-button,
+      .settings-box paper-button + controlled-button,
+      .settings-box controlled-button + controlled-button,
+      .settings-box controlled-button + paper-button {
         margin-inline-start: 16px;
       }
 
diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer_unittest.cc b/chrome/browser/safe_browsing/download_protection/file_analyzer_unittest.cc
index 4be45a3..d88d7a8c3 100644
--- a/chrome/browser/safe_browsing/download_protection/file_analyzer_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection/file_analyzer_unittest.cc
@@ -22,12 +22,12 @@
 namespace safe_browsing {
 
 using ::testing::_;
+using ::testing::DoAll;
 using ::testing::IsEmpty;
 using ::testing::Return;
 using ::testing::SetArgPointee;
 using ::testing::SizeIs;
 using ::testing::StrEq;
-using ::testing::DoAll;
 
 class FileAnalyzerTest : public testing::Test {
  public:
@@ -40,13 +40,17 @@
   }
 
  protected:
-  void SetUp() override { has_result_ = false; }
+  void SetUp() override {
+    has_result_ = false;
+    ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
+  }
 
   void TearDown() override {}
 
  protected:
   bool has_result_;
   FileAnalyzer::Results result_;
+  base::ScopedTempDir temp_dir_;
 
  private:
   content::TestBrowserThreadBundle test_browser_thread_bundle_;
@@ -60,7 +64,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.exe"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   EXPECT_CALL(*extractor, CheckSignature(tmp_path, _)).WillOnce(Return());
   EXPECT_CALL(*extractor, ExtractImageFeatures(tmp_path, _, _, _))
@@ -83,7 +88,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.crx"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   EXPECT_CALL(*extractor, CheckSignature(tmp_path, _)).WillOnce(Return());
   EXPECT_CALL(*extractor, ExtractImageFeatures(tmp_path, _, _, _))
@@ -106,7 +112,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.apk"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   EXPECT_CALL(*extractor, CheckSignature(tmp_path, _)).WillOnce(Return());
   EXPECT_CALL(*extractor, ExtractImageFeatures(tmp_path, _, _, _))
@@ -129,7 +136,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -158,7 +166,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.pkg"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   EXPECT_CALL(*extractor, CheckSignature(tmp_path, _)).WillOnce(Return());
   EXPECT_CALL(*extractor, ExtractImageFeatures(tmp_path, _, _, _))
@@ -181,7 +190,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -210,7 +220,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   std::string file_contents = "invalid contents";
   ASSERT_EQ(
@@ -237,7 +248,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.dmg"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   std::string file_contents = "invalid contents";
   ASSERT_EQ(
@@ -264,7 +276,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.exe"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   EXPECT_CALL(*extractor, CheckSignature(tmp_path, _)).WillOnce(Return());
   EXPECT_CALL(*extractor, ExtractImageFeatures(tmp_path, _, _, _))
@@ -287,7 +300,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -316,7 +330,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   std::string file_contents = "invalid zip";
   ASSERT_EQ(
@@ -340,7 +355,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -369,7 +385,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -398,7 +415,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -427,7 +445,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -456,7 +475,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -489,7 +509,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -525,7 +546,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.zip"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.crdownload"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   base::ScopedTempDir zip_source_dir;
   ASSERT_TRUE(zip_source_dir.CreateUniqueTempDir());
@@ -558,7 +580,8 @@
   base::RunLoop run_loop;
 
   base::FilePath target_path(FILE_PATH_LITERAL("target.exe"));
-  base::FilePath tmp_path(FILE_PATH_LITERAL("tmp.exe"));
+  base::FilePath tmp_path =
+      temp_dir_.GetPath().Append(FILE_PATH_LITERAL("tmp.crdownload"));
 
   ClientDownloadRequest::SignatureInfo signature;
   *signature.add_signed_data() = "signature";
diff --git a/chrome/browser/signin/account_consistency_mode_manager.cc b/chrome/browser/signin/account_consistency_mode_manager.cc
index b713e95..bd52dde 100644
--- a/chrome/browser/signin/account_consistency_mode_manager.cc
+++ b/chrome/browser/signin/account_consistency_mode_manager.cc
@@ -6,6 +6,7 @@
 
 #include <string>
 
+#include "base/command_line.h"
 #include "base/logging.h"
 #include "base/memory/singleton.h"
 #include "base/metrics/field_trial_params.h"
@@ -127,7 +128,9 @@
   PrefService* prefs = profile->GetPrefs();
   // Propagate settings changes from the previous launch to the signin-allowed
   // pref.
-  bool signin_allowed = prefs->GetBoolean(prefs::kSigninAllowedOnNextStartup);
+  bool signin_allowed =
+      prefs->GetBoolean(prefs::kSigninAllowedOnNextStartup) &&
+      !base::CommandLine::ForCurrentProcess()->HasSwitch("disallow-signin");
   prefs->SetBoolean(prefs::kSigninAllowed, signin_allowed);
 
   UMA_HISTOGRAM_BOOLEAN("Signin.SigninAllowed", signin_allowed);
diff --git a/chrome/browser/signin/account_consistency_mode_manager.h b/chrome/browser/signin/account_consistency_mode_manager.h
index aeaa184..727673b 100644
--- a/chrome/browser/signin/account_consistency_mode_manager.h
+++ b/chrome/browser/signin/account_consistency_mode_manager.h
@@ -75,6 +75,8 @@
                            MigrateAtCreation);
   FRIEND_TEST_ALL_PREFIXES(AccountConsistencyModeManagerTest,
                            SigninAllowedChangesDiceState);
+  FRIEND_TEST_ALL_PREFIXES(AccountConsistencyModeManagerTest,
+                           DisallowSigninSwitch);
 
 #if BUILDFLAG(ENABLE_DICE_SUPPORT)
   // Schedules migration to happen at next startup. Exposed as a static function
diff --git a/chrome/browser/signin/account_consistency_mode_manager_unittest.cc b/chrome/browser/signin/account_consistency_mode_manager_unittest.cc
index 8cee2f64..e82e241b 100644
--- a/chrome/browser/signin/account_consistency_mode_manager_unittest.cc
+++ b/chrome/browser/signin/account_consistency_mode_manager_unittest.cc
@@ -7,6 +7,8 @@
 #include <memory>
 #include <utility>
 
+#include "base/command_line.h"
+#include "base/test/scoped_command_line.h"
 #include "build/build_config.h"
 #include "build/buildflag.h"
 #include "chrome/browser/prefs/browser_prefs.h"
@@ -118,6 +120,38 @@
   }
 }
 
+// The command line switch "disallow-signin" only affects the current run.
+TEST(AccountConsistencyModeManagerTest, DisallowSigninSwitch) {
+  ScopedAccountConsistencyDice scoped_dice;
+  content::TestBrowserThreadBundle test_thread_bundle;
+  TestingProfile profile;
+
+  {
+    // With the switch, signin is disallowed.
+    base::test::ScopedCommandLine scoped_command_line;
+    scoped_command_line.GetProcessCommandLine()->AppendSwitch(
+        "disallow-signin");
+    AccountConsistencyModeManager manager(&profile);
+    EXPECT_FALSE(profile.GetPrefs()->GetBoolean(prefs::kSigninAllowed));
+    EXPECT_TRUE(
+        profile.GetPrefs()->GetBoolean(prefs::kSigninAllowedOnNextStartup));
+    // Dice should be disabled.
+    EXPECT_EQ(signin::AccountConsistencyMethod::kDiceFixAuthErrors,
+              manager.GetAccountConsistencyMethod());
+  }
+
+  {
+    // Remove the switch, signin is allowed again.
+    AccountConsistencyModeManager manager(&profile);
+    EXPECT_TRUE(profile.GetPrefs()->GetBoolean(prefs::kSigninAllowed));
+    EXPECT_TRUE(
+        profile.GetPrefs()->GetBoolean(prefs::kSigninAllowedOnNextStartup));
+    // Dice should be enabled.
+    EXPECT_EQ(signin::AccountConsistencyMethod::kDice,
+              manager.GetAccountConsistencyMethod());
+  }
+}
+
 // Checks that Dice migration happens when the reconcilor is created.
 TEST(AccountConsistencyModeManagerTest, MigrateAtCreation) {
   content::TestBrowserThreadBundle test_thread_bundle;
diff --git a/chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc b/chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc
index 193531f..ba92b457 100644
--- a/chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc
+++ b/chrome/browser/supervised_user/supervised_user_google_auth_navigation_throttle.cc
@@ -8,13 +8,13 @@
 #include "base/memory/ptr_util.h"
 #include "build/build_config.h"
 #include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h"
 #include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h"
 #include "components/google/core/common/google_util.h"
-#include "components/signin/core/browser/signin_manager.h"
 #include "content/public/browser/navigation_handle.h"
 #include "content/public/browser/web_contents.h"
+#include "services/identity/public/cpp/identity_manager.h"
 
 #if defined(OS_ANDROID)
 #include "chrome/browser/supervised_user/child_accounts/child_account_service_android.h"
@@ -133,9 +133,8 @@
     content::WebContents* web_contents = navigation_handle()->GetWebContents();
     Profile* profile =
         Profile::FromBrowserContext(web_contents->GetBrowserContext());
-    SigninManager* signin_manager =
-        SigninManagerFactory::GetForProfile(profile);
-    AccountInfo account_info = signin_manager->GetAuthenticatedAccountInfo();
+    auto* identity_manager = IdentityManagerFactory::GetForProfile(profile);
+    AccountInfo account_info = identity_manager->GetPrimaryAccountInfo();
     ReauthenticateChildAccount(
         web_contents, account_info.email,
         base::Bind(&SupervisedUserGoogleAuthNavigationThrottle::
diff --git a/chrome/browser/ui/views/webauthn/hover_list_view.cc b/chrome/browser/ui/views/webauthn/hover_list_view.cc
index baf993a..e2c8c17 100644
--- a/chrome/browser/ui/views/webauthn/hover_list_view.cc
+++ b/chrome/browser/ui/views/webauthn/hover_list_view.cc
@@ -125,9 +125,6 @@
   auto hover_button =
       CreateHoverButtonForListItem(item_tag, icon, item_text, this);
 
-  if (tags_to_list_item_views_.empty())
-    first_list_item_view_ = hover_button.get();
-
   auto* list_item_view_ptr = hover_button.release();
   AddChildView(list_item_view_ptr);
   auto* separator = AddSeparatorAsChild(this);
@@ -166,10 +163,6 @@
   if (view_it == tags_to_list_item_views_.end())
     return;
 
-  auto* list_item_ptr = view_it->second.item_view;
-  if (list_item_ptr == first_list_item_view_)
-    first_list_item_view_ = nullptr;
-
   RemoveListItemView(view_it->second);
   tags_to_list_item_views_.erase(view_it);
 
@@ -191,11 +184,16 @@
   RemoveChildView(list_item.separator_view);
 }
 
+views::Button& HoverListView::GetTopListItemView() const {
+  DCHECK(!tags_to_list_item_views_.empty());
+  return *tags_to_list_item_views_.begin()->second.item_view;
+}
+
 void HoverListView::RequestFocus() {
-  if (!first_list_item_view_)
+  if (tags_to_list_item_views_.empty())
     return;
 
-  first_list_item_view_->RequestFocus();
+  GetTopListItemView().RequestFocus();
 }
 
 void HoverListView::OnListItemAdded(int item_tag) {
diff --git a/chrome/browser/ui/views/webauthn/hover_list_view.h b/chrome/browser/ui/views/webauthn/hover_list_view.h
index 51bbae5..24fa9254 100644
--- a/chrome/browser/ui/views/webauthn/hover_list_view.h
+++ b/chrome/browser/ui/views/webauthn/hover_list_view.h
@@ -56,6 +56,7 @@
   void AddListItemView(int item_tag);
   void RemoveListItemView(int item_tag);
   void RemoveListItemView(ListItemViews list_item);
+  views::Button& GetTopListItemView() const;
 
   // views::View:
   void RequestFocus() override;
@@ -70,7 +71,6 @@
   void ButtonPressed(views::Button* sender, const ui::Event& event) override;
 
   std::unique_ptr<HoverListModel> model_;
-  views::Button* first_list_item_view_ = nullptr;
   std::map<int, ListItemViews> tags_to_list_item_views_;
   base::Optional<ListItemViews> placeholder_list_item_view_;
 
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index f47cc774..c2a5e31 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -47,9 +47,10 @@
 }
 
 size_t IndexOf(const PermissionMessages& warnings, const std::string& warning) {
+  base::string16 warning16 = base::ASCIIToUTF16(warning);
   size_t i = 0;
   for (const PermissionMessage& msg : warnings) {
-    if (msg.message() == base::ASCIIToUTF16(warning))
+    if (msg.message() == warning16)
       return i;
     ++i;
   }
@@ -123,10 +124,8 @@
 TEST(PermissionsTest, GetByID) {
   PermissionsInfo* info = PermissionsInfo::GetInstance();
   APIPermissionSet apis = info->GetAll();
-  for (APIPermissionSet::const_iterator i = apis.begin();
-       i != apis.end(); ++i) {
-    EXPECT_EQ(i->id(), i->info()->id());
-  }
+  for (const auto* api : apis)
+    EXPECT_EQ(api->id(), api->info()->id());
 }
 
 // Tests that GetByName works with normal permission names and aliases.
@@ -142,8 +141,7 @@
   size_t count = 0;
   PermissionsInfo* info = PermissionsInfo::GetInstance();
   APIPermissionSet apis = info->GetAll();
-  for (APIPermissionSet::const_iterator api = apis.begin();
-       api != apis.end(); ++api) {
+  for (const auto* api : apis) {
     // Make sure only the valid permission IDs get returned.
     EXPECT_NE(APIPermission::kInvalid, api->id());
     EXPECT_NE(APIPermission::kUnknown, api->id());
@@ -325,7 +323,7 @@
 }
 
 TEST(PermissionsTest, CreateUnion) {
-  APIPermission* permission = NULL;
+  APIPermission* permission = nullptr;
 
   ManifestPermissionSet manifest_permissions;
   APIPermissionSet apis1;
@@ -354,7 +352,7 @@
     value->AppendString("tcp-connect:*.example.com:80");
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
 
   // Union with an empty set.
@@ -396,7 +394,7 @@
     std::unique_ptr<base::ListValue> value(new base::ListValue());
     value->AppendString("tcp-connect:*.example.com:80");
     value->AppendString("udp-send-to::8899");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   apis2.insert(permission);
 
@@ -411,7 +409,7 @@
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
     value->AppendString("udp-send-to::8899");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   // Insert a new permission socket permisssion which will replace the old one.
   expected_apis.insert(permission);
@@ -443,7 +441,7 @@
 }
 
 TEST(PermissionsTest, CreateIntersection) {
-  APIPermission* permission = NULL;
+  APIPermission* permission = nullptr;
 
   ManifestPermissionSet manifest_permissions;
   APIPermissionSet apis1;
@@ -476,7 +474,7 @@
     value->AppendString("tcp-connect:*.example.com:80");
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   apis1.insert(permission);
 
@@ -511,7 +509,7 @@
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
     value->AppendString("udp-send-to::8899");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   apis2.insert(permission);
 
@@ -521,7 +519,7 @@
     std::unique_ptr<base::ListValue> value(new base::ListValue());
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   expected_apis.insert(permission);
 
@@ -552,7 +550,7 @@
 }
 
 TEST(PermissionsTest, CreateDifference) {
-  APIPermission* permission = NULL;
+  APIPermission* permission = nullptr;
 
   ManifestPermissionSet manifest_permissions;
   APIPermissionSet apis1;
@@ -585,7 +583,7 @@
     value->AppendString("tcp-connect:*.example.com:80");
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   apis1.insert(permission);
 
@@ -608,7 +606,7 @@
     std::unique_ptr<base::ListValue> value(new base::ListValue());
     value->AppendString("tcp-connect:*.example.com:80");
     value->AppendString("udp-send-to::8899");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   apis2.insert(permission);
 
@@ -618,7 +616,7 @@
     std::unique_ptr<base::ListValue> value(new base::ListValue());
     value->AppendString("udp-bind::8080");
     value->AppendString("udp-send-to::8888");
-    ASSERT_TRUE(permission->FromValue(value.get(), NULL, NULL));
+    ASSERT_TRUE(permission->FromValue(value.get(), nullptr, nullptr));
   }
   expected_apis.insert(permission);
 
@@ -895,15 +893,14 @@
   const PermissionMessageProvider* provider = PermissionMessageProvider::Get();
   PermissionsInfo* info = PermissionsInfo::GetInstance();
   APIPermissionSet permissions = info->GetAll();
-  for (APIPermissionSet::const_iterator i = permissions.begin();
-       i != permissions.end(); ++i) {
-    const APIPermissionInfo* permission_info = i->info();
-    EXPECT_TRUE(permission_info != NULL);
+  for (const auto* permission : permissions) {
+    const APIPermissionInfo* permission_info = permission->info();
+    EXPECT_TRUE(permission_info);
 
     PermissionIDSet id;
     id.insert(permission_info->id());
     bool has_message = !provider->GetPermissionMessages(id).empty();
-    bool should_have_message = !skip.count(i->id());
+    bool should_have_message = !skip.count(permission->id());
     EXPECT_EQ(should_have_message, has_message) << permission_info->name();
   }
 }
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index a1484101..47cf5c6f 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -692,7 +692,7 @@
       "../browser/net/system_network_context_manager_browsertest.cc",
       "../browser/net/variations_http_headers_browsertest.cc",
       "../browser/net/websocket_browsertest.cc",
-      "../browser/no_background_tasks_browsertest.cc",
+      "../browser/no_best_effort_tasks_browsertest.cc",
       "../browser/ntp_snippets/content_suggestions_service_factory_browsertest.cc",
       "../browser/ntp_tiles/ntp_tiles_browsertest.cc",
       "../browser/page_load_metrics/observers/ads_page_load_metrics_observer_browsertest.cc",
diff --git a/chrome/test/chromedriver/test/test_expectations b/chrome/test/chromedriver/test/test_expectations
index fe8be1a9..a9b6bd9 100644
--- a/chrome/test/chromedriver/test/test_expectations
+++ b/chrome/test/chromedriver/test/test_expectations
@@ -30,8 +30,18 @@
 
 _OS_NEGATIVE_FILTER = {}
 _OS_NEGATIVE_FILTER['win'] = [
+    # https://crbug.com/899919
+    'SessionHandlingTest.testGetSessions',
+    'SessionHandlingTest.testQuitASessionMoreThanOnce',
+    'SupportIPv4AndIPv6.testSupportIPv4AndIPv6',
+    'ZChromeStartRetryCountTest.testChromeStartRetryCount',
 ]
 _OS_NEGATIVE_FILTER['linux'] = [
+    # https://crbug.com/899919
+    'SessionHandlingTest.testGetSessions',
+    'SessionHandlingTest.testQuitASessionMoreThanOnce',
+    'SupportIPv4AndIPv6.testSupportIPv4AndIPv6',
+    'ZChromeStartRetryCountTest.testChromeStartRetryCount',
 ]
 _OS_NEGATIVE_FILTER['mac'] = [
     # https://crbug.com/868599
@@ -39,6 +49,12 @@
     'WindowTest.testCanMaximizeTheWindowFromIframe',
     'WindowTest.testSetsTheSizeOfTheCurrentWindow',
     'WindowTest.testCanMaximizeTheWindow',
+
+    # https://crbug.com/899919
+    'SessionHandlingTest.testGetSessions',
+    'SessionHandlingTest.testQuitASessionMoreThanOnce',
+    'SupportIPv4AndIPv6.testSupportIPv4AndIPv6',
+    'ZChromeStartRetryCountTest.testChromeStartRetryCount',
 ]
 
 _SPECIFIC_OS_REVISION_NEGATIVE_FILTER = {}
diff --git a/chrome/test/data/webui/chromeos/fake_networking_private.js b/chrome/test/data/webui/chromeos/fake_networking_private.js
index ad647c0c9..c4776cdb 100644
--- a/chrome/test/data/webui/chromeos/fake_networking_private.js
+++ b/chrome/test/data/webui/chromeos/fake_networking_private.js
@@ -37,6 +37,7 @@
         WiFi: {Type: 'WiFi', State: ''},
         Cellular: {Type: 'Cellular', State: ''},
         Tether: {Type: 'Tether', State: ''},
+        VPN: {Type: 'VPN', State: ''},
         WiMAX: {Type: 'WiMAX', State: ''},
       };
 
diff --git a/chrome/test/data/webui/md_history/history_list_test.js b/chrome/test/data/webui/md_history/history_list_test.js
index fc5c12df..df3acaa 100644
--- a/chrome/test/data/webui/md_history/history_list_test.js
+++ b/chrome/test/data/webui/md_history/history_list_test.js
@@ -379,11 +379,6 @@
     const dialog = element.$.dialog.get();
     app.historyResult(createHistoryInfo(), TEST_HISTORY_RESULTS);
     app.historyResult(createHistoryInfo(), ADDITIONAL_RESULTS);
-    app.historyResult(createHistoryInfo(), [
-      createHistoryEntry('2015-01-01', 'http://example.com'),
-      createHistoryEntry('2015-01-01', 'http://example.com'),
-      createHistoryEntry('2015-01-01', 'http://example.com')
-    ]);
     return PolymerTest.flushTasks()
         .then(function() {
           Polymer.dom.flush();
@@ -392,9 +387,6 @@
           items[2].$.checkbox.click();
           items[5].$.checkbox.click();
           items[7].$.checkbox.click();
-          items[8].$.checkbox.click();
-          items[9].$.checkbox.click();
-          items[10].$.checkbox.click();
 
           return PolymerTest.flushTasks();
         })
diff --git a/chrome/test/data/webui/multidevice_setup/integration_test.js b/chrome/test/data/webui/multidevice_setup/integration_test.js
index ade06915..cdb279c 100644
--- a/chrome/test/data/webui/multidevice_setup/integration_test.js
+++ b/chrome/test/data/webui/multidevice_setup/integration_test.js
@@ -99,6 +99,9 @@
       /** @type {!settings.FakeQuickUnlockPrivate} */
       let fakeQuickUnlockPrivate;
 
+      /** @type {?TestMultideviceSetupBrowserProxy} */
+      let browserProxy = null;
+
       const PASSWORD = 'password-page';
       const SUCCESS = 'setup-succeeded-page';
       const START = 'start-setup-page';
@@ -107,6 +110,9 @@
       const WRONG_PASSWORD = 'wrongPassword';
 
       setup(() => {
+        browserProxy = new TestMultideviceSetupBrowserProxy();
+        multidevice_setup.BrowserProxyImpl.instance_ = browserProxy;
+
         multiDeviceSetupElement = document.createElement('multidevice-setup');
         multiDeviceSetupElement.delegate = new FakeDelegate();
         fakeMojoService = new FakeMojoService();
diff --git a/chrome/test/data/webui/multidevice_setup/setup_succeeded_page_test.js b/chrome/test/data/webui/multidevice_setup/setup_succeeded_page_test.js
index 6d795741..0223896 100644
--- a/chrome/test/data/webui/multidevice_setup/setup_succeeded_page_test.js
+++ b/chrome/test/data/webui/multidevice_setup/setup_succeeded_page_test.js
@@ -12,13 +12,19 @@
  */
 class TestMultideviceSetupBrowserProxy extends TestBrowserProxy {
   constructor() {
-    super(['openMultiDeviceSettings']);
+    super(['getProfileInfo', 'openMultiDeviceSettings']);
   }
 
   /** @override */
   openMultiDeviceSettings() {
     this.methodCalled('openMultiDeviceSettings');
   }
+
+  /** @override */
+  getProfileInfo() {
+    this.methodCalled('getProfileInfo');
+    return Promise.resolve({});
+  }
 }
 
 cr.define('multidevice_setup', () => {
diff --git a/chrome/test/data/webui/settings/controlled_button_tests.js b/chrome/test/data/webui/settings/controlled_button_tests.js
index 1948397..33db8d9e 100644
--- a/chrome/test/data/webui/settings/controlled_button_tests.js
+++ b/chrome/test/data/webui/settings/controlled_button_tests.js
@@ -58,4 +58,25 @@
     assertFalse(controlledButton.$$('paper-button').disabled);
     assertFalse(!!controlledButton.$$('cr-policy-pref-indicator'));
   });
+
+  test('null pref', function() {
+    controlledButton.pref = extensionControlledPref;
+    Polymer.dom.flush();
+    assertTrue(controlledButton.$$('paper-button').disabled);
+    assertTrue(!!controlledButton.$$('cr-policy-pref-indicator'));
+
+    controlledButton.pref = null;
+    Polymer.dom.flush();
+    assertFalse(controlledButton.$$('paper-button').disabled);
+    assertFalse(!!controlledButton.$$('cr-policy-pref-indicator'));
+  });
+
+  test('action-button', function() {
+    assertNotEquals("action-button",
+        controlledButton.$$('paper-button').className);
+    controlledButton.actionButton = true;
+    Polymer.dom.flush();
+    assertEquals("action-button",
+        controlledButton.$$('paper-button').className);
+  });
 });
diff --git a/chrome/test/data/webui/settings/internet_detail_page_tests.js b/chrome/test/data/webui/settings/internet_detail_page_tests.js
index 6ccbe6c2..56a1af8 100644
--- a/chrome/test/data/webui/settings/internet_detail_page_tests.js
+++ b/chrome/test/data/webui/settings/internet_detail_page_tests.js
@@ -9,6 +9,24 @@
   /** @type {NetworkingPrivate} */
   let api_;
 
+  /** @type {Object} */
+  let prefs_ = {
+    'vpn_config_allowed': {
+      key: 'vpn_config_allowed',
+      type: chrome.settingsPrivate.PrefType.BOOLEAN,
+      value: true,
+    },
+    // Added use_shared_proxies because triggering a change in prefs_ without
+    // it will fail a "Pref is missing" assertion in the network-proxy-section
+    'settings': {
+      'use_shared_proxies': {
+        key: 'use_shared_proxies',
+        type: chrome.settingsPrivate.PrefType.BOOLEAN,
+        value: true,
+      },
+    },
+  };
+
   suiteSetup(function() {
     loadTimeData.overrideValues({
       internetAddConnection: 'internetAddConnection',
@@ -65,6 +83,15 @@
     return allowShared;
   }
 
+  function getDisconnectButton() {
+    const titleDiv = internetDetailPage.$$('#titleDiv');
+    assertTrue(!!titleDiv);
+    const button =
+        titleDiv.querySelector('controlled-button[label="Disconnect"]');
+    assertTrue(!!button);
+    return button;
+  }
+
   setup(function() {
     PolymerTest.clearBody();
     internetDetailPage =
@@ -179,5 +206,39 @@
         assertFalse(allowShared.disabled);
       });
     });
+
+    test('VPN config allowed', function() {
+      api_.enableNetworkType('VPN');
+      setNetworksForTest([{
+        GUID: 'vpn_guid',
+        Name: 'vpn_user',
+        Type: 'VPN',
+      }]);
+      internetDetailPage.init('vpn_guid', 'VPN', 'vpn_user');
+      prefs_.vpn_config_allowed.value = true;
+      internetDetailPage.prefs = prefs_;
+      return flushAsync().then(() => {
+        const disconnectButton = getDisconnectButton();
+        assertFalse(disconnectButton.hasAttribute('enforced_'));
+        assertFalse(!!disconnectButton.$$('cr-policy-pref-indicator'));
+      });
+    });
+
+    test('VPN config disallowed', function() {
+      api_.enableNetworkType('VPN');
+      setNetworksForTest([{
+        GUID: 'vpn_guid',
+        Name: 'vpn_user',
+        Type: 'VPN',
+      }]);
+      internetDetailPage.init('vpn_guid', 'VPN', 'vpn_user');
+      prefs_.vpn_config_allowed.value = false;
+      internetDetailPage.prefs = prefs_;
+      return flushAsync().then(() => {
+        const disconnectButton = getDisconnectButton();
+        assertTrue(disconnectButton.hasAttribute('enforced_'));
+        assertTrue(!!disconnectButton.$$('cr-policy-pref-indicator'));
+      });
+    });
   });
 });
diff --git a/chromeos/settings/system_settings_provider.cc b/chromeos/settings/system_settings_provider.cc
index 3c402940..9d1631c 100644
--- a/chromeos/settings/system_settings_provider.cc
+++ b/chromeos/settings/system_settings_provider.cc
@@ -51,7 +51,13 @@
 
 void SystemSettingsProvider::DoSet(const std::string& path,
                                    const base::Value& in_value) {
+  // TODO(olsen): crbug.com/433840 - separate read path and write path.
+  // The write path which goes through CrosSettings and SystemSettingsProvider,
+  // should more simply go straight through TimezoneUtil.
+
   // Guest, public, or child accounts cannot change the time zone.
+  // TODO(olsen): This logic is duplicated in TimezoneUtil::CanSetSystemTimezone
+  // and can be removed once the write path goes through there.
   if (!LoginState::Get()->IsUserLoggedIn() ||
       LoginState::Get()->IsGuestSessionUser() ||
       LoginState::Get()->IsPublicSessionUser() ||
diff --git a/components/autofill/ios/form_util/form_activity_tab_helper_unittest.mm b/components/autofill/ios/form_util/form_activity_tab_helper_unittest.mm
index e81b9f8..1b4a6ee7 100644
--- a/components/autofill/ios/form_util/form_activity_tab_helper_unittest.mm
+++ b/components/autofill/ios/form_util/form_activity_tab_helper_unittest.mm
@@ -25,7 +25,7 @@
   }
 };
 
-// Test fixture for autofill::FormActivityTabHelper class.
+// Tests fixture for autofill::FormActivityTabHelper class.
 class FormActivityTabHelperTest
     : public web::WebJsTest<web::WebTestWithWebState> {
  public:
@@ -53,7 +53,7 @@
   std::unique_ptr<autofill::TestFormActivityObserver> observer_;
 };
 
-// Test that observer is called on form submission.
+// Tests that observer is called on form submission using submit control.
 TEST_F(FormActivityTabHelperTest, TestObserverDocumentSubmitted) {
   LoadHtmlAndInject(
       @"<form name='form-name'>"
@@ -84,7 +84,38 @@
             observer_->submit_document_info()->form_in_main_frame);
 }
 
-// Test that observer is called on form activity (input event).
+// Tests that observer is called on form submission using submit() method.
+TEST_F(FormActivityTabHelperTest, TestFormSubmittedHook) {
+  LoadHtmlAndInject(
+      @"<form name='form-name' id='form'>"
+       "<input type='submit'/>"
+       "</form>");
+  ASSERT_FALSE(observer_->submit_document_info());
+  const std::string kTestFormName("form-name");
+  const std::string kTestFormData(
+      "[{\"name\":\"form-name\",\"origin\":\"https://chromium.test/"
+      "\",\"action\":\"https://chromium.test/\"}]");
+  bool has_user_gesture = false;
+  bool form_in_main_frame = true;
+  EXPECT_TRUE(base::test::ios::WaitUntilConditionOrTimeout(
+      base::test::ios::kWaitForJSCompletionTimeout, ^bool {
+        return web::GetMainWebFrame(web_state()) != nullptr;
+      }));
+  web::WebFrame* main_frame = web::GetMainWebFrame(web_state());
+
+  ExecuteJavaScript(@"document.getElementById('form').submit();");
+  ASSERT_TRUE(observer_->submit_document_info());
+  EXPECT_EQ(web_state(), observer_->submit_document_info()->web_state);
+  EXPECT_EQ(main_frame, observer_->submit_document_info()->sender_frame);
+  EXPECT_EQ(kTestFormName, observer_->submit_document_info()->form_name);
+  EXPECT_EQ(kTestFormData, observer_->submit_document_info()->form_data);
+  EXPECT_EQ(has_user_gesture,
+            observer_->submit_document_info()->has_user_gesture);
+  EXPECT_EQ(form_in_main_frame,
+            observer_->submit_document_info()->form_in_main_frame);
+}
+
+// Tests that observer is called on form activity (input event).
 TEST_F(FormActivityTabHelperTest, TestObserverFormActivityFrameMessaging) {
   LoadHtmlAndInject(
       @"<form name='form-name'>"
diff --git a/components/autofill/ios/form_util/resources/form_handlers.js b/components/autofill/ios/form_util/resources/form_handlers.js
index f1aee25..8963d6b 100644
--- a/components/autofill/ios/form_util/resources/form_handlers.js
+++ b/components/autofill/ios/form_util/resources/form_handlers.js
@@ -25,44 +25,50 @@
 /**
  * The MutationObserver tracking form related changes.
  */
-__gCrWeb.formHandlers.formMutationObserver = null;
+var formMutationObserver_ = null;
 
 /**
  * The form mutation message scheduled to be sent to browser.
  */
-__gCrWeb.formHandlers.formMutationMessageToSend = null;
+var formMutationMessageToSend_ = null;
 
 /**
  * A message scheduled to be sent to host on the next runloop.
  */
-__gCrWeb.formHandlers.messageToSend = null;
+var messageToSend_ = null;
 
 /**
  * The last HTML element that had focus.
  */
-__gCrWeb.formHandlers.lastFocusedElement = null;
+var lastFocusedElement_ = null;
 
+/**
+ * The original implementation of HTMLFormElement.submit that will be called by
+ * the hook.
+ * @private
+ */
+var formSubmitOriginalFunction_ = null;
 
 /**
  * Schedule |mesg| to be sent on next runloop.
  * If called multiple times on the same runloop, only the last message is really
  * sent.
  */
-var sendMessageOnNextLoop_ = function(mesg) {
-  if (!__gCrWeb.formHandlers.messageToSend) {
+function sendMessageOnNextLoop_(mesg) {
+  if (!messageToSend_) {
     setTimeout(function() {
-      __gCrWeb.message.invokeOnHost(__gCrWeb.formHandlers.messageToSend);
-      __gCrWeb.formHandlers.messageToSend = null;
+      __gCrWeb.message.invokeOnHost(messageToSend_);
+      messageToSend_ = null;
     }, 0);
   }
-  __gCrWeb.formHandlers.messageToSend = mesg;
+  messageToSend_ = mesg;
 }
 
 /** @private
  * @param {string} originalURL A string containing a URL (absolute, relative...)
  * @return {string} A string containing a full URL (absolute with scheme)
  */
-var getFullyQualifiedUrl_ = function(originalURL) {
+function getFullyQualifiedUrl_(originalURL) {
   // A dummy anchor (never added to the document) is used to obtain the
   // fully-qualified URL of |originalURL|.
   var anchor = document.createElement('a');
@@ -86,18 +92,18 @@
  * is much easier to manage than adding handlers to individual elements.
  * @private
  */
-var formActivity_ = function(evt) {
+function formActivity_(evt) {
   var target = evt.target;
   var value = target.value || '';
   var fieldType = target.type || '';
   if (evt.type != 'blur') {
-    __gCrWeb.formHandlers.lastFocusedElement = document.activeElement;
+    lastFocusedElement_ = document.activeElement;
   }
   if (['change', 'input'].includes(evt.type) &&
       __gCrWeb.form.wasEditedByUser !== null) {
     __gCrWeb.form.wasEditedByUser.set(target, evt.isTrusted);
   }
-  if (target != __gCrWeb.formHandlers.lastFocusedElement) return;
+  if (target != lastFocusedElement_) return;
   var msg = {
     'command': 'form.activity',
     'formName': __gCrWeb.form.getFormIdentifier(evt.target.form),
@@ -114,36 +120,38 @@
 /**
  * Capture form submit actions.
  */
-var submitHandler_ = function(evt) {
-  var action;
+function submitHandler_(evt) {
   if (evt['defaultPrevented']) return;
-  // Default action is to re-submit to same page.
-  action = evt.target.getAttribute('action') || document.location.href;
+  formSubmitted_(evt.target);
+}
 
+// Send the form data to the browser.
+function formSubmitted_(form) {
+  // Default action is to re-submit to same page.
+  var action = form.getAttribute('action') || document.location.href;
   __gCrWeb.message.invokeOnHost({
     'command': 'form.submit',
-    'formName': __gCrWeb.form.getFormIdentifier(evt.target),
+    'formName': __gCrWeb.form.getFormIdentifier(form),
     'href': getFullyQualifiedUrl_(action),
-    'formData':__gCrWeb.fill.autofillSubmissionData(evt.target)
+    'formData': __gCrWeb.fill.autofillSubmissionData(form)
   });
-};
+}
 
 /**
  * Schedules |msg| to be sent after |delay|. Until |msg| is sent, further calls
  * to this function are ignored.
  */
-var sendFormMutationMessageAfterDelay_ = function(msg, delay) {
-  if (__gCrWeb.formHandlers.formMutationMessageToSend) return;
+function sendFormMutationMessageAfterDelay_(msg, delay) {
+  if (formMutationMessageToSend_) return;
 
-  __gCrWeb.formHandlers.formMutationMessageToSend = msg;
+  formMutationMessageToSend_ = msg;
   setTimeout(function() {
-    __gCrWeb.message.invokeOnHost(
-        __gCrWeb.formHandlers.formMutationMessageToSend);
-    __gCrWeb.formHandlers.formMutationMessageToSend = null;
+    __gCrWeb.message.invokeOnHost(formMutationMessageToSend_);
+    formMutationMessageToSend_ = null;
   }, delay);
 };
 
-var attachListeners_ = function() {
+function attachListeners_() {
   /**
    * Focus events performed on the 'capture' phase otherwise they are often
    * not received.
@@ -161,6 +169,23 @@
    */
   document.addEventListener('keyup', formActivity_, false);
   document.addEventListener('submit', submitHandler_, false);
+
+  // Per specification, SubmitEvent is not triggered when calling form.submit().
+  // Hook the method to call the handler in that case.
+  if (formSubmitOriginalFunction_ === null) {
+    formSubmitOriginalFunction_ = HTMLFormElement.prototype.submit;
+    HTMLFormElement.prototype.submit = function() {
+      // If an error happens in formSubmitted_, this will cancel the form
+      // submission which can lead to usability issue for the user.
+      // Put the formSubmitted_ in a try catch to ensure the original function
+      // is always called.
+      try {
+        formSubmitted_(this);
+      } catch (e) {
+      }
+      formSubmitOriginalFunction_.call(this);
+    }
+  }
 };
 
 // Attach the listeners immediately to try to catch early actions of the user.
@@ -178,47 +203,45 @@
  * @suppress {checkTypes} Required for for...of loop on mutations.
  */
 __gCrWeb.formHandlers['trackFormMutations'] = function(delay) {
-  if (__gCrWeb.formHandlers.formMutationObserver) {
-    __gCrWeb.formHandlers.formMutationObserver.disconnect();
-    __gCrWeb.formHandlers.formMutationObserver = null;
+  if (formMutationObserver_) {
+    formMutationObserver_.disconnect();
+    formMutationObserver_ = null;
   }
 
   if (!delay) return;
 
-  __gCrWeb.formHandlers.formMutationObserver =
-      new MutationObserver(function(mutations) {
-        for (var i = 0; i < mutations.length; i++) {
-          var mutation = mutations[i];
-          // Only process mutations to the tree of nodes.
-          if (mutation.type != 'childList') continue;
-          var addedElements = [];
-          for (var j = 0; j < mutation.addedNodes.length; j++) {
-            var node = mutation.addedNodes[j];
-            // Ignore non-element nodes.
-            if (node.nodeType != Node.ELEMENT_NODE) continue;
-            addedElements.push(node);
-            [].push.apply(
-                addedElements, [].slice.call(node.getElementsByTagName('*')));
-          }
-          var form_changed = addedElements.find(function(element) {
-            return element.tagName.match(/(FORM|INPUT|SELECT|OPTION)/);
-          });
-          if (form_changed) {
-            var msg = {
-              'command': 'form.activity',
-              'formName': '',
-              'fieldIdentifier': '',
-              'fieldType': '',
-              'type': 'form_changed',
-              'value': '',
-              'hasUserGesture': false
-            };
-            return sendFormMutationMessageAfterDelay_(msg, delay);
-          }
-        }
+  formMutationObserver_ = new MutationObserver(function(mutations) {
+    for (var i = 0; i < mutations.length; i++) {
+      var mutation = mutations[i];
+      // Only process mutations to the tree of nodes.
+      if (mutation.type != 'childList') continue;
+      var addedElements = [];
+      for (var j = 0; j < mutation.addedNodes.length; j++) {
+        var node = mutation.addedNodes[j];
+        // Ignore non-element nodes.
+        if (node.nodeType != Node.ELEMENT_NODE) continue;
+        addedElements.push(node);
+        [].push.apply(
+            addedElements, [].slice.call(node.getElementsByTagName('*')));
+      }
+      var form_changed = addedElements.find(function(element) {
+        return element.tagName.match(/(FORM|INPUT|SELECT|OPTION)/);
       });
-  __gCrWeb.formHandlers.formMutationObserver.observe(
-      document, {childList: true, subtree: true});
+      if (form_changed) {
+        var msg = {
+          'command': 'form.activity',
+          'formName': '',
+          'fieldIdentifier': '',
+          'fieldType': '',
+          'type': 'form_changed',
+          'value': '',
+          'hasUserGesture': false
+        };
+        return sendFormMutationMessageAfterDelay_(msg, delay);
+      }
+    }
+  });
+  formMutationObserver_.observe(document, {childList: true, subtree: true});
 };
 
 /**
diff --git a/components/language/OWNERS b/components/language/OWNERS
index 77a0ab0..8e8f75c 100644
--- a/components/language/OWNERS
+++ b/components/language/OWNERS
@@ -3,6 +3,7 @@
 jiameng@chromium.org
 renjieliu@chromium.org
 martis@chromium.org
+anthonyvd@chromium.org
 
 # TEAM: language@chromium.org
 # COMPONENT: UI>Browser>Language
diff --git a/components/password_manager/core/browser/form_parsing/form_parser.cc b/components/password_manager/core/browser/form_parsing/form_parser.cc
index 899f7b69..a30b697 100644
--- a/components/password_manager/core/browser/form_parsing/form_parser.cc
+++ b/components/password_manager/core/browser/form_parsing/form_parser.cc
@@ -567,11 +567,13 @@
 // ProcessedField instances, or an empty vector if there was not a single
 // password field. Also, computes the vector of all password values and
 // associated element names in |all_possible_passwords|, and similarly for
-// usernames and |all_possible_usernames|.
+// usernames and |all_possible_usernames|. If |mode| is |kSaving|, fields with
+// empty values are ignored.
 std::vector<ProcessedField> ProcessFields(
     const std::vector<FormFieldData>& fields,
     autofill::ValueElementVector* all_possible_passwords,
-    autofill::ValueElementVector* all_possible_usernames) {
+    autofill::ValueElementVector* all_possible_usernames,
+    FormDataParser::Mode mode) {
   DCHECK(all_possible_passwords);
   DCHECK(all_possible_passwords->empty());
 
@@ -586,9 +588,12 @@
   // Similarly for usernames.
   std::set<base::StringPiece16> seen_username_values;
 
+  const bool consider_only_non_empty = mode == FormDataParser::Mode::kSaving;
   for (const FormFieldData& field : fields) {
     if (!field.IsTextInputElement())
       continue;
+    if (consider_only_non_empty && field.value.empty())
+      continue;
 
     const bool is_password = field.form_control_type == "password";
     if (!field.value.empty()) {
@@ -717,7 +722,7 @@
   autofill::ValueElementVector all_possible_passwords;
   autofill::ValueElementVector all_possible_usernames;
   std::vector<ProcessedField> processed_fields = ProcessFields(
-      form_data.fields, &all_possible_passwords, &all_possible_usernames);
+      form_data.fields, &all_possible_passwords, &all_possible_usernames, mode);
 
   if (processed_fields.empty())
     return nullptr;
diff --git a/components/password_manager/core/browser/form_parsing/form_parser_unittest.cc b/components/password_manager/core/browser/form_parsing/form_parser_unittest.cc
index 2b1c203..a4f7618 100644
--- a/components/password_manager/core/browser/form_parsing/form_parser_unittest.cc
+++ b/components/password_manager/core/browser/form_parsing/form_parser_unittest.cc
@@ -40,28 +40,25 @@
 constexpr char kNonimportantValue[] = "non-important unique";
 
 // Use this in FieldDataDescription below to mark the expected username and
-// password fields. The *_FILLING variants apply to
-// FormDataParser::Mode::kFilling only, the *_SAVING variants to
-// FormDataParser::Mode::kSaving only, the suffix-less variants to both.
+// password fields.
 enum class ElementRole {
   NONE,
-  USERNAME_FILLING,
-  USERNAME_SAVING,
   USERNAME,
-  CURRENT_PASSWORD_FILLING,
-  CURRENT_PASSWORD_SAVING,
   CURRENT_PASSWORD,
-  NEW_PASSWORD_FILLING,
-  NEW_PASSWORD_SAVING,
   NEW_PASSWORD,
-  CONFIRMATION_PASSWORD_FILLING,
-  CONFIRMATION_PASSWORD_SAVING,
   CONFIRMATION_PASSWORD
 };
 
 // Expected FormFieldData are constructed based on these descriptions.
 struct FieldDataDescription {
+  // The |role*| fields state the expected role of the field. The
+  // |role_filling| speaks specifically about parsing in
+  // FormDataParser::Mode::kFilling only, the |role_saving| about
+  // FormDataParser::Mode::kSaving. If set, |role| overrides both of the
+  // others.
   ElementRole role = ElementRole::NONE;
+  ElementRole role_filling = ElementRole::NONE;
+  ElementRole role_saving = ElementRole::NONE;
   bool is_focusable = true;
   bool is_enabled = true;
   bool is_readonly = false;
@@ -122,6 +119,30 @@
   }
 };
 
+// Updates |result| by putting |id| in the appropriate |result|'s field based
+// on |role|.
+void UpdateResultWithIdByRole(ParseResultIds* result,
+                              uint32_t id,
+                              ElementRole role) {
+  switch (role) {
+    case ElementRole::NONE:
+      // Nothing to update.
+      break;
+    case ElementRole::USERNAME:
+      result->username_id = id;
+      break;
+    case ElementRole::CURRENT_PASSWORD:
+      result->password_id = id;
+      break;
+    case ElementRole::NEW_PASSWORD:
+      result->new_password_id = id;
+      break;
+    case ElementRole::CONFIRMATION_PASSWORD:
+      result->confirmation_password_id = id;
+      break;
+  }
+}
+
 // Creates a FormData to be fed to the parser. Includes FormFieldData as
 // described in |fields_description|. Generates |fill_result| and |save_result|
 // expectations about the result in FILLING and SAVING mode, respectively. Also
@@ -157,49 +178,14 @@
     if (field_description.autocomplete_attribute)
       field.autocomplete_attribute = field_description.autocomplete_attribute;
     form_data.fields.push_back(field);
-    switch (field_description.role) {
-      case ElementRole::NONE:
-        break;
-      case ElementRole::USERNAME_FILLING:
-        fill_result->username_id = unique_id;
-        break;
-      case ElementRole::USERNAME_SAVING:
-        save_result->username_id = unique_id;
-        break;
-      case ElementRole::USERNAME:
-        fill_result->username_id = unique_id;
-        save_result->username_id = unique_id;
-        break;
-      case ElementRole::CURRENT_PASSWORD_FILLING:
-        fill_result->password_id = unique_id;
-        break;
-      case ElementRole::CURRENT_PASSWORD_SAVING:
-        save_result->password_id = unique_id;
-        break;
-      case ElementRole::CURRENT_PASSWORD:
-        fill_result->password_id = unique_id;
-        save_result->password_id = unique_id;
-        break;
-      case ElementRole::NEW_PASSWORD_FILLING:
-        fill_result->new_password_id = unique_id;
-        break;
-      case ElementRole::NEW_PASSWORD_SAVING:
-        save_result->new_password_id = unique_id;
-        break;
-      case ElementRole::NEW_PASSWORD:
-        fill_result->new_password_id = unique_id;
-        save_result->new_password_id = unique_id;
-        break;
-      case ElementRole::CONFIRMATION_PASSWORD_FILLING:
-        fill_result->confirmation_password_id = unique_id;
-        break;
-      case ElementRole::CONFIRMATION_PASSWORD_SAVING:
-        save_result->confirmation_password_id = unique_id;
-        break;
-      case ElementRole::CONFIRMATION_PASSWORD:
-        fill_result->confirmation_password_id = unique_id;
-        save_result->confirmation_password_id = unique_id;
-        break;
+    if (field_description.role == ElementRole::NONE) {
+      UpdateResultWithIdByRole(fill_result, unique_id,
+                               field_description.role_filling);
+      UpdateResultWithIdByRole(save_result, unique_id,
+                               field_description.role_saving);
+    } else {
+      UpdateResultWithIdByRole(fill_result, unique_id, field_description.role);
+      UpdateResultWithIdByRole(save_result, unique_id, field_description.role);
     }
     if (field_description.prediction.type != autofill::MAX_VALID_FIELD_TYPE) {
       (*predictions)[unique_id] = field_description.prediction;
@@ -263,11 +249,25 @@
     EXPECT_EQ(*element_value, field_it->value);
 }
 
+// Describes the |form_data| including field values and names. Use this in
+// SCOPED_TRACE if other logging messages might refer to the form.
+testing::Message DescribeFormData(const FormData& form_data) {
+  testing::Message result;
+  result << "Form contains " << form_data.fields.size() << " fields:\n";
+  for (const FormFieldData& field : form_data.fields) {
+    result << "type=" << field.form_control_type << ", name=" << field.name
+           << ", value=" << field.value
+           << ", unique id=" << field.unique_renderer_id << "\n";
+  }
+  return result;
+}
+
 // Check that the information distilled from |form_data| into |password_form| is
 // matching |expectations|.
 void CheckPasswordFormFields(const PasswordForm& password_form,
                              const FormData& form_data,
                              const ParseResultIds& expectations) {
+  SCOPED_TRACE(DescribeFormData(form_data));
   CheckField(form_data.fields, expectations.username_id,
              password_form.username_element, &password_form.username_value,
              "username");
@@ -584,10 +584,10 @@
           // Forms with empty fields cannot be saved, so the parsing result for
           // saving is empty.
           {
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text",
                .value = ""},
-              {.role = ElementRole::CURRENT_PASSWORD_FILLING,
+              {.role_filling = ElementRole::CURRENT_PASSWORD,
                .form_control_type = "password",
                .value = ""},
           },
@@ -609,10 +609,10 @@
           "Empty sign-in form with an extra text field",
           {
               {.form_control_type = "text", .value = ""},
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text",
                .value = ""},
-              {.role = ElementRole::CURRENT_PASSWORD_FILLING,
+              {.role_filling = ElementRole::CURRENT_PASSWORD,
                .form_control_type = "password",
                .value = ""},
           },
@@ -620,9 +620,9 @@
       {
           "Non-empty sign-in form with an extra text field",
           {
-              {.role = ElementRole::USERNAME_SAVING,
+              {.role_saving = ElementRole::USERNAME,
                .form_control_type = "text"},
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text",
                .value = ""},
               {.role = ElementRole::CURRENT_PASSWORD,
@@ -632,11 +632,11 @@
       {
           "Empty sign-in form with an extra invisible text field",
           {
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text",
                .value = ""},
               {.form_control_type = "text", .is_focusable = false, .value = ""},
-              {.role = ElementRole::CURRENT_PASSWORD_FILLING,
+              {.role_filling = ElementRole::CURRENT_PASSWORD,
                .form_control_type = "password",
                .value = ""},
           },
@@ -655,7 +655,7 @@
           // Filled forms with a username field which is left empty are
           // suspicious. The parser will just omit the username altogether.
           {
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text",
                .value = ""},
               {.role = ElementRole::CURRENT_PASSWORD,
@@ -666,9 +666,9 @@
           "Simple empty sign-in form with empty password",
           // Empty password, nothing to save.
           {
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text"},
-              {.role = ElementRole::CURRENT_PASSWORD_FILLING,
+              {.role_filling = ElementRole::CURRENT_PASSWORD,
                .form_control_type = "password",
                .value = ""},
           },
@@ -1163,10 +1163,10 @@
           .fields =
               {
                   {.form_control_type = "password", .value = ""},
-                  {.role = ElementRole::USERNAME,
+                  {.role_filling = ElementRole::USERNAME,
                    .form_control_type = "text",
                    .autocomplete_attribute = "username"},
-                  {.role = ElementRole::CURRENT_PASSWORD,
+                  {.role_filling = ElementRole::CURRENT_PASSWORD,
                    .form_control_type = "password",
                    .autocomplete_attribute = "current-password",
                    .value = ""},
@@ -1178,6 +1178,26 @@
           .number_of_all_possible_passwords = 0,
       },
       {
+          .description_for_logging = "Empty values don't get added to "
+                                     "all_possible_passwords even if form gets "
+                                     "parsed",
+          .fields =
+              {
+                  {.form_control_type = "password", .value = ""},
+                  {.role = ElementRole::USERNAME,
+                   .form_control_type = "text",
+                   .autocomplete_attribute = "username"},
+                  {.role = ElementRole::CURRENT_PASSWORD,
+                   .form_control_type = "password",
+                   .autocomplete_attribute = "current-password"},
+                  {.form_control_type = "text"},
+                  {.form_control_type = "text"},
+                  {.form_control_type = "password", .value = ""},
+                  {.form_control_type = "password", .value = ""},
+              },
+          .number_of_all_possible_passwords = 1,
+      },
+      {
           .description_for_logging =
               "A particular type of a squashed form (sign-in + sign-up)",
           .fields =
@@ -1229,11 +1249,11 @@
           "Username prediction does not override structure if empty and mode "
           "is SAVING",
           {
-              {.role = ElementRole::USERNAME_FILLING,
+              {.role_filling = ElementRole::USERNAME,
                .form_control_type = "text",
                .predicted_username = 2,
                .value = ""},
-              {.role = ElementRole::USERNAME_SAVING,
+              {.role_saving = ElementRole::USERNAME,
                .form_control_type = "text"},
               {.role = ElementRole::CURRENT_PASSWORD,
                .form_control_type = "password"},
@@ -1417,6 +1437,62 @@
   });
 }
 
+// Check that empty values are ignored when parsing for saving.
+TEST(FormParserTest, NoEmptyValues) {
+  CheckTestData({
+      {
+          "Server hints overridden for non-empty values.",
+          {
+              {.role_filling = ElementRole::USERNAME,
+               .form_control_type = "text",
+               .prediction = {.type = autofill::USERNAME},
+               .value = ""},
+              {.role_saving = ElementRole::USERNAME,
+               .form_control_type = "text"},
+              {.role_saving = ElementRole::CURRENT_PASSWORD,
+               .form_control_type = "password"},
+              {.role_filling = ElementRole::NEW_PASSWORD,
+               .form_control_type = "password",
+               .prediction = {.type = autofill::ACCOUNT_CREATION_PASSWORD},
+               .value = ""},
+          },
+      },
+      {
+          "Autocomplete attributes overridden for non-empty values.",
+          {
+              {.role_filling = ElementRole::USERNAME,
+               .form_control_type = "text",
+               .autocomplete_attribute = "username",
+               .value = ""},
+              {.role_saving = ElementRole::USERNAME,
+               .form_control_type = "text"},
+              {.role_filling = ElementRole::CURRENT_PASSWORD,
+               .form_control_type = "password",
+               .autocomplete_attribute = "current-password",
+               .value = ""},
+              {.role = ElementRole::NEW_PASSWORD,
+               .form_control_type = "password",
+               .autocomplete_attribute = "new-password"},
+          },
+      },
+      {
+          "Structure heuristics overridden for non-empty values.",
+          {
+              {.role_saving = ElementRole::USERNAME,
+               .form_control_type = "text"},
+              {.role_filling = ElementRole::USERNAME,
+               .form_control_type = "text",
+               .value = ""},
+              {.role = ElementRole::CURRENT_PASSWORD,
+               .form_control_type = "password"},
+              {.role_filling = ElementRole::NEW_PASSWORD,
+               .form_control_type = "password",
+               .value = ""},
+          },
+      },
+  });
+}
+
 TEST(FormParserTest, HistogramsForUsernameDetectionMethod) {
   struct HistogramTestCase {
     FormParsingTestCase parsing_data;
diff --git a/components/password_manager/core/browser/new_password_form_manager.cc b/components/password_manager/core/browser/new_password_form_manager.cc
index ee9c5f6..705ba585 100644
--- a/components/password_manager/core/browser/new_password_form_manager.cc
+++ b/components/password_manager/core/browser/new_password_form_manager.cc
@@ -40,12 +40,13 @@
     TimeDelta::FromMilliseconds(500);
 
 ValueElementPair PasswordToSave(const PasswordForm& form) {
-  if (form.new_password_element.empty() || form.new_password_value.empty())
+  if (form.new_password_value.empty()) {
+    DCHECK(!form.password_value.empty());
     return {form.password_value, form.password_element};
+  }
   return {form.new_password_value, form.new_password_element};
 }
 
-
 // Copies field properties masks from the form |from| to the form |to|.
 void CopyFieldPropertiesMasks(const FormData& from, FormData* to) {
   // Skip copying if the number of fields is different.
diff --git a/components/password_manager/core/browser/new_password_form_manager_unittest.cc b/components/password_manager/core/browser/new_password_form_manager_unittest.cc
index 1a0b7a11..917be51 100644
--- a/components/password_manager/core/browser/new_password_form_manager_unittest.cc
+++ b/components/password_manager/core/browser/new_password_form_manager_unittest.cc
@@ -576,6 +576,27 @@
   CheckPendingCredentials(expected, form_manager_->GetPendingCredentials());
 }
 
+// Tests creating pending credentials when the password field has an empty name.
+TEST_F(NewPasswordFormManagerTest, CreatePendingCredentialsEmptyName) {
+  TestMockTimeTaskRunner::ScopedContext scoped_context(task_runner_.get());
+  fetcher_->SetNonFederated({}, 0u);
+
+  FormData anonymous_signup = observed_form_;
+  // There is an anonymous password field.
+  anonymous_signup.fields[2].name.clear();
+  anonymous_signup.fields[2].value = ASCIIToUTF16("a password");
+  // Mark the password field as new-password.
+  FormStructure form_structure(observed_form_);
+  form_structure.field(2)->set_server_type(autofill::ACCOUNT_CREATION_PASSWORD);
+  std::vector<FormStructure*> predictions{&form_structure};
+  form_manager_->ProcessServerPredictions(predictions);
+
+  EXPECT_TRUE(
+      form_manager_->SetSubmittedFormIfIsManaged(anonymous_signup, &driver_));
+  EXPECT_EQ(ASCIIToUTF16("a password"),
+            form_manager_->GetPendingCredentials().password_value);
+}
+
 // Tests that there is no crash even when the observed form is a not password
 // form and the submitted form is password form.
 TEST_F(NewPasswordFormManagerTest, NoCrashOnNonPasswordForm) {
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto
index b8cdde0..6812cd8 100644
--- a/components/policy/proto/device_management_backend.proto
+++ b/components/policy/proto/device_management_backend.proto
@@ -121,6 +121,8 @@
     // mandatory, but it failed and we are doing a fallback to manual
     // enrollment.
     FLAVOR_ENROLLMENT_ATTESTATION_MANUAL_FALLBACK = 11;
+    // Enrollment triggered by USB pre-configuration
+    FLAVOR_ENROLLMENT_ATTESTATION_USB_ENROLLMENT = 12;
   };
 
   // Indicates the registration flavor. This is passed to the server FYI when
diff --git a/components/policy/resources/policy_templates.json b/components/policy/resources/policy_templates.json
index 6218d39..fa92999 100644
--- a/components/policy/resources/policy_templates.json
+++ b/components/policy/resources/policy_templates.json
@@ -13357,7 +13357,7 @@
       'tags': ['admin-sharing'],
       'features': {
         'dynamic_refresh': True,
-        'per_profile': False,
+        'per_profile': True,
       },
       'supported_on': ['chrome.*:70-'],
       'caption': '''Report OS and <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Version Information''',
@@ -13377,7 +13377,7 @@
       'tags': ['admin-sharing'],
       'features': {
         'dynamic_refresh': True,
-        'per_profile': False,
+        'per_profile': True,
       },
       'supported_on': ['chrome.*:70-'],
       'caption': '''Report <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> Policy Information''',
@@ -13397,7 +13397,7 @@
       'tags': ['admin-sharing'],
       'features': {
         'dynamic_refresh': True,
-        'per_profile': False,
+        'per_profile': True,
       },
       'supported_on': ['chrome.*:70-'],
       'caption': '''Report Machine Identification information''',
@@ -13417,7 +13417,7 @@
       'tags': ['admin-sharing'],
       'features': {
         'dynamic_refresh': True,
-        'per_profile': False,
+        'per_profile': True,
       },
       'supported_on': ['chrome.*:70-'],
       'caption': '''Report User Identification information''',
diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc
index 93b00189..c22cdfb 100644
--- a/components/signin/core/browser/gaia_cookie_manager_service.cc
+++ b/components/signin/core/browser/gaia_cookie_manager_service.cc
@@ -847,11 +847,10 @@
     const OAuthMultiloginResult& result) {
   DCHECK(requests_.front().request_type() ==
          GaiaCookieRequestType::SET_ACCOUNTS);
-
+  RecordMultiloginFinished(result.error());
   if (result.error().state() == GoogleServiceAuthError::NONE) {
     VLOG(1) << "Multilogin successful accounts="
             << base::JoinString(requests_.front().account_ids(), " ");
-    RecordMultiloginFinished(GoogleServiceAuthError::AuthErrorNone());
     std::vector<std::string> account_ids = requests_.front().account_ids();
     access_tokens_.clear();
     fetcher_backoff_.InformOfRequest(true);
@@ -871,7 +870,6 @@
                        base::Unretained(this))));
     return;
   }
-  RecordMultiloginFinished(result.error());
   // If Gaia responded with status: "INVALID_TOKENS", we have to mark tokens as
   // invalid.
   if (result.error().state() ==
diff --git a/components/subresource_filter/core/common/indexed_ruleset.cc b/components/subresource_filter/core/common/indexed_ruleset.cc
index 5321788..af89f6e 100644
--- a/components/subresource_filter/core/common/indexed_ruleset.cc
+++ b/components/subresource_filter/core/common/indexed_ruleset.cc
@@ -52,7 +52,7 @@
 
 // RulesetIndexer --------------------------------------------------------------
 
-const int RulesetIndexer::kIndexedFormatVersion = 23;
+const int RulesetIndexer::kIndexedFormatVersion = 25;
 
 // This static assert is meant to catch cases where
 // url_pattern_index::kUrlPatternIndexFormatVersion is incremented without
@@ -67,7 +67,8 @@
 RulesetIndexer::~RulesetIndexer() = default;
 
 bool RulesetIndexer::AddUrlRule(const proto::UrlRule& rule) {
-  const auto offset = url_pattern_index::SerializeUrlRule(rule, &builder_);
+  const auto offset =
+      url_pattern_index::SerializeUrlRule(rule, &builder_, &domain_map_);
   // Note: A zero offset.o means a "nullptr" offset. It is returned when the
   // rule has not been serialized.
   if (!offset.o)
diff --git a/components/subresource_filter/core/common/indexed_ruleset.h b/components/subresource_filter/core/common/indexed_ruleset.h
index a6f3d40..20f706a 100644
--- a/components/subresource_filter/core/common/indexed_ruleset.h
+++ b/components/subresource_filter/core/common/indexed_ruleset.h
@@ -85,6 +85,10 @@
   url_pattern_index::UrlPatternIndexBuilder whitelist_;
   url_pattern_index::UrlPatternIndexBuilder deactivation_;
 
+  // Maintains a map of domain vectors to their existing offsets, to avoid
+  // storing a particular vector more than once.
+  url_pattern_index::FlatDomainMap domain_map_;
+
   DISALLOW_COPY_AND_ASSIGN(RulesetIndexer);
 };
 
diff --git a/components/sync/engine_impl/model_type_worker.cc b/components/sync/engine_impl/model_type_worker.cc
index 60ecd55c..57f7d6a 100644
--- a/components/sync/engine_impl/model_type_worker.cc
+++ b/components/sync/engine_impl/model_type_worker.cc
@@ -359,7 +359,9 @@
 void ModelTypeWorker::ApplyUpdates(StatusController* status) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   // This should only ever be called after one PassiveApplyUpdates.
-  DCHECK(model_type_state_.initial_sync_done());
+  DCHECK(model_type_state_.initial_sync_done())
+      << "ApplyUpdates() called without initial sync being done for "
+      << ModelTypeToString(type_);
   // Download cycle is done, pass all updates to the processor.
   ApplyPendingUpdates();
 }
@@ -367,7 +369,9 @@
 void ModelTypeWorker::PassiveApplyUpdates(StatusController* status) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
   // This should only be called at the end of the very first download cycle.
-  DCHECK(!model_type_state_.initial_sync_done());
+  DCHECK(!model_type_state_.initial_sync_done())
+      << "PassiveApplyUpdates() called after initial sync has been done for "
+      << ModelTypeToString(type_);
   // Indicate to the processor that the initial download is done. The initial
   // sync technically isn't done yet but by the time this value is persisted to
   // disk on the model thread it will be.
diff --git a/components/translate/OWNERS b/components/translate/OWNERS
index b481dc685..8a1cf230 100644
--- a/components/translate/OWNERS
+++ b/components/translate/OWNERS
@@ -5,6 +5,7 @@
 #                                        hajimehoshi@chromium.org
 #   CSP and isolated worlds: toyoshim@chromium.org
 andrewhayden@chromium.org
+anthonyvd@chromium.org
 droger@chromium.org
 groby@chromium.org
 hajimehoshi@chromium.org
diff --git a/components/url_pattern_index/url_pattern_index.cc b/components/url_pattern_index/url_pattern_index.cc
index fa89d73b..273d421 100644
--- a/components/url_pattern_index/url_pattern_index.cc
+++ b/components/url_pattern_index/url_pattern_index.cc
@@ -27,9 +27,6 @@
 
 namespace {
 
-using FlatStringOffset = flatbuffers::Offset<flatbuffers::String>;
-using FlatDomains = flatbuffers::Vector<FlatStringOffset>;
-using FlatDomainsOffset = flatbuffers::Offset<FlatDomains>;
 using FlatUrlRuleList = flatbuffers::Vector<flatbuffers::Offset<flat::UrlRule>>;
 
 using ActivationTypeMap =
@@ -135,8 +132,12 @@
   // the offset to the serialized rule. Returns an empty offset in case the rule
   // can't be converted. The conversion is not possible if the rule has
   // attributes not supported by this client version.
-  UrlRuleOffset SerializeConvertedRule(
-      flatbuffers::FlatBufferBuilder* builder) const {
+  //
+  // |domain_map| Should point to a non-nullptr map of domain vectors to their
+  // existing offsets. It is used to de-dupe domain vectors in the serialized
+  // rules.
+  UrlRuleOffset SerializeConvertedRule(flatbuffers::FlatBufferBuilder* builder,
+                                       FlatDomainMap* domain_map) const {
     if (!is_convertible_)
       return UrlRuleOffset();
 
@@ -145,7 +146,6 @@
     FlatDomainsOffset domains_included_offset;
     FlatDomainsOffset domains_excluded_offset;
     if (rule_.domains_size()) {
-      // TODO(pkalinnikov): Consider sharing the vectors between rules.
       std::vector<FlatStringOffset> domains_included;
       std::vector<FlatStringOffset> domains_excluded;
       // Reserve only for |domains_included| because it is expected to be the
@@ -171,9 +171,10 @@
           domains_included.push_back(offset);
       }
       // The domains are stored in sorted order to support fast matching.
-      domains_included_offset = SerializeDomainList(std::move(domains_included), builder);
+      domains_included_offset =
+          SerializeDomainList(std::move(domains_included), builder, domain_map);
       domains_excluded_offset =
-          SerializeDomainList(std::move(domains_excluded), builder);
+          SerializeDomainList(std::move(domains_excluded), builder, domain_map);
     }
 
     // Non-ascii characters in patterns are unsupported.
@@ -182,7 +183,7 @@
 
     // TODO(crbug.com/884063): Lower case case-insensitive patterns here if we
     // want to support case-insensitive rules for subresource filter.
-    auto url_pattern_offset = builder->CreateString(rule_.url_pattern());
+    auto url_pattern_offset = builder->CreateSharedString(rule_.url_pattern());
 
     return flat::CreateUrlRule(
         *builder, options_, element_types_, activation_types_,
@@ -191,9 +192,9 @@
   }
 
  private:
-  FlatDomainsOffset SerializeDomainList(
-      std::vector<FlatStringOffset> domains,
-      flatbuffers::FlatBufferBuilder* builder) const {
+  FlatDomainsOffset SerializeDomainList(std::vector<FlatStringOffset> domains,
+                                        flatbuffers::FlatBufferBuilder* builder,
+                                        FlatDomainMap* domain_map) const {
     // The comparator ensuring the domains order necessary for fast matching.
     auto precedes = [&builder](FlatStringOffset lhs, FlatStringOffset rhs) {
       return CompareDomains(
@@ -204,7 +205,17 @@
     if (domains.empty())
       return FlatDomainsOffset();
     std::sort(domains.begin(), domains.end(), precedes);
-    return builder->CreateVector(domains);
+
+    // Share domain lists if we've already serialized an exact duplicate. Note
+    // that this can share excluded and included domain lists.
+    DCHECK(domain_map);
+    auto it = domain_map->find(domains);
+    if (it == domain_map->end()) {
+      auto offset = builder->CreateVector(domains);
+      (*domain_map)[domains] = offset;
+      return offset;
+    }
+    return it->second;
   }
 
   static bool ConvertAnchorType(proto::AnchorType anchor_type,
@@ -352,11 +363,26 @@
 
 // Helpers. --------------------------------------------------------------------
 
+bool OffsetVectorCompare::operator()(
+    const std::vector<FlatStringOffset>& a,
+    const std::vector<FlatStringOffset>& b) const {
+  auto compare = [](const FlatStringOffset a_offset,
+                    const FlatStringOffset b_offset) {
+    DCHECK(!a_offset.IsNull());
+    DCHECK(!b_offset.IsNull());
+    return a_offset.o < b_offset.o;
+  };
+  // |lexicographical_compare| is how vector::operator< is implemented.
+  return std::lexicographical_compare(a.begin(), a.end(), b.begin(), b.end(),
+                                      compare);
+}
+
 UrlRuleOffset SerializeUrlRule(const proto::UrlRule& rule,
-                               flatbuffers::FlatBufferBuilder* builder) {
+                               flatbuffers::FlatBufferBuilder* builder,
+                               FlatDomainMap* domain_map) {
   DCHECK(builder);
   UrlRuleFlatBufferConverter converter(rule);
-  return converter.SerializeConvertedRule(builder);
+  return converter.SerializeConvertedRule(builder, domain_map);
 }
 
 int CompareDomains(base::StringPiece lhs_domain, base::StringPiece rhs_domain) {
diff --git a/components/url_pattern_index/url_pattern_index.h b/components/url_pattern_index/url_pattern_index.h
index bfe8786..ec1dc95 100644
--- a/components/url_pattern_index/url_pattern_index.h
+++ b/components/url_pattern_index/url_pattern_index.h
@@ -8,6 +8,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include <map>
 #include <vector>
 
 #include "base/macros.h"
@@ -37,6 +38,17 @@
 using UrlRuleOffset = flatbuffers::Offset<flat::UrlRule>;
 using UrlPatternIndexOffset = flatbuffers::Offset<flat::UrlPatternIndex>;
 
+using FlatStringOffset = flatbuffers::Offset<flatbuffers::String>;
+using FlatDomains = flatbuffers::Vector<FlatStringOffset>;
+using FlatDomainsOffset = flatbuffers::Offset<FlatDomains>;
+
+struct OffsetVectorCompare {
+  bool operator()(const std::vector<FlatStringOffset>& a,
+                  const std::vector<FlatStringOffset>& b) const;
+};
+using FlatDomainMap = std::
+    map<std::vector<FlatStringOffset>, FlatDomainsOffset, OffsetVectorCompare>;
+
 constexpr size_t kNGramSize = 5;
 static_assert(kNGramSize <= sizeof(NGram), "NGram type is too narrow.");
 
@@ -51,8 +63,13 @@
 // Serializes the |rule| to the FlatBuffer |builder|, and returns an offset to
 // it in the resulting buffer. Returns null offset iff the |rule| could not be
 // serialized because of unsupported options or it is otherwise invalid.
+//
+// |domain_map| Should point to a non-nullptr map of domain vectors to their
+// existing offsets. It is used to de-dupe domain vectors in the serialized
+// rules.
 UrlRuleOffset SerializeUrlRule(const proto::UrlRule& rule,
-                               flatbuffers::FlatBufferBuilder* builder);
+                               flatbuffers::FlatBufferBuilder* builder,
+                               FlatDomainMap* domain_map);
 
 // Performs three-way comparison between two domains. In the total order defined
 // by this predicate, the lengths of domains will be monotonically decreasing.
diff --git a/components/url_pattern_index/url_pattern_index_unittest.cc b/components/url_pattern_index/url_pattern_index_unittest.cc
index 994fd27d..7d96261 100644
--- a/components/url_pattern_index/url_pattern_index_unittest.cc
+++ b/components/url_pattern_index/url_pattern_index_unittest.cc
@@ -30,7 +30,7 @@
 
  protected:
   bool AddUrlRule(const proto::UrlRule& rule) {
-    auto offset = SerializeUrlRule(rule, flat_builder_.get());
+    auto offset = SerializeUrlRule(rule, flat_builder_.get(), &domain_map_);
     if (offset.o)
       index_builder_->IndexUrlRule(offset);
     return !!offset.o;
@@ -98,6 +98,7 @@
     index_builder_.reset();
     flat_builder_.reset(new flatbuffers::FlatBufferBuilder());
     index_builder_.reset(new UrlPatternIndexBuilder(flat_builder_.get()));
+    domain_map_.clear();
   }
 
  private:
@@ -105,6 +106,8 @@
   std::unique_ptr<UrlPatternIndexBuilder> index_builder_;
   std::unique_ptr<UrlPatternIndexMatcher> index_matcher_;
 
+  FlatDomainMap domain_map_;
+
   DISALLOW_COPY_AND_ASSIGN(UrlPatternIndexTest);
 };
 
diff --git a/components/url_pattern_index/url_rule_util_unittest.cc b/components/url_pattern_index/url_rule_util_unittest.cc
index 312e63d..b06fad8 100644
--- a/components/url_pattern_index/url_rule_util_unittest.cc
+++ b/components/url_pattern_index/url_rule_util_unittest.cc
@@ -54,7 +54,8 @@
   UrlRuleUtilTest() = default;
 
   const flat::UrlRule* MakeFlatRule(const proto::UrlRule& rule) {
-    auto offset = url_pattern_index::SerializeUrlRule(rule, &flat_builder_);
+    auto offset =
+        url_pattern_index::SerializeUrlRule(rule, &flat_builder_, &domain_map_);
     return flatbuffers::GetTemporaryPointer(flat_builder_, offset);
   }
 
@@ -72,6 +73,8 @@
 
   flatbuffers::FlatBufferBuilder flat_builder_;
 
+  FlatDomainMap domain_map_;
+
  private:
   DISALLOW_COPY_AND_ASSIGN(UrlRuleUtilTest);
 };
diff --git a/components/viz/common/quads/draw_quad_unittest.cc b/components/viz/common/quads/draw_quad_unittest.cc
index 82b9c82..cae3f216 100644
--- a/components/viz/common/quads/draw_quad_unittest.cc
+++ b/components/viz/common/quads/draw_quad_unittest.cc
@@ -151,19 +151,19 @@
   { QUAD_DATA quad_new->SetNew(shared_state, quad_rect, __VA_ARGS__); } \
   SETUP_AND_COPY_QUAD_NEW(Type, quad_new);
 
-#define CREATE_QUAD_ALL_RP(Type, a, b, c, d, e, f, g, h, copy_a)           \
+#define CREATE_QUAD_ALL_RP(Type, a, b, c, d, e, f, g, h, i, copy_a)        \
   Type* quad_all = render_pass->CreateAndAppendDrawQuad<Type>();           \
   {                                                                        \
     QUAD_DATA quad_all->SetAll(shared_state, quad_rect, quad_visible_rect, \
-                               needs_blending, a, b, c, d, e, f, g, h);    \
+                               needs_blending, a, b, c, d, e, f, g, h, i); \
   }                                                                        \
   SETUP_AND_COPY_QUAD_ALL_RP(Type, quad_all, copy_a);
 
-#define CREATE_QUAD_NEW_RP(Type, a, b, c, d, e, f, g, h, i, copy_a)          \
+#define CREATE_QUAD_NEW_RP(Type, a, b, c, d, e, f, g, h, i, j, copy_a)       \
   Type* quad_new = render_pass->CreateAndAppendDrawQuad<Type>();             \
   {                                                                          \
     QUAD_DATA quad_new->SetNew(shared_state, quad_rect, a, b, c, d, e, f, g, \
-                               h, i);                                        \
+                               h, i, j);                                     \
   }                                                                          \
   SETUP_AND_COPY_QUAD_NEW_RP(Type, quad_new, copy_a);
 
@@ -195,6 +195,7 @@
   gfx::PointF filters_origin;
   gfx::RectF tex_coord_rect(1, 1, 255, 254);
   bool force_anti_aliasing_off = false;
+  float backdrop_filter_quality = 1.0f;
 
   RenderPassId copied_render_pass_id = 235;
   CREATE_SHARED_STATE();
@@ -202,7 +203,8 @@
   CREATE_QUAD_NEW_RP(RenderPassDrawQuad, visible_rect, render_pass_id,
                      mask_resource_id, mask_uv_rect, mask_texture_size,
                      filters_scale, filters_origin, tex_coord_rect,
-                     force_anti_aliasing_off, copied_render_pass_id);
+                     force_anti_aliasing_off, backdrop_filter_quality,
+                     copied_render_pass_id);
   EXPECT_EQ(DrawQuad::RENDER_PASS, copy_quad->material);
   EXPECT_EQ(visible_rect, copy_quad->visible_rect);
   EXPECT_EQ(copied_render_pass_id, copy_quad->render_pass_id);
@@ -217,7 +219,7 @@
   CREATE_QUAD_ALL_RP(RenderPassDrawQuad, render_pass_id, mask_resource_id,
                      mask_uv_rect, mask_texture_size, filters_scale,
                      filters_origin, tex_coord_rect, force_anti_aliasing_off,
-                     copied_render_pass_id);
+                     backdrop_filter_quality, copied_render_pass_id);
   EXPECT_EQ(DrawQuad::RENDER_PASS, copy_quad->material);
   EXPECT_EQ(copied_render_pass_id, copy_quad->render_pass_id);
   EXPECT_EQ(mask_resource_id, copy_quad->mask_resource_id());
@@ -521,6 +523,7 @@
   gfx::PointF filters_origin(0.f, 0.f);
   gfx::RectF tex_coord_rect(1.f, 1.f, 33.f, 19.f);
   bool force_anti_aliasing_off = false;
+  float backdrop_filter_quality = 1.0f;
 
   int copied_render_pass_id = 235;
 
@@ -528,7 +531,8 @@
   CREATE_QUAD_NEW_RP(RenderPassDrawQuad, visible_rect, render_pass_id,
                      mask_resource_id, mask_uv_rect, mask_texture_size,
                      filters_scale, filters_origin, tex_coord_rect,
-                     force_anti_aliasing_off, copied_render_pass_id);
+                     force_anti_aliasing_off, backdrop_filter_quality,
+                     copied_render_pass_id);
   EXPECT_EQ(mask_resource_id, quad_new->mask_resource_id());
   EXPECT_EQ(1, IterateAndCount(quad_new));
   EXPECT_EQ(mask_resource_id + 1, quad_new->mask_resource_id());
@@ -538,7 +542,7 @@
   quad_new->SetNew(shared_state, quad_rect, visible_rect, render_pass_id,
                    new_mask_resource_id, mask_uv_rect, mask_texture_size,
                    filters_scale, filters_origin, tex_coord_rect,
-                   force_anti_aliasing_off);
+                   force_anti_aliasing_off, backdrop_filter_quality);
   EXPECT_EQ(0, IterateAndCount(quad_new));
   EXPECT_EQ(0u, quad_new->mask_resource_id());
 }
diff --git a/components/viz/common/quads/render_pass_draw_quad.cc b/components/viz/common/quads/render_pass_draw_quad.cc
index 4bd6826..2eec14d 100644
--- a/components/viz/common/quads/render_pass_draw_quad.cc
+++ b/components/viz/common/quads/render_pass_draw_quad.cc
@@ -29,13 +29,15 @@
                                 const gfx::Vector2dF& filters_scale,
                                 const gfx::PointF& filters_origin,
                                 const gfx::RectF& tex_coord_rect,
-                                bool force_anti_aliasing_off) {
+                                bool force_anti_aliasing_off,
+                                float backdrop_filter_quality) {
   DCHECK(render_pass_id);
 
   bool needs_blending = true;
   SetAll(shared_quad_state, rect, visible_rect, needs_blending, render_pass_id,
          mask_resource_id, mask_uv_rect, mask_texture_size, filters_scale,
-         filters_origin, tex_coord_rect, force_anti_aliasing_off);
+         filters_origin, tex_coord_rect, force_anti_aliasing_off,
+         backdrop_filter_quality);
 }
 
 void RenderPassDrawQuad::SetAll(const SharedQuadState* shared_quad_state,
@@ -49,7 +51,8 @@
                                 const gfx::Vector2dF& filters_scale,
                                 const gfx::PointF& filters_origin,
                                 const gfx::RectF& tex_coord_rect,
-                                bool force_anti_aliasing_off) {
+                                bool force_anti_aliasing_off,
+                                float backdrop_filter_quality) {
   DCHECK(render_pass_id);
 
   DrawQuad::SetAll(shared_quad_state, DrawQuad::RENDER_PASS, rect, visible_rect,
@@ -63,6 +66,7 @@
   this->filters_origin = filters_origin;
   this->tex_coord_rect = tex_coord_rect;
   this->force_anti_aliasing_off = force_anti_aliasing_off;
+  this->backdrop_filter_quality = backdrop_filter_quality;
 }
 
 const RenderPassDrawQuad* RenderPassDrawQuad::MaterialCast(
@@ -80,6 +84,7 @@
   cc::MathUtil::AddToTracedValue("mask_uv_rect", mask_uv_rect, value);
   cc::MathUtil::AddToTracedValue("tex_coord_rect", tex_coord_rect, value);
   value->SetBoolean("force_anti_aliasing_off", force_anti_aliasing_off);
+  value->SetDouble("backdrop_filter_quality", backdrop_filter_quality);
 }
 
 }  // namespace viz
diff --git a/components/viz/common/quads/render_pass_draw_quad.h b/components/viz/common/quads/render_pass_draw_quad.h
index c4e3f6de..fe641f91 100644
--- a/components/viz/common/quads/render_pass_draw_quad.h
+++ b/components/viz/common/quads/render_pass_draw_quad.h
@@ -37,7 +37,8 @@
               const gfx::Vector2dF& filters_scale,
               const gfx::PointF& filters_origin,
               const gfx::RectF& tex_coord_rect,
-              bool force_anti_aliasing_off);
+              bool force_anti_aliasing_off,
+              float backdrop_filter_quality);
 
   void SetAll(const SharedQuadState* shared_quad_state,
               const gfx::Rect& rect,
@@ -50,7 +51,8 @@
               const gfx::Vector2dF& filters_scale,
               const gfx::PointF& filters_origin,
               const gfx::RectF& tex_coord_rect,
-              bool force_anti_aliasing_off);
+              bool force_anti_aliasing_off,
+              float backdrop_filter_quality);
 
   RenderPassId render_pass_id;
   gfx::RectF mask_uv_rect;
@@ -70,6 +72,8 @@
 
   bool force_anti_aliasing_off;
 
+  float backdrop_filter_quality;
+
   ResourceId mask_resource_id() const {
     return resources.ids[kMaskResourceIdIndex];
   }
diff --git a/components/viz/common/quads/render_pass_unittest.cc b/components/viz/common/quads/render_pass_unittest.cc
index a501452..34c7546 100644
--- a/components/viz/common/quads/render_pass_unittest.cc
+++ b/components/viz/common/quads/render_pass_unittest.cc
@@ -214,7 +214,7 @@
   pass_quad->SetNew(pass->shared_quad_state_list.back(), contrib_output_rect,
                     contrib_output_rect, contrib_id, 0, gfx::RectF(),
                     gfx::Size(), gfx::Vector2dF(), gfx::PointF(), gfx::RectF(),
-                    false);
+                    false, 1.0f);
 
   pass_list.push_back(std::move(pass));
   pass_list.push_back(std::move(contrib));
diff --git a/components/viz/common/surfaces/child_local_surface_id_allocator_unittest.cc b/components/viz/common/surfaces/child_local_surface_id_allocator_unittest.cc
index a9928bf6..03584c2 100644
--- a/components/viz/common/surfaces/child_local_surface_id_allocator_unittest.cc
+++ b/components/viz/common/surfaces/child_local_surface_id_allocator_unittest.cc
@@ -114,7 +114,8 @@
   ParentLocalSurfaceIdAllocator parent_allocator2;
   ChildLocalSurfaceIdAllocator child_allocator;
 
-  EXPECT_TRUE(parent_allocator.GenerateId().is_valid());
+  parent_allocator.GenerateId();
+  EXPECT_TRUE(parent_allocator.GetCurrentLocalSurfaceId().is_valid());
   EXPECT_TRUE(child_allocator.UpdateFromParent(
       parent_allocator.GetCurrentLocalSurfaceId(),
       parent_allocator.allocation_time()));
diff --git a/components/viz/common/surfaces/parent_local_surface_id_allocator.cc b/components/viz/common/surfaces/parent_local_surface_id_allocator.cc
index 2cc69be..837d87e 100644
--- a/components/viz/common/surfaces/parent_local_surface_id_allocator.cc
+++ b/components/viz/common/surfaces/parent_local_surface_id_allocator.cc
@@ -54,7 +54,7 @@
   is_invalid_ = true;
 }
 
-const LocalSurfaceId& ParentLocalSurfaceIdAllocator::GenerateId() {
+void ParentLocalSurfaceIdAllocator::GenerateId() {
   if (!is_allocation_suppressed_) {
     ++current_local_surface_id_allocation_.local_surface_id_
           .parent_sequence_number_;
@@ -78,8 +78,6 @@
         current_local_surface_id_allocation_.local_surface_id_.ToString());
   }
   is_invalid_ = false;
-
-  return current_local_surface_id_allocation_.local_surface_id_;
 }
 
 const LocalSurfaceId& ParentLocalSurfaceIdAllocator::GetCurrentLocalSurfaceId()
diff --git a/components/viz/common/surfaces/parent_local_surface_id_allocator.h b/components/viz/common/surfaces/parent_local_surface_id_allocator.h
index f200717..27e6a76 100644
--- a/components/viz/common/surfaces/parent_local_surface_id_allocator.h
+++ b/components/viz/common/surfaces/parent_local_surface_id_allocator.h
@@ -45,7 +45,7 @@
   // provided from an external source.
   void Invalidate();
 
-  const LocalSurfaceId& GenerateId();
+  void GenerateId();
 
   const LocalSurfaceId& GetCurrentLocalSurfaceId() const;
 
diff --git a/components/viz/common/surfaces/parent_local_surface_id_allocator_unittest.cc b/components/viz/common/surfaces/parent_local_surface_id_allocator_unittest.cc
index 703e42e..883870b7 100644
--- a/components/viz/common/surfaces/parent_local_surface_id_allocator_unittest.cc
+++ b/components/viz/common/surfaces/parent_local_surface_id_allocator_unittest.cc
@@ -87,8 +87,9 @@
 TEST(ParentLocalSurfaceIdAllocatorTest,
      UpdateFromChildOnlyUpdatesExpectedLocalSurfaceIdComponents) {
   ParentLocalSurfaceIdAllocator child_updated_parent_allocator;
+  child_updated_parent_allocator.GenerateId();
   LocalSurfaceId preupdate_local_surface_id =
-      child_updated_parent_allocator.GenerateId();
+      child_updated_parent_allocator.GetCurrentLocalSurfaceId();
   LocalSurfaceId child_allocated_local_surface_id =
       GetFakeChildAllocatedLocalSurfaceId(child_updated_parent_allocator);
   EXPECT_EQ(preupdate_local_surface_id.parent_sequence_number(),
@@ -122,8 +123,9 @@
   LocalSurfaceId pregenerateid_local_surface_id =
       generating_parent_allocator.GetCurrentLocalSurfaceId();
 
+  generating_parent_allocator.GenerateId();
   const LocalSurfaceId& returned_local_surface_id =
-      generating_parent_allocator.GenerateId();
+      generating_parent_allocator.GetCurrentLocalSurfaceId();
 
   const LocalSurfaceId& postgenerateid_local_surface_id =
       generating_parent_allocator.GetCurrentLocalSurfaceId();
@@ -157,8 +159,9 @@
   EXPECT_EQ(new_local_surface_id,
             default_constructed_parent_allocator.GetCurrentLocalSurfaceId());
 
+  default_constructed_parent_allocator.GenerateId();
   LocalSurfaceId generated_id =
-      default_constructed_parent_allocator.GenerateId();
+      default_constructed_parent_allocator.GetCurrentLocalSurfaceId();
 
   EXPECT_EQ(generated_id.embed_token(), new_local_surface_id.embed_token());
   EXPECT_EQ(generated_id.child_sequence_number(),
diff --git a/components/viz/service/display/display_unittest.cc b/components/viz/service/display/display_unittest.cc
index d4e8ccf2..ae387014 100644
--- a/components/viz/service/display/display_unittest.cc
+++ b/components/viz/service/display/display_unittest.cc
@@ -230,7 +230,8 @@
 
   EXPECT_FALSE(scheduler_->damaged);
   EXPECT_FALSE(scheduler_->has_new_root_surface);
-  display_->SetLocalSurfaceId(id_allocator_.GenerateId(), 1.f);
+  id_allocator_.GenerateId();
+  display_->SetLocalSurfaceId(id_allocator_.GetCurrentLocalSurfaceId(), 1.f);
   EXPECT_FALSE(scheduler_->damaged);
   EXPECT_FALSE(scheduler_->display_resized_);
   EXPECT_TRUE(scheduler_->has_new_root_surface);
@@ -318,7 +319,8 @@
   // Pass is wrong size so shouldn't be swapped. However, damage should
   // result in latency info being stored for the next swap.
   {
-    display_->SetLocalSurfaceId(id_allocator_.GenerateId(), 1.f);
+    id_allocator_.GenerateId();
+    display_->SetLocalSurfaceId(id_allocator_.GetCurrentLocalSurfaceId(), 1.f);
 
     scheduler_->ResetDamageForTest();
 
@@ -348,7 +350,8 @@
     pass->damage_rect = gfx::Rect(10, 10, 0, 0);
     pass->id = 1u;
 
-    display_->SetLocalSurfaceId(id_allocator_.GenerateId(), 1.f);
+    id_allocator_.GenerateId();
+    display_->SetLocalSurfaceId(id_allocator_.GetCurrentLocalSurfaceId(), 1.f);
 
     pass_list.push_back(std::move(pass));
     scheduler_->ResetDamageForTest();
@@ -421,7 +424,8 @@
 
   // Resize should cause a swap if no frame was swapped at the previous size.
   {
-    display_->SetLocalSurfaceId(id_allocator_.GenerateId(), 1.f);
+    id_allocator_.GenerateId();
+    display_->SetLocalSurfaceId(id_allocator_.GetCurrentLocalSurfaceId(), 1.f);
     scheduler_->swapped = false;
     display_->Resize(gfx::Size(200, 200));
     EXPECT_FALSE(scheduler_->swapped);
@@ -452,7 +456,8 @@
 
   // Surface that's damaged completely should be resized and swapped.
   {
-    display_->SetLocalSurfaceId(id_allocator_.GenerateId(), 1.0f);
+    id_allocator_.GenerateId();
+    display_->SetLocalSurfaceId(id_allocator_.GetCurrentLocalSurfaceId(), 1.0f);
     pass = RenderPass::Create();
     pass->output_rect = gfx::Rect(0, 0, 99, 99);
     pass->damage_rect = gfx::Rect(0, 0, 99, 99);
@@ -489,7 +494,8 @@
   StubDisplayClient client;
   display_->Initialize(&client, manager_.surface_manager());
 
-  LocalSurfaceId local_surface_id(id_allocator_.GenerateId());
+  id_allocator_.GenerateId();
+  LocalSurfaceId local_surface_id(id_allocator_.GetCurrentLocalSurfaceId());
   display_->SetLocalSurfaceId(local_surface_id, 1.f);
 
   display_->Resize(gfx::Size(100, 100));
@@ -558,8 +564,10 @@
 };
 
 TEST_F(DisplayTest, Finish) {
-  LocalSurfaceId local_surface_id1(id_allocator_.GenerateId());
-  LocalSurfaceId local_surface_id2(id_allocator_.GenerateId());
+  id_allocator_.GenerateId();
+  LocalSurfaceId local_surface_id1(id_allocator_.GetCurrentLocalSurfaceId());
+  id_allocator_.GenerateId();
+  LocalSurfaceId local_surface_id2(id_allocator_.GetCurrentLocalSurfaceId());
 
   RendererSettings settings;
   settings.partial_swap_enabled = true;
@@ -658,7 +666,8 @@
 // There should not be a side-effect on other Displays.
 TEST_F(DisplayTest, CompositorFrameDamagesCorrectDisplay) {
   RendererSettings settings;
-  LocalSurfaceId local_surface_id(id_allocator_.GenerateId());
+  id_allocator_.GenerateId();
+  LocalSurfaceId local_surface_id(id_allocator_.GetCurrentLocalSurfaceId());
 
   // Set up first display.
   SetUpSoftwareDisplay(settings);
@@ -2522,7 +2531,8 @@
     quad->SetNew(shared_quad_state, rect1, rect1, SK_ColorBLACK, false);
     quad1->SetNew(shared_quad_state2, rect1, rect1, render_pass_id,
                   mask_resource_id, gfx::RectF(), gfx::Size(),
-                  gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                  gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false,
+                  1.0f);
     EXPECT_EQ(1u, frame.render_pass_list.front()->quad_list.size());
     EXPECT_EQ(1u, frame.render_pass_list.at(1)->quad_list.size());
     display_->RemoveOverdrawQuads(&frame);
@@ -2767,10 +2777,10 @@
                                SkBlendMode::kSrcOver, 0);
     R1->SetNew(shared_quad_state, rect1, rect1, render_pass_id,
                mask_resource_id, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
     R2->SetNew(shared_quad_state, rect2, rect2, render_pass_id,
                mask_resource_id, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
     D1->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false);
     D2->SetNew(shared_quad_state4, rect4, rect4, SK_ColorBLACK, false);
     EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size());
@@ -2815,10 +2825,10 @@
                                SkBlendMode::kSrcOver, 0);
     R1->SetNew(shared_quad_state, rect5, rect5, render_pass_id,
                mask_resource_id, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
     R2->SetNew(shared_quad_state, rect1, rect1, render_pass_id,
                mask_resource_id, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
     D1->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false);
     D2->SetNew(shared_quad_state4, rect6, rect6, SK_ColorBLACK, false);
     EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size());
@@ -2862,10 +2872,10 @@
                                SkBlendMode::kSrcOver, 0);
     R1->SetNew(shared_quad_state, rect5, rect5, render_pass_id,
                mask_resource_id, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
     R2->SetNew(shared_quad_state, rect1, rect1, render_pass_id,
                mask_resource_id, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
     D1->SetNew(shared_quad_state3, rect3, rect3, SK_ColorBLACK, false);
     D2->SetNew(shared_quad_state4, rect7, rect7, SK_ColorBLACK, false);
     EXPECT_EQ(4u, frame.render_pass_list.front()->quad_list.size());
@@ -3212,7 +3222,9 @@
 
 TEST_F(DisplayTest, CompositorFrameWithPresentationToken) {
   RendererSettings settings;
-  const LocalSurfaceId local_surface_id(id_allocator_.GenerateId());
+  id_allocator_.GenerateId();
+  const LocalSurfaceId local_surface_id(
+      id_allocator_.GetCurrentLocalSurfaceId());
 
   // Set up first display.
   SetUpSoftwareDisplay(settings);
diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
index 5720d33..0095043a 100644
--- a/components/viz/service/display/gl_renderer.cc
+++ b/components/viz/service/display/gl_renderer.cc
@@ -259,6 +259,9 @@
   // Filtered background texture.
   sk_sp<SkImage> background_image;
   GLuint background_image_id = 0;
+  // A multiplier for the temporary surface we create to apply the backdrop
+  // filter.
+  float backdrop_filter_quality = 1.0;
   // Whether the original background texture is needed for the mask.
   bool mask_for_background = false;
 };
@@ -805,7 +808,8 @@
     const cc::FilterOperations& backdrop_filters,
     uint32_t background_texture,
     const gfx::Rect& rect,
-    const gfx::Rect& unclipped_rect) {
+    const gfx::Rect& unclipped_rect,
+    const float backdrop_filter_quality) {
   DCHECK(ShouldApplyBackgroundFilters(quad, &backdrop_filters));
   auto use_gr_context = ScopedUseGrContext::Create(this);
 
@@ -834,9 +838,12 @@
     return nullptr;
   }
 
+  gfx::Rect quality_adjusted_rect =
+      ScaleToEnclosingRect(rect, backdrop_filter_quality);
+
   // Create surface to draw into.
-  SkImageInfo dst_info =
-      SkImageInfo::MakeN32Premul(rect.width(), rect.height());
+  SkImageInfo dst_info = SkImageInfo::MakeN32Premul(
+      quality_adjusted_rect.width(), quality_adjusted_rect.height());
   sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(
       use_gr_context->context(), SkBudgeted::kYes, dst_info);
   if (!surface) {
@@ -850,12 +857,17 @@
   // to disable subnormal floats for performance and security reasons.
   cc::ScopedSubnormalFloatDisabler disabler;
   SkMatrix local_matrix;
-  local_matrix.setScale(quad->filters_scale.x(), quad->filters_scale.y());
+  local_matrix.setScale(quad->filters_scale.x() * backdrop_filter_quality,
+                        quad->filters_scale.y() * backdrop_filter_quality);
 
   SkPaint paint;
   paint.setImageFilter(filter->makeWithLocalMatrix(local_matrix));
-  surface->getCanvas()->translate(-rect.x(), -rect.y());
-  surface->getCanvas()->drawImage(src_image, rect.x(), rect.y(), &paint);
+  surface->getCanvas()->translate(-quality_adjusted_rect.x(),
+                                  -quality_adjusted_rect.y());
+  surface->getCanvas()->drawImageRect(
+      src_image, SkRect::MakeWH(rect.width(), rect.height()),
+      RectToSkRect(quality_adjusted_rect), &paint);
+
   // Flush the drawing before source texture read lock goes out of scope.
   // Skia API does not guarantee that when the SkImage goes out of scope,
   // its externally referenced resources would force the rendering to be
@@ -883,6 +895,7 @@
   params.window_matrix = current_frame()->window_matrix;
   params.projection_matrix = current_frame()->projection_matrix;
   params.tex_coord_rect = quad->tex_coord_rect;
+  params.backdrop_filter_quality = quad->backdrop_filter_quality;
   if (bypass != render_pass_bypass_quads_.end()) {
     TileDrawQuad* tile_quad = &bypass->second;
     // The projection matrix used by GLRenderer has a flip.  As tile texture
@@ -1034,7 +1047,8 @@
         // pixels' coordinate space.
         params->background_image = ApplyBackgroundFilters(
             quad, *params->backdrop_filters, params->background_texture,
-            params->background_rect, unclipped_rect);
+            params->background_rect, unclipped_rect,
+            params->backdrop_filter_quality);
         if (params->background_image) {
           params->background_image_id =
               GetGLTextureIDFromSkImage(params->background_image.get());
@@ -1352,6 +1366,8 @@
     if (params->background_image_id) {
       gl_->ActiveTexture(GL_TEXTURE0 + last_texture_unit);
       gl_->BindTexture(GL_TEXTURE_2D, params->background_image_id);
+      if (params->backdrop_filter_quality != 1.0f)
+        gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
       gl_->ActiveTexture(GL_TEXTURE0);
     }
     // If |mask_for_background| then we have both |background_image_id| and
diff --git a/components/viz/service/display/gl_renderer.h b/components/viz/service/display/gl_renderer.h
index cd43cab..106de94 100644
--- a/components/viz/service/display/gl_renderer.h
+++ b/components/viz/service/display/gl_renderer.h
@@ -211,7 +211,8 @@
       const cc::FilterOperations& backdrop_filters,
       uint32_t background_texture,
       const gfx::Rect& rect,
-      const gfx::Rect& unclipped_rect);
+      const gfx::Rect& unclipped_rect,
+      const float backdrop_filter_quality);
 
   const TileDrawQuad* CanPassBeDrawnDirectly(const RenderPass* pass) override;
 
diff --git a/components/viz/service/display/overlay_unittest.cc b/components/viz/service/display/overlay_unittest.cc
index 90cf582a5b4..5a16c99 100644
--- a/components/viz/service/display/overlay_unittest.cc
+++ b/components/viz/service/display/overlay_unittest.cc
@@ -1351,7 +1351,7 @@
       pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
   quad->SetNew(pass->shared_quad_state_list.back(), kOverlayRect, kOverlayRect,
                render_pass_id, 0, gfx::RectF(), gfx::Size(),
-               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+               gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
 
   CreateFullscreenCandidateQuad(
       resource_provider_.get(), child_resource_provider_.get(),
@@ -2641,7 +2641,7 @@
   child_pass1_rpdq->SetNew(child_pass1_sqs, unit_rect, unit_rect,
                            child_pass1_id, 0, gfx::RectF(), gfx::Size(),
                            gfx::Vector2dF(), gfx::PointF(),
-                           gfx::RectF(0, 0, 1, 1), false);
+                           gfx::RectF(0, 0, 1, 1), false, 1.0f);
 
   SharedQuadState* child_pass2_sqs =
       root_pass->shared_quad_state_list.ElementAt(1);
@@ -2654,7 +2654,7 @@
   child_pass2_rpdq->SetNew(child_pass2_sqs, unit_rect, unit_rect,
                            child_pass2_id, 0, gfx::RectF(), gfx::Size(),
                            gfx::Vector2dF(), gfx::PointF(),
-                           gfx::RectF(0, 0, 1, 1), false);
+                           gfx::RectF(0, 0, 1, 1), false, 1.0f);
 
   root_pass->damage_rect = gfx::Rect();
 
@@ -3424,7 +3424,7 @@
 TEST_F(CALayerOverlayRPDQTest, RenderPassDrawQuadNoFilters) {
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
 
   EXPECT_EQ(1U, ca_layer_list_.size());
@@ -3445,7 +3445,7 @@
   render_pass_filters_[render_pass_id_] = &filters_;
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
 
   EXPECT_EQ(1U, ca_layer_list_.size());
@@ -3456,7 +3456,7 @@
   render_pass_filters_[render_pass_id_] = &filters_;
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 2), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 2), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
   EXPECT_EQ(1U, ca_layer_list_.size());
 }
@@ -3466,7 +3466,7 @@
   render_pass_filters_[render_pass_id_] = &filters_;
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 2), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 2), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
   EXPECT_EQ(1U, ca_layer_list_.size());
 }
@@ -3477,7 +3477,7 @@
   render_pass_filters_[render_pass_id_] = &filters_;
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 2), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 2), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
   EXPECT_EQ(1U, ca_layer_list_.size());
 }
@@ -3487,7 +3487,7 @@
   render_pass_backdrop_filters_[render_pass_id_] = &backdrop_filters_;
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
   EXPECT_EQ(0U, ca_layer_list_.size());
 }
@@ -3495,7 +3495,7 @@
 TEST_F(CALayerOverlayRPDQTest, RenderPassDrawQuadMask) {
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 2, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
   EXPECT_EQ(1U, ca_layer_list_.size());
 }
@@ -3505,7 +3505,7 @@
   render_pass_filters_[render_pass_id_] = &filters_;
   quad_->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                 kOverlayRect, render_pass_id_, 0, gfx::RectF(), gfx::Size(),
-                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false, 1.0f);
   ProcessForOverlays();
   EXPECT_EQ(0U, ca_layer_list_.size());
 }
@@ -3518,7 +3518,8 @@
     auto* quad = pass_->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
     quad->SetNew(pass_->shared_quad_state_list.back(), kOverlayRect,
                  kOverlayRect, render_pass_id_, 2, gfx::RectF(), gfx::Size(),
-                 gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false);
+                 gfx::Vector2dF(1, 1), gfx::PointF(), gfx::RectF(), false,
+                 1.0f);
   }
 
   ProcessForOverlays();
diff --git a/components/viz/service/display/renderer_pixeltest.cc b/components/viz/service/display/renderer_pixeltest.cc
index 22ff9e6e..f11650ad 100644
--- a/components/viz/service/display/renderer_pixeltest.cc
+++ b/components/viz/service/display/renderer_pixeltest.cc
@@ -179,7 +179,8 @@
                gfx::Vector2dF(),  // filters scale
                gfx::PointF(),     // filter origin
                gfx::RectF(rect),  // tex_coord_rect
-               false);            // force_anti_aliasing_off
+               false,             // force_anti_aliasing_off
+               1.0f);             // backdrop_filter_quality
 }
 
 void CreateTestTwoColoredTextureDrawQuad(
@@ -1964,7 +1965,7 @@
   render_pass_quad->SetNew(pass_shared_state, pass_rect, pass_rect,
                            child_pass_id, 0, gfx::RectF(), gfx::Size(),
                            gfx::Vector2dF(), gfx::PointF(),
-                           gfx::RectF(pass_rect), false);
+                           gfx::RectF(pass_rect), false, 1.0f);
 
   RenderPassList pass_list;
   pass_list.push_back(std::move(child_pass));
@@ -2024,7 +2025,7 @@
   render_pass_quad->SetNew(pass_shared_state, pass_rect, pass_rect,
                            child_pass_id, 0, gfx::RectF(), gfx::Size(),
                            gfx::Vector2dF(), gfx::PointF(),
-                           gfx::RectF(pass_rect), false);
+                           gfx::RectF(pass_rect), false, 1.0f);
 
   RenderPassList pass_list;
   pass_list.push_back(std::move(child_pass));
@@ -2085,7 +2086,7 @@
   render_pass_quad->SetNew(pass_shared_state, pass_rect, pass_rect,
                            child_pass_id, 0, gfx::RectF(), gfx::Size(),
                            gfx::Vector2dF(), gfx::PointF(),
-                           gfx::RectF(pass_rect), false);
+                           gfx::RectF(pass_rect), false, 1.0f);
 
   RenderPassList pass_list;
   pass_list.push_back(std::move(child_pass));
@@ -2167,7 +2168,7 @@
   render_pass_quad->SetNew(pass_shared_state, pass_rect, pass_rect,
                            child_pass_id, 0, gfx::RectF(), gfx::Size(),
                            gfx::Vector2dF(), gfx::PointF(),
-                           gfx::RectF(pass_rect), false);
+                           gfx::RectF(pass_rect), false, 1.0f);
 
   RenderPassList pass_list;
 
@@ -2360,7 +2361,8 @@
       gfx::Vector2dF(),                          // filters scale
       gfx::PointF(),                             // filter origin
       gfx::RectF(sub_rect),                      // tex_coord_rect
-      false);                                    // force_anti_aliasing_off
+      false,                                     // force_anti_aliasing_off
+      1.0f);                                     // backdrop_filter_quality
   // White background behind the masked render pass.
   auto* white = root_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
   white->SetNew(root_pass_shared_state, viewport_rect, viewport_rect,
@@ -2456,7 +2458,8 @@
       gfx::Vector2dF(),                          // filters scale
       gfx::PointF(),                             // filter origin
       gfx::RectF(sub_rect),                      // tex_coord_rect
-      false);                                    // force_anti_aliasing_off
+      false,                                     // force_anti_aliasing_off
+      1.0f);                                     // backdrop_filter_quality
   // White background behind the masked render pass.
   auto* white = root_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
   white->SetNew(root_pass_shared_state, viewport_rect, viewport_rect,
@@ -2516,7 +2519,8 @@
                                gfx::Vector2dF(1.0f, 1.0f),  // filters_scale
                                gfx::PointF(),               // filters_origin
                                gfx::RectF(),                // tex_coord_rect
-                               false);  // force_anti_aliasing_off
+                               false,  // force_anti_aliasing_off
+                               1.0f);  // backdrop_filter_quality
     }
 
     const int kColumnWidth = device_viewport_rect.width() / 3;
@@ -2856,6 +2860,7 @@
 
   bool needs_blending = false;
   bool force_anti_aliasing_off = true;
+  float backdrop_filter_quality = 1.0f;
   gfx::Transform hole_pass_to_target_transform;
   hole_pass_to_target_transform.Translate(50, 50);
   hole_pass_to_target_transform.Scale(0.5f + 1.0f / (rect.width() * 2.0f),
@@ -2867,7 +2872,7 @@
   pass_quad->SetAll(pass_shared_state, rect, rect, needs_blending,
                     child_pass_id, 0, gfx::RectF(), gfx::Size(),
                     gfx::Vector2dF(), gfx::PointF(), gfx::RectF(rect),
-                    force_anti_aliasing_off);
+                    force_anti_aliasing_off, backdrop_filter_quality);
 
   gfx::Transform green_quad_to_target_transform;
   SharedQuadState* green_shared_state = CreateTestSharedQuadState(
@@ -3035,7 +3040,7 @@
   child_pass_quad->SetNew(child_pass_shared_state, child_pass_rect,
                           child_pass_rect, child_pass_id, 0, gfx::RectF(),
                           gfx::Size(), gfx::Vector2dF(), gfx::PointF(),
-                          gfx::RectF(child_pass_rect), false);
+                          gfx::RectF(child_pass_rect), false, 1.0f);
 
   RenderPassList pass_list;
   pass_list.push_back(std::move(child_pass));
diff --git a/components/viz/service/display/surface_aggregator.cc b/components/viz/service/display/surface_aggregator.cc
index 4b770ef..a759fe59 100644
--- a/components/viz/service/display/surface_aggregator.cc
+++ b/components/viz/service/display/surface_aggregator.cc
@@ -425,7 +425,8 @@
     quad->SetNew(shared_quad_state, scaled_rect, scaled_visible_rect,
                  remapped_pass_id, 0, gfx::RectF(), gfx::Size(),
                  gfx::Vector2dF(), gfx::PointF(), gfx::RectF(scaled_rect),
-                 /*force_anti_aliasing_off=*/false);
+                 /*force_anti_aliasing_off=*/false,
+                 /* backdrop_filter_quality*/ 1.0f);
   }
 
   // Need to re-query since referenced_surfaces_ iterators are not stable.
@@ -534,7 +535,8 @@
   quad->SetNew(shared_quad_state, output_rect, output_rect,
                root_render_pass->id, 0, gfx::RectF(), gfx::Size(),
                gfx::Vector2dF(), gfx::PointF(), gfx::RectF(output_rect),
-               /*force_anti_aliasing_off=*/false);
+               /*force_anti_aliasing_off=*/false,
+               /*backdrop_filter_quality*/ 1.0f);
   dest_pass_list_->push_back(std::move(color_conversion_pass));
 }
 
diff --git a/components/viz/service/display/surface_aggregator_pixeltest.cc b/components/viz/service/display/surface_aggregator_pixeltest.cc
index 46aa050..4dc1dd7 100644
--- a/components/viz/service/display/surface_aggregator_pixeltest.cc
+++ b/components/viz/service/display/surface_aggregator_pixeltest.cc
@@ -96,7 +96,9 @@
   auto root_frame =
       CompositorFrameBuilder().AddRenderPass(std::move(pass)).Build();
 
-  SurfaceId root_surface_id(support_->frame_sink_id(), allocator_.GenerateId());
+  allocator_.GenerateId();
+  SurfaceId root_surface_id(support_->frame_sink_id(),
+                            allocator_.GetCurrentLocalSurfaceId());
   support_->SubmitCompositorFrame(allocator_.GetCurrentLocalSurfaceId(),
                                   std::move(root_frame));
 
@@ -120,10 +122,12 @@
       nullptr, &manager_, kArbitraryChildFrameSinkId, kIsChildRoot,
       kNeedsSyncPoints);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support->frame_sink_id(),
                              child_local_surface_id);
-  LocalSurfaceId root_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId root_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId root_surface_id(support_->frame_sink_id(), root_local_surface_id);
 
   {
@@ -204,12 +208,15 @@
   auto right_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryRightFrameSinkId, kIsChildRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId left_child_local_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId left_child_local_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId left_child_id(left_support->frame_sink_id(), left_child_local_id);
-  LocalSurfaceId right_child_local_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId right_child_local_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId right_child_id(right_support->frame_sink_id(),
                            right_child_local_id);
-  LocalSurfaceId root_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId root_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId root_surface_id(support_->frame_sink_id(), root_local_surface_id);
 
   {
diff --git a/components/viz/service/display/surface_aggregator_unittest.cc b/components/viz/service/display/surface_aggregator_unittest.cc
index 5b53cff..baeb6fdc 100644
--- a/components/viz/service/display/surface_aggregator_unittest.cc
+++ b/components/viz/service/display/surface_aggregator_unittest.cc
@@ -328,7 +328,7 @@
     auto* quad = pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>();
     quad->SetNew(shared_state, output_rect, output_rect, render_pass_id, 0,
                  gfx::RectF(), gfx::Size(), gfx::Vector2dF(), gfx::PointF(),
-                 gfx::RectF(), false);
+                 gfx::RectF(), false, 1.0f);
   }
 
  protected:
@@ -517,7 +517,9 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(embedded_support->frame_sink_id(),
                                 embedded_local_surface_id);
 
@@ -575,7 +577,9 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(embedded_support->frame_sink_id(),
                                 embedded_local_surface_id);
 
@@ -693,7 +697,9 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(embedded_support->frame_sink_id(),
                                 embedded_local_surface_id);
 
@@ -736,12 +742,15 @@
       nullptr, &manager_, kArbitraryFrameSinkId2, kChildIsRoot,
       kNeedsSyncPoints);
 
+  child_allocator_.GenerateId();
   LocalSurfaceId fallback_child_local_surface_id =
-      child_allocator_.GenerateId();
+      child_allocator_.GetCurrentLocalSurfaceId();
   SurfaceId fallback_child_surface_id(fallback_child_support->frame_sink_id(),
                                       fallback_child_local_surface_id);
 
-  LocalSurfaceId primary_child_local_surface_id = child_allocator_.GenerateId();
+  child_allocator_.GenerateId();
+  LocalSurfaceId primary_child_local_surface_id =
+      child_allocator_.GetCurrentLocalSurfaceId();
   SurfaceId primary_child_surface_id(primary_child_support->frame_sink_id(),
                                      primary_child_local_surface_id);
 
@@ -816,7 +825,8 @@
   testing::Mock::VerifyAndClearExpectations(&aggregated_damage_callback);
 
   // Submit the fallback again to create some damage then aggregate again.
-  fallback_child_local_surface_id = child_allocator_.GenerateId();
+  child_allocator_.GenerateId();
+  fallback_child_local_surface_id = child_allocator_.GetCurrentLocalSurfaceId();
 
   SubmitCompositorFrame(fallback_child_support.get(), fallback_child_passes,
 
@@ -887,7 +897,9 @@
   auto primary_child_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId primary_child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId primary_child_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId primary_child_surface_id(primary_child_support->frame_sink_id(),
                                      primary_child_local_surface_id);
 
@@ -955,7 +967,9 @@
   auto primary_child_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId primary_child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId primary_child_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId primary_child_surface_id(primary_child_support->frame_sink_id(),
                                      primary_child_local_surface_id);
 
@@ -1024,7 +1038,9 @@
   auto primary_child_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId primary_child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId primary_child_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId primary_child_surface_id(primary_child_support->frame_sink_id(),
                                      primary_child_local_surface_id);
 
@@ -1090,7 +1106,9 @@
   auto primary_child_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId primary_child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId primary_child_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId primary_child_surface_id(primary_child_support->frame_sink_id(),
                                      primary_child_local_surface_id);
   std::vector<Quad> primary_child_quads = {
@@ -1109,7 +1127,9 @@
   auto fallback_child_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId2, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId fallback_child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId fallback_child_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId fallback_child_surface_id(fallback_child_support->frame_sink_id(),
                                       fallback_child_local_surface_id);
 
@@ -1179,7 +1199,9 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(embedded_support->frame_sink_id(),
                                 embedded_local_surface_id);
 
@@ -1237,7 +1259,9 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId2, kChildIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(embedded_support->frame_sink_id(),
                                 embedded_local_surface_id);
 
@@ -1319,11 +1343,14 @@
   auto parent_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId2, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId embedded_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(embedded_support->frame_sink_id(),
                                 embedded_local_surface_id);
+  allocator_.GenerateId();
   SurfaceId nonexistent_surface_id(support_->frame_sink_id(),
-                                   allocator_.GenerateId());
+                                   allocator_.GetCurrentLocalSurfaceId());
 
   std::vector<Quad> embedded_quads = {
       Quad::SolidColorQuad(SK_ColorGREEN, gfx::Rect(5, 5))};
@@ -1337,7 +1364,9 @@
   embedded_support->RequestCopyOfOutput(embedded_local_surface_id,
                                         std::move(copy_request));
 
-  LocalSurfaceId parent_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId parent_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId parent_surface_id(parent_support->frame_sink_id(),
                               parent_local_surface_id);
 
@@ -1409,7 +1438,9 @@
 
 // This tests referencing a surface that has multiple render passes.
 TEST_F(SurfaceAggregatorValidSurfaceTest, MultiPassSurfaceReference) {
-  LocalSurfaceId embedded_local_surface_id = child_allocator_.GenerateId();
+  child_allocator_.GenerateId();
+  LocalSurfaceId embedded_local_surface_id =
+      child_allocator_.GetCurrentLocalSurfaceId();
   SurfaceId embedded_surface_id(child_support_->frame_sink_id(),
                                 embedded_local_surface_id);
 
@@ -1578,7 +1609,8 @@
 // Tests a reference to a valid surface with no submitted frame. A
 // SolidColorDrawQuad should be placed in lieu of a frame.
 TEST_F(SurfaceAggregatorValidSurfaceTest, ValidSurfaceReferenceWithNoFrame) {
-  LocalSurfaceId empty_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId empty_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId surface_with_no_frame_id(kArbitraryFrameSinkId1,
                                      empty_local_surface_id);
 
@@ -1606,7 +1638,9 @@
 // with no submitted frame. A SolidColorDrawQuad should be placed in lieu of a
 // frame.
 TEST_F(SurfaceAggregatorValidSurfaceTest, ValidFallbackWithNoFrame) {
-  const LocalSurfaceId empty_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  const LocalSurfaceId empty_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   const SurfaceId surface_with_no_frame_id(support_->frame_sink_id(),
                                            empty_local_surface_id);
 
@@ -1649,7 +1683,8 @@
 
 // Tests a more complex cycle with one intermediate surface.
 TEST_F(SurfaceAggregatorValidSurfaceTest, TwoSurfaceCyclicalReference) {
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
 
@@ -1693,7 +1728,8 @@
 // Tests that we map render pass IDs from different surfaces into a unified
 // namespace and update RenderPassDrawQuad's id references to match.
 TEST_F(SurfaceAggregatorValidSurfaceTest, RenderPassIdMapping) {
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
 
@@ -1825,7 +1861,9 @@
       nullptr, &manager_, kArbitraryFrameSinkId3, kChildIsRoot,
       kNeedsSyncPoints);
   int pass_id = 1;
-  LocalSurfaceId grandchild_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId grandchild_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId grandchild_surface_id(grandchild_support->frame_sink_id(),
                                   grandchild_local_surface_id);
 
@@ -1841,7 +1879,9 @@
   QueuePassAsFrame(std::move(grandchild_pass), grandchild_local_surface_id,
                    device_scale_factor, grandchild_support.get());
 
-  LocalSurfaceId child_one_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_one_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_one_surface_id(child_one_support->frame_sink_id(),
                                  child_one_local_surface_id);
 
@@ -1861,7 +1901,9 @@
   QueuePassAsFrame(std::move(child_one_pass), child_one_local_surface_id,
                    device_scale_factor, child_one_support.get());
 
-  LocalSurfaceId child_two_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_two_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_two_surface_id(child_two_support->frame_sink_id(),
                                  child_two_local_surface_id);
 
@@ -1941,7 +1983,8 @@
       nullptr, &manager_, kArbitraryMiddleFrameSinkId, kChildIsRoot,
       kNeedsSyncPoints);
   // Innermost child surface.
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   {
@@ -1975,7 +2018,9 @@
   }
 
   // Middle child surface.
-  LocalSurfaceId middle_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId middle_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId middle_surface_id(middle_support->frame_sink_id(),
                               middle_local_surface_id);
   {
@@ -2124,7 +2169,8 @@
   auto* child_root_pass_sqs = child_root_pass->shared_quad_state_list.front();
   child_root_pass_sqs->quad_to_target_transform.Translate(8, 0);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -2142,7 +2188,9 @@
   AddPasses(&parent_surface_frame.render_pass_list, parent_surface_passes,
             &parent_surface_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId parent_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId parent_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId parent_surface_id(parent_support->frame_sink_id(),
                               parent_local_surface_id);
   parent_support->SubmitCompositorFrame(parent_local_surface_id,
@@ -2308,7 +2356,8 @@
   auto* child_root_pass_sqs = child_root_pass->shared_quad_state_list.front();
   child_root_pass_sqs->quad_to_target_transform.Translate(8, 0);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -2326,7 +2375,9 @@
   AddPasses(&parent_surface_frame.render_pass_list, parent_surface_passes,
             &parent_surface_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId parent_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId parent_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId parent_surface_id(parent_support->frame_sink_id(),
                               parent_local_surface_id);
   parent_support->SubmitCompositorFrame(parent_local_surface_id,
@@ -2410,7 +2461,8 @@
   auto* child_root_pass_sqs = child_root_pass->shared_quad_state_list.front();
   child_root_pass_sqs->quad_to_target_transform.Translate(8, 0);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -2428,7 +2480,9 @@
   AddPasses(&parent_surface_frame.render_pass_list, parent_surface_passes,
             &parent_surface_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId parent_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId parent_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId parent_surface_id(parent_support->frame_sink_id(),
                               parent_local_surface_id);
   parent_support->SubmitCompositorFrame(parent_local_surface_id,
@@ -2523,7 +2577,9 @@
         gfx::Rect(SurfaceSize())));
   }
 
-  LocalSurfaceId second_root_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId second_root_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId second_root_surface_id(support_->frame_sink_id(),
                                    second_root_local_surface_id);
   {
@@ -2571,11 +2627,16 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId id1 = allocator_.GenerateId();
-  LocalSurfaceId id2 = allocator_.GenerateId();
-  LocalSurfaceId id3 = allocator_.GenerateId();
-  LocalSurfaceId id4 = allocator_.GenerateId();
-  LocalSurfaceId id5 = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId id1 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id2 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id3 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id4 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id5 = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId fallback_surface_id(kArbitraryFrameSinkId1, id2);
   SurfaceId primary_surface_id(kArbitraryFrameSinkId1, id4);
   std::vector<Quad> embedded_quads = {
@@ -2627,10 +2688,14 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId id1 = allocator_.GenerateId();
-  LocalSurfaceId id2 = allocator_.GenerateId();
-  LocalSurfaceId id3 = allocator_.GenerateId();
-  LocalSurfaceId id4 = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId id1 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id2 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id3 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id4 = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId fallback_surface_id(kArbitraryFrameSinkId1, id2);
   SurfaceId primary_surface_id(kArbitraryFrameSinkId2, id4);
   std::vector<Quad> embedded_quads = {
@@ -2681,9 +2746,12 @@
 // Verifies that when only a primary surface is provided any damage to primary
 // surface damages the display.
 TEST_F(SurfaceAggregatorValidSurfaceTest, SurfaceDamagePrimarySurfaceOnly) {
-  LocalSurfaceId id1 = allocator_.GenerateId();
-  LocalSurfaceId id2 = allocator_.GenerateId();
-  LocalSurfaceId id3 = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId id1 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id2 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id3 = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId primary_surface_id(kArbitraryFrameSinkId1, id2);
 
   CompositorFrame frame = MakeCompositorFrameFromSurfaceRanges(
@@ -2718,9 +2786,12 @@
   auto embedded_support = std::make_unique<CompositorFrameSinkSupport>(
       nullptr, &manager_, kArbitraryFrameSinkId1, kRootIsRoot,
       kNeedsSyncPoints);
-  LocalSurfaceId id1 = allocator_.GenerateId();
-  LocalSurfaceId id2 = allocator_.GenerateId();
-  LocalSurfaceId id3 = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId id1 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id2 = allocator_.GetCurrentLocalSurfaceId();
+  allocator_.GenerateId();
+  LocalSurfaceId id3 = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId surface_id(kArbitraryFrameSinkId1, id2);
 
   std::vector<Quad> embedded_quads = {
@@ -2765,7 +2836,8 @@
 
 // Tests that quads outside the damage rect are ignored.
 TEST_F(SurfaceAggregatorPartialSwapTest, IgnoreOutside) {
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   constexpr float device_scale_factor = 1.0f;
@@ -3550,7 +3622,8 @@
   AddPasses(&child_surface_frame.render_pass_list, child_surface_passes,
             &child_surface_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -3630,7 +3703,8 @@
   AddPasses(&child_surface_frame.render_pass_list, child_surface_passes,
             &child_surface_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -3666,7 +3740,9 @@
   std::vector<Quad> grand_child_quads = {Quad::RenderPassQuad(1)};
   std::vector<Pass> grand_child_passes = {
       Pass(grand_child_quads, 1, SurfaceSize())};
-  LocalSurfaceId grand_child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId grand_child_local_surface_id =
+      allocator_.GetCurrentLocalSurfaceId();
   SurfaceId grand_child_surface_id(grand_child_support->frame_sink_id(),
                                    grand_child_local_surface_id);
   {
@@ -3746,7 +3822,8 @@
   AddPasses(&child_frame.render_pass_list, child_passes,
             &child_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -3913,7 +3990,8 @@
   AddPasses(&child_frame.render_pass_list, child_passes,
             &child_frame.metadata.referenced_surfaces);
 
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   child_support_->SubmitCompositorFrame(child_local_surface_id,
@@ -4006,7 +4084,8 @@
 // Tests that quads outside the damage rect are not ignored for cached render
 // pass.
 TEST_F(SurfaceAggregatorPartialSwapTest, NotIgnoreOutsideForCachedRenderPass) {
-  LocalSurfaceId child_local_surface_id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  LocalSurfaceId child_local_surface_id = allocator_.GetCurrentLocalSurfaceId();
   SurfaceId child_surface_id(child_support_->frame_sink_id(),
                              child_local_surface_id);
   // The child surface has two quads, one with a visible rect of 15,15 6x6 and
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc b/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
index b32d8408c..c220188 100644
--- a/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
+++ b/components/viz/service/frame_sinks/frame_sink_manager_unittest.cc
@@ -420,8 +420,10 @@
 // next garbage collection.
 TEST_F(FrameSinkManagerTest, EvictSurfaces) {
   ParentLocalSurfaceIdAllocator allocator;
-  LocalSurfaceId local_surface_id1 = allocator.GenerateId();
-  LocalSurfaceId local_surface_id2 = allocator.GenerateId();
+  allocator.GenerateId();
+  LocalSurfaceId local_surface_id1 = allocator.GetCurrentLocalSurfaceId();
+  allocator.GenerateId();
+  LocalSurfaceId local_surface_id2 = allocator.GetCurrentLocalSurfaceId();
   SurfaceId surface_id1(kFrameSinkIdA, local_surface_id1);
   SurfaceId surface_id2(kFrameSinkIdB, local_surface_id2);
 
diff --git a/components/viz/service/frame_sinks/video_detector_unittest.cc b/components/viz/service/frame_sinks/video_detector_unittest.cc
index 72e36d9..eb19ea29 100644
--- a/components/viz/service/frame_sinks/video_detector_unittest.cc
+++ b/components/viz/service/frame_sinks/video_detector_unittest.cc
@@ -95,8 +95,9 @@
     detector_->AddObserver(std::move(video_detector_observer));
 
     root_frame_sink_ = CreateFrameSink();
+    parent_local_surface_id_allocator_.GenerateId();
     root_frame_sink_->SubmitCompositorFrame(
-        parent_local_surface_id_allocator_.GenerateId(),
+        parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId(),
         MakeDefaultCompositorFrame());
   }
 
@@ -145,9 +146,12 @@
   void SendUpdate(CompositorFrameSinkSupport* frame_sink,
                   const gfx::Rect& damage) {
     LocalSurfaceId local_surface_id =
-        frame_sink->last_activated_local_surface_id().is_valid()
-            ? frame_sink->last_activated_local_surface_id()
-            : parent_local_surface_id_allocator_.GenerateId();
+        frame_sink->last_activated_local_surface_id();
+    if (!local_surface_id.is_valid()) {
+      parent_local_surface_id_allocator_.GenerateId();
+      local_surface_id =
+          parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
+    }
     frame_sink->SubmitCompositorFrame(local_surface_id,
                                       MakeDamagedCompositorFrame(damage));
   }
diff --git a/components/viz/service/surfaces/surface_unittest.cc b/components/viz/service/surfaces/surface_unittest.cc
index 99332a4..4af65f9 100644
--- a/components/viz/service/surfaces/surface_unittest.cc
+++ b/components/viz/service/surfaces/surface_unittest.cc
@@ -70,8 +70,10 @@
 TEST(SurfaceTest, SurfaceIds) {
   for (size_t i = 0; i < 3; ++i) {
     ParentLocalSurfaceIdAllocator allocator;
-    LocalSurfaceId id1 = allocator.GenerateId();
-    LocalSurfaceId id2 = allocator.GenerateId();
+    allocator.GenerateId();
+    LocalSurfaceId id1 = allocator.GetCurrentLocalSurfaceId();
+    allocator.GenerateId();
+    LocalSurfaceId id2 = allocator.GetCurrentLocalSurfaceId();
     EXPECT_NE(id1, id2);
   }
 }
diff --git a/components/viz/test/surface_hittest_test_helpers.cc b/components/viz/test/surface_hittest_test_helpers.cc
index 8f2d32b..11ebfff 100644
--- a/components/viz/test/surface_hittest_test_helpers.cc
+++ b/components/viz/test/surface_hittest_test_helpers.cc
@@ -44,7 +44,7 @@
   render_pass_quad->SetNew(pass->shared_quad_state_list.back(), quad_rect,
                            quad_rect, render_pass_id, ResourceId(),
                            gfx::RectF(), gfx::Size(), gfx::Vector2dF(),
-                           gfx::PointF(), gfx::RectF(), false);
+                           gfx::PointF(), gfx::RectF(), false, 1.0f);
 }
 
 void CreateSurfaceDrawQuad(RenderPass* pass,
diff --git a/components/viz/test/test_layer_tree_frame_sink.cc b/components/viz/test/test_layer_tree_frame_sink.cc
index da33573..8ccc2c8 100644
--- a/components/viz/test/test_layer_tree_frame_sink.cc
+++ b/components/viz/test/test_layer_tree_frame_sink.cc
@@ -168,7 +168,9 @@
 
   if (frame_size != display_size_ ||
       device_scale_factor != device_scale_factor_) {
-    local_surface_id = parent_local_surface_id_allocator_->GenerateId();
+    parent_local_surface_id_allocator_->GenerateId();
+    local_surface_id =
+        parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId();
     display_->SetLocalSurfaceId(local_surface_id, device_scale_factor);
     display_->Resize(frame_size);
     display_size_ = frame_size;
diff --git a/content/browser/background_fetch/background_fetch_data_manager_unittest.cc b/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
index 794c18e..cc2618b 100644
--- a/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
+++ b/content/browser/background_fetch/background_fetch_data_manager_unittest.cc
@@ -28,15 +28,18 @@
 #include "content/browser/cache_storage/cache_storage_cache_handle.h"
 #include "content/browser/cache_storage/cache_storage_manager.h"
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "content/common/service_worker/service_worker_utils.h"
 #include "content/public/browser/background_fetch_response.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_partition.h"
+#include "content/public/test/test_utils.h"
 #include "services/network/public/mojom/fetch_api.mojom.h"
 #include "storage/browser/blob/blob_data_handle.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "third_party/blink/public/platform/modules/background_fetch/background_fetch.mojom.h"
 #include "third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "third_party/skia/include/core/SkColor.h"
 
@@ -477,7 +480,8 @@
       operation_ptr_vec.push_back(blink::mojom::BatchOperation::New());
       operation_ptr_vec[0]->operation_type =
           blink::mojom::OperationType::kDelete;
-      operation_ptr_vec[0]->request = request;
+      operation_ptr_vec[0]->request =
+          mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request);
 
       handle.value()->BatchOperation(
           std::move(operation_ptr_vec), true /* fail_on_duplicates */,
diff --git a/content/browser/background_fetch/background_fetch_service_impl.cc b/content/browser/background_fetch/background_fetch_service_impl.cc
index edfea31..f19f58f 100644
--- a/content/browser/background_fetch/background_fetch_service_impl.cc
+++ b/content/browser/background_fetch/background_fetch_service_impl.cc
@@ -15,11 +15,13 @@
 #include "content/browser/background_fetch/background_fetch_request_match_params.h"
 #include "content/browser/bad_message.h"
 #include "content/browser/storage_partition_impl.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "content/common/service_worker/service_worker_types.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_process_host.h"
 #include "mojo/public/cpp/bindings/strong_binding.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 
 namespace content {
 
@@ -104,13 +106,18 @@
 void BackgroundFetchServiceImpl::Fetch(
     int64_t service_worker_registration_id,
     const std::string& developer_id,
-    const std::vector<ServiceWorkerFetchRequest>& requests,
+    std::vector<blink::mojom::FetchAPIRequestPtr> requests,
     const BackgroundFetchOptions& options,
     const SkBitmap& icon,
     blink::mojom::BackgroundFetchUkmDataPtr ukm_data,
     FetchCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-  if (!ValidateDeveloperId(developer_id) || !ValidateRequests(requests)) {
+  std::vector<ServiceWorkerFetchRequest> request_;
+  for (const auto& request : requests) {
+    request_.push_back(
+        mojo::ConvertTo<content::ServiceWorkerFetchRequest>(request));
+  }
+  if (!ValidateDeveloperId(developer_id) || !ValidateRequests(request_)) {
     std::move(callback).Run(
         blink::mojom::BackgroundFetchError::INVALID_ARGUMENT,
         base::nullopt /* registration */);
@@ -126,7 +133,7 @@
                                                 base::GenerateGUID());
 
   background_fetch_context_->StartFetch(
-      registration_id, requests, options, icon, std::move(ukm_data),
+      registration_id, request_, options, icon, std::move(ukm_data),
       render_frame_host_, std::move(callback));
 }
 
@@ -140,18 +147,24 @@
     int64_t service_worker_registration_id,
     const std::string& developer_id,
     const std::string& unique_id,
-    const base::Optional<ServiceWorkerFetchRequest>& request_to_match,
+    blink::mojom::FetchAPIRequestPtr request_to_match,
     blink::mojom::QueryParamsPtr cache_query_params,
     bool match_all,
     MatchRequestsCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
-
   BackgroundFetchRegistrationId registration_id(
       service_worker_registration_id, origin_, developer_id, unique_id);
 
+  base::Optional<ServiceWorkerFetchRequest> request_to_match_opt;
+  if (request_to_match.is_null()) {
+    request_to_match_opt = base::nullopt;
+  } else {
+    request_to_match_opt =
+        mojo::ConvertTo<ServiceWorkerFetchRequest>(request_to_match);
+  }
   // Create BackgroundFetchMatchRequestParams.
   auto match_params = std::make_unique<BackgroundFetchRequestMatchParams>(
-      request_to_match, std::move(cache_query_params), match_all);
+      request_to_match_opt, std::move(cache_query_params), match_all);
 
   background_fetch_context_->MatchRequests(
       registration_id, std::move(match_params), std::move(callback));
diff --git a/content/browser/background_fetch/background_fetch_service_impl.h b/content/browser/background_fetch/background_fetch_service_impl.h
index 68f68503b..daab4fc4 100644
--- a/content/browser/background_fetch/background_fetch_service_impl.h
+++ b/content/browser/background_fetch/background_fetch_service_impl.h
@@ -47,20 +47,19 @@
   // blink::mojom::BackgroundFetchService implementation.
   void Fetch(int64_t service_worker_registration_id,
              const std::string& developer_id,
-             const std::vector<ServiceWorkerFetchRequest>& requests,
+             std::vector<blink::mojom::FetchAPIRequestPtr> requests,
              const BackgroundFetchOptions& options,
              const SkBitmap& icon,
              blink::mojom::BackgroundFetchUkmDataPtr ukm_data,
              FetchCallback callback) override;
   void GetIconDisplaySize(GetIconDisplaySizeCallback callback) override;
-  void MatchRequests(
-      int64_t service_worker_registration_id,
-      const std::string& developer_id,
-      const std::string& unique_id,
-      const base::Optional<ServiceWorkerFetchRequest>& request_to_match,
-      blink::mojom::QueryParamsPtr cache_query_params,
-      bool match_all,
-      MatchRequestsCallback callback) override;
+  void MatchRequests(int64_t service_worker_registration_id,
+                     const std::string& developer_id,
+                     const std::string& unique_id,
+                     blink::mojom::FetchAPIRequestPtr request_to_match,
+                     blink::mojom::QueryParamsPtr cache_query_params,
+                     bool match_all,
+                     MatchRequestsCallback callback) override;
   void UpdateUI(int64_t service_worker_registration_id,
                 const std::string& developer_id,
                 const std::string& unique_id,
diff --git a/content/browser/background_fetch/background_fetch_service_unittest.cc b/content/browser/background_fetch/background_fetch_service_unittest.cc
index 62b501b6..508ce87 100644
--- a/content/browser/background_fetch/background_fetch_service_unittest.cc
+++ b/content/browser/background_fetch/background_fetch_service_unittest.cc
@@ -24,11 +24,13 @@
 #include "content/browser/background_fetch/background_fetch_test_data_manager.h"
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
 #include "content/browser/storage_partition_impl.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "content/common/service_worker/service_worker_types.h"
 #include "mojo/core/embedder/embedder.h"
 #include "mojo/public/cpp/bindings/message.h"
 #include "services/network/public/mojom/fetch_api.mojom.h"
 #include "third_party/blink/public/common/manifest/manifest.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 #include "ui/gfx/geometry/size.h"
 
 namespace content {
@@ -122,9 +124,14 @@
 
     base::HistogramTester histogram_tester;
     base::RunLoop run_loop;
+    std::vector<blink::mojom::FetchAPIRequestPtr> request_ptr;
+    for (const auto& request : requests) {
+      request_ptr.push_back(
+          mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request));
+    }
     service_->Fetch(
-        service_worker_registration_id, developer_id, requests, options, icon,
-        blink::mojom::BackgroundFetchUkmData::New(),
+        service_worker_registration_id, developer_id, std::move(request_ptr),
+        options, icon, blink::mojom::BackgroundFetchUkmData::New(),
         base::BindOnce(&BackgroundFetchServiceTest::DidGetRegistration,
                        base::Unretained(this), run_loop.QuitClosure(),
                        out_error, out_registration));
@@ -178,9 +185,14 @@
     base::AutoReset<bool> hang_registration_creation_for_testing(
         &context_->hang_registration_creation_for_testing_, true);
     base::RunLoop run_loop;
+    std::vector<blink::mojom::FetchAPIRequestPtr> request_ptr;
+    for (const auto& request : requests) {
+      request_ptr.push_back(
+          mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request));
+    }
     service_->Fetch(
-        service_worker_registration_id, developer_id, requests, options, icon,
-        blink::mojom::BackgroundFetchUkmData::New(),
+        service_worker_registration_id, developer_id, std::move(request_ptr),
+        options, icon, blink::mojom::BackgroundFetchUkmData::New(),
         base::BindOnce(&BackgroundFetchServiceTest::DidGetRegistration,
                        base::Unretained(this), run_loop.QuitClosure(),
                        out_error, out_registration));
@@ -198,8 +210,8 @@
     base::RunLoop run_loop;
     service_->MatchRequests(
         service_worker_registration_id, developer_id, unique_id,
-        base::nullopt /* request_to_match*/, nullptr /* cache_query_params*/,
-        true /* match_all */,
+        blink::mojom::FetchAPIRequest::New() /* request_to_match*/,
+        nullptr /* cache_query_params*/, true /* match_all */,
         base::BindOnce(&BackgroundFetchServiceTest::DidMatchAllRequests,
                        base::Unretained(this), run_loop.QuitClosure(),
                        out_fetches));
@@ -569,12 +581,11 @@
   MatchAllRequests(service_worker_registration_id, registration.developer_id,
                    registration.unique_id, &fetches);
   ASSERT_EQ(fetches.size(), requests.size());
-
   for (size_t i = 0; i < fetches.size(); ++i) {
-    ASSERT_EQ(fetches[i].request.url, requests[i].url);
-    EXPECT_EQ(fetches[i].request.method, requests[i].method);
+    ASSERT_EQ(fetches[i].request->url, requests[i].url);
+    EXPECT_EQ(fetches[i].request->method, requests[i].method);
 
-    EXPECT_EQ(fetches[i].response->url_list[0], fetches[i].request.url);
+    EXPECT_EQ(fetches[i].response->url_list[0], fetches[i].request->url);
     EXPECT_EQ(fetches[i].response->response_type,
               network::mojom::FetchResponseType::kDefault);
 
@@ -678,13 +689,13 @@
     std::swap(fetches[0], fetches[1]);
 
   for (size_t i = 0; i < fetches.size(); ++i) {
-    ASSERT_EQ(fetches[i].request.url, requests[i].url);
-    EXPECT_EQ(fetches[i].request.method, requests[i].method);
+    ASSERT_EQ(fetches[i].request->url, requests[i].url);
+    EXPECT_EQ(fetches[i].request->method, requests[i].method);
 
     switch (i) {
       case 0:
         EXPECT_EQ(fetches[i].response->status_code, 404);
-        EXPECT_EQ(fetches[i].response->url_list[0], fetches[i].request.url);
+        EXPECT_EQ(fetches[i].response->url_list[0], fetches[i].request->url);
         EXPECT_EQ(fetches[i].response->response_type,
                   network::mojom::FetchResponseType::kDefault);
         break;
diff --git a/content/browser/background_fetch/storage/create_metadata_task.cc b/content/browser/background_fetch/storage/create_metadata_task.cc
index 4d938b5..6753dc7d 100644
--- a/content/browser/background_fetch/storage/create_metadata_task.cc
+++ b/content/browser/background_fetch/storage/create_metadata_task.cc
@@ -16,8 +16,10 @@
 #include "content/browser/background_fetch/storage/image_helpers.h"
 #include "content/browser/background_fetch/storage/mark_registration_for_deletion_task.h"
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "content/common/service_worker/service_worker_utils.h"
 #include "third_party/blink/public/common/service_worker/service_worker_status_code.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 
 namespace content {
 
@@ -367,7 +369,8 @@
   for (auto& request : requests_) {
     auto operation = blink::mojom::BatchOperation::New();
     operation->operation_type = blink::mojom::OperationType::kPut;
-    operation->request = std::move(request);
+    operation->request =
+        mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request);
     // Empty response.
     operation->response = blink::mojom::FetchAPIResponse::New();
     operations.push_back(std::move(operation));
diff --git a/content/browser/background_fetch/storage/match_requests_task.cc b/content/browser/background_fetch/storage/match_requests_task.cc
index ae757cc9..72a550f0 100644
--- a/content/browser/background_fetch/storage/match_requests_task.cc
+++ b/content/browser/background_fetch/storage/match_requests_task.cc
@@ -9,7 +9,9 @@
 #include "content/browser/background_fetch/storage/database_helpers.h"
 #include "content/browser/cache_storage/cache_storage_manager.h"
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "services/network/public/cpp/cors/cors.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 
 namespace content {
 
@@ -81,7 +83,8 @@
   for (size_t i = 0; i < size; i++) {
     auto& entry = entries[i];
     BackgroundFetchSettledFetch settled_fetch;
-    settled_fetch.request = std::move(*entry.first);
+    settled_fetch.request =
+        mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(*entry.first);
 
     if (entry.second && entry.second->url_list.empty()) {
       // We didn't process this empty response, so we should expose it
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc
index bf15c05..7f2eaa0 100644
--- a/content/browser/cache_storage/cache_storage_cache.cc
+++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -33,6 +33,8 @@
 #include "content/browser/cache_storage/cache_storage_manager.h"
 #include "content/browser/cache_storage/cache_storage_quota_client.h"
 #include "content/browser/cache_storage/cache_storage_scheduler.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
+#include "content/common/service_worker/service_worker_utils.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/common/content_features.h"
 #include "content/public/common/referrer.h"
@@ -146,8 +148,8 @@
     return true;
 
   for (const std::string& trimmed :
-       base::SplitString(vary_iter->second, ",",
-                         base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY)) {
+       base::SplitString(vary_iter->second, ",", base::TRIM_WHITESPACE,
+                         base::SPLIT_WANT_NONEMPTY)) {
     if (trimmed == "*")
       return false;
 
@@ -197,7 +199,7 @@
   }
   std::sort(sorted->begin(), sorted->end(),
             [](BatchOperation* left, BatchOperation* right) {
-              return left->request.url < right->request.url;
+              return left->request->url < right->request->url;
             });
 
   // Check each entry in the sorted vector for any duplicates.  Since the
@@ -219,7 +221,7 @@
     // If this entry already matches a duplicate we found, then just skip
     // ahead to find any remaining duplicates.
     if (!duplicate_url_list_out->empty() &&
-        outer_op->request.url.spec() == duplicate_url_list_out->back()) {
+        outer_op->request->url.spec() == duplicate_url_list_out->back()) {
       continue;
     }
 
@@ -227,18 +229,27 @@
       const BatchOperation* inner_op = *inner;
       // Since the list is sorted we can stop looking at neighbors after
       // the first different URL.
-      if (outer_op->request.url != inner_op->request.url) {
+      if (outer_op->request->url != inner_op->request->url) {
         break;
       }
+
+      // This conversion is temporary and it will be removed once
+      // ServiceWorkerHeaderMap is removed.
+      ServiceWorkerHeaderMap request_header_map =
+          ServiceWorkerUtils::ToServiceWorkerHeaderMap(
+              outer_op->request->headers);
+      ServiceWorkerHeaderMap request_header_map_cached =
+          ServiceWorkerUtils::ToServiceWorkerHeaderMap(
+              inner_op->request->headers);
       // VaryMatches() is asymmetric since the operation depends on the VARY
       // header in the target response.  Since we only visit each pair of
       // entries once we need to perform the VaryMatches() call in both
       // directions.
-      if (VaryMatches(outer_op->request.headers, inner_op->request.headers,
+      if (VaryMatches(request_header_map, request_header_map_cached,
                       inner_op->response->headers) ||
-          VaryMatches(outer_op->request.headers, inner_op->request.headers,
+          VaryMatches(request_header_map, request_header_map_cached,
                       outer_op->response->headers)) {
-        duplicate_url_list_out->push_back(inner_op->request.url.spec());
+        duplicate_url_list_out->push_back(inner_op->request->url.spec());
         break;
       }
     }
@@ -1314,7 +1325,6 @@
                      expected_response_time, buffer, buf_len,
                      std::move(scoped_entry_ptr)));
 
-
   // Use LOWEST priority here as writing side data is less important than
   // loading resources on the page.
   int rv = backend_->OpenEntry(url.spec(), net::LOWEST, entry_ptr,
@@ -1350,9 +1360,8 @@
     int buf_len,
     disk_cache::ScopedEntryPtr entry,
     std::unique_ptr<proto::CacheMetadata> headers) {
-  if (!headers ||
-      headers->response().response_time() !=
-          expected_response_time.ToInternalValue()) {
+  if (!headers || headers->response().response_time() !=
+                      expected_response_time.ToInternalValue()) {
     std::move(callback).Run(CacheStorageError::kErrorNotFound);
     return;
   }
@@ -1416,9 +1425,7 @@
 
   std::unique_ptr<ServiceWorkerFetchRequest> request(
       new ServiceWorkerFetchRequest(
-          operation->request.url, operation->request.method,
-          operation->request.headers, operation->request.referrer,
-          operation->request.is_reload));
+          mojo::ConvertTo<ServiceWorkerFetchRequest>(operation->request)));
 
   Put(std::move(request), std::move(operation->response), std::move(callback));
 }
@@ -1826,9 +1833,10 @@
 
   std::unique_ptr<ServiceWorkerFetchRequest> request(
       new ServiceWorkerFetchRequest(
-          operation->request.url, operation->request.method,
-          operation->request.headers, operation->request.referrer,
-          operation->request.is_reload));
+          operation->request->url, operation->request->method,
+          ServiceWorkerUtils::ToServiceWorkerHeaderMap(
+              operation->request->headers),
+          operation->request->referrer, operation->request->is_reload));
 
   scheduler_->ScheduleOperation(base::BindOnce(
       &CacheStorageCache::DeleteImpl, weak_ptr_factory_.GetWeakPtr(),
diff --git a/content/browser/cache_storage/cache_storage_cache_unittest.cc b/content/browser/cache_storage/cache_storage_cache_unittest.cc
index 3c05f29d..f9500ac 100644
--- a/content/browser/cache_storage/cache_storage_cache_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_cache_unittest.cc
@@ -26,6 +26,7 @@
 #include "content/browser/cache_storage/cache_storage_cache_handle.h"
 #include "content/browser/cache_storage/cache_storage_histogram_utils.h"
 #include "content/browser/cache_storage/cache_storage_manager.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "content/common/service_worker/service_worker_types.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_partition.h"
@@ -52,6 +53,7 @@
 #include "storage/browser/test/mock_special_storage_policy.h"
 #include "storage/common/blob_storage/blob_handle.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 #include "url/origin.h"
 
 using blink::mojom::CacheStorageError;
@@ -519,7 +521,8 @@
     blink::mojom::BatchOperationPtr operation =
         blink::mojom::BatchOperation::New();
     operation->operation_type = blink::mojom::OperationType::kPut;
-    operation->request = request;
+    operation->request =
+        mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request);
     operation->response = std::move(response);
 
     std::vector<blink::mojom::BatchOperationPtr> operations;
@@ -574,7 +577,8 @@
     blink::mojom::BatchOperationPtr operation =
         blink::mojom::BatchOperation::New();
     operation->operation_type = blink::mojom::OperationType::kDelete;
-    operation->request = request;
+    operation->request =
+        mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request);
     operation->match_params = std::move(match_params);
 
     std::vector<blink::mojom::BatchOperationPtr> operations;
@@ -795,29 +799,35 @@
   blink::mojom::BatchOperationPtr operation1 =
       blink::mojom::BatchOperation::New();
   operation1->operation_type = blink::mojom::OperationType::kPut;
-  operation1->request = body_request_;
-  operation1->request.url = GURL("http://example.com/1");
+  operation1->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
+  operation1->request->url = GURL("http://example.com/1");
   operation1->response = CreateBlobBodyResponse();
   operation1->response->url_list.push_back(GURL("http://example.com/1"));
-  ServiceWorkerFetchRequest request1 = operation1->request;
+  ServiceWorkerFetchRequest request1 =
+      mojo::ConvertTo<ServiceWorkerFetchRequest>(operation1->request);
 
   blink::mojom::BatchOperationPtr operation2 =
       blink::mojom::BatchOperation::New();
   operation2->operation_type = blink::mojom::OperationType::kPut;
-  operation2->request = body_request_;
-  operation2->request.url = GURL("http://example.com/2");
+  operation2->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
+  operation2->request->url = GURL("http://example.com/2");
   operation2->response = CreateBlobBodyResponse();
   operation2->response->url_list.push_back(GURL("http://example.com/2"));
-  ServiceWorkerFetchRequest request2 = operation2->request;
+  ServiceWorkerFetchRequest request2 =
+      mojo::ConvertTo<ServiceWorkerFetchRequest>(operation2->request);
 
   blink::mojom::BatchOperationPtr operation3 =
       blink::mojom::BatchOperation::New();
   operation3->operation_type = blink::mojom::OperationType::kPut;
-  operation3->request = body_request_;
-  operation3->request.url = GURL("http://example.com/3");
+  operation3->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
+  operation3->request->url = GURL("http://example.com/3");
   operation3->response = CreateBlobBodyResponse();
   operation3->response->url_list.push_back(GURL("http://example.com/3"));
-  ServiceWorkerFetchRequest request3 = operation3->request;
+  ServiceWorkerFetchRequest request3 =
+      mojo::ConvertTo<ServiceWorkerFetchRequest>(operation3->request);
 
   std::vector<blink::mojom::BatchOperationPtr> operations;
   operations.push_back(std::move(operation1));
@@ -924,7 +934,8 @@
   blink::mojom::BatchOperationPtr operation =
       blink::mojom::BatchOperation::New();
   operation->operation_type = blink::mojom::OperationType::kPut;
-  operation->request = body_request_;
+  operation->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation->response = CreateBlobBodyResponse();
 
   std::vector<blink::mojom::BatchOperationPtr> operations;
@@ -949,13 +960,16 @@
   // Two unique puts that will collectively overflow unit64_t size of the
   // batch operation.
   blink::mojom::BatchOperationPtr operation1 =
-      blink::mojom::BatchOperation::New(blink::mojom::OperationType::kPut,
-                                        body_request_, CreateBlobBodyResponse(),
-                                        nullptr /* match_params */);
+      blink::mojom::BatchOperation::New(
+          blink::mojom::OperationType::kPut,
+          mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_),
+          CreateBlobBodyResponse(), nullptr /* match_params */);
   operation1->response->blob->size = std::numeric_limits<uint64_t>::max();
   blink::mojom::BatchOperationPtr operation2 =
       blink::mojom::BatchOperation::New(
-          blink::mojom::OperationType::kPut, body_request_with_query_,
+          blink::mojom::OperationType::kPut,
+          mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(
+              body_request_with_query_),
           CreateBlobBodyResponse(), nullptr /* match_params */);
   operation2->response->blob->size = std::numeric_limits<uint64_t>::max();
 
@@ -989,13 +1003,15 @@
   blink::mojom::BatchOperationPtr operation1 =
       blink::mojom::BatchOperation::New();
   operation1->operation_type = blink::mojom::OperationType::kPut;
-  operation1->request = body_request_;
+  operation1->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation1->response = CreateNoBodyResponse();
 
   blink::mojom::BatchOperationPtr operation2 =
       blink::mojom::BatchOperation::New();
   operation2->operation_type = blink::mojom::OperationType::kPut;
-  operation2->request = body_request_;
+  operation2->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation2->response = CreateBlobBodyResponse();
 
   std::vector<blink::mojom::BatchOperationPtr> operations;
@@ -1018,13 +1034,15 @@
   blink::mojom::BatchOperationPtr operation1 =
       blink::mojom::BatchOperation::New();
   operation1->operation_type = blink::mojom::OperationType::kPut;
-  operation1->request = body_request_;
+  operation1->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation1->response = CreateNoBodyResponse();
 
   blink::mojom::BatchOperationPtr operation2 =
       blink::mojom::BatchOperation::New();
   operation2->operation_type = blink::mojom::OperationType::kPut;
-  operation2->request = body_request_;
+  operation2->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation2->response = CreateBlobBodyResponse();
 
   std::vector<blink::mojom::BatchOperationPtr> operations;
@@ -1627,7 +1645,8 @@
   blink::mojom::BatchOperationPtr operation =
       blink::mojom::BatchOperation::New();
   operation->operation_type = blink::mojom::OperationType::kPut;
-  operation->request = body_request_;
+  operation->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation->response = std::move(response);
   operation->response->blob->size = std::numeric_limits<uint64_t>::max();
 
@@ -1986,7 +2005,8 @@
   blink::mojom::BatchOperationPtr operation1 =
       blink::mojom::BatchOperation::New();
   operation1->operation_type = blink::mojom::OperationType::kPut;
-  operation1->request = body_request_;
+  operation1->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation1->response = CreateBlobBodyResponse();
 
   std::unique_ptr<base::RunLoop> close_loop1(new base::RunLoop());
@@ -2005,7 +2025,8 @@
   blink::mojom::BatchOperationPtr operation2 =
       blink::mojom::BatchOperation::New();
   operation2->operation_type = blink::mojom::OperationType::kPut;
-  operation2->request = body_request_;
+  operation2->request =
+      mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(body_request_);
   operation2->response = CreateBlobBodyResponse();
 
   delayable_backend->set_delay_open_entry(false);
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.cc b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
index 9394792..a141dce 100644
--- a/content/browser/cache_storage/cache_storage_dispatcher_host.cc
+++ b/content/browser/cache_storage/cache_storage_dispatcher_host.cc
@@ -21,12 +21,15 @@
 #include "content/browser/cache_storage/cache_storage_cache_handle.h"
 #include "content/browser/cache_storage/cache_storage_context_impl.h"
 #include "content/browser/cache_storage/cache_storage_manager.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
+#include "content/common/service_worker/service_worker_utils.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/content_browser_client.h"
 #include "content/public/common/origin_util.h"
 #include "mojo/public/cpp/bindings/message.h"
 #include "third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 #include "url/gurl.h"
 #include "url/origin.h"
 
@@ -63,7 +66,7 @@
   ~CacheImpl() override = default;
 
   // blink::mojom::CacheStorageCache implementation:
-  void Match(const ServiceWorkerFetchRequest& request,
+  void Match(blink::mojom::FetchAPIRequestPtr request,
              blink::mojom::QueryParamsPtr match_params,
              MatchCallback callback) override {
     content::CacheStorageCache* cache = cache_handle_.value();
@@ -74,8 +77,9 @@
     }
 
     auto scoped_request = std::make_unique<ServiceWorkerFetchRequest>(
-        request.url, request.method, request.headers, request.referrer,
-        request.is_reload);
+        request->url, request->method,
+        ServiceWorkerUtils::ToServiceWorkerHeaderMap(request->headers),
+        request->referrer, request->is_reload);
 
     cache->Match(
         std::move(scoped_request), std::move(match_params),
@@ -96,7 +100,7 @@
         blink::mojom::MatchResult::NewResponse(std::move(response)));
   }
 
-  void MatchAll(const base::Optional<ServiceWorkerFetchRequest>& request,
+  void MatchAll(blink::mojom::FetchAPIRequestPtr request,
                 blink::mojom::QueryParamsPtr match_params,
                 MatchAllCallback callback) override {
     content::CacheStorageCache* cache = cache_handle_.value();
@@ -110,8 +114,9 @@
 
     if (request && !request->url.is_empty()) {
       request_ptr = std::make_unique<ServiceWorkerFetchRequest>(
-          request->url, request->method, request->headers, request->referrer,
-          request->is_reload);
+          request->url, request->method,
+          ServiceWorkerUtils::ToServiceWorkerHeaderMap(request->headers),
+          request->referrer, request->is_reload);
     }
 
     cache->MatchAll(
@@ -134,7 +139,7 @@
         blink::mojom::MatchAllResult::NewResponses(std::move(responses)));
   }
 
-  void Keys(const base::Optional<ServiceWorkerFetchRequest>& request,
+  void Keys(blink::mojom::FetchAPIRequestPtr request,
             blink::mojom::QueryParamsPtr match_params,
             KeysCallback callback) override {
     content::CacheStorageCache* cache = cache_handle_.value();
@@ -145,12 +150,13 @@
     }
 
     std::unique_ptr<ServiceWorkerFetchRequest> request_ptr;
-
     if (request) {
       request_ptr = std::make_unique<ServiceWorkerFetchRequest>(
-          request->url, request->method, request->headers, request->referrer,
-          request->is_reload);
+          request->url, request->method,
+          ServiceWorkerUtils::ToServiceWorkerHeaderMap(request->headers),
+          request->referrer, request->is_reload);
     }
+
     cache->Keys(
         std::move(request_ptr), std::move(match_params),
         base::BindOnce(&CacheImpl::OnCacheKeysCallback,
@@ -165,8 +171,14 @@
       std::move(callback).Run(blink::mojom::CacheKeysResult::NewStatus(error));
       return;
     }
+    std::vector<blink::mojom::FetchAPIRequestPtr> requests_;
+    for (auto request : *requests) {
+      requests_.push_back(
+          mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request));
+    }
 
-    std::move(callback).Run(blink::mojom::CacheKeysResult::NewKeys(*requests));
+    std::move(callback).Run(
+        blink::mojom::CacheKeysResult::NewKeys(std::move(requests_)));
   }
 
   void Batch(std::vector<blink::mojom::BatchOperationPtr> batch_operations,
@@ -296,7 +308,7 @@
 }
 
 void CacheStorageDispatcherHost::Match(
-    const content::ServiceWorkerFetchRequest& request,
+    blink::mojom::FetchAPIRequestPtr request,
     blink::mojom::QueryParamsPtr match_params,
     blink::mojom::CacheStorage::MatchCallback callback) {
   TRACE_EVENT0("CacheStorage",
@@ -309,8 +321,9 @@
   if (!ValidState())
     return;
   auto scoped_request = std::make_unique<ServiceWorkerFetchRequest>(
-      request.url, request.method, request.headers, request.referrer,
-      request.is_reload);
+      request->url, request->method,
+      ServiceWorkerUtils::ToServiceWorkerHeaderMap(request->headers),
+      request->referrer, request->is_reload);
 
   if (!match_params->cache_name) {
     context_->cache_manager()->MatchAllCaches(
diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.h b/content/browser/cache_storage/cache_storage_dispatcher_host.h
index ade31c5..4e72d5e 100644
--- a/content/browser/cache_storage/cache_storage_dispatcher_host.h
+++ b/content/browser/cache_storage/cache_storage_dispatcher_host.h
@@ -20,6 +20,7 @@
 #include "mojo/public/cpp/bindings/associated_binding_set.h"
 #include "mojo/public/cpp/bindings/strong_associated_binding_set.h"
 #include "mojo/public/cpp/bindings/strong_binding_set.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 
 namespace url {
 class Origin;
@@ -69,7 +70,7 @@
               blink::mojom::CacheStorage::DeleteCallback callback) override;
   void Has(const base::string16& cache_name,
            blink::mojom::CacheStorage::HasCallback callback) override;
-  void Match(const content::ServiceWorkerFetchRequest& request,
+  void Match(blink::mojom::FetchAPIRequestPtr request,
              blink::mojom::QueryParamsPtr match_params,
              blink::mojom::CacheStorage::MatchCallback callback) override;
   void Open(const base::string16& cache_name,
diff --git a/content/browser/cache_storage/cache_storage_manager_unittest.cc b/content/browser/cache_storage/cache_storage_manager_unittest.cc
index 81a67df..3be783c1 100644
--- a/content/browser/cache_storage/cache_storage_manager_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
@@ -32,6 +32,7 @@
 #include "content/browser/cache_storage/cache_storage_context_impl.h"
 #include "content/browser/cache_storage/cache_storage_index.h"
 #include "content/browser/cache_storage/cache_storage_quota_client.h"
+#include "content/common/service_worker/service_worker_type_converter.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/cache_storage_usage_info.h"
 #include "content/public/browser/storage_partition.h"
@@ -55,6 +56,7 @@
 #include "storage/common/blob_storage/blob_handle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/platform/modules/cache_storage/cache_storage.mojom.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
 #include "url/origin.h"
 
 using blink::mojom::CacheStorageError;
@@ -492,7 +494,8 @@
     blink::mojom::BatchOperationPtr operation =
         blink::mojom::BatchOperation::New();
     operation->operation_type = blink::mojom::OperationType::kPut;
-    operation->request = request;
+    operation->request =
+        mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request);
     operation->response = std::move(response);
 
     std::vector<blink::mojom::BatchOperationPtr> operations;
@@ -515,7 +518,8 @@
     blink::mojom::BatchOperationPtr operation =
         blink::mojom::BatchOperation::New();
     operation->operation_type = blink::mojom::OperationType::kDelete;
-    operation->request = request;
+    operation->request =
+        mojo::ConvertTo<blink::mojom::FetchAPIRequestPtr>(request);
     operation->response = blink::mojom::FetchAPIResponse::New();
 
     std::vector<blink::mojom::BatchOperationPtr> operations;
diff --git a/content/browser/histograms_internals_ui.cc b/content/browser/histograms_internals_ui.cc
index e338b28..ef0a776 100644
--- a/content/browser/histograms_internals_ui.cc
+++ b/content/browser/histograms_internals_ui.cc
@@ -73,8 +73,9 @@
   args->GetString(1, &query);
 
   base::ListValue histograms_list;
-  for (base::HistogramBase* histogram : base::StatisticsRecorder::WithName(
-           base::StatisticsRecorder::GetHistograms(), query)) {
+  for (base::HistogramBase* histogram :
+       base::StatisticsRecorder::Sort(base::StatisticsRecorder::WithName(
+           base::StatisticsRecorder::GetHistograms(), query))) {
     // TODO(crbug.com/809820): Return the histogram object as a DictionaryValue
     // for better UI that is built client side.
     std::string ascii_output;
diff --git a/content/browser/network_service_instance.cc b/content/browser/network_service_instance.cc
index e2e06d84..91b9781 100644
--- a/content/browser/network_service_instance.cc
+++ b/content/browser/network_service_instance.cc
@@ -56,11 +56,9 @@
   GetNetworkService()->GetNetworkChangeManager(std::move(request));
 }
 
-using CrashHandlersMap =
-    std::map<NetworkServiceCrashHandlerId, base::RepeatingClosure>;
-CrashHandlersMap& GetCrashHandlersMap() {
-  static base::NoDestructor<CrashHandlersMap> s_map;
-  return *s_map;
+base::CallbackList<void()>& GetCrashHandlersList() {
+  static base::NoDestructor<base::CallbackList<void()>> s_list;
+  return *s_list;
 }
 
 void OnNetworkServiceCrash() {
@@ -68,10 +66,7 @@
   DCHECK(g_network_service_ptr);
   DCHECK(g_network_service_ptr->is_bound());
   DCHECK(g_network_service_ptr->encountered_error());
-  for (const auto& it : GetCrashHandlersMap()) {
-    const base::RepeatingClosure& handler = it.second;
-    handler.Run();
-  }
+  GetCrashHandlersList().Notify();
 }
 
 }  // namespace
@@ -161,30 +156,15 @@
   return g_network_service_ptr->get();
 }
 
-NetworkServiceCrashHandlerId RegisterNetworkServiceCrashHandler(
-    base::RepeatingClosure handler) {
+std::unique_ptr<base::CallbackList<void()>::Subscription>
+RegisterNetworkServiceCrashHandler(base::RepeatingClosure handler) {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
   DCHECK(!handler.is_null());
 
-  static int next_handler_id = 1;
-  NetworkServiceCrashHandlerId handler_id =
-      NetworkServiceCrashHandlerId::FromUnsafeValue(next_handler_id++);
+  if (base::FeatureList::IsEnabled(network::features::kNetworkService))
+    return GetCrashHandlersList().Add(std::move(handler));
 
-  if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
-    CrashHandlersMap& map = GetCrashHandlersMap();
-    map[handler_id] = std::move(handler);
-  }
-
-  return handler_id;
-}
-
-void UnregisterNetworkServiceCrashHandler(
-    NetworkServiceCrashHandlerId handler_id) {
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
-    CrashHandlersMap& map = GetCrashHandlersMap();
-    map.erase(handler_id);
-  }
+  return nullptr;
 }
 
 network::NetworkService* GetNetworkServiceImpl() {
diff --git a/content/browser/network_service_restart_browsertest.cc b/content/browser/network_service_restart_browsertest.cc
index 48d4220..d22ac8b 100644
--- a/content/browser/network_service_restart_browsertest.cc
+++ b/content/browser/network_service_restart_browsertest.cc
@@ -336,9 +336,9 @@
   // Register 2 crash handlers.
   int counter1 = 0;
   int counter2 = 0;
-  NetworkServiceCrashHandlerId handler_id1 = RegisterNetworkServiceCrashHandler(
+  auto handler1 = RegisterNetworkServiceCrashHandler(
       base::BindRepeating(&IncrementInt, base::Unretained(&counter1)));
-  NetworkServiceCrashHandlerId handler_id2 = RegisterNetworkServiceCrashHandler(
+  auto handler2 = RegisterNetworkServiceCrashHandler(
       base::BindRepeating(&IncrementInt, base::Unretained(&counter2)));
 
   // Crash the NetworkService process.
@@ -359,7 +359,7 @@
   EXPECT_TRUE(network_context.is_bound());
 
   // Unregister one of the handlers.
-  UnregisterNetworkServiceCrashHandler(handler_id2);
+  handler2.reset();
 
   // Crash the NetworkService process.
   SimulateNetworkServiceCrash();
@@ -373,9 +373,6 @@
   // Verify only the first crash handler executed.
   EXPECT_EQ(2, counter1);
   EXPECT_EQ(1, counter2);
-
-  // Test cleanup.
-  UnregisterNetworkServiceCrashHandler(handler_id1);
 }
 
 // Make sure |StoragePartitionImpl::GetNetworkContext()| returns valid interface
diff --git a/content/browser/renderer_host/browser_compositor_view_mac.mm b/content/browser/renderer_host/browser_compositor_view_mac.mm
index 32ae1291..59128ca 100644
--- a/content/browser/renderer_host/browser_compositor_view_mac.mm
+++ b/content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -94,8 +94,9 @@
 }
 
 bool BrowserCompositorMac::RequestRepaintForTesting() {
+  dfh_local_surface_id_allocator_.GenerateId();
   const viz::LocalSurfaceId& new_local_surface_id =
-      dfh_local_surface_id_allocator_.GenerateId();
+      dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
   delegated_frame_host_->EmbedSurface(
       new_local_surface_id, dfh_size_dip_,
       cc::DeadlinePolicy::UseExistingDeadline());
@@ -153,9 +154,10 @@
   root_layer_->SetBounds(gfx::Rect(dfh_size_dip_));
 
   if (needs_new_surface_id) {
+    dfh_local_surface_id_allocator_.GenerateId();
     GetDelegatedFrameHost()->EmbedSurface(
-        dfh_local_surface_id_allocator_.GenerateId(), dfh_size_dip_,
-        GetDeadlinePolicy(is_resize));
+        dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId(),
+        dfh_size_dip_, GetDeadlinePolicy(is_resize));
   }
 
   if (recyclable_compositor_) {
@@ -432,10 +434,10 @@
 }
 
 const viz::LocalSurfaceId& BrowserCompositorMac::GetRendererLocalSurfaceId() {
-  if (dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId().is_valid())
-    return dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
+  if (!dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId().is_valid())
+    dfh_local_surface_id_allocator_.GenerateId();
 
-  return dfh_local_surface_id_allocator_.GenerateId();
+  return dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
 }
 
 base::TimeTicks BrowserCompositorMac::GetRendererLocalSurfaceIdAllocationTime()
@@ -445,7 +447,8 @@
 
 const viz::LocalSurfaceId&
 BrowserCompositorMac::AllocateNewRendererLocalSurfaceId() {
-  return dfh_local_surface_id_allocator_.GenerateId();
+  dfh_local_surface_id_allocator_.GenerateId();
+  return dfh_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
 }
 
 bool BrowserCompositorMac::UpdateRendererLocalSurfaceIdFromChild(
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index b2701cb0..55fdea6 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -1442,8 +1442,12 @@
 }
 
 viz::LocalSurfaceId CompositorImpl::GenerateLocalSurfaceId() const {
-  if (enable_surface_synchronization_)
-    return CompositorDependencies::Get().surface_id_allocator.GenerateId();
+  if (enable_surface_synchronization_) {
+    viz::ParentLocalSurfaceIdAllocator& allocator =
+        CompositorDependencies::Get().surface_id_allocator;
+    allocator.GenerateId();
+    return allocator.GetCurrentLocalSurfaceId();
+  }
 
   return viz::LocalSurfaceId();
 }
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 5014740..2ce81d4 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1280,9 +1280,11 @@
   process->CleanupCorbExceptionForPluginUponDestruction();
 
   if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
-    static NetworkServiceCrashHandlerId s_crash_handler_id;
-    if (s_crash_handler_id.is_null()) {
-      s_crash_handler_id = RegisterNetworkServiceCrashHandler(
+    static base::NoDestructor<
+        std::unique_ptr<base::CallbackList<void()>::Subscription>>
+        s_crash_handler_subscription;
+    if (!*s_crash_handler_subscription) {
+      *s_crash_handler_subscription = RegisterNetworkServiceCrashHandler(
           base::BindRepeating(&OnNetworkServiceCrashForCorb));
     }
 
diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
index 90cc8133..b6bb6aaec 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc
@@ -3156,8 +3156,9 @@
 
 TEST_F(RenderWidgetHostViewAuraTest, ZeroSizeStillGetsLocalSurfaceId) {
   gfx::Size frame_size;
+  parent_local_surface_id_allocator_.GenerateId();
   viz::LocalSurfaceId local_surface_id =
-      parent_local_surface_id_allocator_.GenerateId();
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
 
   view_->InitAsChild(nullptr);
   aura::client::ParentWindowWithContext(
@@ -3187,8 +3188,9 @@
     return;
 
   gfx::Size frame_size(100, 100);
+  parent_local_surface_id_allocator_.GenerateId();
   viz::LocalSurfaceId local_surface_id =
-      parent_local_surface_id_allocator_.GenerateId();
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
 
   view_->InitAsChild(nullptr);
   aura::client::ParentWindowWithContext(
@@ -3235,9 +3237,15 @@
   gfx::Size size1(100, 100);
   gfx::Size size2(200, 200);
   gfx::Size size3(300, 300);
-  viz::LocalSurfaceId id1 = parent_local_surface_id_allocator_.GenerateId();
-  viz::LocalSurfaceId id2 = parent_local_surface_id_allocator_.GenerateId();
-  viz::LocalSurfaceId id3 = parent_local_surface_id_allocator_.GenerateId();
+  parent_local_surface_id_allocator_.GenerateId();
+  viz::LocalSurfaceId id1 =
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
+  parent_local_surface_id_allocator_.GenerateId();
+  viz::LocalSurfaceId id2 =
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
+  parent_local_surface_id_allocator_.GenerateId();
+  viz::LocalSurfaceId id3 =
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
 
   aura::Window* root_window = parent_view_->GetNativeView()->GetRootWindow();
   view_->InitAsChild(nullptr);
@@ -3420,9 +3428,10 @@
   view_->CreateNewRendererCompositorFrameSink();
 
   // Submit a frame from the new RendererCompositorFrameSink.
-  view_->SubmitCompositorFrame(parent_local_surface_id_allocator_.GenerateId(),
-                               MakeDelegatedFrame(1.f, frame_size, view_rect),
-                               base::nullopt);
+  parent_local_surface_id_allocator_.GenerateId();
+  view_->SubmitCompositorFrame(
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId(),
+      MakeDelegatedFrame(1.f, frame_size, view_rect), base::nullopt);
   view_->RunOnCompositingDidCommit();
 }
 
diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
index c141008b..ce9fed45 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm
@@ -2223,7 +2223,9 @@
   viz::ChildLocalSurfaceIdAllocator child_allocator;
   child_allocator.UpdateFromParent(
       local_surface_id1, rwhv_mac_->GetLocalSurfaceIdAllocationTime());
-  viz::LocalSurfaceId local_surface_id2 = child_allocator.GenerateId();
+  child_allocator.GenerateId();
+  viz::LocalSurfaceId local_surface_id2 =
+      child_allocator.GetCurrentLocalSurfaceId();
   cc::RenderFrameMetadata metadata;
   metadata.viewport_size_in_pixels = gfx::Size(75, 75);
   metadata.local_surface_id = local_surface_id2;
@@ -2244,7 +2246,9 @@
   viz::ChildLocalSurfaceIdAllocator child_allocator;
   child_allocator.UpdateFromParent(
       local_surface_id1, rwhv_mac_->GetLocalSurfaceIdAllocationTime());
-  viz::LocalSurfaceId local_surface_id2 = child_allocator.GenerateId();
+  child_allocator.GenerateId();
+  viz::LocalSurfaceId local_surface_id2 =
+      child_allocator.GetCurrentLocalSurfaceId();
   cc::RenderFrameMetadata metadata;
   metadata.viewport_size_in_pixels = gfx::Size(75, 75);
   metadata.local_surface_id = local_surface_id2;
diff --git a/content/browser/renderer_host/render_widget_targeter.cc b/content/browser/renderer_host/render_widget_targeter.cc
index 0e880bca..18cc7119 100644
--- a/content/browser/renderer_host/render_widget_targeter.cc
+++ b/content/browser/renderer_host/render_widget_targeter.cc
@@ -85,6 +85,13 @@
 
 int TracingUmaTracker::next_id_ = 1;
 
+enum class HitTestResultsMatch {
+  kDoNotMatch = 0,
+  kMatch = 1,
+  kHitTestResultChanged = 2,
+  kMaxValue = kHitTestResultChanged,
+};
+
 RenderWidgetTargetResult::RenderWidgetTargetResult() = default;
 
 RenderWidgetTargetResult::RenderWidgetTargetResult(
@@ -393,17 +400,42 @@
     UMA_HISTOGRAM_COUNTS_100("Event.AsyncTargeting.AsyncClientDepth",
                              async_depth_);
   }
-  if (features::IsVizHitTestingSurfaceLayerEnabled() &&
-      expected_frame_sink_id.is_valid()) {
-    UMA_HISTOGRAM_BOOLEAN("Event.VizHitTestSurfaceLayer.ResultsMatch",
-                          target->GetFrameSinkId() == expected_frame_sink_id);
-    FlushEventQueue(true);
-    return;
-  }
+
   // RenderWidgetHostViewMac can be deleted asynchronously, in which case the
   // View will be valid but there will no longer be a RenderWidgetHostImpl.
   if (!root_view || !root_view->GetRenderWidgetHost())
     return;
+
+  if (features::IsVizHitTestingSurfaceLayerEnabled() &&
+      expected_frame_sink_id.is_valid()) {
+    static const char* kResultsMatchHistogramName =
+        "Event.VizHitTestSurfaceLayer.ResultsMatch";
+    bool results_match = target->GetFrameSinkId() == expected_frame_sink_id;
+    HitTestResultsMatch match_result =
+        HitTestResultsMatch::kHitTestResultChanged;
+    if (results_match) {
+      match_result = HitTestResultsMatch::kMatch;
+    } else {
+      // If the results do not match, it is possible that the hit test data
+      // changed during verification. We do synchronous hit test again to make
+      // sure the result is reliable.
+      RenderWidgetTargetResult result =
+          delegate_->FindTargetSynchronously(root_view, event);
+      if (!result.should_query_view && result.view &&
+          expected_frame_sink_id == result.view->GetFrameSinkId()) {
+        // If the result did not change, it is likely that viz hit test finds
+        // the wrong target.
+        match_result = HitTestResultsMatch::kDoNotMatch;
+      } else {
+        // Hit test data changed, so the result is no longer reliable.
+        match_result = HitTestResultsMatch::kHitTestResultChanged;
+      }
+    }
+    UMA_HISTOGRAM_ENUMERATION(kResultsMatchHistogramName, match_result,
+                              HitTestResultsMatch::kMaxValue);
+    FlushEventQueue(true);
+    return;
+  }
   delegate_->DispatchEventToTarget(root_view, target, event, latency,
                                    target_location);
   FlushEventQueue(false);
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 17ee17d..7fc1ad54 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4866,13 +4866,15 @@
 
 void WebContentsImpl::DidFirstVisuallyNonEmptyPaint(
     RenderViewHostImpl* source) {
+  // Set |did_first_visually_non_empty_paint_| before notifying observers so
+  // they can see that CompletedFirstVisuallyNonEmptyPaint() is true.
+  did_first_visually_non_empty_paint_ = true;
+
   // TODO(nick): When this is ported to FrameHostMsg_, we should only listen if
   // |source| is the main frame.
   for (auto& observer : observers_)
     observer.DidFirstVisuallyNonEmptyPaint();
 
-  did_first_visually_non_empty_paint_ = true;
-
   if (theme_color_ != last_sent_theme_color_) {
     // Theme color should have updated by now if there was one.
     for (auto& observer : observers_)
diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc
index 366f3859..f6e19b3f 100644
--- a/content/browser/web_contents/web_contents_impl_unittest.cc
+++ b/content/browser/web_contents/web_contents_impl_unittest.cc
@@ -299,16 +299,25 @@
     last_url_ = validated_url;
   }
 
+  void DidFirstVisuallyNonEmptyPaint() override {
+    observed_did_first_visually_non_empty_paint_ = true;
+    EXPECT_TRUE(web_contents()->CompletedFirstVisuallyNonEmptyPaint());
+  }
+
   void DidChangeThemeColor(SkColor theme_color) override {
     last_theme_color_ = theme_color;
   }
 
   const GURL& last_url() const { return last_url_; }
   SkColor last_theme_color() const { return last_theme_color_; }
+  bool observed_did_first_visually_non_empty_paint() const {
+    return observed_did_first_visually_non_empty_paint_;
+  }
 
  private:
   GURL last_url_;
   SkColor last_theme_color_;
+  bool observed_did_first_visually_non_empty_paint_ = false;
 
   DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver);
 };
@@ -3584,4 +3593,13 @@
   EXPECT_EQ(effective_flags, expected_flags);
 }
 
+TEST_F(WebContentsImplTest, DidFirstVisuallyNonEmptyPaint) {
+  TestWebContentsObserver observer(contents());
+
+  RenderWidgetHostOwnerDelegate* rwhod = test_rvh();
+  rwhod->RenderWidgetDidFirstVisuallyNonEmptyPaint();
+
+  EXPECT_TRUE(observer.observed_did_first_visually_non_empty_paint());
+}
+
 }  // namespace content
diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
index 1ff4677c..99314b5 100644
--- a/content/common/BUILD.gn
+++ b/content/common/BUILD.gn
@@ -239,6 +239,8 @@
     "service_manager/service_manager_connection_impl.h",
     "service_worker/service_worker_loader_helpers.cc",
     "service_worker/service_worker_loader_helpers.h",
+    "service_worker/service_worker_type_converter.cc",
+    "service_worker/service_worker_type_converter.h",
     "service_worker/service_worker_types.cc",
     "service_worker/service_worker_types.h",
     "service_worker/service_worker_utils.cc",
diff --git a/content/common/background_fetch/background_fetch_struct_traits.cc b/content/common/background_fetch/background_fetch_struct_traits.cc
index fd3f88b..5629e09 100644
--- a/content/common/background_fetch/background_fetch_struct_traits.cc
+++ b/content/common/background_fetch/background_fetch_struct_traits.cc
@@ -5,7 +5,6 @@
 #include "content/common/background_fetch/background_fetch_struct_traits.h"
 
 #include "content/common/service_worker/service_worker.mojom.h"
-#include "content/common/service_worker/service_worker_fetch_request_mojom_traits.h"
 #include "mojo/public/cpp/bindings/array_data_view.h"
 #include "third_party/blink/public/common/manifest/manifest_mojom_traits.h"
 #include "third_party/blink/public/mojom/manifest/manifest.mojom.h"
diff --git a/content/common/background_fetch/background_fetch_struct_traits.h b/content/common/background_fetch/background_fetch_struct_traits.h
index 2fc02ab..f404d0a5 100644
--- a/content/common/background_fetch/background_fetch_struct_traits.h
+++ b/content/common/background_fetch/background_fetch_struct_traits.h
@@ -81,9 +81,9 @@
 struct CONTENT_EXPORT
     StructTraits<blink::mojom::BackgroundFetchSettledFetchDataView,
                  content::BackgroundFetchSettledFetch> {
-  static const content::ServiceWorkerFetchRequest& request(
+  static blink::mojom::FetchAPIRequestPtr request(
       const content::BackgroundFetchSettledFetch& fetch) {
-    return fetch.request;
+    return content::BackgroundFetchSettledFetch::CloneRequest(fetch.request);
   }
   static blink::mojom::FetchAPIResponsePtr response(
       const content::BackgroundFetchSettledFetch& fetch) {
diff --git a/content/common/background_fetch/background_fetch_types.cc b/content/common/background_fetch/background_fetch_types.cc
index 5ff3ae7..ba708afd 100644
--- a/content/common/background_fetch/background_fetch_types.cc
+++ b/content/common/background_fetch/background_fetch_types.cc
@@ -70,6 +70,21 @@
       response->cors_exposed_header_names, response->is_in_cache_storage,
       CloneSerializedBlob(response->side_data_blob));
 }
+
+// static
+blink::mojom::FetchAPIRequestPtr BackgroundFetchSettledFetch::CloneRequest(
+    const blink::mojom::FetchAPIRequestPtr& request) {
+  if (!request)
+    return nullptr;
+  return blink::mojom::FetchAPIRequest::New(
+      request->mode, request->is_main_resource_load,
+      request->request_context_type, request->frame_type, request->url,
+      request->method, request->headers, CloneSerializedBlob(request->blob),
+      request->referrer, request->credentials_mode, request->cache_mode,
+      request->redirect_mode, request->integrity, request->keepalive,
+      request->client_id, request->is_reload, request->is_history_navigation);
+}
+
 BackgroundFetchSettledFetch::BackgroundFetchSettledFetch() = default;
 
 BackgroundFetchSettledFetch::BackgroundFetchSettledFetch(
@@ -79,7 +94,7 @@
 
 BackgroundFetchSettledFetch& BackgroundFetchSettledFetch::operator=(
     const BackgroundFetchSettledFetch& other) {
-  request = other.request;
+  request = CloneRequest(other.request);
   response = CloneResponse(other.response);
   return *this;
 }
diff --git a/content/common/background_fetch/background_fetch_types.h b/content/common/background_fetch/background_fetch_types.h
index c20ad3a..2e93b02 100644
--- a/content/common/background_fetch/background_fetch_types.h
+++ b/content/common/background_fetch/background_fetch_types.h
@@ -75,13 +75,15 @@
 struct CONTENT_EXPORT BackgroundFetchSettledFetch {
   static blink::mojom::FetchAPIResponsePtr CloneResponse(
       const blink::mojom::FetchAPIResponsePtr& response);
+  static blink::mojom::FetchAPIRequestPtr CloneRequest(
+      const blink::mojom::FetchAPIRequestPtr& request);
   BackgroundFetchSettledFetch();
   BackgroundFetchSettledFetch(const BackgroundFetchSettledFetch& other);
   BackgroundFetchSettledFetch& operator=(
       const BackgroundFetchSettledFetch& other);
   ~BackgroundFetchSettledFetch();
 
-  ServiceWorkerFetchRequest request;
+  blink::mojom::FetchAPIRequestPtr request;
   blink::mojom::FetchAPIResponsePtr response;
 };
 
diff --git a/content/common/service_worker/service_worker_fetch_request.typemap b/content/common/service_worker/service_worker_fetch_request.typemap
deleted file mode 100644
index 4991157c..0000000
--- a/content/common/service_worker/service_worker_fetch_request.typemap
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2017 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-mojom =
-    "//third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom"
-public_headers = [ "//content/common/service_worker/service_worker_types.h" ]
-traits_headers = [
-  "//content/common/service_worker/service_worker_fetch_request_mojom_traits.h",
-]
-sources = [
-  "//content/common/service_worker/service_worker_fetch_request_mojom_traits.cc",
-]
-type_mappings =
-    [ "blink.mojom.FetchAPIRequest=::content::ServiceWorkerFetchRequest" ]
diff --git a/content/common/service_worker/service_worker_fetch_request_mojom_traits.cc b/content/common/service_worker/service_worker_fetch_request_mojom_traits.cc
deleted file mode 100644
index 7e857e5..0000000
--- a/content/common/service_worker/service_worker_fetch_request_mojom_traits.cc
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/common/service_worker/service_worker_fetch_request_mojom_traits.h"
-
-#include "base/logging.h"
-#include "content/public/common/referrer_struct_traits.h"
-#include "url/mojom/url_gurl_mojom_traits.h"
-
-namespace mojo {
-
-using network::mojom::FetchRequestMode;
-
-
-bool StructTraits<blink::mojom::FetchAPIRequestDataView,
-                  content::ServiceWorkerFetchRequest>::
-    Read(blink::mojom::FetchAPIRequestDataView data,
-         content::ServiceWorkerFetchRequest* out) {
-  std::unordered_map<std::string, std::string> headers;
-  blink::mojom::SerializedBlobPtr serialized_blob_ptr;
-  if (!data.ReadMode(&out->mode) ||
-      !data.ReadRequestContextType(&out->request_context_type) ||
-      !data.ReadFrameType(&out->frame_type) || !data.ReadUrl(&out->url) ||
-      !data.ReadMethod(&out->method) || !data.ReadHeaders(&headers) ||
-      !data.ReadBlob(&serialized_blob_ptr) ||
-      !data.ReadReferrer(&out->referrer) ||
-      !data.ReadCredentialsMode(&out->credentials_mode) ||
-      !data.ReadRedirectMode(&out->redirect_mode) ||
-      !data.ReadIntegrity(&out->integrity) ||
-      !data.ReadClientId(&out->client_id)) {
-    return false;
-  }
-
-  // content::ServiceWorkerFetchRequest doesn't support request body.
-  if (serialized_blob_ptr)
-    return false;
-
-  out->is_main_resource_load = data.is_main_resource_load();
-  out->headers.insert(headers.begin(), headers.end());
-  out->cache_mode = data.cache_mode();
-  out->keepalive = data.keepalive();
-  out->is_reload = data.is_reload();
-  out->is_history_navigation = data.is_history_navigation();
-  return true;
-}
-
-}  // namespace mojo
diff --git a/content/common/service_worker/service_worker_fetch_request_mojom_traits.h b/content/common/service_worker/service_worker_fetch_request_mojom_traits.h
deleted file mode 100644
index 3a7f35d..0000000
--- a/content/common/service_worker/service_worker_fetch_request_mojom_traits.h
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_FETCH_REQUEST_MOJOM_TRAITS_H_
-#define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_FETCH_REQUEST_MOJOM_TRAITS_H_
-
-#include "base/numerics/safe_conversions.h"
-#include "content/public/common/referrer.h"
-#include "services/network/public/mojom/request_context_frame_type.mojom.h"
-#include "storage/common/blob_storage/blob_handle.h"
-#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
-
-namespace mojo {
-
-
-template <>
-struct StructTraits<blink::mojom::FetchAPIRequestDataView,
-                    content::ServiceWorkerFetchRequest> {
-  static network::mojom::FetchRequestMode mode(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.mode;
-  }
-
-  static bool is_main_resource_load(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.is_main_resource_load;
-  }
-
-  static blink::mojom::RequestContextType request_context_type(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.request_context_type;
-  }
-
-  static network::mojom::RequestContextFrameType frame_type(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.frame_type;
-  }
-
-  static const GURL& url(const content::ServiceWorkerFetchRequest& request) {
-    return request.url;
-  }
-
-  static const std::string& method(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.method;
-  }
-
-  static std::map<std::string,
-                  std::string,
-                  content::ServiceWorkerCaseInsensitiveCompare>
-  headers(const content::ServiceWorkerFetchRequest& request) {
-    return request.headers;
-  }
-
-  // content::ServiceWorkerFetchRequest does not support the request body.
-  static blink::mojom::SerializedBlobPtr blob(
-      const content::ServiceWorkerFetchRequest& request) {
-    return nullptr;
-  }
-
-  static const content::Referrer& referrer(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.referrer;
-  }
-
-  static network::mojom::FetchCredentialsMode credentials_mode(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.credentials_mode;
-  }
-
-  static blink::mojom::FetchCacheMode cache_mode(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.cache_mode;
-  }
-
-  static network::mojom::FetchRedirectMode redirect_mode(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.redirect_mode;
-  }
-
-  static const std::string& integrity(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.integrity;
-  }
-
-  static bool keepalive(const content::ServiceWorkerFetchRequest& request) {
-    return request.keepalive;
-  }
-
-  static const std::string& client_id(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.client_id;
-  }
-
-  static bool is_reload(const content::ServiceWorkerFetchRequest& request) {
-    return request.is_reload;
-  }
-
-  static bool is_history_navigation(
-      const content::ServiceWorkerFetchRequest& request) {
-    return request.is_history_navigation;
-  }
-
-  static bool Read(blink::mojom::FetchAPIRequestDataView data,
-                   content::ServiceWorkerFetchRequest* out);
-};
-
-}  // namespace mojo
-
-#endif  // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_FETCH_REQUEST_MOJOM_TRAITS_H_
diff --git a/content/common/service_worker/service_worker_type_converter.cc b/content/common/service_worker/service_worker_type_converter.cc
new file mode 100644
index 0000000..c524959
--- /dev/null
+++ b/content/common/service_worker/service_worker_type_converter.cc
@@ -0,0 +1,64 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/service_worker/service_worker_type_converter.h"
+#include "third_party/blink/public/mojom/blob/serialized_blob.mojom.h"
+
+namespace mojo {
+
+// static
+blink::mojom::FetchAPIRequestPtr
+TypeConverter<blink::mojom::FetchAPIRequestPtr,
+              content::ServiceWorkerFetchRequest>::
+    Convert(content::ServiceWorkerFetchRequest request) {
+  auto request_ptr = blink::mojom::FetchAPIRequest::New();
+  request_ptr->mode = request.mode;
+  request_ptr->is_main_resource_load = request.is_main_resource_load;
+  request_ptr->request_context_type = request.request_context_type;
+  request_ptr->frame_type = request.frame_type;
+  request_ptr->url = request.url;
+  request_ptr->method = request.method;
+  request_ptr->headers.insert(request.headers.begin(), request.headers.end());
+  request_ptr->referrer = request.referrer;
+  request_ptr->credentials_mode = request.credentials_mode;
+  request_ptr->cache_mode = request.cache_mode;
+  request_ptr->redirect_mode = request.redirect_mode;
+  request_ptr->integrity = request.integrity;
+  request_ptr->keepalive = request.keepalive;
+  request_ptr->client_id = request.client_id;
+  request_ptr->is_reload = request.is_reload;
+  request_ptr->is_history_navigation = request.is_history_navigation;
+  return request_ptr;
+}
+
+content::ServiceWorkerFetchRequest
+TypeConverter<content::ServiceWorkerFetchRequest,
+              blink::mojom::FetchAPIRequestPtr>::
+    Convert(const blink::mojom::FetchAPIRequestPtr& request_ptr) {
+  DCHECK(request_ptr);
+
+  content::ServiceWorkerFetchRequest request;
+  request.mode = request_ptr->mode;
+  request.is_main_resource_load = request_ptr->is_main_resource_load;
+  request.request_context_type = request_ptr->request_context_type;
+  request.frame_type = request_ptr->frame_type;
+  request.url = request_ptr->url;
+  request.method = request_ptr->method;
+  request.headers.insert(request_ptr->headers.begin(),
+                         request_ptr->headers.end());
+  request.referrer = request_ptr->referrer;
+  request.credentials_mode = request_ptr->credentials_mode;
+  request.cache_mode = request_ptr->cache_mode;
+  request.redirect_mode = request_ptr->redirect_mode;
+  if (request_ptr->integrity.has_value())
+    request.integrity = request_ptr->integrity.value();
+  request.keepalive = request_ptr->keepalive;
+  if (request_ptr->client_id.has_value())
+    request.client_id = request_ptr->client_id.value();
+  request.is_reload = request_ptr->is_reload;
+  request.is_history_navigation = request_ptr->is_history_navigation;
+  return request;
+}
+
+}  // namespace mojo
diff --git a/content/common/service_worker/service_worker_type_converter.h b/content/common/service_worker/service_worker_type_converter.h
new file mode 100644
index 0000000..b29c9fb
--- /dev/null
+++ b/content/common/service_worker/service_worker_type_converter.h
@@ -0,0 +1,32 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPE_CONVERTER_H_
+#define CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPE_CONVERTER_H_
+
+#include "content/common/content_export.h"
+#include "content/common/service_worker/service_worker_types.h"
+#include "mojo/public/cpp/bindings/type_converter.h"
+#include "third_party/blink/public/platform/modules/fetch/fetch_api_request.mojom.h"
+
+namespace mojo {
+// TODO(https://crbug.com/789854) Remove these converters once
+// ServiceWorkerFetchRequest is removed.
+template <>
+struct TypeConverter<blink::mojom::FetchAPIRequestPtr,
+                     content::ServiceWorkerFetchRequest> {
+  CONTENT_EXPORT static blink::mojom::FetchAPIRequestPtr Convert(
+      content::ServiceWorkerFetchRequest request);
+};
+
+template <>
+struct TypeConverter<content::ServiceWorkerFetchRequest,
+                     blink::mojom::FetchAPIRequestPtr> {
+  CONTENT_EXPORT static content::ServiceWorkerFetchRequest Convert(
+      const blink::mojom::FetchAPIRequestPtr& request_ptr);
+};
+
+}  // namespace mojo
+
+#endif  // CONTENT_COMMON_SERVICE_WORKER_SERVICE_WORKER_TYPE_CONVERTER_H_
diff --git a/content/common/service_worker/service_worker_utils.cc b/content/common/service_worker/service_worker_utils.cc
index 24675b2..211cef90 100644
--- a/content/common/service_worker/service_worker_utils.cc
+++ b/content/common/service_worker/service_worker_utils.cc
@@ -276,6 +276,14 @@
   return request;
 }
 
+// static
+ServiceWorkerHeaderMap ServiceWorkerUtils::ToServiceWorkerHeaderMap(
+    const RequestHeaderMap& header_) {
+  content::ServiceWorkerHeaderMap header;
+  header.insert(header_.begin(), header_.end());
+  return header;
+}
+
 bool LongestScopeMatcher::MatchLongest(const GURL& scope) {
   if (!ServiceWorkerUtils::ScopeMatches(scope, url_))
     return false;
diff --git a/content/common/service_worker/service_worker_utils.h b/content/common/service_worker/service_worker_utils.h
index 5533595..9840d76 100644
--- a/content/common/service_worker/service_worker_utils.h
+++ b/content/common/service_worker/service_worker_utils.h
@@ -10,6 +10,7 @@
 #include <vector>
 
 #include "base/command_line.h"
+#include "base/containers/flat_map.h"
 #include "base/macros.h"
 #include "content/common/content_export.h"
 #include "content/common/service_worker/service_worker_types.h"
@@ -23,6 +24,8 @@
 
 class ServiceWorkerUtils {
  public:
+  using RequestHeaderMap = base::flat_map<std::string, std::string>;
+
   static bool IsMainResourceType(ResourceType type) {
     return IsResourceTypeFrame(type) || type == RESOURCE_TYPE_SHARED_WORKER;
   }
@@ -70,7 +73,6 @@
     return oss.str();
   }
 
-
   static bool ShouldBypassCacheDueToUpdateViaCache(
       bool is_main_script,
       blink::mojom::ServiceWorkerUpdateViaCache cache_mode);
@@ -86,6 +88,11 @@
   CONTENT_EXPORT static ServiceWorkerFetchRequest
   DeserializeFetchRequestFromString(const std::string& serialized);
 
+  // TODO(https://crbug.com/789854) Remove this once ServiceWorkerHeaderMap is
+  // removed.
+  CONTENT_EXPORT static content::ServiceWorkerHeaderMap
+  ToServiceWorkerHeaderMap(const RequestHeaderMap& header_);
+
  private:
   static bool IsPathRestrictionSatisfiedInternal(
       const GURL& scope,
diff --git a/content/common/typemaps.gni b/content/common/typemaps.gni
index a9818ee..6d8a5fe5 100644
--- a/content/common/typemaps.gni
+++ b/content/common/typemaps.gni
@@ -14,7 +14,6 @@
   "//content/common/navigation_params.typemap",
   "//content/common/push_messaging.typemap",
   "//content/common/render_frame_metadata.typemap",
-  "//content/common/service_worker/service_worker_fetch_request.typemap",
   "//content/common/url_loader_factory_bundle.typemap",
   "//content/common/web_preferences.typemap",
   "//content/common/media/media_session.typemap",
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/TracingControllerAndroidImplTest.java b/content/public/android/javatests/src/org/chromium/content/browser/TracingControllerAndroidImplTest.java
index b87023f..d6c09a4b 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/TracingControllerAndroidImplTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/TracingControllerAndroidImplTest.java
@@ -19,6 +19,7 @@
 import org.chromium.base.Callback;
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.content_public.browser.test.util.CriteriaHelper;
 import org.chromium.content_shell_apk.ContentShellActivity;
@@ -41,6 +42,7 @@
     @Test
     @MediumTest
     @Feature({"GPU"})
+    @DisabledTest(message = "crbug.com/899894")
     public void testTraceFileCreation() throws Exception {
         ContentShellActivity activity = mActivityTestRule.launchContentShellWithUrl("about:blank");
         mActivityTestRule.waitForActiveShellToBeDoneLoading();
@@ -85,6 +87,7 @@
     @Test
     @MediumTest
     @Feature({"GPU"})
+    @DisabledTest(message = "crbug.com/899894")
     public void testGetKnownCategories() throws Exception {
         ContentShellActivity activity = mActivityTestRule.launchContentShellWithUrl("about:blank");
         mActivityTestRule.waitForActiveShellToBeDoneLoading();
@@ -105,6 +108,7 @@
     @Test
     @MediumTest
     @Feature({"GPU"})
+    @DisabledTest(message = "crbug.com/899894")
     public void testBufferUsage() throws Exception {
         ContentShellActivity activity = mActivityTestRule.launchContentShellWithUrl("about:blank");
         mActivityTestRule.waitForActiveShellToBeDoneLoading();
@@ -127,6 +131,7 @@
     @Test
     @MediumTest
     @Feature({"GPU"})
+    @DisabledTest(message = "crbug.com/899894")
     public void testStopCallbackAndCompression() throws Exception {
         ContentShellActivity activity = mActivityTestRule.launchContentShellWithUrl("about:blank");
         mActivityTestRule.waitForActiveShellToBeDoneLoading();
diff --git a/content/public/browser/network_service_instance.h b/content/public/browser/network_service_instance.h
index 62b15fe7..71d916a 100644
--- a/content/public/browser/network_service_instance.h
+++ b/content/public/browser/network_service_instance.h
@@ -5,9 +5,11 @@
 #ifndef CONTENT_PUBLIC_BROWSER_NETWORK_SERVICE_INSTANCE_H_
 #define CONTENT_PUBLIC_BROWSER_NETWORK_SERVICE_INSTANCE_H_
 
+#include <memory>
+
 #include "base/callback.h"
+#include "base/callback_list.h"
 #include "content/common/content_export.h"
-#include "gpu/command_buffer/common/id_type.h"
 
 namespace network {
 class NetworkConnectionTracker;
@@ -39,28 +41,14 @@
 CONTENT_EXPORT network::mojom::NetworkService* GetNetworkServiceFromConnector(
     service_manager::Connector* connector);
 
-// Opaque type identifying a registered NetworkService crash handler.
-class CrashHandlerDummyType;
-using NetworkServiceCrashHandlerId = gpu::IdType32<CrashHandlerDummyType>;
-
 // Registers |handler| to run (on UI thread) after NetworkServicePtr encounters
-// an error.  Note that there are no ordering wrt error handlers for other
-// interfaces (e.g. NetworkContextPtr and/or URLLoaderFactoryPtr).
-//
-// The return value can be passed to UnregisterNetworkServiceCrashHandler to
-// unregister the |handler|.
+// an error.  Note that there are no ordering guarantees wrt error handlers for
+// other interfaces (e.g. NetworkContextPtr and/or URLLoaderFactoryPtr).
 //
 // Can only be called on the UI thread.  No-op if NetworkService is disabled.
-CONTENT_EXPORT NetworkServiceCrashHandlerId
+CONTENT_EXPORT std::unique_ptr<base::CallbackList<void()>::Subscription>
 RegisterNetworkServiceCrashHandler(base::RepeatingClosure handler);
 
-// Unregisters the crash handler with the given |handler_id|.  See also
-// RegisterNetworkServiceCrashHandler.
-//
-// Can only be called on the UI thread.  No-op if NetworkService is disabled.
-CONTENT_EXPORT void UnregisterNetworkServiceCrashHandler(
-    NetworkServiceCrashHandlerId handler_id);
-
 // When network service is disabled, returns the in-process NetworkService
 // pointer which is used to ease transition to network service.
 // Must only be called on the IO thread.  Must not be called if the network
diff --git a/content/public/test/DEPS b/content/public/test/DEPS
index 8acc5a4..f4f6be70 100644
--- a/content/public/test/DEPS
+++ b/content/public/test/DEPS
@@ -1,5 +1,6 @@
 include_rules = [
   "-content",
+  "+content/common/service_worker/service_worker_types.h",
   "+content/public",
   "+components/download/public/common",
   "+components/viz/common",
diff --git a/content/public/test/test_utils.h b/content/public/test/test_utils.h
index 514926a..37f58ec 100644
--- a/content/public/test/test_utils.h
+++ b/content/public/test/test_utils.h
@@ -13,6 +13,7 @@
 #include "base/run_loop.h"
 #include "base/threading/thread_checker.h"
 #include "build/build_config.h"
+#include "content/common/service_worker/service_worker_types.h"
 #include "content/public/browser/browser_child_process_observer.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/content_browser_client.h"
diff --git a/content/renderer/android/synchronous_layer_tree_frame_sink.cc b/content/renderer/android/synchronous_layer_tree_frame_sink.cc
index 558e0ff..09afb40 100644
--- a/content/renderer/android/synchronous_layer_tree_frame_sink.cc
+++ b/content/renderer/android/synchronous_layer_tree_frame_sink.cc
@@ -260,15 +260,18 @@
 
     if (!root_local_surface_id_.is_valid() || display_size_ != display_size ||
         device_scale_factor_ != frame.metadata.device_scale_factor) {
-      root_local_surface_id_ = parent_local_surface_id_allocator_->GenerateId();
+      parent_local_surface_id_allocator_->GenerateId();
+      root_local_surface_id_ =
+          parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId();
       display_size_ = display_size;
       device_scale_factor_ = frame.metadata.device_scale_factor;
     }
 
     if (!child_local_surface_id_.is_valid() || child_size_ != child_size ||
         device_scale_factor_ != frame.metadata.device_scale_factor) {
+      parent_local_surface_id_allocator_->GenerateId();
       child_local_surface_id_ =
-          parent_local_surface_id_allocator_->GenerateId();
+          parent_local_surface_id_allocator_->GetCurrentLocalSurfaceId();
       child_size_ = child_size;
       device_scale_factor_ = frame.metadata.device_scale_factor;
     }
diff --git a/content/shell/test_runner/test_interfaces.cc b/content/shell/test_runner/test_interfaces.cc
index c5fc6e1..a1c68f9 100644
--- a/content/shell/test_runner/test_interfaces.cc
+++ b/content/shell/test_runner/test_interfaces.cc
@@ -32,7 +32,7 @@
   // progress here in a per-directory manner.
   // TODO(xiaochengh): Progressively allow more tests to use innerText.
   // Remove this function once rebaseline is complete.
-  return test_path >= "LayoutTests/a" && test_path < "LayoutTests/fast/e";
+  return test_path >= "LayoutTests/a" && test_path < "LayoutTests/fast/f";
 }
 }  // namespace
 
diff --git a/content/test/gpu/gpu_tests/depth_capture_expectations.py b/content/test/gpu/gpu_tests/depth_capture_expectations.py
index 08df17b2..3df6b35 100644
--- a/content/test/gpu/gpu_tests/depth_capture_expectations.py
+++ b/content/test/gpu/gpu_tests/depth_capture_expectations.py
@@ -23,6 +23,11 @@
                ['highsierra', ('intel', 0x0a2e)], bug=824438)
 
     self.Flaky('DepthCapture_depthStreamToRGBAFloatTexture',
+               ['win10', ('nvidia', 0x1cb3)], bug=737410)
+    self.Flaky('DepthCapture_depthStreamToRGBAUint8Texture',
+               ['win10', ('nvidia', 0x1cb3)], bug=737410)
+
+    self.Flaky('DepthCapture_depthStreamToRGBAFloatTexture',
                ['android', ('qualcomm', 'Adreno (TM) 418')], bug=899748)
     self.Flaky('DepthCapture_depthStreamToRGBAUint8Texture',
                ['android', ('qualcomm', 'Adreno (TM) 418')], bug=899748)
diff --git a/content/test/gpu/gpu_tests/pixel_expectations.py b/content/test/gpu/gpu_tests/pixel_expectations.py
index 9a709ef..7e2bf8b 100644
--- a/content/test/gpu/gpu_tests/pixel_expectations.py
+++ b/content/test/gpu/gpu_tests/pixel_expectations.py
@@ -16,10 +16,6 @@
     self.Flaky('Pixel_GpuRasterization_BlueBox',
         ['win', ('amd', 0x6613)], bug=653538)
 
-    # TODO(senorblanco) generate new reference images after Edge-AA tess change.
-    self.Fail('Pixel_OffscreenCanvasAccelerated2D')
-    self.Fail('Pixel_OffscreenCanvasAccelerated2DWorker')
-
     # Software compositing is not supported on Android: we skip the tests that
     # disable GPU compositing (--disable-gpu-compositing).
     self.Skip('Pixel_OffscreenCanvasUnaccelerated2D', ['android'])
diff --git a/device/vr/BUILD.gn b/device/vr/BUILD.gn
index 03921dc..a8577f9 100644
--- a/device/vr/BUILD.gn
+++ b/device/vr/BUILD.gn
@@ -63,6 +63,8 @@
         "android/gvr/gvr_gamepad_data_fetcher.cc",
         "android/gvr/gvr_gamepad_data_fetcher.h",
         "android/gvr/gvr_gamepad_data_provider.h",
+        "android/gvr/vr_module_delegate.cc",
+        "android/gvr/vr_module_delegate.h",
       ]
 
       if (enable_arcore) {
diff --git a/device/vr/android/gvr/gvr_device.cc b/device/vr/android/gvr/gvr_device.cc
index a8a3118d..3e7d855 100644
--- a/device/vr/android/gvr/gvr_device.cc
+++ b/device/vr/android/gvr/gvr_device.cc
@@ -16,6 +16,7 @@
 #include "device/vr/android/gvr/gvr_delegate_provider.h"
 #include "device/vr/android/gvr/gvr_delegate_provider_factory.h"
 #include "device/vr/android/gvr/gvr_device_provider.h"
+#include "device/vr/android/gvr/vr_module_delegate.h"
 #include "device/vr/vr_display_impl.h"
 #include "jni/NonPresentingGvrContext_jni.h"
 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/gvr.h"
@@ -161,33 +162,12 @@
     mojom::XRRuntimeSessionOptionsPtr options,
     mojom::XRRuntime::RequestSessionCallback callback) {
   if (!gvr_api_) {
-    EnsureGvrReady();
-    if (!gvr_api_) {
-      std::move(callback).Run(nullptr, nullptr);
-      return;
-    }
-  }
-
-  if (!options->immersive) {
-    // TODO(https://crbug.com/695937): This should be NOTREACHED() once we no
-    // longer need the hacked GRV non-immersive mode.  This should now only be
-    // hit if orientation devices are disabled by flag.
-    ReturnNonImmersiveSession(std::move(callback));
+    Init(base::BindOnce(&GvrDevice::OnInitRequestSessionFinished,
+                        base::Unretained(this), std::move(options),
+                        std::move(callback)));
     return;
   }
-
-  GvrDelegateProvider* delegate_provider = GetGvrDelegateProvider();
-  if (!delegate_provider) {
-    std::move(callback).Run(nullptr, nullptr);
-    return;
-  }
-
-  // StartWebXRPresentation is async as we may trigger a DON (Device ON) flow
-  // that pauses Chrome.
-  delegate_provider->StartWebXRPresentation(
-      GetVRDisplayInfo(), std::move(options),
-      base::BindOnce(&GvrDevice::OnStartPresentResult,
-                     weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
+  OnInitRequestSessionFinished(std::move(options), std::move(callback), true);
 }
 
 void GvrDevice::OnStartPresentResult(
@@ -233,30 +213,6 @@
   exclusive_controller_binding_.Close();
 }
 
-void GvrDevice::EnsureGvrReady() {
-  if (!non_presenting_context_.obj() || !gvr_api_) {
-    GvrDelegateProvider* delegate_provider = GetGvrDelegateProvider();
-    if (!delegate_provider || delegate_provider->ShouldDisableGvrDevice())
-      return;
-    JNIEnv* env = base::android::AttachCurrentThread();
-    non_presenting_context_.Reset(Java_NonPresentingGvrContext_create(
-        env, reinterpret_cast<jlong>(this)));
-    if (!non_presenting_context_.obj())
-      return;
-    jlong context = Java_NonPresentingGvrContext_getNativeGvrContext(
-        env, non_presenting_context_);
-    gvr_api_ =
-        gvr::GvrApi::WrapNonOwned(reinterpret_cast<gvr_context*>(context));
-    SetVRDisplayInfo(CreateVRDisplayInfo(gvr_api_.get(), GetId()));
-
-    if (paused_) {
-      PauseTracking();
-    } else {
-      ResumeTracking();
-    }
-  }
-}
-
 void GvrDevice::OnMagicWindowFrameDataRequest(
     mojom::XRFrameDataProvider::GetFrameDataCallback callback) {
   if (!gvr_api_) {
@@ -295,8 +251,9 @@
 }
 
 void GvrDevice::EnsureInitialized(EnsureInitializedCallback callback) {
-  EnsureGvrReady();
-  std::move(callback).Run();
+  Init(base::BindOnce([](EnsureInitializedCallback callback,
+                         bool success) { std::move(callback).Run(); },
+                      std::move(callback)));
 }
 
 GvrDelegateProvider* GvrDevice::GetGvrDelegateProvider() {
@@ -319,4 +276,85 @@
   OnActivate(reason, std::move(on_handled));
 }
 
+void GvrDevice::Init(base::OnceCallback<void(bool)> on_finished) {
+  VrModuleDelegate* module_delegate = VrModuleDelegate::Get();
+  if (!module_delegate) {
+    std::move(on_finished).Run(false);
+    return;
+  }
+  if (!module_delegate->ModuleInstalled()) {
+    module_delegate->InstallModule(
+        base::BindOnce(&GvrDevice::OnVrModuleInstalled, base::Unretained(this),
+                       std::move(on_finished)));
+    return;
+  }
+  OnVrModuleInstalled(std::move(on_finished), true);
+}
+
+void GvrDevice::OnVrModuleInstalled(base::OnceCallback<void(bool)> on_finished,
+                                    bool success) {
+  if (!success) {
+    std::move(on_finished).Run(false);
+    return;
+  }
+  GvrDelegateProvider* delegate_provider = GetGvrDelegateProvider();
+  if (!delegate_provider || delegate_provider->ShouldDisableGvrDevice()) {
+    std::move(on_finished).Run(false);
+    return;
+  }
+  CreateNonPresentingContext();
+  std::move(on_finished).Run(non_presenting_context_.obj() != nullptr);
+}
+
+void GvrDevice::CreateNonPresentingContext() {
+  if (non_presenting_context_.obj())
+    return;
+  JNIEnv* env = base::android::AttachCurrentThread();
+  non_presenting_context_.Reset(
+      Java_NonPresentingGvrContext_create(env, reinterpret_cast<jlong>(this)));
+  if (!non_presenting_context_.obj())
+    return;
+  jlong context = Java_NonPresentingGvrContext_getNativeGvrContext(
+      env, non_presenting_context_);
+  gvr_api_ = gvr::GvrApi::WrapNonOwned(reinterpret_cast<gvr_context*>(context));
+  SetVRDisplayInfo(CreateVRDisplayInfo(gvr_api_.get(), GetId()));
+
+  if (paused_) {
+    PauseTracking();
+  } else {
+    ResumeTracking();
+  }
+}
+
+void GvrDevice::OnInitRequestSessionFinished(
+    mojom::XRRuntimeSessionOptionsPtr options,
+    mojom::XRRuntime::RequestSessionCallback callback,
+    bool success) {
+  if (!success) {
+    std::move(callback).Run(nullptr, nullptr);
+    return;
+  }
+
+  if (!options->immersive) {
+    // TODO(https://crbug.com/695937): This should be NOTREACHED() once we no
+    // longer need the hacked GRV non-immersive mode.  This should now only be
+    // hit if orientation devices are disabled by flag.
+    ReturnNonImmersiveSession(std::move(callback));
+    return;
+  }
+
+  GvrDelegateProvider* delegate_provider = GetGvrDelegateProvider();
+  if (!delegate_provider) {
+    std::move(callback).Run(nullptr, nullptr);
+    return;
+  }
+
+  // StartWebXRPresentation is async as we may trigger a DON (Device ON) flow
+  // that pauses Chrome.
+  delegate_provider->StartWebXRPresentation(
+      GetVRDisplayInfo(), std::move(options),
+      base::BindOnce(&GvrDevice::OnStartPresentResult,
+                     weak_ptr_factory_.GetWeakPtr(), std::move(callback)));
+}
+
 }  // namespace device
diff --git a/device/vr/android/gvr/gvr_device.h b/device/vr/android/gvr/gvr_device.h
index 93388c05..342f1be 100644
--- a/device/vr/android/gvr/gvr_device.h
+++ b/device/vr/android/gvr/gvr_device.h
@@ -53,9 +53,17 @@
 
   void OnPresentingControllerMojoConnectionError();
   void StopPresenting();
-  void EnsureGvrReady();
   GvrDelegateProvider* GetGvrDelegateProvider();
 
+  void Init(base::OnceCallback<void(bool)> on_finished);
+  void OnVrModuleInstalled(base::OnceCallback<void(bool)> on_finished,
+                           bool success);
+  void CreateNonPresentingContext();
+  void OnInitRequestSessionFinished(
+      mojom::XRRuntimeSessionOptionsPtr options,
+      mojom::XRRuntime::RequestSessionCallback callback,
+      bool success);
+
   base::android::ScopedJavaGlobalRef<jobject> non_presenting_context_;
   std::unique_ptr<gvr::GvrApi> gvr_api_;
 
diff --git a/device/vr/android/gvr/vr_module_delegate.cc b/device/vr/android/gvr/vr_module_delegate.cc
new file mode 100644
index 0000000..d2043470
--- /dev/null
+++ b/device/vr/android/gvr/vr_module_delegate.cc
@@ -0,0 +1,28 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "device/vr/android/gvr/vr_module_delegate.h"
+
+namespace device {
+
+namespace {
+// Storing the global delegate in a raw pointer - as opposed to e.g. an
+// std::unique_ptr - to avoid adding a static initializer.
+VrModuleDelegate* g_vr_module_delegate = nullptr;
+}  // namespace
+
+// static
+VrModuleDelegate* VrModuleDelegate::Get() {
+  return g_vr_module_delegate;
+}
+
+// static
+void VrModuleDelegate::Set(std::unique_ptr<VrModuleDelegate> delegate) {
+  if (g_vr_module_delegate) {
+    delete g_vr_module_delegate;
+  }
+  g_vr_module_delegate = delegate.release();
+}
+
+}  // namespace device
diff --git a/device/vr/android/gvr/vr_module_delegate.h b/device/vr/android/gvr/vr_module_delegate.h
new file mode 100644
index 0000000..9e6c204
--- /dev/null
+++ b/device/vr/android/gvr/vr_module_delegate.h
@@ -0,0 +1,38 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_VR_ANDROID_GVR_VR_MODULE_DELEGATE_H_
+#define DEVICE_VR_ANDROID_GVR_VR_MODULE_DELEGATE_H_
+
+#include "base/callback.h"
+#include "base/macros.h"
+#include "device/vr/vr_export.h"
+
+namespace device {
+
+// Delegates installation of the VR module.
+class DEVICE_VR_EXPORT VrModuleDelegate {
+ public:
+  // Returns the global module delegate.
+  static VrModuleDelegate* Get();
+  // Sets the global module delegate.
+  static void Set(std::unique_ptr<VrModuleDelegate> delegate);
+
+  VrModuleDelegate() = default;
+  virtual ~VrModuleDelegate() = default;
+  // Returns true if the VR module is installed.
+  virtual bool ModuleInstalled() = 0;
+  // Asynchronously requests to install the VR module. |on_finished| is called
+  // after the module install is completed. If |success| is false the module
+  // install failed.
+  virtual void InstallModule(
+      base::OnceCallback<void(bool success)> on_finished) = 0;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(VrModuleDelegate);
+};
+
+}  // namespace device
+
+#endif  // DEVICE_VR_ANDROID_GVR_VR_MODULE_DELEGATE_H_
diff --git a/extensions/common/extension_icon_set.cc b/extensions/common/extension_icon_set.cc
index cb707bf2..1f93f9e 100644
--- a/extensions/common/extension_icon_set.cc
+++ b/extensions/common/extension_icon_set.cc
@@ -29,7 +29,8 @@
   if (match_type == MATCH_EXACTLY) {
     auto result = map_.find(size);
     return result == map_.end() ? base::EmptyString() : result->second;
-  } else if (match_type == MATCH_SMALLER) {
+  }
+  if (match_type == MATCH_SMALLER) {
     auto result = map_.rend();
     for (auto iter = map_.rbegin(); iter != map_.rend(); ++iter) {
       if (iter->first <= size) {
@@ -38,17 +39,17 @@
       }
     }
     return result == map_.rend() ? base::EmptyString() : result->second;
-  } else {
-    DCHECK(match_type == MATCH_BIGGER);
-    auto result = map_.cend();
-    for (auto iter = map_.cbegin(); iter != map_.cend(); ++iter) {
-      if (iter->first >= size) {
-        result = iter;
-        break;
-      }
-    }
-    return result == map_.cend() ? base::EmptyString() : result->second;
   }
+
+  DCHECK(match_type == MATCH_BIGGER);
+  auto result = map_.cend();
+  for (auto iter = map_.cbegin(); iter != map_.cend(); ++iter) {
+    if (iter->first >= size) {
+      result = iter;
+      break;
+    }
+  }
+  return result == map_.cend() ? base::EmptyString() : result->second;
 }
 
 bool ExtensionIconSet::ContainsPath(base::StringPiece path) const {
diff --git a/google_apis/gaia/gaia_auth_fetcher.cc b/google_apis/gaia/gaia_auth_fetcher.cc
index 8799d39b3..89ad611e 100644
--- a/google_apis/gaia/gaia_auth_fetcher.cc
+++ b/google_apis/gaia/gaia_auth_fetcher.cc
@@ -733,6 +733,9 @@
     const std::vector<MultiloginTokenIDPair>& accounts) {
   DCHECK(!fetch_pending_) << "Tried to fetch two things at once!";
 
+  UMA_HISTOGRAM_COUNTS_100("Signin.Multilogin.NumberOfAccounts",
+                           accounts.size());
+
   std::vector<std::string> authorization_header_parts;
   for (const MultiloginTokenIDPair& account : accounts) {
     authorization_header_parts.push_back(base::StringPrintf(
diff --git a/google_apis/gaia/oauth_multilogin_result.cc b/google_apis/gaia/oauth_multilogin_result.cc
index e02a108d..6076fec6 100644
--- a/google_apis/gaia/oauth_multilogin_result.cc
+++ b/google_apis/gaia/oauth_multilogin_result.cc
@@ -3,11 +3,28 @@
 // found in the LICENSE file.
 
 #include "google_apis/gaia/oauth_multilogin_result.h"
+
+#include "base/compiler_specific.h"
 #include "base/json/json_reader.h"
+#include "base/metrics/histogram_macros.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_piece_forward.h"
 
-OAuthMultiloginResult::OAuthMultiloginResult() {}
+OAuthMultiloginResponseStatus ParseOAuthMultiloginResponseStatus(
+    const std::string& status) {
+  if (status == "OK")
+    return OAuthMultiloginResponseStatus::kOk;
+  if (status == "RETRY")
+    return OAuthMultiloginResponseStatus::kRetry;
+  if (status == "INVALID_TOKENS")
+    return OAuthMultiloginResponseStatus::kInvalidTokens;
+  if (status == "INVALID_INPUT")
+    return OAuthMultiloginResponseStatus::kInvalidInput;
+  if (status == "ERROR")
+    return OAuthMultiloginResponseStatus::kError;
+
+  return OAuthMultiloginResponseStatus::kUnknownStatus;
+}
 
 OAuthMultiloginResult::OAuthMultiloginResult(
     const OAuthMultiloginResult& other) {
@@ -30,19 +47,32 @@
 
 void OAuthMultiloginResult::TryParseStatusFromValue(
     base::DictionaryValue* dictionary_value) {
-  std::string status;
-  dictionary_value->GetString("status", &status);
-  if (status == "OK") {
-    error_ = GoogleServiceAuthError::AuthErrorNone();
-  } else if (status == "RETRY") {
-    // This is a transient error.
-    error_ =
-        GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE);
-  } else if (status == "INVALID_TOKENS") {
-    error_ = GoogleServiceAuthError(
-        GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
-  } else {
-    error_ = GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_ERROR);
+  std::string status_string;
+  dictionary_value->GetString("status", &status_string);
+  OAuthMultiloginResponseStatus status =
+      ParseOAuthMultiloginResponseStatus(status_string);
+  UMA_HISTOGRAM_ENUMERATION("Signin.OAuthMultiloginResponseStatus", status);
+  switch (status) {
+    case OAuthMultiloginResponseStatus::kUnknownStatus:
+      error_ = GoogleServiceAuthError(
+          GoogleServiceAuthError::UNEXPECTED_SERVICE_RESPONSE);
+      break;
+    case OAuthMultiloginResponseStatus::kOk:
+      error_ = GoogleServiceAuthError::AuthErrorNone();
+      break;
+    case OAuthMultiloginResponseStatus::kRetry:
+      // This is a transient error.
+      error_ =
+          GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE);
+      break;
+    case OAuthMultiloginResponseStatus::kInvalidTokens:
+      error_ = GoogleServiceAuthError(
+          GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS);
+      break;
+    case OAuthMultiloginResponseStatus::kError:
+    case OAuthMultiloginResponseStatus::kInvalidInput:
+      error_ = GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_ERROR);
+      break;
   }
 }
 
@@ -147,4 +177,4 @@
   }
 }
 
-OAuthMultiloginResult::~OAuthMultiloginResult() = default;
\ No newline at end of file
+OAuthMultiloginResult::~OAuthMultiloginResult() = default;
diff --git a/google_apis/gaia/oauth_multilogin_result.h b/google_apis/gaia/oauth_multilogin_result.h
index 4b7b95ad..213c8a1 100644
--- a/google_apis/gaia/oauth_multilogin_result.h
+++ b/google_apis/gaia/oauth_multilogin_result.h
@@ -17,9 +17,46 @@
 #include "net/url_request/url_request_status.h"
 #include "url/gurl.h"
 
+// Values for the 'status' field of multilogin responses. Used for UMA logging,
+// do not remove or reorder values.
+enum class OAuthMultiloginResponseStatus {
+  // Status could not be parsed.
+  kUnknownStatus = 0,
+
+  // The request was processed successfully, and the rest of this object
+  // contains the cookies to set across domains. The HTTP status code will be
+  // 200.
+  kOk = 1,
+
+  // Something happened while processing the request that made it fail. It is
+  // suspected to be a transient issue, so the client may retry at a later time
+  // with exponential backoff. The HTTP status code will be 503.
+  kRetry = 2,
+
+  // The input parameters were not as expected (wrong header format, missing
+  // parameters, etc). Retrying without changing input parameters will not work.
+  // The HTTP status code will be 400.
+  kInvalidInput = 3,
+
+  // At least one provided token could not be used to authenticate the
+  // corresponding user. This includes the case where the provided Gaia ID does
+  // not match with the corresponding OAuth token. The HTTP status code will be
+  // 403.
+  kInvalidTokens = 4,
+
+  // An error occurred while processing the request, and retrying is not
+  // expected to work. The HTTP status code will be 500.
+  kError = 5,
+
+  kMaxValue = kError,
+};
+
+// Parses the status field of the response.
+OAuthMultiloginResponseStatus ParseOAuthMultiloginResponseStatus(
+    const std::string& status);
+
 class OAuthMultiloginResult {
  public:
-  OAuthMultiloginResult();
   // Parses cookies and status from JSON response. Maps status to
   // GoogleServiceAuthError::State values or sets error to
   // UNEXPECTED_SERVER_RESPONSE if JSON string cannot be parsed.
@@ -56,4 +93,4 @@
   GoogleServiceAuthError error_;
 };
 
-#endif  // GOOGLE_APIS_GAIA_OAUTH_MULTILOGIN_RESULT_H_
\ No newline at end of file
+#endif  // GOOGLE_APIS_GAIA_OAUTH_MULTILOGIN_RESULT_H_
diff --git a/google_apis/gaia/oauth_multilogin_result_unittest.cc b/google_apis/gaia/oauth_multilogin_result_unittest.cc
index bae128b..971cd6a8 100644
--- a/google_apis/gaia/oauth_multilogin_result_unittest.cc
+++ b/google_apis/gaia/oauth_multilogin_result_unittest.cc
@@ -21,7 +21,7 @@
 using ::testing::_;
 
 TEST(OAuthMultiloginResultTest, TryParseCookiesFromValue) {
-  OAuthMultiloginResult result;
+  OAuthMultiloginResult result("");
   // SID: typical response for a domain cookie
   // APISID: typical response for a host cookie
   // SSID: not canonical cookie because of the wrong path, should not be added
@@ -307,4 +307,46 @@
             GoogleServiceAuthError::State::INVALID_GAIA_CREDENTIALS);
   EXPECT_TRUE(result4.error().IsPersistentError());
   EXPECT_THAT(result4.failed_accounts(), ElementsAre(Eq("account1")));
-}
\ No newline at end of file
+
+  // Unknown status.
+  OAuthMultiloginResult unknown_status(R"()]}'
+        {
+          "status": "Foo",
+          "cookies":[
+            {
+              "name":"SID",
+              "value":"vAlUe1",
+              "domain":".google.ru",
+              "path":"/",
+              "isSecure":true,
+              "isHttpOnly":false,
+              "priority":"HIGH",
+              "maxAge":63070000
+            }
+          ]
+        }
+      )");
+  EXPECT_EQ(unknown_status.error().state(),
+            GoogleServiceAuthError::State::UNEXPECTED_SERVICE_RESPONSE);
+  EXPECT_TRUE(unknown_status.cookies().empty());
+}
+
+TEST(OAuthMultiloginResultTest, ParseResponseStatus) {
+  struct TestCase {
+    std::string status_string;
+    OAuthMultiloginResponseStatus expected_status;
+  };
+
+  std::vector<TestCase> test_cases = {
+      {"FOO", OAuthMultiloginResponseStatus::kUnknownStatus},
+      {"OK", OAuthMultiloginResponseStatus::kOk},
+      {"RETRY", OAuthMultiloginResponseStatus::kRetry},
+      {"INVALID_INPUT", OAuthMultiloginResponseStatus::kInvalidInput},
+      {"INVALID_TOKENS", OAuthMultiloginResponseStatus::kInvalidTokens},
+      {"ERROR", OAuthMultiloginResponseStatus::kError}};
+
+  for (const auto& test_case : test_cases) {
+    EXPECT_EQ(test_case.expected_status,
+              ParseOAuthMultiloginResponseStatus(test_case.status_string));
+  }
+}
diff --git a/gpu/angle_deqp_tests_main.cc b/gpu/angle_deqp_tests_main.cc
index 72733c6..169de83 100644
--- a/gpu/angle_deqp_tests_main.cc
+++ b/gpu/angle_deqp_tests_main.cc
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/at_exit.h"
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
@@ -36,8 +35,6 @@
   angle::InitTestHarness(&argc, argv);
   base::TestSuite test_suite(argc, argv);
   int rt = base::LaunchUnitTestsSerially(
-      argc,
-      argv,
-      base::Bind(&RunHelper, base::Unretained(&test_suite)));
+      argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
   return rt;
 }
diff --git a/gpu/angle_end2end_tests_main.cc b/gpu/angle_end2end_tests_main.cc
index 272cf29..cb2c65e 100644
--- a/gpu/angle_end2end_tests_main.cc
+++ b/gpu/angle_end2end_tests_main.cc
@@ -2,14 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/at_exit.h"
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
 #include "base/test/launcher/unit_test_launcher.h"
 #include "base/test/test_suite.h"
 #include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/angle/src/tests/test_utils/ANGLETest.h"
 
 namespace {
@@ -27,11 +25,10 @@
   testing::AddGlobalTestEnvironment(new ANGLETestEnvironment());
   base::TestSuite test_suite(argc, argv);
   int rt = base::LaunchUnitTestsWithOptions(
-      argc,
-      argv,
-      1,  // Run tests serially.
-      0,  // Disable batching.
+      argc, argv,
+      1,     // Run tests serially.
+      0,     // Disable batching.
       true,  // Use job objects.
-      base::Bind(&RunHelper, base::Unretained(&test_suite)));
+      base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
   return rt;
 }
diff --git a/gpu/angle_perftests_main.cc b/gpu/angle_perftests_main.cc
index 871e42d..f5e260c 100644
--- a/gpu/angle_perftests_main.cc
+++ b/gpu/angle_perftests_main.cc
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/at_exit.h"
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
@@ -30,8 +29,6 @@
   base::CommandLine::Init(argc, argv);
   base::TestSuite test_suite(argc, argv);
   int rt = base::LaunchUnitTestsSerially(
-      argc,
-      argv,
-      base::Bind(&RunHelper, base::Unretained(&test_suite)));
+      argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
   return rt;
 }
diff --git a/gpu/angle_unittest_main.cc b/gpu/angle_unittest_main.cc
index 2294b5c..a49b537 100644
--- a/gpu/angle_unittest_main.cc
+++ b/gpu/angle_unittest_main.cc
@@ -2,14 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/at_exit.h"
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
 #include "base/test/launcher/unit_test_launcher.h"
 #include "base/test/test_suite.h"
 #include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/angle/include/GLSLANG/ShaderLang.h"
 
 namespace {
@@ -27,9 +25,7 @@
   sh::Initialize();
   base::TestSuite test_suite(argc, argv);
   int rt = base::LaunchUnitTestsSerially(
-      argc,
-      argv,
-      base::Bind(&RunHelper, base::Unretained(&test_suite)));
+      argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
   sh::Finalize();
   return rt;
 }
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
index 562f650..80d20165 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.cc
@@ -953,6 +953,12 @@
                         attrib_helper.offscreen_framebuffer_size.height());
   }
 
+  // Initialize the tracked scissor and viewport state and then apply the
+  // surface offsets if needed.
+  api()->glGetIntegervFn(GL_VIEWPORT, viewport_);
+  api()->glGetIntegervFn(GL_SCISSOR_BOX, scissor_);
+  ApplySurfaceDrawOffset();
+
   set_initialized();
   return gpu::ContextResult::kSuccess;
 }
@@ -1783,6 +1789,24 @@
       }
       break;
 
+    case GL_VIEWPORT:
+      // The applied viewport and scissor could be offset by the current
+      // surface, return the tracked values instead
+      if (length < 4) {
+        return error::kInvalidArguments;
+      }
+      std::copy(std::begin(viewport_), std::end(viewport_), params);
+      break;
+
+    case GL_SCISSOR_BOX:
+      // The applied viewport and scissor could be offset by the current
+      // surface, return the tracked values instead
+      if (length < 4) {
+        return error::kInvalidArguments;
+      }
+      std::copy(std::begin(scissor_), std::end(scissor_), params);
+      break;
+
     default:
       break;
   }
@@ -2434,6 +2458,27 @@
   }
 }
 
+gfx::Vector2d GLES2DecoderPassthroughImpl::GetSurfaceDrawOffset() const {
+  if (bound_draw_framebuffer_ != 0 || offscreen_) {
+    return gfx::Vector2d();
+  }
+  return surface_->GetDrawOffset();
+}
+
+void GLES2DecoderPassthroughImpl::ApplySurfaceDrawOffset() {
+  if (offscreen_ || !surface_->SupportsDCLayers()) {
+    return;
+  }
+
+  gfx::Vector2d framebuffer_offset = GetSurfaceDrawOffset();
+  api()->glViewportFn(viewport_[0] + framebuffer_offset.x(),
+                      viewport_[1] + framebuffer_offset.y(), viewport_[2],
+                      viewport_[3]);
+  api()->glScissorFn(scissor_[0] + framebuffer_offset.x(),
+                     scissor_[1] + framebuffer_offset.y(), scissor_[2],
+                     scissor_[3]);
+}
+
 bool GLES2DecoderPassthroughImpl::CheckErrorCallbackState() {
   bool had_error_ = had_error_callback_;
   had_error_callback_ = false;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
index 90829fa..2cd798f 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough.h
@@ -599,6 +599,12 @@
     scoped_refptr<TexturePassthrough> texture;
   };
 
+  // Tracked viewport and scissor state for surface offset
+  GLint viewport_[4] = {0, 0, 0, 0};
+  GLint scissor_[4] = {0, 0, 0, 0};
+  gfx::Vector2d GetSurfaceDrawOffset() const;
+  void ApplySurfaceDrawOffset();
+
   // Use a limit that is at least ANGLE's IMPLEMENTATION_MAX_ACTIVE_TEXTURES
   // constant
   static constexpr size_t kMaxTextureUnits = 64;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
index 57cd26b42..a77b7d72 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_passthrough_doers.cc
@@ -219,6 +219,17 @@
   memcpy(data->data() + old_size.ValueOrDie(), str, len);
 }
 
+void AssignGLRectangle(GLint rectangle[4],
+                       GLint x,
+                       GLint y,
+                       GLint width,
+                       GLint height) {
+  rectangle[0] = x;
+  rectangle[1] = y;
+  rectangle[2] = width;
+  rectangle[3] = height;
+}
+
 // In order to minimize the amount of data copied, the command buffer client
 // unpack pixels before sending the glTex[Sub]Image[2|3]D calls. The only
 // parameter it doesn't handle is the alignment. Resetting the unpack state is
@@ -424,13 +435,16 @@
   }
 
   // Update tracking of the bound framebuffer
+  bool draw_framebuffer_changed = false;
   switch (target) {
     case GL_FRAMEBUFFER_EXT:
+      draw_framebuffer_changed = true;
       bound_draw_framebuffer_ = framebuffer;
       bound_read_framebuffer_ = framebuffer;
       break;
 
     case GL_DRAW_FRAMEBUFFER:
+      draw_framebuffer_changed = true;
       bound_draw_framebuffer_ = framebuffer;
       break;
 
@@ -443,6 +457,13 @@
       break;
   }
 
+  // Resync the surface offset if the draw framebuffer has changed to or from
+  // the default framebuffer
+  if (draw_framebuffer_changed && bound_draw_framebuffer_ != framebuffer &&
+      (bound_draw_framebuffer_ == 0 || framebuffer == 0)) {
+    ApplySurfaceDrawOffset();
+  }
+
   return error::kNoError;
 }
 
@@ -931,6 +952,9 @@
         api()->glBindFramebufferEXTFn(
             GL_DRAW_FRAMEBUFFER, emulated_back_buffer_->framebuffer_service_id);
       }
+
+      // Update the surface offset if the bound draw framebuffer is deleted
+      ApplySurfaceDrawOffset();
     }
     if (framebuffer == bound_read_framebuffer_) {
       bound_read_framebuffer_ = 0;
@@ -2330,7 +2354,19 @@
                                                     GLint y,
                                                     GLsizei width,
                                                     GLsizei height) {
-  api()->glScissorFn(x, y, width, height);
+  CheckErrorCallbackState();
+
+  gfx::Vector2d scissor_offset = GetSurfaceDrawOffset();
+  api()->glScissorFn(x + scissor_offset.x(), y + scissor_offset.y(), width,
+                     height);
+
+  if (CheckErrorCallbackState()) {
+    // Skip any state tracking updates if an error was generated
+    return error::kNoError;
+  }
+
+  AssignGLRectangle(scissor_, x, y, width, height);
+
   return error::kNoError;
 }
 
@@ -2976,7 +3012,20 @@
                                                      GLint y,
                                                      GLsizei width,
                                                      GLsizei height) {
-  api()->glViewportFn(x, y, width, height);
+  CheckErrorCallbackState();
+
+  gfx::Vector2d viewport_offset = GetSurfaceDrawOffset();
+  api()->glViewportFn(x + viewport_offset.x(), y + viewport_offset.y(), width,
+                      height);
+
+  if (CheckErrorCallbackState()) {
+    // Skip any state tracking updates if an error was generated. Viewport may
+    // have been out of bounds.
+    return error::kNoError;
+  }
+
+  AssignGLRectangle(viewport_, x, y, width, height);
+
   return error::kNoError;
 }
 
@@ -4810,6 +4859,8 @@
     return error::kNoError;
   }
 
+  ApplySurfaceDrawOffset();
+
   return error::kNoError;
 }
 
diff --git a/gpu/command_buffer/service/service_transfer_cache.cc b/gpu/command_buffer/service/service_transfer_cache.cc
index 755a220..bb2abbf 100644
--- a/gpu/command_buffer/service/service_transfer_cache.cc
+++ b/gpu/command_buffer/service/service_transfer_cache.cc
@@ -7,9 +7,9 @@
 #include <inttypes.h>
 
 #include "base/bind.h"
-#include "base/memory/memory_coordinator_client_registry.h"
 #include "base/strings/stringprintf.h"
 #include "base/sys_info.h"
+#include "base/threading/thread_task_runner_handle.h"
 #include "base/trace_event/memory_dump_manager.h"
 #include "cc/paint/image_transfer_cache_entry.h"
 #include "third_party/skia/include/gpu/GrBackendSurface.h"
diff --git a/gpu/dawn_end2end_tests_main.cc b/gpu/dawn_end2end_tests_main.cc
new file mode 100644
index 0000000..1188ccb
--- /dev/null
+++ b/gpu/dawn_end2end_tests_main.cc
@@ -0,0 +1,33 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/message_loop/message_loop.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_suite.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace {
+
+int RunHelper(base::TestSuite* test_suite) {
+  base::MessageLoop message_loop;
+  return test_suite->Run();
+}
+
+}  // namespace
+
+int main(int argc, char** argv) {
+  base::CommandLine::Init(argc, argv);
+  testing::InitGoogleMock(&argc, argv);
+  base::TestSuite test_suite(argc, argv);
+  int rt = base::LaunchUnitTestsWithOptions(
+      argc, argv,
+      1,     // Run tests serially.
+      0,     // Disable batching.
+      true,  // Use job objects.
+      base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
+  return rt;
+}
diff --git a/gpu/dawn_unittests_main.cc b/gpu/dawn_unittests_main.cc
new file mode 100644
index 0000000..51cf84c8
--- /dev/null
+++ b/gpu/dawn_unittests_main.cc
@@ -0,0 +1,28 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/message_loop/message_loop.h"
+#include "base/test/launcher/unit_test_launcher.h"
+#include "base/test/test_suite.h"
+#include "testing/gmock/include/gmock/gmock.h"
+
+namespace {
+
+int RunHelper(base::TestSuite* test_suite) {
+  base::MessageLoopForIO message_loop;
+  return test_suite->Run();
+}
+
+}  // namespace
+
+int main(int argc, char** argv) {
+  base::CommandLine::Init(argc, argv);
+  testing::InitGoogleMock(&argc, argv);
+  base::TestSuite test_suite(argc, argv);
+  int rt = base::LaunchUnitTestsSerially(
+      argc, argv, base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
+  return rt;
+}
diff --git a/gpu/ipc/client/BUILD.gn b/gpu/ipc/client/BUILD.gn
index f48fafa7..acab7a514 100644
--- a/gpu/ipc/client/BUILD.gn
+++ b/gpu/ipc/client/BUILD.gn
@@ -22,6 +22,8 @@
     "command_buffer_proxy_impl.h",
     "gpu_channel_host.cc",
     "gpu_channel_host.h",
+    "image_decode_accelerator_proxy.cc",
+    "image_decode_accelerator_proxy.h",
     "shared_image_interface_proxy.cc",
     "shared_image_interface_proxy.h",
   ]
@@ -36,6 +38,8 @@
     "//gpu/config:config_sources",
     "//gpu/ipc/common:ipc_common_sources",
     "//mojo/public/cpp/system",
+    "//ui/gfx:color_space",
+    "//ui/gfx/geometry",
     "//ui/gl",
   ]
   public_deps = [
diff --git a/gpu/ipc/client/gpu_channel_host.cc b/gpu/ipc/client/gpu_channel_host.cc
index 6ecc095..c89be5b 100644
--- a/gpu/ipc/client/gpu_channel_host.cc
+++ b/gpu/ipc/client/gpu_channel_host.cc
@@ -44,7 +44,11 @@
       shared_image_interface_(
           this,
           static_cast<int32_t>(
-              GpuChannelReservedRoutes::kSharedImageInterface)) {
+              GpuChannelReservedRoutes::kSharedImageInterface)),
+      image_decode_accelerator_proxy_(
+          this,
+          static_cast<int32_t>(
+              GpuChannelReservedRoutes::kImageDecodeAccelerator)) {
   next_image_id_.GetNext();
   for (int32_t i = 0;
        i <= static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue); ++i)
diff --git a/gpu/ipc/client/gpu_channel_host.h b/gpu/ipc/client/gpu_channel_host.h
index 689c1be..8344666 100644
--- a/gpu/ipc/client/gpu_channel_host.h
+++ b/gpu/ipc/client/gpu_channel_host.h
@@ -24,6 +24,7 @@
 #include "gpu/config/gpu_feature_info.h"
 #include "gpu/config/gpu_info.h"
 #include "gpu/gpu_export.h"
+#include "gpu/ipc/client/image_decode_accelerator_proxy.h"
 #include "gpu/ipc/client/shared_image_interface_proxy.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/message_filter.h"
@@ -150,6 +151,10 @@
     return &shared_image_interface_;
   }
 
+  ImageDecodeAcceleratorProxy* image_decode_accelerator_proxy() {
+    return &image_decode_accelerator_proxy_;
+  }
+
  protected:
   friend class base::RefCountedThreadSafe<GpuChannelHost>;
   ~GpuChannelHost() override;
@@ -253,6 +258,9 @@
 
   SharedImageInterfaceProxy shared_image_interface_;
 
+  // A client-side helper to send image decode requests to the GPU process.
+  ImageDecodeAcceleratorProxy image_decode_accelerator_proxy_;
+
   // Image IDs are allocated in sequence.
   base::AtomicSequenceNumber next_image_id_;
 
diff --git a/gpu/ipc/client/image_decode_accelerator_proxy.cc b/gpu/ipc/client/image_decode_accelerator_proxy.cc
new file mode 100644
index 0000000..734b6460
--- /dev/null
+++ b/gpu/ipc/client/image_decode_accelerator_proxy.cc
@@ -0,0 +1,53 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/ipc/client/image_decode_accelerator_proxy.h"
+
+#include "gpu/command_buffer/common/constants.h"
+#include "gpu/ipc/client/gpu_channel_host.h"
+#include "gpu/ipc/common/command_buffer_id.h"
+#include "gpu/ipc/common/gpu_messages.h"
+#include "ui/gfx/color_space.h"
+#include "ui/gfx/geometry/size.h"
+
+namespace gpu {
+
+ImageDecodeAcceleratorProxy::ImageDecodeAcceleratorProxy(GpuChannelHost* host,
+                                                         int32_t route_id)
+    : host_(host), route_id_(route_id) {}
+
+ImageDecodeAcceleratorProxy::~ImageDecodeAcceleratorProxy() {}
+
+SyncToken ImageDecodeAcceleratorProxy::ScheduleImageDecode(
+    const std::vector<uint8_t>& encoded_data,
+    const gfx::Size& output_size,
+    int32_t raster_decoder_route_id,
+    uint32_t transfer_cache_entry_id,
+    int32_t discardable_handle_shm_id,
+    uint32_t discardable_handle_shm_offset,
+    const gfx::ColorSpace& target_color_space,
+    bool needs_mips) {
+  GpuChannelMsg_ScheduleImageDecode_Params params;
+  params.encoded_data = encoded_data;
+  params.output_size = output_size;
+  params.raster_decoder_route_id = raster_decoder_route_id;
+  params.transfer_cache_entry_id = transfer_cache_entry_id;
+  params.discardable_handle_shm_id = discardable_handle_shm_id;
+  params.discardable_handle_shm_offset = discardable_handle_shm_offset;
+  params.target_color_space = target_color_space;
+  params.needs_mips = needs_mips;
+
+  base::AutoLock lock(lock_);
+  uint64_t release_count = ++next_release_count_;
+  // Note: we send the message under the lock to guarantee monotonicity of the
+  // release counts as seen by the service.
+  host_->Send(
+      new GpuChannelMsg_ScheduleImageDecode(route_id_, params, release_count));
+  return SyncToken(
+      CommandBufferNamespace::GPU_IO,
+      CommandBufferIdFromChannelAndRoute(host_->channel_id(), route_id_),
+      release_count);
+}
+
+}  // namespace gpu
diff --git a/gpu/ipc/client/image_decode_accelerator_proxy.h b/gpu/ipc/client/image_decode_accelerator_proxy.h
new file mode 100644
index 0000000..3abe045
--- /dev/null
+++ b/gpu/ipc/client/image_decode_accelerator_proxy.h
@@ -0,0 +1,84 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_IPC_CLIENT_IMAGE_DECODE_ACCELERATOR_PROXY_H_
+#define GPU_IPC_CLIENT_IMAGE_DECODE_ACCELERATOR_PROXY_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "base/synchronization/lock.h"
+#include "base/thread_annotations.h"
+#include "gpu/command_buffer/common/sync_token.h"
+
+namespace gfx {
+class ColorSpace;
+class Size;
+}  // namespace gfx
+
+namespace gpu {
+class GpuChannelHost;
+
+// A client-side interface to schedule hardware-accelerated image decodes on the
+// GPU process. This is only supported in OOP-R mode. To use this functionality,
+// the renderer should first find out the supported image types (e.g., JPEG,
+// WebP, etc.) and profiles (e.g., a maximum size of 8192x8192). This
+// information can be obtained from GpuInfo. No decode requests should be sent
+// for unsupported image types/profiles.
+//
+// The actual decode is done asynchronously on the service side, but the client
+// can synchronize using a sync token that will be released upon the completion
+// of the decode.
+//
+// To send a decode request, the renderer should:
+//
+// (1) Create a locked ClientImageTransferCacheEntry without a backing
+//     SkPixmap. This entry should not be serialized over the command buffer.
+//
+// (2) Call ScheduleImageDecode().
+//
+// (3) Issue a server wait on the sync token returned in step (2).
+//
+// When the service is done with the decode, a ServiceImageTransferCacheEntry
+// will be created/locked with the decoded data and the sync token is
+// released.
+//
+// Objects of this class are thread-safe.
+//
+// TODO(andrescj): actually put the decoder's capabilities in GpuInfo.
+class ImageDecodeAcceleratorProxy {
+ public:
+  ImageDecodeAcceleratorProxy(GpuChannelHost* host, int32_t route_id);
+  ~ImageDecodeAcceleratorProxy();
+
+  // Schedules a hardware-accelerated image decode on the GPU process. The image
+  // in |encoded_data| is decoded and scaled to |output_size|. Upon completion,
+  // a service-side transfer cache entry will be created with the decoded data
+  // using |transfer_cache_entry_id|, |discardable_handle_shm_id|, and
+  // |discardable_handle_shm_offset|. The |raster_decoder_route_id| is used to
+  // look up the appropriate command buffer and create the transfer cache entry
+  // correctly. Returns a sync token that will be released after the decode is
+  // done and the service-side transfer cache entry is created.
+  SyncToken ScheduleImageDecode(const std::vector<uint8_t>& encoded_data,
+                                const gfx::Size& output_size,
+                                int32_t raster_decoder_route_id,
+                                uint32_t transfer_cache_entry_id,
+                                int32_t discardable_handle_shm_id,
+                                uint32_t discardable_handle_shm_offset,
+                                const gfx::ColorSpace& target_color_space,
+                                bool needs_mips);
+
+ private:
+  GpuChannelHost* const host_;
+  const int32_t route_id_;
+
+  base::Lock lock_;
+  uint64_t next_release_count_ GUARDED_BY(lock_) = 0;
+
+  DISALLOW_COPY_AND_ASSIGN(ImageDecodeAcceleratorProxy);
+};
+
+}  // namespace gpu
+
+#endif  // GPU_IPC_CLIENT_IMAGE_DECODE_ACCELERATOR_PROXY_H_
diff --git a/gpu/ipc/common/BUILD.gn b/gpu/ipc/common/BUILD.gn
index cb89b312..94cbe348 100644
--- a/gpu/ipc/common/BUILD.gn
+++ b/gpu/ipc/common/BUILD.gn
@@ -128,6 +128,8 @@
     "//gpu/command_buffer/common:common_sources",
     "//gpu/config:config_sources",
     "//ui/base",
+    "//ui/gfx:color_space",
+    "//ui/gfx/geometry",
     "//ui/gfx/ipc",
     "//ui/gfx/ipc/buffer_types",
     "//ui/gfx/ipc/color",
diff --git a/gpu/ipc/common/command_buffer_id.h b/gpu/ipc/common/command_buffer_id.h
index 820543c..f2a6ede 100644
--- a/gpu/ipc/common/command_buffer_id.h
+++ b/gpu/ipc/common/command_buffer_id.h
@@ -11,7 +11,8 @@
 
 enum class GpuChannelReservedRoutes : int32_t {
   kSharedImageInterface = 0,
-  kMaxValue = kSharedImageInterface,
+  kImageDecodeAccelerator = 1,
+  kMaxValue = kImageDecodeAccelerator,
 };
 
 inline CommandBufferId CommandBufferIdFromChannelAndRoute(int channel_id,
diff --git a/gpu/ipc/common/gpu_messages.h b/gpu/ipc/common/gpu_messages.h
index 2610bc7..eb8a0ce0 100644
--- a/gpu/ipc/common/gpu_messages.h
+++ b/gpu/ipc/common/gpu_messages.h
@@ -30,6 +30,7 @@
 #include "gpu/ipc/common/surface_handle.h"
 #include "ipc/ipc_channel_handle.h"
 #include "ipc/ipc_message_macros.h"
+#include "ui/gfx/color_space.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/gpu_fence_handle.h"
 #include "ui/gfx/gpu_memory_buffer.h"
@@ -82,6 +83,17 @@
   IPC_STRUCT_MEMBER(uint32_t, release_id)
 IPC_STRUCT_END()
 
+IPC_STRUCT_BEGIN(GpuChannelMsg_ScheduleImageDecode_Params)
+  IPC_STRUCT_MEMBER(std::vector<uint8_t>, encoded_data)
+  IPC_STRUCT_MEMBER(gfx::Size, output_size)
+  IPC_STRUCT_MEMBER(int32_t, raster_decoder_route_id)
+  IPC_STRUCT_MEMBER(uint32_t, transfer_cache_entry_id)
+  IPC_STRUCT_MEMBER(int32_t, discardable_handle_shm_id)
+  IPC_STRUCT_MEMBER(uint32_t, discardable_handle_shm_offset)
+  IPC_STRUCT_MEMBER(gfx::ColorSpace, target_color_space)
+  IPC_STRUCT_MEMBER(bool, needs_mips)
+IPC_STRUCT_END()
+
 IPC_STRUCT_BEGIN(GpuDeferredMessage)
   IPC_STRUCT_MEMBER(IPC::Message, message)
   IPC_STRUCT_MEMBER(std::vector<gpu::SyncToken>, sync_token_fences)
@@ -116,6 +128,14 @@
                     GpuChannelMsg_CreateSharedImage_Params /* params */)
 IPC_MESSAGE_ROUTED1(GpuChannelMsg_DestroySharedImage, gpu::Mailbox /* id */)
 
+// Schedules a hardware-accelerated image decode in the GPU process. Renderers
+// should use gpu::ImageDecodeAcceleratorProxy to schedule decode requests which
+// are processed by gpu::ImageDecodeAcceleratorStub on the service side.
+IPC_MESSAGE_ROUTED2(
+    GpuChannelMsg_ScheduleImageDecode,
+    GpuChannelMsg_ScheduleImageDecode_Params /* decode_params */,
+    uint64_t /* release_count */)
+
 // Crash the GPU process in similar way to how chrome://gpucrash does.
 // This is only supported in testing environments, and is otherwise ignored.
 IPC_MESSAGE_CONTROL0(GpuChannelMsg_CrashForTesting)
diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn
index b31ffd0..d72bdb1 100644
--- a/gpu/ipc/service/BUILD.gn
+++ b/gpu/ipc/service/BUILD.gn
@@ -29,6 +29,8 @@
     "gpu_memory_buffer_factory.h",
     "gpu_watchdog_thread.cc",
     "gpu_watchdog_thread.h",
+    "image_decode_accelerator_stub.cc",
+    "image_decode_accelerator_stub.h",
     "image_transport_surface.h",
     "image_transport_surface_delegate.h",
     "pass_through_image_transport_surface.cc",
diff --git a/gpu/ipc/service/gpu_channel.cc b/gpu/ipc/service/gpu_channel.cc
index ee54e607..e0c20d4c 100644
--- a/gpu/ipc/service/gpu_channel.cc
+++ b/gpu/ipc/service/gpu_channel.cc
@@ -45,6 +45,7 @@
 #include "gpu/ipc/service/gpu_channel_manager.h"
 #include "gpu/ipc/service/gpu_channel_manager_delegate.h"
 #include "gpu/ipc/service/gpu_memory_buffer_factory.h"
+#include "gpu/ipc/service/image_decode_accelerator_stub.h"
 #include "gpu/ipc/service/raster_command_buffer_stub.h"
 #include "gpu/ipc/service/webgpu_command_buffer_stub.h"
 #include "ipc/ipc_channel.h"
@@ -119,6 +120,7 @@
   Scheduler* scheduler_;
   scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
 
+  scoped_refptr<ImageDecodeAcceleratorStub> image_decode_accelerator_stub_;
   base::ThreadChecker io_thread_checker_;
 
   DISALLOW_COPY_AND_ASSIGN(GpuChannelMessageFilter);
@@ -130,7 +132,12 @@
     scoped_refptr<base::SingleThreadTaskRunner> main_task_runner)
     : gpu_channel_(gpu_channel),
       scheduler_(scheduler),
-      main_task_runner_(std::move(main_task_runner)) {
+      main_task_runner_(std::move(main_task_runner)),
+      image_decode_accelerator_stub_(
+          base::MakeRefCounted<ImageDecodeAcceleratorStub>(
+              gpu_channel,
+              static_cast<int32_t>(
+                  GpuChannelReservedRoutes::kImageDecodeAccelerator))) {
   io_thread_checker_.DetachFromThread();
 }
 
@@ -140,6 +147,7 @@
 
 void GpuChannelMessageFilter::Destroy() {
   base::AutoLock auto_lock(gpu_channel_lock_);
+  image_decode_accelerator_stub_->Shutdown();
   gpu_channel_ = nullptr;
 }
 
@@ -270,7 +278,11 @@
     }
 
     scheduler_->ScheduleTasks(std::move(tasks));
-
+  } else if (message.routing_id() ==
+             static_cast<int32_t>(
+                 GpuChannelReservedRoutes::kImageDecodeAccelerator)) {
+    if (!image_decode_accelerator_stub_->OnMessageReceived(message))
+      return MessageErrorHandler(message, "Invalid image decode request");
   } else if (message.routing_id() == MSG_ROUTING_CONTROL ||
              message.type() == GpuCommandBufferMsg_WaitForTokenInRange::ID ||
              message.type() ==
diff --git a/gpu/ipc/service/gpu_channel.h b/gpu/ipc/service/gpu_channel.h
index f0b851e6..aa4dc9b 100644
--- a/gpu/ipc/service/gpu_channel.h
+++ b/gpu/ipc/service/gpu_channel.h
@@ -15,6 +15,7 @@
 #include "base/containers/flat_map.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
+#include "base/memory/scoped_refptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/process/process.h"
 #include "base/single_thread_task_runner.h"
diff --git a/gpu/ipc/service/gpu_channel_manager_unittest.cc b/gpu/ipc/service/gpu_channel_manager_unittest.cc
index d9f5b351..104d6ea 100644
--- a/gpu/ipc/service/gpu_channel_manager_unittest.cc
+++ b/gpu/ipc/service/gpu_channel_manager_unittest.cc
@@ -5,6 +5,7 @@
 #include <stddef.h>
 #include <stdint.h>
 
+#include "gpu/ipc/common/command_buffer_id.h"
 #include "gpu/ipc/common/gpu_messages.h"
 #include "gpu/ipc/service/gpu_channel.h"
 #include "gpu/ipc/service/gpu_channel_manager.h"
@@ -26,7 +27,8 @@
     GpuChannel* channel = CreateChannel(kClientId, true);
     EXPECT_TRUE(channel);
 
-    int32_t kRouteId = 1;
+    int32_t kRouteId =
+        static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue) + 1;
     const SurfaceHandle kFakeSurfaceHandle = 1;
     SurfaceHandle surface_handle = kFakeSurfaceHandle;
     GPUCreateCommandBufferConfig init_params;
diff --git a/gpu/ipc/service/gpu_channel_unittest.cc b/gpu/ipc/service/gpu_channel_unittest.cc
index 49ca6b4..80cb18442 100644
--- a/gpu/ipc/service/gpu_channel_unittest.cc
+++ b/gpu/ipc/service/gpu_channel_unittest.cc
@@ -4,6 +4,7 @@
 
 #include <stdint.h>
 
+#include "gpu/ipc/common/command_buffer_id.h"
 #include "gpu/ipc/common/gpu_messages.h"
 #include "gpu/ipc/service/gpu_channel.h"
 #include "gpu/ipc/service/gpu_channel_test_common.h"
@@ -27,7 +28,8 @@
   SurfaceHandle surface_handle = kFakeSurfaceHandle;
   DCHECK_NE(surface_handle, kNullSurfaceHandle);
 
-  int32_t kRouteId = 1;
+  int32_t kRouteId =
+      static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue) + 1;
   GPUCreateCommandBufferConfig init_params;
   init_params.surface_handle = surface_handle;
   init_params.share_group_id = MSG_ROUTING_NONE;
@@ -55,7 +57,8 @@
   SurfaceHandle surface_handle = kFakeSurfaceHandle;
   DCHECK_NE(surface_handle, kNullSurfaceHandle);
 
-  int32_t kRouteId = 1;
+  int32_t kRouteId =
+      static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue) + 1;
   GPUCreateCommandBufferConfig init_params;
   init_params.surface_handle = surface_handle;
   init_params.share_group_id = MSG_ROUTING_NONE;
@@ -79,7 +82,8 @@
   GpuChannel* channel = CreateChannel(kClientId, true);
   ASSERT_TRUE(channel);
 
-  int32_t kRouteId = 1;
+  int32_t kRouteId =
+      static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue) + 1;
   GPUCreateCommandBufferConfig init_params;
   init_params.surface_handle = kNullSurfaceHandle;
   init_params.share_group_id = MSG_ROUTING_NONE;
@@ -104,7 +108,8 @@
   ASSERT_TRUE(channel);
 
   // Create first context.
-  int32_t kRouteId1 = 1;
+  int32_t kRouteId1 =
+      static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue) + 1;
   int32_t kStreamId1 = 1;
   GPUCreateCommandBufferConfig init_params;
   init_params.surface_handle = kNullSurfaceHandle;
@@ -124,7 +129,7 @@
   EXPECT_TRUE(stub);
 
   // Create second context in same share group but different stream.
-  int32_t kRouteId2 = 2;
+  int32_t kRouteId2 = kRouteId1 + 1;
   int32_t kStreamId2 = 2;
 
   init_params.share_group_id = kRouteId1;
@@ -147,7 +152,8 @@
   ASSERT_TRUE(channel);
 
   // Create first context, we will share this one.
-  int32_t kSharedRouteId = 1;
+  int32_t kSharedRouteId =
+      static_cast<int32_t>(GpuChannelReservedRoutes::kMaxValue) + 1;
   {
     SCOPED_TRACE("kSharedRouteId");
     GPUCreateCommandBufferConfig init_params;
@@ -168,7 +174,7 @@
   EXPECT_TRUE(channel->LookupCommandBuffer(kSharedRouteId));
 
   // This context shares with the first one, this should be possible.
-  int32_t kFriendlyRouteId = 2;
+  int32_t kFriendlyRouteId = kSharedRouteId + 1;
   {
     SCOPED_TRACE("kFriendlyRouteId");
     GPUCreateCommandBufferConfig init_params;
@@ -193,7 +199,7 @@
 
   // Meanwhile another context is being made pointing to the shared one. This
   // should fail.
-  int32_t kAnotherRouteId = 3;
+  int32_t kAnotherRouteId = kFriendlyRouteId + 1;
   {
     SCOPED_TRACE("kAnotherRouteId");
     GPUCreateCommandBufferConfig init_params;
diff --git a/gpu/ipc/service/image_decode_accelerator_stub.cc b/gpu/ipc/service/image_decode_accelerator_stub.cc
new file mode 100644
index 0000000..c1c0c9a7
--- /dev/null
+++ b/gpu/ipc/service/image_decode_accelerator_stub.cc
@@ -0,0 +1,77 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "gpu/ipc/service/image_decode_accelerator_stub.h"
+
+#include "base/feature_list.h"
+#include "base/logging.h"
+#include "base/single_thread_task_runner.h"
+#include "gpu/command_buffer/common/constants.h"
+#include "gpu/command_buffer/common/scheduling_priority.h"
+#include "gpu/command_buffer/service/scheduler.h"
+#include "gpu/command_buffer/service/sync_point_manager.h"
+#include "gpu/config/gpu_finch_features.h"
+#include "gpu/ipc/common/command_buffer_id.h"
+#include "gpu/ipc/common/gpu_messages.h"
+#include "gpu/ipc/service/gpu_channel.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_message_macros.h"
+
+namespace gpu {
+
+ImageDecodeAcceleratorStub::ImageDecodeAcceleratorStub(GpuChannel* channel,
+                                                       int32_t route_id)
+    : channel_(channel),
+      sequence_(channel->scheduler()->CreateSequence(SchedulingPriority::kLow)),
+      sync_point_client_state_(
+          channel->sync_point_manager()->CreateSyncPointClientState(
+              CommandBufferNamespace::GPU_IO,
+              CommandBufferIdFromChannelAndRoute(channel->client_id(),
+                                                 route_id),
+              sequence_)),
+      main_task_runner_(channel->task_runner()),
+      io_task_runner_(channel->io_task_runner()) {}
+
+bool ImageDecodeAcceleratorStub::OnMessageReceived(const IPC::Message& msg) {
+  DCHECK(io_task_runner_->BelongsToCurrentThread());
+  if (!base::FeatureList::IsEnabled(
+          features::kVaapiJpegImageDecodeAcceleration)) {
+    return false;
+  }
+
+  bool handled = true;
+  IPC_BEGIN_MESSAGE_MAP(ImageDecodeAcceleratorStub, msg)
+    IPC_MESSAGE_HANDLER(GpuChannelMsg_ScheduleImageDecode,
+                        OnScheduleImageDecode)
+    IPC_MESSAGE_UNHANDLED(handled = false)
+  IPC_END_MESSAGE_MAP()
+  return handled;
+}
+
+void ImageDecodeAcceleratorStub::Shutdown() {
+  DCHECK(main_task_runner_->BelongsToCurrentThread());
+  base::AutoLock lock(lock_);
+  sync_point_client_state_->Destroy();
+  channel_->scheduler()->DestroySequence(sequence_);
+  channel_ = nullptr;
+}
+
+ImageDecodeAcceleratorStub::~ImageDecodeAcceleratorStub() {
+  DCHECK(!channel_);
+}
+
+void ImageDecodeAcceleratorStub::OnScheduleImageDecode(
+    const GpuChannelMsg_ScheduleImageDecode_Params& decode_params,
+    uint64_t release_count) {
+  DCHECK(io_task_runner_->BelongsToCurrentThread());
+  base::AutoLock lock(lock_);
+  if (!channel_) {
+    // The channel is no longer available, so don't schedule a decode.
+    return;
+  }
+  // TODO(andrescj): schedule the release of the decode sync token and start the
+  // decode.
+}
+
+}  // namespace gpu
diff --git a/gpu/ipc/service/image_decode_accelerator_stub.h b/gpu/ipc/service/image_decode_accelerator_stub.h
new file mode 100644
index 0000000..ba767275
--- /dev/null
+++ b/gpu/ipc/service/image_decode_accelerator_stub.h
@@ -0,0 +1,77 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef GPU_IPC_SERVICE_IMAGE_DECODE_ACCELERATOR_STUB_H_
+#define GPU_IPC_SERVICE_IMAGE_DECODE_ACCELERATOR_STUB_H_
+
+#include "base/macros.h"
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_refptr.h"
+#include "base/synchronization/lock.h"
+#include "base/thread_annotations.h"
+#include "gpu/command_buffer/service/sequence_id.h"
+
+struct GpuChannelMsg_ScheduleImageDecode_Params;
+
+namespace base {
+class SingleThreadTaskRunner;
+}  // namespace base
+
+namespace IPC {
+class Message;
+}  // namespace IPC
+
+namespace gpu {
+class GpuChannel;
+class SyncPointClientState;
+
+// Processes incoming image decode requests from renderers: it schedules the
+// decode with the appropriate hardware decode accelerator and releases sync
+// tokens as decodes complete. These sync tokens must be generated on the client
+// side (in ImageDecodeAcceleratorProxy) using the following information:
+//
+// - The command buffer namespace is GPU_IO.
+// - The command buffer ID is created using the
+//   CommandBufferIdFromChannelAndRoute() function using
+//   GpuChannelReservedRoutes::kImageDecodeAccelerator as the route ID.
+// - The release count should be incremented for each decode request.
+//
+// An object of this class is meant to be used in
+// both the IO thread (for receiving decode requests) and the main thread (for
+// processing completed decodes).
+class ImageDecodeAcceleratorStub
+    : public base::RefCountedThreadSafe<ImageDecodeAcceleratorStub> {
+ public:
+  ImageDecodeAcceleratorStub(GpuChannel* channel, int32_t route_id);
+
+  // Processes a message from the renderer. Should be called on the IO thread.
+  bool OnMessageReceived(const IPC::Message& msg);
+
+  // Called on the main thread to indicate that |channel_| should no longer be
+  // used.
+  void Shutdown();
+
+ private:
+  friend class base::RefCountedThreadSafe<ImageDecodeAcceleratorStub>;
+  ~ImageDecodeAcceleratorStub();
+
+  void OnScheduleImageDecode(
+      const GpuChannelMsg_ScheduleImageDecode_Params& params,
+      uint64_t release_count);
+
+  base::Lock lock_;
+  GpuChannel* channel_ GUARDED_BY(lock_);
+  SequenceId sequence_ GUARDED_BY(lock_);
+  scoped_refptr<SyncPointClientState> sync_point_client_state_
+      GUARDED_BY(lock_);
+
+  scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
+  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+
+  DISALLOW_COPY_AND_ASSIGN(ImageDecodeAcceleratorStub);
+};
+
+}  // namespace gpu
+
+#endif  // GPU_IPC_SERVICE_IMAGE_DECODE_ACCELERATOR_STUB_H_
diff --git a/gpu/swiftshader_tests_main.cc b/gpu/swiftshader_tests_main.cc
index 4badbb9..fb1283e 100644
--- a/gpu/swiftshader_tests_main.cc
+++ b/gpu/swiftshader_tests_main.cc
@@ -2,14 +2,12 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/at_exit.h"
 #include "base/bind.h"
 #include "base/command_line.h"
 #include "base/message_loop/message_loop.h"
 #include "base/test/launcher/unit_test_launcher.h"
 #include "base/test/test_suite.h"
 #include "testing/gmock/include/gmock/gmock.h"
-#include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/swiftshader/tests/unittests/SwiftShaderTest.h"
 
 namespace {
@@ -31,6 +29,6 @@
       1,     // Run tests serially.
       0,     // Disable batching.
       true,  // Use job objects.
-      base::Bind(&RunHelper, base::Unretained(&test_suite)));
+      base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
   return rt;
 }
diff --git a/headless/lib/browser/headless_browser_context_impl.cc b/headless/lib/browser/headless_browser_context_impl.cc
index 6ded70eb..1654413 100644
--- a/headless/lib/browser/headless_browser_context_impl.cc
+++ b/headless/lib/browser/headless_browser_context_impl.cc
@@ -374,12 +374,6 @@
 }
 
 HeadlessBrowserContext::Builder&
-HeadlessBrowserContext::Builder::SetSitePerProcess(bool site_per_process) {
-  options_->site_per_process_ = site_per_process;
-  return *this;
-}
-
-HeadlessBrowserContext::Builder&
 HeadlessBrowserContext::Builder::SetBlockNewWebContents(
     bool block_new_web_contents) {
   options_->block_new_web_contents_ = block_new_web_contents;
diff --git a/headless/lib/browser/headless_browser_context_options.cc b/headless/lib/browser/headless_browser_context_options.cc
index e3ab688..4b5f961 100644
--- a/headless/lib/browser/headless_browser_context_options.cc
+++ b/headless/lib/browser/headless_browser_context_options.cc
@@ -65,11 +65,6 @@
                                browser_options_->incognito_mode);
 }
 
-bool HeadlessBrowserContextOptions::site_per_process() const {
-  return ReturnOverriddenValue(site_per_process_,
-                               browser_options_->site_per_process);
-}
-
 bool HeadlessBrowserContextOptions::block_new_web_contents() const {
   return ReturnOverriddenValue(block_new_web_contents_,
                                browser_options_->block_new_web_contents);
diff --git a/headless/lib/browser/headless_browser_context_options.h b/headless/lib/browser/headless_browser_context_options.h
index 441f884..5ed0cf2 100644
--- a/headless/lib/browser/headless_browser_context_options.h
+++ b/headless/lib/browser/headless_browser_context_options.h
@@ -42,9 +42,6 @@
   // See HeadlessBrowser::Options::incognito_mode.
   bool incognito_mode() const;
 
-  // See HeadlessBrowser::Options::site_per_process.
-  bool site_per_process() const;
-
   // See HeadlessBrowser::Options::block_new_web_contents.
   bool block_new_web_contents() const;
 
@@ -77,7 +74,6 @@
   base::Optional<gfx::Size> window_size_;
   base::Optional<base::FilePath> user_data_dir_;
   base::Optional<bool> incognito_mode_;
-  base::Optional<bool> site_per_process_;
   base::Optional<bool> block_new_web_contents_;
   base::Optional<base::RepeatingCallback<void(WebPreferences*)>>
       override_web_preferences_callback_;
diff --git a/headless/lib/browser/headless_content_browser_client.cc b/headless/lib/browser/headless_content_browser_client.cc
index 4ebabb3..9f1b7e88 100644
--- a/headless/lib/browser/headless_content_browser_client.cc
+++ b/headless/lib/browser/headless_content_browser_client.cc
@@ -330,21 +330,13 @@
       resource_dispatcher_host_delegate_.get());
 }
 
-bool HeadlessContentBrowserClient::DoesSiteRequireDedicatedProcess(
-    content::BrowserContext* browser_context,
-    const GURL& effective_site_url) {
-  return HeadlessBrowserContextImpl::From(browser_context)
-      ->options()
-      ->site_per_process();
-}
-
 bool HeadlessContentBrowserClient::ShouldEnableStrictSiteIsolation() {
   // TODO(lukasza): https://crbug.com/869494: Instead of overriding
   // ShouldEnableStrictSiteIsolation, //headless should inherit the default
   // site-per-process setting from //content - this way tools (tests, but also
   // production cases like screenshot or pdf generation) based on //headless
   // will use a mode that is actually shipping in Chrome.
-  return false;
+  return browser_->options()->site_per_process;
 }
 
 ::network::mojom::NetworkContextPtr
diff --git a/headless/lib/browser/headless_content_browser_client.h b/headless/lib/browser/headless_content_browser_client.h
index 64415ae..fe8ae3a 100644
--- a/headless/lib/browser/headless_content_browser_client.h
+++ b/headless/lib/browser/headless_content_browser_client.h
@@ -59,8 +59,6 @@
       net::ClientCertIdentityList client_certs,
       std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
   void ResourceDispatcherHostCreated() override;
-  bool DoesSiteRequireDedicatedProcess(content::BrowserContext* browser_context,
-                                       const GURL& effective_site_url) override;
   bool ShouldEnableStrictSiteIsolation() override;
 
   ::network::mojom::NetworkContextPtr CreateNetworkContext(
diff --git a/headless/public/headless_browser_context.h b/headless/public/headless_browser_context.h
index 886e2bb..58dcd7b 100644
--- a/headless/public/headless_browser_context.h
+++ b/headless/public/headless_browser_context.h
@@ -105,7 +105,6 @@
   Builder& SetWindowSize(const gfx::Size& window_size);
   Builder& SetUserDataDir(const base::FilePath& user_data_dir);
   Builder& SetIncognitoMode(bool incognito_mode);
-  Builder& SetSitePerProcess(bool site_per_process);
   Builder& SetBlockNewWebContents(bool block_new_web_contents);
   Builder& SetOverrideWebPreferencesCallback(
       base::RepeatingCallback<void(WebPreferences*)> callback);
diff --git a/headless/test/headless_protocol_browsertest.cc b/headless/test/headless_protocol_browsertest.cc
index 5a25a6047..af3c663 100644
--- a/headless/test/headless_protocol_browsertest.cc
+++ b/headless/test/headless_protocol_browsertest.cc
@@ -53,6 +53,10 @@
     command_line->AppendSwitchASCII(::network::switches::kHostResolverRules,
                                     "MAP *.test 127.0.0.1");
     HeadlessAsyncDevTooledBrowserTest::SetUpCommandLine(command_line);
+
+    // Make sure the navigations spawn new processes. We run test harness
+    // in one process (harness.test) and tests in another.
+    command_line->AppendSwitch(::switches::kSitePerProcess);
   }
 
  private:
@@ -175,14 +179,6 @@
     FinishAsynchronousTest();
   }
 
-  // HeadlessBrowserTest overrides.
-  void CustomizeHeadlessBrowserContext(
-      HeadlessBrowserContext::Builder& builder) override {
-    // Make sure the navigations spawn new processes. We run test harness
-    // in one process (harness.test) and tests in another.
-    builder.SetSitePerProcess(true);
-  }
-
  protected:
   bool test_finished_ = false;
   std::string test_folder_;
diff --git a/ios/build/bots/chromium.clang/ToTiOS.json b/ios/build/bots/chromium.clang/ToTiOS.json
index e4fedd22..cd412f0 100644
--- a/ios/build/bots/chromium.clang/ToTiOS.json
+++ b/ios/build/bots/chromium.clang/ToTiOS.json
@@ -8,7 +8,6 @@
     "is_component_build=false",
     "is_debug=false",
     "llvm_force_head_revision=true",
-    "additional_target_cpus=[\"x86\"]",
     "target_cpu=\"x64\"",
     "target_os=\"ios\""
   ],
diff --git a/ios/build/bots/chromium.clang/ToTiOSDevice.json b/ios/build/bots/chromium.clang/ToTiOSDevice.json
index 0d9d31a..b147f0a 100644
--- a/ios/build/bots/chromium.clang/ToTiOSDevice.json
+++ b/ios/build/bots/chromium.clang/ToTiOSDevice.json
@@ -7,7 +7,6 @@
     "is_debug=false",
     "llvm_force_head_revision=true",
     "target_os=\"ios\"",
-    "additional_target_cpus=[\"arm\"]",
     "target_cpu=\"arm64\""
   ],
   "additional_compile_targets": [
diff --git a/ios/build/bots/chromium.fyi/ios-device-goma-canary-clobber.json b/ios/build/bots/chromium.fyi/ios-device-goma-canary-clobber.json
index bc85c73..0bfdc6b 100644
--- a/ios/build/bots/chromium.fyi/ios-device-goma-canary-clobber.json
+++ b/ios/build/bots/chromium.fyi/ios-device-goma-canary-clobber.json
@@ -5,12 +5,11 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[ \"arm64\" ]",
     "goma_dir=\"$(goma_dir)\"",
     "ios_enable_code_signing=false",
     "is_component_build=false",
     "is_debug=false",
-    "target_cpu=\"arm\"",
+    "target_cpu=\"arm64\"",
     "target_os=\"ios\"",
     "use_goma=true"
   ],
diff --git a/ios/build/bots/chromium.fyi/ios-simulator.json b/ios/build/bots/chromium.fyi/ios-simulator.json
index d384089..b232c7a 100644
--- a/ios/build/bots/chromium.fyi/ios-simulator.json
+++ b/ios/build/bots/chromium.fyi/ios-simulator.json
@@ -4,7 +4,6 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "goma_dir=\"$(goma_dir)\"",
     "is_component_build=false",
     "is_debug=true",
diff --git a/ios/build/bots/chromium.fyi/ios12-beta-simulator.json b/ios/build/bots/chromium.fyi/ios12-beta-simulator.json
index 74bef18..eb65b98 100644
--- a/ios/build/bots/chromium.fyi/ios12-beta-simulator.json
+++ b/ios/build/bots/chromium.fyi/ios12-beta-simulator.json
@@ -6,7 +6,6 @@
   "xcode build version": "10a254a",
   "gn_args": [
     "goma_dir=\"$(goma_dir)\"",
-    "additional_target_cpus=[\"x86\"]",
     "is_component_build=false",
     "is_debug=true",
     "symbol_level=1",
diff --git a/ios/build/bots/chromium.fyi/ios12-sdk-device.json b/ios/build/bots/chromium.fyi/ios12-sdk-device.json
index 68b72e1..fabf7a6 100644
--- a/ios/build/bots/chromium.fyi/ios12-sdk-device.json
+++ b/ios/build/bots/chromium.fyi/ios12-sdk-device.json
@@ -6,12 +6,11 @@
   ],
   "xcode build version": "10o45e",
   "gn_args": [
-    "additional_target_cpus=[ \"arm64\" ]",
     "goma_dir=\"$(goma_dir)\"",
     "ios_enable_code_signing=false",
     "is_component_build=false",
     "is_debug=false",
-    "target_cpu=\"arm\"",
+    "target_cpu=\"arm64\"",
     "target_os=\"ios\"",
     "use_goma=true"
   ],
diff --git a/ios/build/bots/chromium.fyi/ios12-sdk-simulator.json b/ios/build/bots/chromium.fyi/ios12-sdk-simulator.json
index 4212490..596d6d0a 100644
--- a/ios/build/bots/chromium.fyi/ios12-sdk-simulator.json
+++ b/ios/build/bots/chromium.fyi/ios12-sdk-simulator.json
@@ -6,7 +6,6 @@
   ],
   "xcode build version": "10o45e",
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "goma_dir=\"$(goma_dir)\"",
     "is_component_build=false",
     "is_debug=true",
diff --git a/ios/build/bots/chromium.fyi/ios12-sdk-xcode-clang.json b/ios/build/bots/chromium.fyi/ios12-sdk-xcode-clang.json
index 68d78a9..2f49a38 100644
--- a/ios/build/bots/chromium.fyi/ios12-sdk-xcode-clang.json
+++ b/ios/build/bots/chromium.fyi/ios12-sdk-xcode-clang.json
@@ -7,7 +7,6 @@
   "xcode build version": "10a254a",
   "use xcode build version": true,
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "ios_enable_code_signing=false",
     "is_component_build=false",
     "is_debug=true",
diff --git a/ios/build/bots/chromium.mac/ios-device-xcode-clang.json b/ios/build/bots/chromium.mac/ios-device-xcode-clang.json
index 22e8d50..1f35773b 100644
--- a/ios/build/bots/chromium.mac/ios-device-xcode-clang.json
+++ b/ios/build/bots/chromium.mac/ios-device-xcode-clang.json
@@ -5,13 +5,12 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[ \"arm64\" ]",
     "goma_dir=\"$(goma_dir)\"",
     "ios_enable_code_signing=false",
     "is_component_build=false",
     "is_debug=false",
     "symbol_level=0",
-    "target_cpu=\"arm\"",
+    "target_cpu=\"arm64\"",
     "target_os=\"ios\"",
     "use_goma=true",
     "use_xcode_clang=true"
diff --git a/ios/build/bots/chromium.mac/ios-device.json b/ios/build/bots/chromium.mac/ios-device.json
index 9294a4e..9271605 100644
--- a/ios/build/bots/chromium.mac/ios-device.json
+++ b/ios/build/bots/chromium.mac/ios-device.json
@@ -6,13 +6,12 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[ \"arm64\" ]",
     "goma_dir=\"$(goma_dir)\"",
     "ios_enable_code_signing=false",
     "is_component_build=false",
     "is_debug=false",
     "symbol_level=0",
-    "target_cpu=\"arm\"",
+    "target_cpu=\"arm64\"",
     "target_os=\"ios\"",
     "use_goma=true"
   ],
diff --git a/ios/build/bots/chromium.mac/ios-simulator-full-configs.json b/ios/build/bots/chromium.mac/ios-simulator-full-configs.json
index f8a2a2ae..384a775 100644
--- a/ios/build/bots/chromium.mac/ios-simulator-full-configs.json
+++ b/ios/build/bots/chromium.mac/ios-simulator-full-configs.json
@@ -5,7 +5,6 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "goma_dir=\"$(goma_dir)\"",
     "is_component_build=false",
     "is_debug=true",
diff --git a/ios/build/bots/chromium.mac/ios-simulator-xcode-clang.json b/ios/build/bots/chromium.mac/ios-simulator-xcode-clang.json
index cec24aa..41ddb79 100644
--- a/ios/build/bots/chromium.mac/ios-simulator-xcode-clang.json
+++ b/ios/build/bots/chromium.mac/ios-simulator-xcode-clang.json
@@ -7,7 +7,6 @@
   "xcode build version": "10a254a",
   "use xcode build version": true,
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "goma_dir=\"$(goma_dir)\"",
     "ios_enable_code_signing=false",
     "is_component_build=false",
diff --git a/ios/build/bots/chromium.mac/ios-simulator.json b/ios/build/bots/chromium.mac/ios-simulator.json
index 8e83b127..cd0c83a 100644
--- a/ios/build/bots/chromium.mac/ios-simulator.json
+++ b/ios/build/bots/chromium.mac/ios-simulator.json
@@ -6,7 +6,6 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "goma_dir=\"$(goma_dir)\"",
     "is_component_build=false",
     "is_debug=true",
diff --git a/ios/build/bots/chromium.mac/ios-uirefresh-simulator.json b/ios/build/bots/chromium.mac/ios-uirefresh-simulator.json
index 34eabc4..5ab4e246 100644
--- a/ios/build/bots/chromium.mac/ios-uirefresh-simulator.json
+++ b/ios/build/bots/chromium.mac/ios-uirefresh-simulator.json
@@ -5,7 +5,6 @@
   "xcode build version": "10a254a",
   "gn_args": [
     "goma_dir=\"$(goma_dir)\"",
-    "additional_target_cpus=[\"x86\"]",
     "is_component_build=false",
     "is_debug=true",
     "symbol_level=1",
diff --git a/ios/build/bots/chromium.mac/ios12-sdk-simulator.json b/ios/build/bots/chromium.mac/ios12-sdk-simulator.json
index d03a4ec..e5a00f0 100644
--- a/ios/build/bots/chromium.mac/ios12-sdk-simulator.json
+++ b/ios/build/bots/chromium.mac/ios12-sdk-simulator.json
@@ -6,7 +6,6 @@
   ],
   "xcode build version": "10a254a",
   "gn_args": [
-    "additional_target_cpus=[\"x86\"]",
     "goma_dir=\"$(goma_dir)\"",
     "is_component_build=false",
     "is_debug=true",
diff --git a/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-device.json b/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-device.json
index fe8109d..2e1c21d8 100644
--- a/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-device.json
+++ b/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-device.json
@@ -11,6 +11,7 @@
     "is_component_build=false",
     "is_debug=false",
     "target_cpu=\"arm\"",
+    "ios_deployment_target=\"10.0\"",
     "target_os=\"ios\"",
     "use_goma=true"
   ],
diff --git a/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-simulator.json b/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-simulator.json
index 14475d29..f3b2bac6 100644
--- a/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-simulator.json
+++ b/ios/build/bots/chromium.webrtc.fyi/WebRTC Chromium FYI ios-simulator.json
@@ -11,6 +11,7 @@
     "is_debug=true",
     "symbol_level=1",
     "target_cpu=\"x64\"",
+    "ios_deployment_target=\"10.0\"",
     "target_os=\"ios\"",
     "use_goma=true"
   ],
diff --git a/ios/chrome/app/strings/ios_chromium_strings.grd b/ios/chrome/app/strings/ios_chromium_strings.grd
index 5198ee86..6aeb49a 100644
--- a/ios/chrome/app/strings/ios_chromium_strings.grd
+++ b/ios/chrome/app/strings/ios_chromium_strings.grd
@@ -207,9 +207,15 @@
       <message name="IDS_IOS_LONG_PRESS_TOOLBAR_IPH_PROMOTION_VOICE_OVER" desc="Text to be read by VoiceOver when the LongPress Toolbar Tip is presented to the user. Read by Text-to-Speech.">
         Chromium tip. For more tab options, press and hold the Show Tabs button in the toolbar, which is at the bottom or top of your screen.
       </message>
-      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaini ng that signing out of a managed account will clear all the Chromium data.[Length: 200em, may be line wrapped to multiple lines at run time.].">
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaining that signing out of a managed account will clear all the Chromium data.[Length: 200em, may be line wrapped to multiple lines at run time.] [iOS only].">
         You are signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>. This will delete your Chromium data from this device, but your data will remain in your Google account.
       </message>
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO_UNITY" desc="Message explaining that signing out of a managed account will clear all the Chromium data.[Length: 200em, may be line wrapped to multiple lines at run time.] [iOS only].">
+        Because you're signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>, your Chromium data will be deleted from this device. Your data will remain in your Google Account.
+      </message>
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE_UNITY" desc="Title of the dialog shown when signing out of a managed account.[Length: 50em] [iOS only].">
+        Clear your Chromium data from this device?
+      </message>
       <message name="IDS_IOS_MANAGED_SIGNIN_SUBTITLE" desc="The subtitle of the Sign in to a managed account dialog. [300em]">
         You are signing in with an account managed by <ph name="DOMAIN">$1<ex>doe.com</ex></ph> and giving its administrator control over your Chromium data. Your data will become permanently tied to this account. Signing out of Chromium will delete your data from this device, but it will remain stored in your Google Account.
       </message>
diff --git a/ios/chrome/app/strings/ios_google_chrome_strings.grd b/ios/chrome/app/strings/ios_google_chrome_strings.grd
index 77eb4d4..84af833 100644
--- a/ios/chrome/app/strings/ios_google_chrome_strings.grd
+++ b/ios/chrome/app/strings/ios_google_chrome_strings.grd
@@ -207,9 +207,15 @@
       <message name="IDS_IOS_LONG_PRESS_TOOLBAR_IPH_PROMOTION_VOICE_OVER" desc="Text to be read by VoiceOver when the LongPress Toolbar Tip is presented to the user. Read by Text-to-Speech.">
         Chrome tip. For more tab options, press and hold the Show Tabs button in the toolbar, which is at the bottom or top of your screen.
       </message>
-      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaini ng that signing out of a managed account will clear all the Chrome data.[Length: 200em, may be line wrapped to multiple lines at run time.].">
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO" desc="Message explaining that signing out of a managed account will clear all the Chrome data.[Length: 200em, may be line wrapped to multiple lines at run time.] [iOS only].">
         You are signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>. This will delete your Chrome data from this device, but your data will remain in your Google account.
       </message>
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO_UNITY" desc="Message explaining that signing out of a managed account will clear all the Chrome data. [Length: 200em, may be line wrapped to multiple lines at run time.] [iOS only].">
+        Because you're signing out of an account managed by <ph name="SIGNOUT_MANAGED_DOMAIN">$1<ex>google.com</ex></ph>, your Chrome data will be deleted from this device. Your data will remain in your Google Account.
+      </message>
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE_UNITY" desc="Title of the dialog shown when signing out of a managed account.[Length: 50em] [iOS only].">
+        Clear your Chrome data from this device?
+      </message>
       <message name="IDS_IOS_MANAGED_SIGNIN_SUBTITLE" desc="The subtitle of the Sign in to a managed account dialog. [300em]">
         You are signing in with an account managed by <ph name="DOMAIN">$1<ex>doe.com</ex></ph> and giving its administrator control over your Chrome data. Your data will become permanently tied to this account. Signing out of Chrome will delete your data from this device, but it will remain stored in your Google Account.
       </message>
diff --git a/ios/chrome/app/strings/ios_strings.grd b/ios/chrome/app/strings/ios_strings.grd
index 4ce26f6..c917229 100644
--- a/ios/chrome/app/strings/ios_strings.grd
+++ b/ios/chrome/app/strings/ios_strings.grd
@@ -618,6 +618,12 @@
       <message name="IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE" desc="The information text on the disconnect dialog [Length: 400em].">
         Changes to your bookmarks, history, passwords, and other settings will no longer be synced to your Google Account. However, your existing data will remain stored in your Google Account.
       </message>
+      <message name="IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE_UNITY" desc="The information text on the disconnect dialog [Length: 400em].">
+        Your bookmarks, history, passwords, and more will no longer be synced to your Google Account.
+      </message>
+      <message name="IDS_IOS_DISCONNECT_DIALOG_TITLE_UNITY" desc="The title of the disconnect dialog [Length: 30em].">
+        Sign out and turn off sync?
+      </message>
       <message name="IDS_IOS_DOWNLOAD_MANAGER_CANNOT_DETERMINE_FILE_SIZE" desc="Message displayed when the size of the file to be downloaded is unknown. [Length: 30em] [iOS only]">
         Cannot determine file size.
       </message>
@@ -849,7 +855,10 @@
       <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT" desc="Label on the button to proceed with signout and clear all Chrome data.[Length: 30em].">
         Accept and sign out
       </message>
-      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE" desc="Title of the dialog shown when signing out of a managed account.[Length: 50em].">
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT_UNITY" desc="Label on the button to proceed with signout and clear all Chrome data.[Length: 30em].">
+        Clear
+      </message>
+      <message name="IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE" desc="Title of the dialog shown when signing out of a managed account.[Length: 50em] [iOS only].">
         Sign out of managed account
       </message>
       <message name="IDS_IOS_MANAGED_SIGNIN_ACCEPT_BUTTON" desc="The title of the Accept button of the Sign in to a managed account dialog. [40em]">
@@ -972,6 +981,9 @@
       <message name="IDS_IOS_OPTIONS_ACCOUNTS_SYNC_TITLE" desc="Title of the Sync button on the accounts settings screen [iOS only] [30em]">
         Sync
       </message>
+      <message name="IDS_IOS_OPTIONS_ACCOUNTS_SIGN_OUT_TURN_OFF_SYNC" desc="Title of the button to sign out and turn off sync. [iOS only]">
+        Sign out and turn off sync
+      </message>
       <message name="IDS_IOS_OPTIONS_ADVANCED_TAB_LABEL" desc="The title of the Advanced section of the Settings page.  [Length: 20em] [iOS only]">
         Advanced
       </message>
diff --git a/ios/chrome/browser/search_engines/resources/search_engine.js b/ios/chrome/browser/search_engines/resources/search_engine.js
index 65456a23..5ed862ed 100644
--- a/ios/chrome/browser/search_engines/resources/search_engine.js
+++ b/ios/chrome/browser/search_engines/resources/search_engine.js
@@ -27,13 +27,14 @@
  * Find <link> of OSDD(Open Search Description Document) in document and return
  * it's URL. If multiple OSDDs are found(which should never happen on a sane web
  * site), return the URL of the first OSDD.
- * @return {string|undefined} "href" of OSDD <link>, or undefined if not found.
+ * @return {Object|undefined} Dictionary containing document.URL and "href"
+ *   of OSDD <link>, or undefined if not found.
  */
 __gCrWeb.searchEngine.getOpenSearchDescriptionDocumentUrl = function() {
   var links = document.getElementsByTagName('link');
   for (var i = 0; i < links.length; ++i) {
     if (links[i].type == 'application/opensearchdescription+xml') {
-      return links[i].href;
+      return {'documentUrl': document.URL, 'openSearchUrl': links[i].href};
     }
   }
 };
diff --git a/ios/chrome/browser/search_engines/search_engine_js_unittest.mm b/ios/chrome/browser/search_engines/search_engine_js_unittest.mm
index 366cdd2..f5c7d82 100644
--- a/ios/chrome/browser/search_engines/search_engine_js_unittest.mm
+++ b/ios/chrome/browser/search_engines/search_engine_js_unittest.mm
@@ -98,8 +98,13 @@
 
   id result = ExecuteJavaScript(
       @"__gCrWeb.searchEngine.getOpenSearchDescriptionDocumentUrl();");
+
+  ASSERT_TRUE([result isKindOfClass:NSDictionary.class]);
+  NSDictionary* dict = result;
+  ASSERT_EQ(2UL, dict.count);
+  EXPECT_NSEQ(@"https://cs.chromium.org/", dict[@"documentUrl"]);
   EXPECT_NSEQ(@"https://cs.chromium.org/codesearch/first_opensearch.xml",
-              result);
+              dict[@"openSearchUrl"]);
 }
 
 // Tests that __gCrWeb.searchEngine.getOpenSearchDescriptionDocumentUrl returns
diff --git a/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm b/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm
index 34560b236..178b4f0f 100644
--- a/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/accounts_collection_view_controller.mm
@@ -364,7 +364,12 @@
 - (CollectionViewItem*)signOutItem {
   SettingsTextItem* item =
       [[SettingsTextItem alloc] initWithType:ItemTypeSignOut];
-  item.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_ACCOUNTS_SIGNOUT);
+  if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
+    item.text =
+        l10n_util::GetNSString(IDS_IOS_OPTIONS_ACCOUNTS_SIGN_OUT_TURN_OFF_SYNC);
+  } else {
+    item.text = l10n_util::GetNSString(IDS_IOS_OPTIONS_ACCOUNTS_SIGNOUT);
+  }
   item.accessibilityTraits |= UIAccessibilityTraitButton;
   item.accessibilityIdentifier = kSettingsAccountsSignoutCellId;
   return item;
@@ -562,22 +567,35 @@
     return;
   }
 
-  NSString* title;
-  NSString* message;
-  NSString* continueButtonTitle;
+  NSString* title = l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_TITLE);
+  NSString* message =
+      l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE);
+  NSString* continueButtonTitle =
+      l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
   if ([self authService]->IsAuthenticatedIdentityManaged()) {
     std::string hosted_domain =
         ios::SigninManagerFactory::GetForBrowserState(_browserState)
             ->GetAuthenticatedAccountInfo()
             .hosted_domain;
-    title = l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE);
-    message = l10n_util::GetNSStringF(IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO,
-                                      base::UTF8ToUTF16(hosted_domain));
-    continueButtonTitle =
-        l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT);
-  } else {
-    title = l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_TITLE);
-    message = l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE);
+    if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
+      title =
+          l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE_UNITY);
+      message =
+          l10n_util::GetNSStringF(IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO_UNITY,
+                                  base::UTF8ToUTF16(hosted_domain));
+      continueButtonTitle = l10n_util::GetNSString(
+          IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT_UNITY);
+    } else {
+      title = l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_TITLE);
+      message = l10n_util::GetNSStringF(IDS_IOS_MANAGED_DISCONNECT_DIALOG_INFO,
+                                        base::UTF8ToUTF16(hosted_domain));
+      continueButtonTitle =
+          l10n_util::GetNSString(IDS_IOS_MANAGED_DISCONNECT_DIALOG_ACCEPT);
+    }
+  } else if (unified_consent::IsUnifiedConsentFeatureEnabled()) {
+    title = l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_TITLE_UNITY);
+    message =
+        l10n_util::GetNSString(IDS_IOS_DISCONNECT_DIALOG_INFO_MOBILE_UNITY);
     continueButtonTitle = l10n_util::GetNSString(
         IDS_IOS_DISCONNECT_DIALOG_CONTINUE_BUTTON_MOBILE);
   }
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
index 6000e36a..7d2b89d 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
@@ -54,6 +54,7 @@
   self.viewController.longPressDelegate = self.longPressDelegate;
 
   self.mediator = [[ToolbarMediator alloc] init];
+  self.mediator.incognito = self.browserState->IsOffTheRecord();
   self.mediator.templateURLService =
       ios::TemplateURLServiceFactory::GetForBrowserState(self.browserState);
   self.mediator.consumer = self.viewController;
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_mediator.h b/ios/chrome/browser/ui/toolbar/toolbar_mediator.h
index 3f773af..d636e71 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_mediator.h
+++ b/ios/chrome/browser/ui/toolbar/toolbar_mediator.h
@@ -22,6 +22,9 @@
 // to a consumer.
 @interface ToolbarMediator : NSObject
 
+// Whether the search icon should be in dark mode or not.
+@property(nonatomic, assign, getter=isIncognito) BOOL incognito;
+
 // TemplateURLService used to check the default search engine.
 @property(nonatomic, assign) TemplateURLService* templateURLService;
 
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm b/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
index 97abfcc..5227ca6 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
+++ b/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
@@ -35,6 +35,9 @@
 // The current web state associated with the toolbar.
 @property(nonatomic, assign) web::WebState* webState;
 
+// The icon for the search button.
+@property(nonatomic, strong) UIImage* searchIcon;
+
 @end
 
 @implementation ToolbarMediator {
@@ -50,6 +53,7 @@
 @synthesize consumer = _consumer;
 @synthesize webState = _webState;
 @synthesize webStateList = _webStateList;
+@synthesize searchIcon = _searchIcon;
 
 - (instancetype)init {
   self = [super init];
@@ -174,6 +178,17 @@
 
 #pragma mark - Setters
 
+- (void)setIncognito:(BOOL)incognito {
+  if (incognito == _incognito)
+    return;
+
+  _incognito = incognito;
+  if (self.searchIcon) {
+    // If the searchEngine was already initialized, ask for the new image.
+    [self searchEngineChanged];
+  }
+}
+
 - (void)setTemplateURLService:(TemplateURLService*)templateURLService {
   _templateURLService = templateURLService;
   if (templateURLService) {
@@ -328,9 +343,11 @@
           SEARCH_ENGINE_GOOGLE) {
     searchEngineIcon = SEARCH_ENGINE_ICON_GOOGLE_SEARCH;
   }
-  UIImage* searchIcon = ios::GetChromeBrowserProvider()
-                            ->GetBrandedImageProvider()
-                            ->GetToolbarSearchIcon(searchEngineIcon);
+  UIImage* searchIcon =
+      ios::GetChromeBrowserProvider()
+          ->GetBrandedImageProvider()
+          ->GetToolbarSearchIcon(searchEngineIcon, self.incognito);
+  DCHECK(searchIcon);
   [self.consumer setSearchIcon:searchIcon];
 }
 
diff --git a/ios/public/provider/chrome/browser/images/branded_image_provider.h b/ios/public/provider/chrome/browser/images/branded_image_provider.h
index 4c6c660..a2c721da 100644
--- a/ios/public/provider/chrome/browser/images/branded_image_provider.h
+++ b/ios/public/provider/chrome/browser/images/branded_image_provider.h
@@ -51,7 +51,8 @@
   virtual UIImage* GetDownloadGoogleDriveImage();
 
   // Returns the 28pt x 28pt image to use for the "Search" icon in the toolbar.
-  virtual UIImage* GetToolbarSearchIcon(SearchEngineIcon type);
+  virtual UIImage* GetToolbarSearchIcon(SearchEngineIcon type,
+                                        bool dark_version);
 
  private:
   DISALLOW_COPY_AND_ASSIGN(BrandedImageProvider);
diff --git a/ios/public/provider/chrome/browser/images/branded_image_provider.mm b/ios/public/provider/chrome/browser/images/branded_image_provider.mm
index c5aa6a1e..2867b0c 100644
--- a/ios/public/provider/chrome/browser/images/branded_image_provider.mm
+++ b/ios/public/provider/chrome/browser/images/branded_image_provider.mm
@@ -47,6 +47,7 @@
   return nil;
 }
 
-UIImage* BrandedImageProvider::GetToolbarSearchIcon(SearchEngineIcon type) {
+UIImage* BrandedImageProvider::GetToolbarSearchIcon(SearchEngineIcon type,
+                                                    bool dark_version) {
   return [UIImage imageNamed:@"toolbar_search"];
 }
diff --git a/media/audio/audio_output_device.h b/media/audio/audio_output_device.h
index 4e0344f..cc48143 100644
--- a/media/audio/audio_output_device.h
+++ b/media/audio/audio_output_device.h
@@ -217,7 +217,7 @@
   //
   // TODO(scherkus): Replace this by changing AudioRendererSink to either accept
   // the callback via Start(). See http://crbug.com/151051 for details.
-  bool stopping_hack_;
+  bool stopping_hack_ GUARDED_BY(audio_thread_lock_);
 
   base::WaitableEvent did_receive_auth_;
   AudioParameters output_params_;
diff --git a/media/base/video_rotation.h b/media/base/video_rotation.h
index aaa354c..05690ae 100644
--- a/media/base/video_rotation.h
+++ b/media/base/video_rotation.h
@@ -11,7 +11,7 @@
 
 // Enumeration to represent 90 degree video rotation for MP4 videos
 // where it can be rotated by 90 degree intervals.
-enum VideoRotation {
+enum VideoRotation : int {
   VIDEO_ROTATION_0 = 0,
   VIDEO_ROTATION_90,
   VIDEO_ROTATION_180,
diff --git a/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl b/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl
index d37288a..99859e0 100644
--- a/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl
+++ b/mojo/public/tools/bindings/generators/java_templates/enum_definition.tmpl
@@ -15,6 +15,13 @@
     public static final int {{field|name}} = {{enum_value(enum, field, loop.index0)}};
 {% endfor %}
 
+{%-   if enum.min_value is not none %}
+    public static final int MIN_VALUE = (int) ({{enum.min_value}});
+{%-   endif %}
+{%-   if enum.max_value is not none %}
+    public static final int MAX_VALUE = (int) ({{enum.max_value}});
+{%-   endif %}
+
     private static final boolean IS_EXTENSIBLE = {% if enum.extensible %}true{% else %}false{% endif %};
 
     public static boolean isKnownValue(int value) {
diff --git a/net/android/javatests/src/org/chromium/net/AndroidNetworkLibraryTestUtil.java b/net/android/javatests/src/org/chromium/net/AndroidNetworkLibraryTestUtil.java
index 1e82092..aefce5b 100644
--- a/net/android/javatests/src/org/chromium/net/AndroidNetworkLibraryTestUtil.java
+++ b/net/android/javatests/src/org/chromium/net/AndroidNetworkLibraryTestUtil.java
@@ -16,7 +16,7 @@
      * Helper for tests that simulates an app controlling cleartext traffic on M and newer.
      */
     @CalledByNative
-    private static void setUpSecurityPolicyForTesting(boolean cleartextPermitted) throws Exception {
+    public static void setUpSecurityPolicyForTesting(boolean cleartextPermitted) throws Exception {
         sDefaultCleartextCheckCount = 0;
         sPerHostCleartextCheckCount = 0;
         AndroidNetworkLibrary.NetworkSecurityPolicyProxy.setInstanceForTesting(
diff --git a/services/media_session/audio_focus_manager.cc b/services/media_session/audio_focus_manager.cc
index a24d0e957..63a6fa2 100644
--- a/services/media_session/audio_focus_manager.cc
+++ b/services/media_session/audio_focus_manager.cc
@@ -190,6 +190,7 @@
 
   if (audio_focus_stack_.back()->id() != id) {
     RemoveFocusEntryIfPresent(id);
+    active_media_controller_.SetMediaSession(GetActiveGainSession());
     return;
   }
 
@@ -202,14 +203,14 @@
       observer->OnFocusLost(row->info().Clone());
     });
 
-    DidChangeFocus();
+    active_media_controller_.SetMediaSession(GetActiveGainSession());
     return;
   }
 
   if (IsAudioFocusEnforcementEnabled())
     EnforceAudioFocusAbandon(row->audio_focus_type());
 
-  DidChangeFocus();
+  active_media_controller_.SetMediaSession(GetActiveGainSession());
 
   // Notify observers that we lost audio focus.
   observers_.ForAllPtrs([&row](mojom::AudioFocusObserver* observer) {
@@ -267,7 +268,7 @@
   row->SetAudioFocusType(type);
   audio_focus_stack_.push_back(std::move(row));
 
-  DidChangeFocus();
+  active_media_controller_.SetMediaSession(GetActiveGainSession());
 
   // Notify observers that we were gained audio focus.
   mojom::MediaSessionInfoPtr session_info =
@@ -352,13 +353,14 @@
   }
 }
 
-void AudioFocusManager::DidChangeFocus() {
-  if (audio_focus_stack_.empty()) {
-    active_media_controller_.ClearMediaSession();
-  } else {
-    active_media_controller_.SetMediaSession(
-        audio_focus_stack_.back()->session());
+mojom::MediaSession* AudioFocusManager::GetActiveGainSession() const {
+  for (auto& row : base::Reversed(audio_focus_stack_)) {
+    if (row->audio_focus_type() != mojom::AudioFocusType::kGain)
+      continue;
+    return row->session();
   }
+
+  return nullptr;
 }
 
 AudioFocusManager::AudioFocusManager() {
diff --git a/services/media_session/audio_focus_manager.h b/services/media_session/audio_focus_manager.h
index 1149eebb..2218913b 100644
--- a/services/media_session/audio_focus_manager.h
+++ b/services/media_session/audio_focus_manager.h
@@ -88,8 +88,8 @@
   void AbandonAudioFocusInternal(RequestId);
   void EnforceAudioFocusAbandon(mojom::AudioFocusType);
 
-  // Called when the active media session with audio focus changes.
-  void DidChangeFocus();
+  // Get the top most media session with the gain audio focus type.
+  mojom::MediaSession* GetActiveGainSession() const;
 
   std::unique_ptr<StackRow> RemoveFocusEntryIfPresent(RequestId id);
 
diff --git a/services/media_session/media_controller.cc b/services/media_session/media_controller.cc
index fdddf74..754f9c91 100644
--- a/services/media_session/media_controller.cc
+++ b/services/media_session/media_controller.cc
@@ -79,19 +79,18 @@
 
 void MediaController::SetMediaSession(mojom::MediaSession* session) {
   DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+
+  if (session == nullptr) {
+    session_binding_.Close();
+  } else if (session_ != session) {
+    // Add |this| as an observer for |session|.
+    session_binding_.Close();
+    mojom::MediaSessionObserverPtr observer;
+    session_binding_.Bind(mojo::MakeRequest(&observer));
+    session->AddObserver(std::move(observer));
+  }
+
   session_ = session;
-
-  // Add |this| as an observer for |session|.
-  session_binding_.Close();
-  mojom::MediaSessionObserverPtr observer;
-  session_binding_.Bind(mojo::MakeRequest(&observer));
-  session->AddObserver(std::move(observer));
-}
-
-void MediaController::ClearMediaSession() {
-  DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-  session_ = nullptr;
-  session_binding_.Close();
 }
 
 void MediaController::BindToInterface(mojom::MediaControllerRequest request) {
diff --git a/services/media_session/media_controller.h b/services/media_session/media_controller.h
index 36deb02e..517bb33 100644
--- a/services/media_session/media_controller.h
+++ b/services/media_session/media_controller.h
@@ -38,7 +38,6 @@
   void MediaSessionInfoChanged(mojom::MediaSessionInfoPtr) override;
 
   void SetMediaSession(mojom::MediaSession*);
-  void ClearMediaSession();
 
   void BindToInterface(mojom::MediaControllerRequest);
   void FlushForTesting();
diff --git a/services/media_session/media_controller_unittest.cc b/services/media_session/media_controller_unittest.cc
index f29b19b..1fb7612 100644
--- a/services/media_session/media_controller_unittest.cc
+++ b/services/media_session/media_controller_unittest.cc
@@ -41,9 +41,9 @@
     base::RunLoop().RunUntilIdle();
   }
 
-  void RequestAudioFocus(test::MockMediaSession& session) {
-    session.RequestAudioFocusFromService(audio_focus_ptr_,
-                                         mojom::AudioFocusType::kGainTransient);
+  void RequestAudioFocus(test::MockMediaSession& session,
+                         mojom::AudioFocusType type) {
+    session.RequestAudioFocusFromService(audio_focus_ptr_, type);
   }
 
   mojom::MediaControllerPtr& controller() { return media_controller_ptr_; }
@@ -63,7 +63,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
@@ -74,22 +74,90 @@
   }
 }
 
-TEST_F(MediaControllerTest, ActiveController_Suspend_Multiple) {
+TEST_F(MediaControllerTest, ActiveController_Multiple_Abandon_Top) {
   test::MockMediaSession media_session_1;
+  test::MockMediaSession media_session_2;
 
   {
     test::MockMediaSessionMojoObserver observer(media_session_1);
-    RequestAudioFocus(media_session_1);
+    RequestAudioFocus(media_session_1, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
-  test::MockMediaSession media_session_2;
-
   {
     test::MockMediaSessionMojoObserver observer_1(media_session_1);
     test::MockMediaSessionMojoObserver observer_2(media_session_2);
 
-    RequestAudioFocus(media_session_2);
+    RequestAudioFocus(media_session_2, mojom::AudioFocusType::kGain);
+
+    observer_1.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
+    observer_2.WaitForState(mojom::MediaSessionInfo::SessionState::kActive);
+  }
+
+  media_session_2.AbandonAudioFocusFromClient();
+
+  {
+    test::MockMediaSessionMojoObserver observer(media_session_1);
+    controller()->Resume();
+    observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+}
+
+TEST_F(MediaControllerTest, ActiveController_Multiple_Abandon_UnderTransient) {
+  test::MockMediaSession media_session_1;
+  test::MockMediaSession media_session_2;
+  test::MockMediaSession media_session_3;
+
+  {
+    test::MockMediaSessionMojoObserver observer(media_session_1);
+    RequestAudioFocus(media_session_1, mojom::AudioFocusType::kGain);
+    observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  {
+    test::MockMediaSessionMojoObserver observer_1(media_session_1);
+    test::MockMediaSessionMojoObserver observer_2(media_session_2);
+
+    RequestAudioFocus(media_session_2, mojom::AudioFocusType::kGain);
+
+    observer_1.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
+    observer_2.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  {
+    test::MockMediaSessionMojoObserver observer_2(media_session_2);
+    test::MockMediaSessionMojoObserver observer_3(media_session_3);
+
+    RequestAudioFocus(media_session_3, mojom::AudioFocusType::kGainTransient);
+
+    observer_2.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
+    observer_3.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  media_session_2.AbandonAudioFocusFromClient();
+
+  {
+    test::MockMediaSessionMojoObserver observer(media_session_1);
+    controller()->Resume();
+    observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+}
+
+TEST_F(MediaControllerTest, ActiveController_Multiple_Gain) {
+  test::MockMediaSession media_session_1;
+  test::MockMediaSession media_session_2;
+
+  {
+    test::MockMediaSessionMojoObserver observer(media_session_1);
+    RequestAudioFocus(media_session_1, mojom::AudioFocusType::kGain);
+    observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  {
+    test::MockMediaSessionMojoObserver observer_1(media_session_1);
+    test::MockMediaSessionMojoObserver observer_2(media_session_2);
+
+    RequestAudioFocus(media_session_2, mojom::AudioFocusType::kGain);
 
     observer_1.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
     observer_2.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
@@ -100,18 +168,79 @@
     controller()->Suspend();
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
   }
+}
+
+TEST_F(MediaControllerTest, ActiveController_Multiple_GainTransient) {
+  test::MockMediaSession media_session_1;
+  test::MockMediaSession media_session_2;
 
   {
     test::MockMediaSessionMojoObserver observer(media_session_1);
-    media_session_2.AbandonAudioFocusFromClient();
+    RequestAudioFocus(media_session_1, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
+  EXPECT_EQ(2, media_session_1.add_observer_count());
+
+  {
+    test::MockMediaSessionMojoObserver observer_1(media_session_1);
+    test::MockMediaSessionMojoObserver observer_2(media_session_2);
+
+    RequestAudioFocus(media_session_2, mojom::AudioFocusType::kGainTransient);
+
+    observer_1.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
+    observer_2.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  // The top session has changed but the controller is still bound to
+  // |media_session_1|. We should make sure we do not add an observer if we
+  // already have one.
+  EXPECT_EQ(3, media_session_1.add_observer_count());
+
+  {
+    test::MockMediaSessionMojoObserver observer(media_session_1);
+    controller()->Resume();
+    observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  EXPECT_EQ(4, media_session_1.add_observer_count());
+}
+
+TEST_F(MediaControllerTest, ActiveController_Multiple_GainTransientMayDuck) {
+  test::MockMediaSession media_session_1;
+  test::MockMediaSession media_session_2;
+
+  {
+    test::MockMediaSessionMojoObserver observer(media_session_1);
+    RequestAudioFocus(media_session_1, mojom::AudioFocusType::kGain);
+    observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  EXPECT_EQ(2, media_session_1.add_observer_count());
+
+  {
+    test::MockMediaSessionMojoObserver observer_1(media_session_1);
+    test::MockMediaSessionMojoObserver observer_2(media_session_2);
+
+    RequestAudioFocus(media_session_2,
+                      mojom::AudioFocusType::kGainTransientMayDuck);
+
+    observer_1.WaitForState(mojom::MediaSessionInfo::SessionState::kDucking);
+    observer_2.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
+  }
+
+  // The top session has changed but the controller is still bound to
+  // |media_session_1|. We should make sure we do not add an observer if we
+  // already have one.
+  EXPECT_EQ(3, media_session_1.add_observer_count());
+
   {
     test::MockMediaSessionMojoObserver observer(media_session_1);
     controller()->Suspend();
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPaused);
   }
+
+  EXPECT_EQ(4, media_session_1.add_observer_count());
 }
 
 TEST_F(MediaControllerTest, ActiveController_Suspend_Noop) {
@@ -123,7 +252,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
@@ -133,7 +262,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 }
@@ -143,7 +272,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
@@ -165,7 +294,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
@@ -181,7 +310,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForState(mojom::MediaSessionInfo::SessionState::kActive);
   }
 
@@ -203,7 +332,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     media_session.Stop();
     observer.WaitForState(mojom::MediaSessionInfo::SessionState::kInactive);
   }
@@ -220,7 +349,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForPlaybackState(mojom::MediaPlaybackState::kPlaying);
   }
 
@@ -243,7 +372,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session_1);
-    RequestAudioFocus(media_session_1);
+    RequestAudioFocus(media_session_1, mojom::AudioFocusType::kGain);
     observer.WaitForState(mojom::MediaSessionInfo::SessionState::kActive);
   }
 
@@ -260,7 +389,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(controller());
-    RequestAudioFocus(media_session_2);
+    RequestAudioFocus(media_session_2, mojom::AudioFocusType::kGain);
     observer.WaitForState(mojom::MediaSessionInfo::SessionState::kActive);
   }
 
@@ -282,7 +411,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForState(mojom::MediaSessionInfo::SessionState::kActive);
     EXPECT_EQ(0, media_session.prev_track_count());
   }
@@ -299,7 +428,7 @@
 
   {
     test::MockMediaSessionMojoObserver observer(media_session);
-    RequestAudioFocus(media_session);
+    RequestAudioFocus(media_session, mojom::AudioFocusType::kGain);
     observer.WaitForState(mojom::MediaSessionInfo::SessionState::kActive);
     EXPECT_EQ(0, media_session.next_track_count());
   }
diff --git a/services/media_session/mock_media_session.cc b/services/media_session/mock_media_session.cc
index 783f152e..8c69462 100644
--- a/services/media_session/mock_media_session.cc
+++ b/services/media_session/mock_media_session.cc
@@ -87,6 +87,8 @@
 }
 
 void MockMediaSession::AddObserver(mojom::MediaSessionObserverPtr observer) {
+  ++add_observer_count_;
+
   observer->MediaSessionInfoChanged(GetMediaSessionInfoSync());
   observers_.AddPtr(std::move(observer));
 }
diff --git a/services/media_session/mock_media_session.h b/services/media_session/mock_media_session.h
index 90e622e..3b3dc070 100644
--- a/services/media_session/mock_media_session.h
+++ b/services/media_session/mock_media_session.h
@@ -84,6 +84,7 @@
 
   int prev_track_count() const { return prev_track_count_; }
   int next_track_count() const { return next_track_count_; }
+  int add_observer_count() const { return add_observer_count_; }
 
  private:
   void SetState(mojom::MediaSessionInfo::SessionState);
@@ -97,6 +98,7 @@
 
   int prev_track_count_ = 0;
   int next_track_count_ = 0;
+  int add_observer_count_ = 0;
 
   mojom::MediaSessionInfo::SessionState state_ =
       mojom::MediaSessionInfo::SessionState::kInactive;
diff --git a/services/viz/public/cpp/compositing/quads_struct_traits.cc b/services/viz/public/cpp/compositing/quads_struct_traits.cc
index 47121a2..af3742e9 100644
--- a/services/viz/public/cpp/compositing/quads_struct_traits.cc
+++ b/services/viz/public/cpp/compositing/quads_struct_traits.cc
@@ -79,6 +79,7 @@
     return false;
   }
   quad->force_anti_aliasing_off = data.force_anti_aliasing_off();
+  quad->backdrop_filter_quality = data.backdrop_filter_quality();
   return true;
 }
 
diff --git a/services/viz/public/cpp/compositing/quads_struct_traits.h b/services/viz/public/cpp/compositing/quads_struct_traits.h
index ac28fea3..129fcd1c 100644
--- a/services/viz/public/cpp/compositing/quads_struct_traits.h
+++ b/services/viz/public/cpp/compositing/quads_struct_traits.h
@@ -189,6 +189,12 @@
     return quad->force_anti_aliasing_off;
   }
 
+  static float backdrop_filter_quality(const viz::DrawQuad& input) {
+    const viz::RenderPassDrawQuad* quad =
+        viz::RenderPassDrawQuad::MaterialCast(&input);
+    return quad->backdrop_filter_quality;
+  }
+
   static bool Read(viz::mojom::RenderPassQuadStateDataView data,
                    viz::DrawQuad* out);
 };
diff --git a/services/viz/public/cpp/compositing/struct_traits_unittest.cc b/services/viz/public/cpp/compositing/struct_traits_unittest.cc
index fdc693e..0cb36c0 100644
--- a/services/viz/public/cpp/compositing/struct_traits_unittest.cc
+++ b/services/viz/public/cpp/compositing/struct_traits_unittest.cc
@@ -903,6 +903,7 @@
   const gfx::Rect rect2(2468, 8642, 4321, 1234);
   const uint32_t color2 = 0xffffffff;
   const bool force_anti_aliasing_off = true;
+  const float backdrop_filter_quality = 1.0f;
   SolidColorDrawQuad* solid_quad =
       render_pass->CreateAndAppendDrawQuad<SolidColorDrawQuad>();
   solid_quad->SetNew(sqs, rect2, rect2, color2, force_anti_aliasing_off);
@@ -934,7 +935,7 @@
   render_pass_quad->SetNew(sqs, rect4, rect4, render_pass_id, resource_id4,
                            mask_uv_rect, mask_texture_size, filters_scale,
                            filters_origin, tex_coord_rect,
-                           force_anti_aliasing_off);
+                           force_anti_aliasing_off, backdrop_filter_quality);
 
   const gfx::Rect rect5(123, 567, 91011, 131415);
   const ResourceId resource_id5(1337);
diff --git a/services/viz/public/interfaces/compositing/quads.mojom b/services/viz/public/interfaces/compositing/quads.mojom
index b1eaad0..3f12a14 100644
--- a/services/viz/public/interfaces/compositing/quads.mojom
+++ b/services/viz/public/interfaces/compositing/quads.mojom
@@ -41,6 +41,7 @@
   gfx.mojom.RectF tex_coord_rect;
 
   bool force_anti_aliasing_off;
+  float backdrop_filter_quality;
 };
 
 struct SolidColorQuadState {
diff --git a/services/ws/client_root.cc b/services/ws/client_root.cc
index 1ca884b..bbc6decc 100644
--- a/services/ws/client_root.cc
+++ b/services/ws/client_root.cc
@@ -90,8 +90,9 @@
   if (last_surface_size_in_pixels_ != size_in_pixels ||
       !server_window->local_surface_id().has_value() ||
       last_device_scale_factor_ != window_->layer()->device_scale_factor()) {
+    parent_local_surface_id_allocator_.GenerateId();
     server_window->set_local_surface_id(
-        parent_local_surface_id_allocator_.GenerateId());
+        parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId());
     last_surface_size_in_pixels_ = size_in_pixels;
     last_device_scale_factor_ = window_->layer()->device_scale_factor();
   }
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index d2d12e8b..c471e2f 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -2351,6 +2351,21 @@
             ]
         }
     ],
+    "InterestFeedContentSuggestions": [
+        {
+            "platforms": [
+                "android"
+            ],
+            "experiments": [
+                {
+                    "name": "Enabled",
+                    "enable_features": [
+                        "InterestFeedContentSuggestions"
+                    ]
+                }
+            ]
+        }
+    ],
     "InvalidationsGCMUpstream": [
         {
             "platforms": [
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
index 2ce7c71..ea30da1 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -18,8 +18,6 @@
 crbug.com/450202 fast/multicol/span/overflow-on-multicol.html [ Skip ]
 
 # Wrong quirks mode line height for pattern <div><a><img></a></div>
-crbug.com/854840 fast/table/backgr_border-table-quirks-collapsed-border.html [ Failure Pass ]
-crbug.com/854840 fast/table/backgr_border-table-quirks.html [ Failure Pass ]
 
 # Superscript text off by 1px
 crbug.com/636993 external/wpt/css/css-text-decor/text-decoration-color.html [ Failure ]
@@ -60,9 +58,10 @@
 # New failures are appended below by the script.
 crbug.com/728378 compositing/culling/tile-occlusion-boundaries.html [ Failure ]
 crbug.com/864398 compositing/iframes/floating-self-painting-frame.html [ Failure ]
-crbug.com/591099 compositing/masks/mask-with-removed-filters.html [ Pass ]
+crbug.com/591099 compositing/masks/mask-with-removed-filters.html [ Failure Pass ]
 crbug.com/591099 compositing/video-frame-size-change.html [ Pass ]
 crbug.com/591099 css3/filters/composited-layer-child-bounds-after-composited-to-sw-shadow-change.html [ Failure ]
+crbug.com/591099 editing/selection/drag-in-iframe.html [ Failure Pass ]
 crbug.com/591099 editing/selection/paint-hyphen.html [ Pass ]
 crbug.com/591099 external/wpt/content-security-policy/generic/only-valid-whitespaces-are-allowed.html [ Pass ]
 crbug.com/591099 external/wpt/css/CSS2/abspos/abspos-in-block-in-inline-in-relpos-inline.html [ Failure ]
@@ -232,16 +231,11 @@
 crbug.com/591099 external/wpt/editing/run/multitest.html [ Pass ]
 crbug.com/591099 external/wpt/editing/run/strikethrough.html [ Pass ]
 crbug.com/591099 external/wpt/encoding/legacy-mb-korean/euc-kr/euckr-decode-ksc_5601.html [ Timeout ]
-crbug.com/591099 external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html [ Pass ]
-crbug.com/591099 external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute.https.sub.html [ Pass ]
-crbug.com/591099 external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy.https.sub.html [ Pass ]
-crbug.com/591099 external/wpt/feature-policy/picture-in-picture-default-feature-policy.https.sub.html [ Pass ]
-crbug.com/591099 external/wpt/feature-policy/reporting/picture-in-picture-reporting.html [ Pass ]
 crbug.com/591099 external/wpt/fetch/api/redirect/redirect-count.any.html [ Pass ]
 crbug.com/591099 external/wpt/fetch/api/redirect/redirect-count.any.worker.html [ Pass ]
 crbug.com/591099 external/wpt/fetch/api/request/request-keepalive-quota.html?include=slow-2 [ Pass ]
 crbug.com/591099 external/wpt/fetch/http-cache/basic-auth-cache-test.html [ Timeout ]
-crbug.com/591099 external/wpt/geolocation-API/PositionOptions.https.html [ Failure Pass ]
+crbug.com/591099 external/wpt/geolocation-API/PositionOptions.https.html [ Failure ]
 crbug.com/591099 external/wpt/html/browsers/history/joint-session-history/joint-session-history-remove-iframe.html [ Timeout ]
 crbug.com/591099 external/wpt/html/browsers/the-window-object/window-open-noopener.html?_parent [ Timeout ]
 crbug.com/591099 external/wpt/html/browsers/the-window-object/window-open-noopener.html?_self [ Timeout ]
@@ -256,15 +250,9 @@
 crbug.com/591099 external/wpt/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/track.html [ Pass ]
 crbug.com/591099 external/wpt/html/semantics/embedded-content/media-elements/track/track-element/cloneNode.html [ Pass ]
 crbug.com/591099 external/wpt/html/semantics/scripting-1/the-script-element/async_010.htm [ Pass ]
-crbug.com/591099 external/wpt/picture-in-picture/disable-picture-in-picture.html [ Pass ]
-crbug.com/591099 external/wpt/picture-in-picture/enter-picture-in-picture.html [ Pass ]
-crbug.com/591099 external/wpt/picture-in-picture/exit-picture-in-picture.html [ Pass ]
 crbug.com/591099 external/wpt/picture-in-picture/leave-picture-in-picture.html [ Pass ]
-crbug.com/591099 external/wpt/picture-in-picture/picture-in-picture-element.html [ Pass Timeout ]
 crbug.com/591099 external/wpt/picture-in-picture/picture-in-picture-window.html [ Pass ]
 crbug.com/591099 external/wpt/picture-in-picture/request-picture-in-picture-twice.html [ Pass ]
-crbug.com/591099 external/wpt/picture-in-picture/request-picture-in-picture.html [ Pass ]
-crbug.com/591099 external/wpt/picture-in-picture/shadow-dom.html [ Pass ]
 crbug.com/591099 external/wpt/requestidlecallback/callback-iframe.html [ Pass Timeout ]
 crbug.com/591099 external/wpt/service-workers/service-worker/navigation-preload/broken-chunked-encoding.https.html [ Pass ]
 crbug.com/591099 external/wpt/service-workers/service-worker/update-after-navigation-redirect.https.html [ Pass ]
@@ -289,8 +277,8 @@
 crbug.com/591099 fast/block/positioning/positioned-child-inside-relative-positioned-anonymous-block.html [ Failure ]
 crbug.com/591099 fast/borders/bidi-002.html [ Failure ]
 crbug.com/859497 fast/borders/bidi-009a.html [ Failure ]
-crbug.com/591099 fast/borders/border-radius-mask-canvas-border.html [ Pass ]
-crbug.com/591099 fast/borders/border-radius-mask-canvas-with-mask.html [ Pass ]
+crbug.com/591099 fast/borders/border-radius-mask-canvas-border.html [ Failure Pass ]
+crbug.com/591099 fast/borders/border-radius-mask-canvas-with-mask.html [ Failure Pass ]
 crbug.com/591099 fast/borders/inline-mask-overlay-image-outset-vertical-rl.html [ Failure ]
 crbug.com/591099 fast/canvas/canvas-hidpi-blurry.html [ Pass ]
 crbug.com/591099 fast/css-intrinsic-dimensions/height-positioned.html [ Pass ]
@@ -314,9 +302,7 @@
 crbug.com/889721 fast/inline/continuation-outlines-with-layers.html [ Failure ]
 crbug.com/889721 fast/inline/continuation-outlines.html [ Failure ]
 crbug.com/835484 fast/inline/inline-focus-ring-under-absolute-enclosing-relative-div.html [ Failure ]
-crbug.com/835484 fast/inline/nested-text-descendants.html [ Failure ]
 crbug.com/889721 fast/inline/outline-continuations.html [ Failure ]
-crbug.com/835484 fast/inline/outline-offset.html [ Failure ]
 crbug.com/591099 fast/overflow/overflow-update-transform.html [ Failure ]
 crbug.com/591099 fast/overflow/scrollRevealButton.html [ Pass ]
 crbug.com/591099 fast/replaced/replaced-breaking.html [ Failure Pass ]
@@ -330,15 +316,11 @@
 crbug.com/591099 fast/text/descent-clip-in-scaled-page.html [ Failure ]
 crbug.com/591099 fast/text/ellipsis-in-relative-inline-right.html [ Failure ]
 crbug.com/591099 fast/text/ellipsis-in-relative-inline.html [ Failure ]
-crbug.com/714962 fast/text/emoticons.html [ Failure Pass ]
 crbug.com/796943 fast/text/international/shape-across-elements-simple.html [ Pass ]
-crbug.com/591099 fast/text/unicode-fallback-font.html [ Failure Pass ]
 crbug.com/591099 fast/text/whitespace/018.html [ Failure ]
 crbug.com/591099 fast/writing-mode/auto-sizing-orthogonal-flows.html [ Failure ]
 crbug.com/714962 fast/writing-mode/background-vertical-lr.html [ Failure ]
 crbug.com/591099 fast/writing-mode/basic-vertical-line.html [ Failure ]
-crbug.com/591099 fast/writing-mode/border-radius-clipping-vertical-lr.html [ Failure Pass ]
-crbug.com/714962 fast/writing-mode/border-styles-vertical-lr.html [ Failure Pass ]
 crbug.com/591099 fast/writing-mode/fieldsets.html [ Failure ]
 crbug.com/591099 fast/writing-mode/percentage-height-orthogonal-writing-modes.html [ Failure ]
 crbug.com/591099 fast/writing-mode/table-percent-width-quirk.html [ Pass ]
@@ -364,20 +346,15 @@
 crbug.com/591099 http/tests/security/setDomainRelaxationForbiddenForURLScheme.html [ Crash ]
 crbug.com/591099 http/tests/webaudio/autoplay-crossorigin.html [ Failure ]
 crbug.com/591099 idle-callback/test-runner-run-idle-tasks.html [ Crash Pass ]
-crbug.com/591099 images/color-profile-image-filter-all.html [ Failure Pass ]
-crbug.com/591099 inspector-protocol/accessibility/accessibility-ignoredNodes.js [ Failure ]
-crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-labelledby.js [ Failure ]
+crbug.com/591099 inspector-protocol/accessibility/accessibility-ignoredNodes.js [ Failure Pass ]
+crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-labelledby.js [ Failure Pass ]
 crbug.com/591099 inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-pseudo-element.js [ Failure ]
 crbug.com/714962 inspector-protocol/layout-fonts/languages-emoji-rare-glyphs.js [ Failure ]
 crbug.com/591099 inspector-protocol/runtime/runtime-console-log-handle-navigate.js [ Pass ]
 crbug.com/591099 inspector-protocol/timeline/page-frames.js [ Failure ]
 crbug.com/591099 intersection-observer/v2/text-shadow.html [ Failure ]
 crbug.com/591099 media/controls/lazy-loaded-style.html [ Pass ]
-crbug.com/591099 media/picture-in-picture/controls/picture-in-picture-button.html [ Pass ]
-crbug.com/591099 media/picture-in-picture/controls/picture-in-picture-video-with-audio-only-button.html [ Pass ]
-crbug.com/591099 media/picture-in-picture/mediastream.html [ Pass ]
-crbug.com/591099 media/picture-in-picture/picture-in-picture-enabled.html [ Pass ]
-crbug.com/591099 media/picture-in-picture/picture-in-picture-interstitial.html [ Pass ]
+crbug.com/591099 media/video-zoom-controls.html [ Pass ]
 crbug.com/591099 paint/float/float-under-inline-self-painting-change.html [ Failure ]
 crbug.com/835484 paint/inline/focus-ring-under-absolute-with-relative-continuation.html [ Failure ]
 crbug.com/591099 paint/invalidation/compositing/subpixel-offset-scaled-transform-composited.html [ Failure ]
@@ -431,19 +408,19 @@
 crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug50695-2.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug55527.html [ Failure ]
-crbug.com/591099 transforms/3d/general/perspective-units.html [ Failure Pass ]
+crbug.com/591099 transforms/3d/general/perspective-units.html [ Pass ]
 crbug.com/870008 virtual/android/rootscroller/position-fixed-in-unscrollable-document-iframe.html [ Failure Pass ]
 crbug.com/591099 virtual/android/url-bar/bottom-and-top-fixed-sticks-to-top.html [ Failure ]
 crbug.com/591099 virtual/exotic-color-space/ [ Skip ]
 crbug.com/591099 virtual/feature-policy-vibrate/ [ Skip ]
-crbug.com/591099 virtual/fractional_scrolling/fast/scrolling/fractional-scroll-offset-iframe-fixed-position.html [ Pass ]
-crbug.com/591099 virtual/fractional_scrolling_threaded/fast/scrolling/fractional-scroll-offset-iframe-fixed-position.html [ Pass ]
-crbug.com/591099 virtual/fractional_scrolling_threaded/fast/scrolling/overflow-scrollability.html [ Failure Pass ]
+crbug.com/591099 virtual/fractional_scrolling/fast/scrolling/fractional-scroll-offset-iframe-fixed-position.html [ Failure Pass ]
+crbug.com/591099 virtual/fractional_scrolling_threaded/fast/scrolling/fractional-scroll-offset-iframe-fixed-position.html [ Failure Pass ]
+crbug.com/591099 virtual/fractional_scrolling_threaded/fast/scrolling/overflow-scrollability.html [ Crash Failure Pass ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-filter-all.html [ Failure ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-blending-color-over-image.html [ Pass ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-blending-gradient-over-pattern.html [ Pass Timeout ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-hidpi-blurry.html [ Pass ]
-crbug.com/591099 virtual/gpu/fast/canvas/canvas-with-overflowing-object-fit.html [ Pass ]
+crbug.com/591099 virtual/gpu/fast/canvas/canvas-with-overflowing-object-fit.html [ Failure Pass ]
 crbug.com/591099 virtual/intersection-observer-v2/intersection-observer/v2/text-shadow.html [ Failure ]
 crbug.com/591099 virtual/layout_ng/ [ Skip ]
 crbug.com/824918 virtual/layout_ng_experimental/ [ Skip ]
@@ -477,13 +454,8 @@
 crbug.com/591099 virtual/spv2/paint/invalidation/box/margin.html [ Failure Pass ]
 crbug.com/591099 virtual/stable/ [ Skip ]
 crbug.com/591099 virtual/threaded/ [ Skip ]
-crbug.com/591099 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html [ Pass ]
-crbug.com/591099 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute.https.sub.html [ Pass ]
-crbug.com/591099 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy.https.sub.html [ Pass ]
-crbug.com/591099 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-default-feature-policy.https.sub.html [ Pass ]
-crbug.com/591099 virtual/unified-autoplay/external/wpt/feature-policy/reporting/picture-in-picture-reporting.html [ Pass ]
 crbug.com/591099 virtual/user-activation-v2/fast/events/mouse-cursor.html [ Failure ]
 crbug.com/591099 virtual/user-activation-v2/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
 crbug.com/591099 virtual/user-activation-v2/fast/events/touch/gesture/touch-gesture-scroll-input-field.html [ Pass ]
-crbug.com/591099 virtual/video-surface-layer/media/stable/video-object-fit-stable.html [ Pass ]
+crbug.com/591099 virtual/video-surface-layer/media/stable/video-object-fit-stable.html [ Failure Pass ]
 crbug.com/591099 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Pass ]
diff --git a/third_party/WebKit/LayoutTests/SlowTests b/third_party/WebKit/LayoutTests/SlowTests
index 6d54aee..37a527d5 100644
--- a/third_party/WebKit/LayoutTests/SlowTests
+++ b/third_party/WebKit/LayoutTests/SlowTests
@@ -1403,9 +1403,6 @@
 crbug.com/874695 virtual/user-activation-v2/fullscreen/model/fully-exit-fullscreen-nested-iframe.html [ Slow ]
 crbug.com/874695 virtual/user-activation-v2/fullscreen/rendering/overflow.html [ Slow ]
 crbug.com/874695 virtual/video-surface-layer/external/wpt/feature-policy/experimental-features/vertical-scroll-touch-block-manual.tentative.html [ Slow ]
-crbug.com/874695 virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-in-multiple-workers.js [ Slow ]
-crbug.com/874695 virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/breakpoints-ui-shifted-breakpoint.js [ Slow ]
-crbug.com/874695 virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/dom-breakpoints.js [ Slow ]
 crbug.com/874695 virtual/video-surface-layer/media/audio-controls-do-not-fade-out.html [ Slow ]
 crbug.com/874695 virtual/video-surface-layer/media/autoplay-muted.html [ Slow ]
 crbug.com/874695 virtual/video-surface-layer/media/autoplay-when-visible.html [ Slow ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 9056ea14..3632821 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -35,7 +35,6 @@
 crbug.com/891427 fast/replaced/replaced-breaking.html [ Failure ]
 crbug.com/891427 http/tests/devtools/tracing/decode-resize.js [ Failure ]
 crbug.com/891427 virtual/threaded/http/tests/devtools/tracing/decode-resize.js [ Failure ]
-crbug.com/891427 media/picture-in-picture/mediastream.html [ Crash ]
 crbug.com/891427 virtual/android/fullscreen/rendering/backdrop-video.html [ Failure ]
 crbug.com/891427 virtual/android/rootscroller/set-root-scroller.html [ Failure ]
 crbug.com/891427 virtual/android/rootscroller/set-rootscroller-before-load.html [ Failure ]
@@ -140,7 +139,6 @@
 crbug.com/881040 virtual/new-remote-playback-pipeline/media/controls/lazy-loaded-style.html [ Failure ]
 crbug.com/881040 virtual/new-remote-playback-pipeline/media/controls/paint-controls-webkit-appearance-none-custom-bg.html [ Failure ]
 crbug.com/881040 virtual/new-remote-playback-pipeline/media/controls/paint-controls-webkit-appearance-none.html [ Failure ]
-crbug.com/881040 external/wpt/picture-in-picture/idlharness.window.html [ Failure ]
 crbug.com/881040 media/video-layer-crash.html [ Failure ]
 
 # Remove these when --enable-display-compositor-pixel-dump becomes the
@@ -4927,16 +4925,19 @@
 crbug.com/783154 [ Mac ] media/controls/modern/doubletap-to-jump-forwards-too-short.html [ Skip ]
 crbug.com/783154 [ Mac ] media/controls/modern/doubletap-on-play-button.html [ Skip ]
 crbug.com/783154 [ Mac ] media/controls/modern/doubletap-to-toggle-fullscreen.html [ Skip ]
+crbug.com/783154 [ Mac ] media/controls/click-anywhere-to-play-pause.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/video-surface-layer/media/controls/modern/doubletap-to-jump-backwards.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/video-surface-layer/media/controls/modern/doubletap-to-jump-forwards.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/video-surface-layer/media/controls/modern/doubletap-to-jump-forwards-too-short.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/video-surface-layer/media/controls/modern/doubletap-on-play-button.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/video-surface-layer/media/controls/modern/doubletap-to-toggle-fullscreen.html [ Skip ]
+crbug.com/783154 [ Mac ] virtual/video-surface-layer/media/controls/click-anywhere-to-play-pause.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/new-remote-playback-pipeline/media/controls/modern/doubletap-to-jump-backwards.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/new-remote-playback-pipeline/media/controls/modern/doubletap-to-jump-forwards.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/new-remote-playback-pipeline/media/controls/modern/doubletap-to-jump-forwards-too-short.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/new-remote-playback-pipeline/media/controls/modern/doubletap-on-play-button.html [ Skip ]
 crbug.com/783154 [ Mac ] virtual/new-remote-playback-pipeline/media/controls/modern/doubletap-to-toggle-fullscreen.html [ Skip ]
+crbug.com/783154 [ Mac ] virtual/new-remote-playback-pipeline/media/controls/click-anywhere-to-play-pause.html [ Skip ]
 
 # Seen flaky on Linux, suppressing on Windows as well
 crbug.com/831720 [ Win Linux ] media/controls/modern/doubletap-to-jump-forwards-too-short.html [ Pass Failure ]
@@ -5060,38 +5061,6 @@
 crbug.com/811565 [ Fuchsia ] tables/mozilla/bugs/bug2479-3.html [ Failure Pass ]
 crbug.com/811565 [ Fuchsia ] tables/mozilla/core/bloomberg.html [ Failure Pass ]
 
-# TODO(apacible): Remove these once SurfaceLayerForVideo works on LayoutTests.
-crbug.com/806249 external/wpt/picture-in-picture/picture-in-picture-window.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/picture-in-picture-element.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/disable-picture-in-picture.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/shadow-dom.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/request-picture-in-picture.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/request-picture-in-picture-twice.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/leave-picture-in-picture.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/enter-picture-in-picture.html [ Failure ]
-crbug.com/806249 external/wpt/picture-in-picture/exit-picture-in-picture.html [ Failure ]
-crbug.com/806249 external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html [ Failure ]
-crbug.com/806249 external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute.https.sub.html [ Failure ]
-crbug.com/806249 external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy.https.sub.html [ Failure ]
-crbug.com/806249 external/wpt/feature-policy/picture-in-picture-default-feature-policy.https.sub.html [ Failure ]
-crbug.com/806249 external/wpt/feature-policy/reporting/picture-in-picture-reporting.html [ Failure ]
-### See crbug.com/891427 comment near the top of this file:
-####crbug.com/806249 http/tests/devtools/sources/debugger-breakpoints/picture-in-picture-event-listener-breakpoints.js [ Timeout ]
-crbug.com/806249 media/picture-in-picture/controls/picture-in-picture-button.html [ Failure ]
-crbug.com/806249 media/picture-in-picture/controls/picture-in-picture-video-with-audio-only-button.html [ Failure ]
-crbug.com/806249 media/picture-in-picture/picture-in-picture-enabled.html [ Failure ]
-crbug.com/811977 media/picture-in-picture/picture-in-picture-interstitial.html [ Failure ]
-### See crbug.com/891427 comment near the top of this file:
-###crbug.com/811977 media/picture-in-picture/mediastream.html [ Failure ]
-crbug.com/806249 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html [ Failure ]
-crbug.com/806249 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy-attribute.https.sub.html [ Failure ]
-crbug.com/806249 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-allowed-by-feature-policy.https.sub.html [ Failure ]
-crbug.com/806249 virtual/unified-autoplay/external/wpt/feature-policy/picture-in-picture-default-feature-policy.https.sub.html [ Failure ]
-crbug.com/806249 virtual/unified-autoplay/external/wpt/feature-policy/reporting/picture-in-picture-reporting.html [ Failure ]
-crbug.com/806249 virtual/video-surface-layer/external/wpt/html/semantics/embedded-content/media-elements/autoplay-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html [ Skip ]
-crbug.com/806249 virtual/video-surface-layer/external/wpt/html/semantics/embedded-content/media-elements/autoplay-default-feature-policy.https.sub.html [ Skip ]
-crbug.com/806249 virtual/video-surface-layer/external/wpt/html/semantics/embedded-content/media-elements/autoplay-disabled-by-feature-policy.https.sub.html [ Skip ]
-
 ### See crbug.com/891427 comment near the top of this file:
 ###crbug.com/816914 [ Mac ] fast/canvas/canvas-drawImage-live-video.html [ Failure Pass ]
 crbug.com/817167 http/tests/devtools/oopif/oopif-cookies-refresh.js [ Failure Timeout Pass ]
@@ -5749,13 +5718,17 @@
 # Sheriff 2018-10-26
 ### See crbug.com/891427 comment near the top of this file:
 ####crbug.com/899087 [ Linux ] virtual/android/fullscreen/full-screen-iframe-allowed-video.html [ Failure Pass ]
-crbug.com/899232 [ Linux ] virtual/user-activation-v2/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html [ Failure Pass ]
+crbug.com/899222 [ Linux Win ] virtual/user-activation-v2/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html [ Failure Pass ]
+
 
 # Sheriff 2018-10-29
-crbug.com/899710 [ Linux ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations.js [ Failure Pass ]
+crbug.com/899710 [ Linux ] virtual/threaded/http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations.js [ Failure Pass Timeout ]
 crbug.com/899715 [ Linux ] virtual/threaded/fast/scroll-behavior/wheel-and-touch-scroll-use-count.html [ Failure Pass ]
 crbug.com/898987 [ Android ] synthetic_gestures/smooth-scroll-tiny-delta.html [ Failure Pass ]
 
 # Sheriff 2018-10-30
 crbug.com/867668 [ Linux ] virtual/user-activation-v2/fast/events/middleClickAutoscroll-click-hyperlink.html [ Failure Pass ]
 crbug.com/867668 [ Linux ] virtual/user-activation-v2/fast/events/middleClickAutoscroll-nested-divs-forbidden.html [ Failure Pass ]
+crbug.com/899222 [ Linux Win ] virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-scrollbar-touchpad-fling.html [ Failure Pass ]
+crbug.com/899222 [ Linux Win ] virtual/user-activation-v2/fast/events/touch/gesture/gesture-scrollbar-touchscreen-fling.html [ Failure Pass ]
+crbug.com/899222 [ Linux Win ] virtual/scroll_customization/fast/events/touch/gesture/gesture-scrollbar-touchscreen-fling.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites
index a8e2b0b18..de89ee7c 100644
--- a/third_party/WebKit/LayoutTests/VirtualTestSuites
+++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -711,24 +711,6 @@
              "--enable-display-compositor-pixel-dump"]
   },
   {
-    "prefix": "video-surface-layer",
-    "base": "external/wpt/picture-in-picture",
-    "args": ["--enable-features=UseSurfaceLayerForVideo",
-             "--enable-display-compositor-pixel-dump"]
-  },
-  {
-    "prefix": "video-surface-layer",
-    "base": "external/wpt/feature-policy",
-    "args": ["--enable-features=UseSurfaceLayerForVideo",
-             "--enable-display-compositor-pixel-dump"]
-  },
-  {
-    "prefix": "video-surface-layer",
-    "base": "http/tests/devtools/sources/debugger-breakpoints",
-    "args": ["--enable-features=UseSurfaceLayerForVideo",
-             "--enable-display-compositor-pixel-dump"]
-  },
-  {
     "prefix": "user-activation-v2",
     "base": "fast/dom/Window",
     "args": ["--enable-features=UserActivationV2"]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt
new file mode 100644
index 0000000..c657b7c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation-expected.txt
@@ -0,0 +1,59 @@
+This is a testharness.js-based test.
+Found 55 tests; 54 PASS, 1 FAIL, 0 TIMEOUT, 0 NOTRUN.
+PASS <length> values computed are correctly via var()-reference
+PASS <length> values computed are correctly via var()-reference when font-size is inherited
+PASS <length> values are computed correctly when font-size is inherited [14em]
+PASS <length> values are computed correctly when font-size is inherited [calc(14em + 10px)]
+PASS <length> values are computed correctly [12px]
+PASS <length> values are computed correctly [13vw]
+PASS <length> values are computed correctly [14em]
+PASS <length> values are computed correctly [15vmin]
+PASS <length> values are computed correctly [calc(16px - 7em + 10vh)]
+PASS <length-percentage> values are computed correctly [17em]
+PASS <length-percentage> values are computed correctly [18%]
+PASS <length-percentage> values are computed correctly [calc(19em - 2%)]
+PASS <length># values are computed correctly [10px, 3em]
+PASS <length># values are computed correctly [4em ,9px]
+PASS <length># values are computed correctly [8em]
+PASS <length-percentage># values are computed correctly [3% , 10vmax  , 22px]
+PASS <length-percentage># values are computed correctly [calc(50% + 1em), 4px]
+PASS <length-percentage># values are computed correctly [calc(13% + 37px)]
+PASS <length>+ values are computed correctly [10px 3em]
+PASS <length>+ values are computed correctly [4em 9px]
+PASS <length-percentage>+ values are computed correctly [3% 10vmax 22px]
+PASS <length-percentage>+ values are computed correctly [calc(50% + 1em) 4px]
+PASS <transform-function> values are computed correctly [translateX(2px)]
+PASS <transform-function> values are computed correctly [translateX(10em)]
+PASS <transform-function> values are computed correctly [translateX(calc(11em + 10%))]
+PASS <transform-function>+ values are computed correctly [translateX(10%) scale(2)]
+PASS <integer> values are computed correctly [15]
+PASS <integer> values are computed correctly [calc(15 + 15)]
+PASS <integer> values are computed correctly [calc(2.4)]
+PASS <integer> values are computed correctly [calc(2.6)]
+PASS <integer> values are computed correctly [calc(2.6 + 3.1)]
+PASS <integer>+ values are computed correctly [15 calc(2.4) calc(2.6)]
+PASS <color> values are computed correctly [#ff0000]
+PASS <color> values are computed correctly [#000f00]
+PASS <color> values are computed correctly [#00000a]
+PASS <color> values are computed correctly [#badbee]
+PASS <color> values are computed correctly [#badbee33]
+PASS <color> values are computed correctly [tomato]
+PASS <color> values are computed correctly [plum]
+PASS <color> values are computed correctly [currentcolor]
+PASS * values are computed correctly [tomato]
+PASS tomato | plum values are computed correctly [plum]
+PASS tomato | plum | <color> values are computed correctly [plum]
+PASS * values are computed correctly [-50grad]
+PASS <angle> values are computed correctly [180deg]
+PASS <angle> values are computed correctly [400grad]
+PASS <angle> values are computed correctly [calc(360deg + 400grad)]
+PASS * values are computed correctly [50s]
+PASS <time> values are computed correctly [1s]
+PASS <time> values are computed correctly [1000ms]
+PASS <time> values are computed correctly [calc(1000ms + 1s)]
+PASS * values are computed correctly [50dpi]
+PASS <resolution> values are computed correctly [1dppx]
+PASS <resolution> values are computed correctly [96dpi]
+FAIL <resolution> values are computed correctly [calc(1dppx + 96dpi)] assert_equals: expected "2dppx" but got "0dppx"
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation.html
index 855d9f3..2525e43e 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-computation.html
@@ -18,141 +18,147 @@
 
 <script>
 
-for (let element of [divWithFontSizeSet, divWithFontSizeInherited]) {
-    let id = element.id;
+// Generate a property and temporarily set its value. Then call 'fn' with
+// the name of the generated property.
+function with_custom_property(element, reg, value, fn) {
+    if (element.id.length == 0)
+        throw 'The specified element must have an ID';
 
-    // Generate a property and temporarily set its value. Then call 'fn' with
-    // the name of the generated property.
-    function with_custom_property(reg, value, fn) {
-        let name = generate_property(reg);
+    let name = generate_property(reg);
 
-        // Because we want to include the parsing step, insert a stylesheet
-        // node with textContent.
-        let node = document.createElement('style');
-        node.textContent = `#${id} { ${name}:${value}; }`;
-        document.body.append(node);
+    // Because we want to include the parsing step, insert a stylesheet
+    // node with textContent.
+    let node = document.createElement('style');
+    node.textContent = `#${element.id} { ${name}:${value}; }`;
+    document.body.append(node);
 
-        try {
-            fn(name);
-        } finally {
-            node.remove();
-        }
+    try {
+        fn(name);
+    } finally {
+        node.remove();
     }
-
-    function assert_computed_value(syntax, value, expected) {
-        with_custom_property(syntax, value, (name) => {
-            let actual = getComputedStyle(element).getPropertyValue(name);
-            assert_equals(actual, expected);
-        });
-    }
-
-    // Computes an absolute reference value for some length.
-    //
-    // E.g. to figure out how many pixels '10vh' is, do length_ref('10vh').
-    function length_ref(value, refnode = ref) {
-        try {
-            // The reference property 'min-height' is chosen arbitrarily, but
-            // avoid properties with "resolved value is used value"-behavior
-            // [1], as it may affect rounding, and custom properties do not
-            // have this behavior.
-            //
-            // [1] https://drafts.csswg.org/cssom/#resolved-values
-            const ref_property = 'min-height';
-            refnode.style = `${ref_property}: ${value}`;
-            return getComputedStyle(refnode).getPropertyValue(ref_property);
-        } finally {
-            refnode.style = '';
-        }
-    }
-
-    test(function() {
-        assert_computed_value('<length>', '12px', '12px');
-        assert_computed_value('<length>', '13vw', length_ref('13vw'));
-        assert_computed_value('<length>', '14em', '140px');
-        assert_computed_value('<length>', '15vmin', length_ref('15vmin'));
-        assert_computed_value('<length>', 'calc(16px - 7em + 10vh)', length_ref('calc(10vh - 54px)'));
-        with_custom_property('<length>', '14em', (name) => {
-            assert_computed_value('<length>', `var(${name})`, '140px');
-        });
-    }, "<length> values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<length-percentage>', '17em', '170px');
-        assert_computed_value('<length-percentage>', '18%', '18%');
-        assert_computed_value('<length-percentage>', 'calc(19em - 2%)', 'calc(190px + -2%)');
-    }, "<length-percentage> values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<length>#', '10px, 3em', '10px, 30px');
-        assert_computed_value('<length>#', '10px, 3em', '10px, 30px');
-        assert_computed_value('<length>#', '4em ,9px', '40px, 9px');
-        assert_computed_value('<length>#', '8em', '80px');
-    }, "<length># values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<length-percentage>#', '3% , 10vmax  , 22px', ['3%', length_ref('10vmax'), '22px'].join(', '));
-        assert_computed_value('<length-percentage>#', 'calc(50% + 1em), 4px', 'calc(10px + 50%), 4px');
-        assert_computed_value('<length-percentage>#', 'calc(13% + 37px)', 'calc(37px + 13%)');
-    }, "<length-percentage># values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<length>+', '10px 3em', '10px 30px');
-        assert_computed_value('<length>+', '4em 9px', '40px 9px');
-    }, "<length>+ values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<length-percentage>+', '3% 10vmax 22px', ['3%', length_ref('10vmax'), '22px'].join(' '));
-        assert_computed_value('<length-percentage>+', 'calc(50% + 1em) 4px', 'calc(10px + 50%) 4px');
-    }, "<length-percentage>+ values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<transform-function>', 'translateX(2px)', 'translateX(2px)');
-        assert_computed_value('<transform-function>', 'translateX(10em)', 'translateX(100px)');
-        assert_computed_value('<transform-function>', 'translateX(calc(11em + 10%))', 'translateX(calc(110px + 10%))');
-        assert_computed_value('<transform-function>+', 'translateX(10%) scale(2)', 'translateX(10%) scale(2)');
-    }, "<transform-function> values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<integer>', '15', '15');
-        assert_computed_value('<integer>', 'calc(15 + 15)', '30');
-        assert_computed_value('<integer>', 'calc(2.4)', '2');
-        assert_computed_value('<integer>', 'calc(2.6)', '3');
-        assert_computed_value('<integer>', 'calc(2.6 + 3.1)', '6');
-    }, "<integer> values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<integer>+', '15 calc(2.4) calc(2.6)', '15 2 3');
-    }, "<integer>+ values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('<color>', '#ff0000', 'rgb(255, 0, 0)');
-        assert_computed_value('<color>', '#000f00', 'rgb(0, 15, 0)');
-        assert_computed_value('<color>', '#00000a', 'rgb(0, 0, 10)');
-        assert_computed_value('<color>', '#badbee', 'rgb(186, 219, 238)');
-        assert_computed_value('<color>', '#badbee33', 'rgba(186, 219, 238, 0.2)');
-        assert_computed_value('<color>', 'tomato', 'rgb(255, 99, 71)');
-        assert_computed_value('<color>', 'plum', 'rgb(221, 160, 221)');
-        assert_computed_value('<color>', 'currentcolor', 'currentcolor');
-    }, "<color> values are computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('*', 'tomato', 'tomato');
-        assert_computed_value('tomato | plum', 'plum', 'plum');
-        assert_computed_value('tomato | plum | <color>', 'plum', 'plum');
-    }, "ident values that look like color keywords are not converted to colors" + id);
-
-    test(function() {
-        assert_computed_value('*', '-50grad', '-50grad');
-        assert_computed_value('<angle>', '180deg', '180deg');
-        assert_computed_value('<angle>', '400grad', '360deg');
-        assert_computed_value('<angle>', 'calc(360deg + 400grad)', '720deg');
-    }, "<angle> values computed correctly for " + id);
-
-    test(function() {
-        assert_computed_value('*', '50s', '50s');
-        assert_computed_value('<time>', '1s', '1s');
-        assert_computed_value('<time>', '1000ms', '1s');
-        assert_computed_value('<time>', 'calc(1000ms + 1s)', '2s');
-    }, "<time> values computed correctly for " + id);
 }
+
+function assert_computed_value(element, syntax, value, expected) {
+    with_custom_property(element, syntax, value, (name) => {
+        let actual = getComputedStyle(element).getPropertyValue(name);
+        assert_equals(actual, expected);
+    });
+}
+
+// Computes an absolute reference value for some length.
+//
+// E.g. to figure out how many pixels '10vh' is, do length_ref('10vh').
+function length_ref(value, refnode = ref) {
+    try {
+        // The reference property 'min-height' is chosen arbitrarily, but
+        // avoid properties with "resolved value is used value"-behavior
+        // [1], as it may affect rounding, and custom properties do not
+        // have this behavior.
+        //
+        // [1] https://drafts.csswg.org/cssom/#resolved-values
+        const ref_property = 'min-height';
+        refnode.style = `${ref_property}: ${value}`;
+        return getComputedStyle(refnode).getPropertyValue(ref_property);
+    } finally {
+        refnode.style = '';
+    }
+}
+
+function test_computed_value(syntax, value, expected) {
+    test(function() {
+        assert_computed_value(divWithFontSizeSet, syntax, value, expected);
+    }, `${syntax} values are computed correctly [${value}]`);
+}
+
+test(function(){
+    const element = divWithFontSizeSet;
+    with_custom_property(element, '<length>', '14em', (name) => {
+        assert_computed_value(element, '<length>', `var(${name})`, '140px');
+    });
+}, '<length> values computed are correctly via var()-reference');
+
+test(function(){
+    const element = divWithFontSizeInherited;
+    with_custom_property(element, '<length>', '14em', (name) => {
+        assert_computed_value(element, '<length>', `var(${name})`, '140px');
+    });
+}, '<length> values computed are correctly via var()-reference when font-size is inherited');
+
+test(function(){
+    const element = divWithFontSizeInherited;
+    assert_computed_value(element, '<length>', '14em', '140px');
+}, '<length> values are computed correctly when font-size is inherited [14em]');
+
+test(function(){
+    const element = divWithFontSizeInherited;
+    assert_computed_value(element, '<length>', 'calc(14em + 10px)', '150px');
+}, '<length> values are computed correctly when font-size is inherited [calc(14em + 10px)]');
+
+test_computed_value('<length>', '12px', '12px');
+test_computed_value('<length>', '13vw', length_ref('13vw'));
+test_computed_value('<length>', '14em', '140px');
+test_computed_value('<length>', '15vmin', length_ref('15vmin'));
+test_computed_value('<length>', 'calc(16px - 7em + 10vh)', length_ref('calc(10vh - 54px)'));
+
+test_computed_value('<length-percentage>', '17em', '170px');
+test_computed_value('<length-percentage>', '18%', '18%');
+test_computed_value('<length-percentage>', 'calc(19em - 2%)', 'calc(190px + -2%)');
+
+test_computed_value('<length>#', '10px, 3em', '10px, 30px');
+test_computed_value('<length>#', '4em ,9px', '40px, 9px');
+test_computed_value('<length>#', '8em', '80px');
+
+test_computed_value('<length-percentage>#', '3% , 10vmax  , 22px', ['3%', length_ref('10vmax'), '22px'].join(', '));
+test_computed_value('<length-percentage>#', 'calc(50% + 1em), 4px', 'calc(10px + 50%), 4px');
+test_computed_value('<length-percentage>#', 'calc(13% + 37px)', 'calc(37px + 13%)');
+
+test_computed_value('<length>+', '10px 3em', '10px 30px');
+test_computed_value('<length>+', '4em 9px', '40px 9px');
+
+test_computed_value('<length-percentage>+', '3% 10vmax 22px', ['3%', length_ref('10vmax'), '22px'].join(' '));
+test_computed_value('<length-percentage>+', 'calc(50% + 1em) 4px', 'calc(10px + 50%) 4px');
+
+test_computed_value('<transform-function>', 'translateX(2px)', 'translateX(2px)');
+test_computed_value('<transform-function>', 'translateX(10em)', 'translateX(100px)');
+test_computed_value('<transform-function>', 'translateX(calc(11em + 10%))', 'translateX(calc(110px + 10%))');
+test_computed_value('<transform-function>+', 'translateX(10%) scale(2)', 'translateX(10%) scale(2)');
+
+test_computed_value('<integer>', '15', '15');
+test_computed_value('<integer>', 'calc(15 + 15)', '30');
+test_computed_value('<integer>', 'calc(2.4)', '2');
+test_computed_value('<integer>', 'calc(2.6)', '3');
+test_computed_value('<integer>', 'calc(2.6 + 3.1)', '6');
+
+test_computed_value('<integer>+', '15 calc(2.4) calc(2.6)', '15 2 3');
+
+test_computed_value('<color>', '#ff0000', 'rgb(255, 0, 0)');
+test_computed_value('<color>', '#000f00', 'rgb(0, 15, 0)');
+test_computed_value('<color>', '#00000a', 'rgb(0, 0, 10)');
+test_computed_value('<color>', '#badbee', 'rgb(186, 219, 238)');
+test_computed_value('<color>', '#badbee33', 'rgba(186, 219, 238, 0.2)');
+test_computed_value('<color>', 'tomato', 'rgb(255, 99, 71)');
+test_computed_value('<color>', 'plum', 'rgb(221, 160, 221)');
+test_computed_value('<color>', 'currentcolor', 'currentcolor');
+
+// Custom ident values that look like color keywords should not be converted.
+test_computed_value('*', 'tomato', 'tomato');
+test_computed_value('tomato | plum', 'plum', 'plum');
+test_computed_value('tomato | plum | <color>', 'plum', 'plum');
+
+test_computed_value('*', '-50grad', '-50grad');
+test_computed_value('<angle>', '180deg', '180deg');
+test_computed_value('<angle>', '400grad', '360deg');
+test_computed_value('<angle>', 'calc(360deg + 400grad)', '720deg');
+
+test_computed_value('*', '50s', '50s');
+test_computed_value('<time>', '1s', '1s');
+test_computed_value('<time>', '1000ms', '1s');
+test_computed_value('<time>', 'calc(1000ms + 1s)', '2s');
+
+test_computed_value('*', '50dpi', '50dpi');
+test_computed_value('<resolution>', '1dppx', '1dppx');
+test_computed_value('<resolution>', '96dpi', '1dppx');
+test_computed_value('<resolution>', 'calc(1dppx + 96dpi)', '2dppx');
+
 </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-initial.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-initial.html
index 24543d5..77aa9cd1 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-initial.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/registered-property-initial.html
@@ -1,35 +1,45 @@
-<!DOCTYPE HTML>
+<!DOCTYPE html>
 <link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#dom-propertydescriptor-initialvalue" />
 <link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#register-a-custom-property" />
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-<style>
-#target {
-  background: var(--inherited-color);
-  color: var(--non-inherited-color);
-}
-</style>
+<script src="./resources/utils.js"></script>
 <div id=target></div>
 <script>
-test(function() {
-    CSS.registerProperty({name: '--length', syntax: '<length>', initialValue: 'calc(10px + 15px)', inherits: false});
-    CSS.registerProperty({name: '--length-percentage', syntax: '<length-percentage>', initialValue: 'calc(1in + 10% + 4px)', inherits: false});
-    CSS.registerProperty({name: '--inherited-color', syntax: '<color>', initialValue: 'pink', inherits: true});
-    CSS.registerProperty({name: '--non-inherited-color', syntax: '<color>', initialValue: 'purple', inherits: false});
-    CSS.registerProperty({name: '--transform-function', syntax: '<transform-function>', initialValue: 'rotate(42deg)', inherits: false});
-    CSS.registerProperty({name: '--single-transform-list', syntax: '<transform-list>', initialValue: 'scale(calc(2 + 2))', inherits: false});
-    CSS.registerProperty({name: '--multiple-transform-list', syntax: '<transform-list>', initialValue: 'scale(calc(2 + 1)) translateX(calc(3px + 1px))', inherits: false});
 
-    computedStyle = getComputedStyle(target);
-    assert_equals(computedStyle.getPropertyValue('--length'), '25px');
-    assert_equals(computedStyle.getPropertyValue('--length-percentage'), 'calc(100px + 10%)');
-    assert_equals(computedStyle.getPropertyValue('--inherited-color'), 'rgb(255, 192, 203)');
-    assert_equals(computedStyle.getPropertyValue('--non-inherited-color'), 'rgb(128, 0, 128)');
-    assert_equals(computedStyle.getPropertyValue('--transform-function'), 'rotate(42deg)');
-    assert_equals(computedStyle.getPropertyValue('--single-transform-list'), 'scale(4)');
-    assert_equals(computedStyle.getPropertyValue('--multiple-transform-list'), 'scale(3) translateX(4px)');
+function test_initial_value(reg, expected) {
+    let suffix = reg.inherits === true ? ', inherits' : '';
+    test(function(){
+        let name = generate_property(reg);
+        let actual = getComputedStyle(target).getPropertyValue(name);
+        assert_equals(actual, expected);
+    }, `Initial value for ${reg.syntax} correctly computed [${reg.initialValue}${suffix}]`);
+}
 
-    assert_equals(computedStyle.backgroundColor, 'rgb(255, 192, 203)');
-    assert_equals(computedStyle.color, 'rgb(128, 0, 128)');
-}, "Initial values of registered properties can be referenced when no custom properties are explicitly set.");
+test_initial_value({ syntax: '<length>', initialValue: 'calc(10px + 15px)' }, '25px');
+test_initial_value({ syntax: '<length-percentage>', initialValue: 'calc(1in + 10% + 4px)' }, 'calc(100px + 10%)');
+test_initial_value({ syntax: '<color>', initialValue: 'pink', inherits: true }, 'rgb(255, 192, 203)');
+test_initial_value({ syntax: '<color>', initialValue: 'purple' }, 'rgb(128, 0, 128)');
+test_initial_value({ syntax: '<transform-function>', initialValue: 'rotate(42deg)' }, 'rotate(42deg)');
+test_initial_value({ syntax: '<transform-list>', initialValue: 'scale(calc(2 + 2))' }, 'scale(4)');
+test_initial_value({ syntax: '<transform-list>', initialValue: 'scale(calc(2 + 1)) translateX(calc(3px + 1px))' }, 'scale(3) translateX(4px)');
+
+// Test that the initial value of the custom property 'reg' is successfully
+// substituted into 'property'.
+function test_substituted_value(reg, property, expected) {
+    let inherits_text = reg.inherits === true ? 'inherited' : 'non-inherited';
+    test(function(){
+        try {
+            let name = generate_property(reg);
+            target.style = `${property}:var(${name});`;
+            assert_equals(getComputedStyle(target).getPropertyValue(property), expected);
+        } finally {
+            target.style = '';
+        }
+    }, `Initial ${inherits_text} value can be substituted [${reg.initialValue}, ${property}]`);
+}
+
+test_substituted_value({ syntax: '<color>', initialValue: 'purple', inherits: true }, 'color', 'rgb(128, 0, 128)');
+test_substituted_value({ syntax: '<color>', initialValue: 'pink' }, 'background-color', 'rgb(255, 192, 203)');
+
 </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/resources/utils.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/resources/utils.js
index c4dc3fd5..bef5956 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/resources/utils.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/resources/utils.js
@@ -50,6 +50,14 @@
 // generated. If a single string is used as the argument, it is assumed to be
 // the syntax.
 function generate_property(reg) {
+  // Verify that only valid keys are specified. This prevents the caller from
+  // accidentally supplying 'inherited' instead of 'inherits', for example.
+  if (typeof(reg) === 'object') {
+    const permitted = new Set(['name', 'syntax', 'initialValue', 'inherits']);
+    if (!Object.keys(reg).every(k => permitted.has(k)))
+      throw new Error('generate_property: invalid parameter');
+  }
+
   let syntax = typeof(reg) === 'string' ? reg : reg.syntax;
   let initial = typeof(reg.initialValue) === 'undefined' ? any_initial_value(syntax)
                                                          : reg.initialValue;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/self-utils.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/self-utils.html
index 530c5f6..05aa4b2 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/self-utils.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-properties-values-api/self-utils.html
@@ -32,4 +32,10 @@
   }
 }, 'Generated properties respect inherits flag');
 
+test(function(){
+  assert_throws(new Error(), () => generate_property({syntax: '<length>', foo: 1}));
+  assert_throws(new Error(), () => generate_property({syntax: '<length>', inherited: false}));
+  assert_throws(new Error(), () => generate_property({syntax: '<length>', initial: '10px'}));
+}, 'Can\'t generate property with unknown fields');
+
 </script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/idlharness.window-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/idlharness.window-expected.txt
deleted file mode 100644
index 6c3e97c1..0000000
--- a/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/idlharness.window-expected.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-This is a testharness.js-based test.
-FAIL idl_test setup promise_test: Unhandled rejection with value: object "NotSupportedError: Picture-in-Picture is not available."
-PASS Partial interface HTMLVideoElement: original interface defined
-PASS Partial interface Document: original interface defined
-PASS Partial interface DocumentOrShadowRoot: original interface defined
-PASS PictureInPictureWindow interface: existence and properties of interface object
-PASS PictureInPictureWindow interface object length
-PASS PictureInPictureWindow interface object name
-PASS PictureInPictureWindow interface: existence and properties of interface prototype object
-PASS PictureInPictureWindow interface: existence and properties of interface prototype object's "constructor" property
-PASS PictureInPictureWindow interface: existence and properties of interface prototype object's @@unscopables property
-PASS PictureInPictureWindow interface: attribute width
-PASS PictureInPictureWindow interface: attribute height
-PASS PictureInPictureWindow interface: attribute onresize
-FAIL PictureInPictureWindow must be primary interface of pipw assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: pipw is not defined"
-FAIL Stringification of pipw assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: pipw is not defined"
-FAIL PictureInPictureWindow interface: pipw must inherit property "width" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: pipw is not defined"
-FAIL PictureInPictureWindow interface: pipw must inherit property "height" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: pipw is not defined"
-FAIL PictureInPictureWindow interface: pipw must inherit property "onresize" with the proper type assert_equals: Unexpected exception when evaluating object expected null but got object "ReferenceError: pipw is not defined"
-PASS EnterPictureInPictureEvent interface: existence and properties of interface object
-PASS EnterPictureInPictureEvent interface object length
-PASS EnterPictureInPictureEvent interface object name
-PASS EnterPictureInPictureEvent interface: existence and properties of interface prototype object
-PASS EnterPictureInPictureEvent interface: existence and properties of interface prototype object's "constructor" property
-PASS EnterPictureInPictureEvent interface: existence and properties of interface prototype object's @@unscopables property
-PASS EnterPictureInPictureEvent interface: attribute pictureInPictureWindow
-PASS HTMLVideoElement interface: operation requestPictureInPicture()
-PASS HTMLVideoElement interface: attribute onenterpictureinpicture
-PASS HTMLVideoElement interface: attribute onleavepictureinpicture
-PASS HTMLVideoElement interface: attribute disablePictureInPicture
-PASS HTMLVideoElement interface: video must inherit property "requestPictureInPicture()" with the proper type
-PASS HTMLVideoElement interface: video must inherit property "onenterpictureinpicture" with the proper type
-PASS HTMLVideoElement interface: video must inherit property "onleavepictureinpicture" with the proper type
-PASS HTMLVideoElement interface: video must inherit property "disablePictureInPicture" with the proper type
-PASS WorkerGlobalScope interface: existence and properties of interface object
-PASS DocumentOrShadowRoot interface: document must inherit property "pictureInPictureElement" with the proper type
-PASS Document interface: attribute pictureInPictureEnabled
-PASS Document interface: operation exitPictureInPicture()
-PASS Document interface: attribute pictureInPictureElement
-PASS Document interface: document must inherit property "pictureInPictureEnabled" with the proper type
-PASS Document interface: document must inherit property "exitPictureInPicture()" with the proper type
-PASS Document interface: document must inherit property "pictureInPictureElement" with the proper type
-PASS ShadowRoot interface: attribute pictureInPictureElement
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-script-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-script-expected.txt
index d5da37d0..d43564b0 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-script-expected.txt
@@ -1,4 +1,6 @@
 PASS: windows-1255
+
+
 This test checks that charset sniffer does not get confused by the left angle bracket that is not part of a tag. There was a bug where the less-than caused all text after it until the next closing bracket to be consumed as the tag, resulting in the closing script tag being missed by the charset sniffer.
 
 The charset sniffer would think it was still in the script mode and ignore the meta tag. This test relies on the charset sniffer ignoring meta tags inside script and checking at least 1024 bytes of data for a meta tag.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-tag-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-tag-expected.txt
index 4913c4f..73c2e96 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-tag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/bracket-in-tag-expected.txt
@@ -1,2 +1,4 @@
- PASS: windows-1252
+PASS: windows-1252
+
+
 This test baselines charset sniffer behavior where the opening bracket inside a tag is consumed as part of the tag data, causing the meta tag to be missed.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt
index 15ca8a8..9822e5b 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/dumpAsText/utf-16-no-bom-expected.txt
@@ -1,4 +1,5 @@
 This XML file does not appear to have any style information associated with it. The document tree is shown below.
+
 <TEST>
 Should be "CYRILLIC SMALL LETTER IO" (like e with diaeresis): Ñ‘
 </TEST>
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/escaped-bracket-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/escaped-bracket-expected.txt
index faf6564c..8c19bfae 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/escaped-bracket-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/escaped-bracket-expected.txt
@@ -1,2 +1,4 @@
 PASS: KOI8-R
+
+
 This test checks whether charset sniffer skips over escaped characters correctly.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/invalid-UTF-8-2-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/invalid-UTF-8-2-expected.txt
index 66c6f22c..9f4ea4f 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/invalid-UTF-8-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/invalid-UTF-8-2-expected.txt
@@ -1,4 +1,5 @@
 This tests the decoding of invalid UTF-8 sequences.
 
 The following should be: "т��т ���" or "т��т ��������":
+
 т��т ���
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/invalid-multi-byte-over-consumption-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/invalid-multi-byte-over-consumption-expected.txt
index 4d542ab0..be5cecb 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/invalid-multi-byte-over-consumption-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/invalid-multi-byte-over-consumption-expected.txt
@@ -1,4 +1,5 @@
 Test if an invalid multi-byte sequence is onverconsumed leading to an XSS vector
 
 ABCD" onchange="test='Failed'" using malformed byte sequence 0x83 0x22
+
 Passed
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/latin1-unencodables-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/latin1-unencodables-expected.txt
index e4e8083b..86c6d4d 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/latin1-unencodables-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/latin1-unencodables-expected.txt
@@ -1,3 +1,3 @@
 PASS: did not crash
 
-  
+ 
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/meta-in-body-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/meta-in-body-expected.txt
index 2996f645..25fb244 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/meta-in-body-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/meta-in-body-expected.txt
@@ -1,2 +1,4 @@
 PASS: ISO-2022-JP
+
+
 This test checks that the charset sniffer scans at least 1024 bytes of data to find a meta tag, even if it is not in the head section.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/meta-in-script-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/meta-in-script-expected.txt
index aee5598..faff75b 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/meta-in-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/meta-in-script-expected.txt
@@ -1,3 +1,5 @@
 CONSOLE ERROR: line 4: Uncaught SyntaxError: Unexpected token <
 PASS: windows-1255
+
+
 This test passes if the charset is parsed from the meta tag outside the script.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/meta-in-title-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/meta-in-title-expected.txt
index 5322e7b..dd9a7f4 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/meta-in-title-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/meta-in-title-expected.txt
@@ -1,2 +1,4 @@
 PASS: KOI8-R
+
+
 This test verifies that charset sniffer ignores meta tag in a title.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt
index 760606b..638be04 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/mismatched-end-tag-expected.txt
@@ -1,2 +1,4 @@
 PASS: windows-1255
+
+
 This test checks that charset sniffer does not get confused by the extraneous end script tag and ignore the meta tag, thinking it is inside a script.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/namespace-tolerance-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/namespace-tolerance-expected.txt
index a349969..c7979aa1 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/namespace-tolerance-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/namespace-tolerance-expected.txt
@@ -1,5 +1,5 @@
-This test ensures a UTF-8 encoding is properly set on documents that: 
-(1) use namespace prefixes on HTML elements 
-(2) specify a non-latin charset 
-(3) contain non-latin characters 
+This test ensures a UTF-8 encoding is properly set on documents that:
+(1) use namespace prefixes on HTML elements
+(2) specify a non-latin charset
+(3) contain non-latin characters
 If this test passes, the UTF-8 character below should exactly match the character the character in namespace-tolerance-expected.txt. 法
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt
index 7740144d..69404c7 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/not-http-equiv-content-expected.txt
@@ -1,2 +1,4 @@
 PASS: windows-1255
+
+
 This test checks that charset sniffer does not get confused by the text that contains charset wording.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-10-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-10-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-10-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-10-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-100-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-100-expected.txt
index fb5c09b..1b888e2 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-100-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-100-expected.txt
@@ -6,6 +6,7 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
@@ -14,6 +15,5 @@
 <!DOCTYPE HTML>
 <script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS05Ij4='))</script>
 <script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
+
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-110-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-110-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-110-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-110-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-120-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-120-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-120-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-120-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-20-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-20-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-20-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-20-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-30-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-30-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-30-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-30-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-40-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-40-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-40-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-40-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-50-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-50-expected.txt
index ace06462..b028b89 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-50-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-50-expected.txt
@@ -6,6 +6,7 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
@@ -22,6 +23,5 @@
 test 059: expected Windows-1254; used Windows-1252
 <!DOCTYPE HTML>
 <script type="text/plain"><meta charset="ISO-8859-9"></script>
+
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-60-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-60-expected.txt
index edb9453f..377afa3 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-60-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-60-expected.txt
@@ -6,6 +6,7 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
@@ -13,6 +14,5 @@
 test 060: expected Windows-1254; used Windows-1252
 <!DOCTYPE HTML>
 <style type="text/plain"><meta charset="ISO-8859-9"></style>
+
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-70-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-70-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-70-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-70-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-80-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-80-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-80-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-80-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-90-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-90-expected.txt
index b2882a5..48141593 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-90-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-90-expected.txt
@@ -6,6 +6,7 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
@@ -17,6 +18,5 @@
 <!DOCTYPE HTML>
 <script>document.write(atob('PG1ldGEgaHR0cC1lcXVpdj0iQ29udGVudC1UeXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7Y2hhcnNldD1JU08tODg1OS0xIj4='))</script>
 <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-9">
+
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-expected.txt
index 34a41e70..3624521 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/parser-tests-expected.txt
@@ -6,10 +6,9 @@
 56, 57, 58, 59 - we do not run scripts during encoding detection phase and parser treats meta inside a script as text, not a tag.
 60 - parser treats meta inside style as text, not a tag.
 97, 99, 102 - we do not run scripts during encoding detection.
+
 Status: Tests ran.
 
 Serious failures:
 
 (Tests are considered to pass even if they treat Win1254 and ISO-8859-4 as separate.)
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/quotes-in-title-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/quotes-in-title-expected.txt
index c430b7f..f481b9fa 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/quotes-in-title-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/quotes-in-title-expected.txt
@@ -1,2 +1,4 @@
 PASS: KOI8-R
+
+
 This test checks whether charset sniffer skips over quoted elements in a title tag correctly. Tests a bug in the charset sniffer that would consume all characters after the bracket in the quoted text until the next closing bracket, causing the closing title tag to be missed.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/tag-name-digit-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/tag-name-digit-expected.txt
index 0ba3825..7fb0721 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/tag-name-digit-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/tag-name-digit-expected.txt
@@ -1,3 +1,5 @@
 <0notatag>
 PASS: windows-1255
+
+
 This test checks that charset sniffer does not get confused by text that looks like a tag whose name begins with a digit.
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/x-user-defined-unencodables-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/x-user-defined-unencodables-expected.txt
index e4e8083b..86c6d4d 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/x-user-defined-unencodables-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/x-user-defined-unencodables-expected.txt
@@ -1,3 +1,3 @@
 PASS: did not crash
 
-  
+ 
diff --git a/third_party/WebKit/LayoutTests/fast/encoding/yentest2-expected.txt b/third_party/WebKit/LayoutTests/fast/encoding/yentest2-expected.txt
index 95557a31..d83c46b 100644
--- a/third_party/WebKit/LayoutTests/fast/encoding/yentest2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/encoding/yentest2-expected.txt
@@ -1,5 +1,5 @@
-two backslashes external: \ 
-one backslash external: 
-two backslashes inline: \ 
-one backslash inline: 
+two backslashes external: \
+one backslash external:
+two backslashes inline: \
+one backslash inline:
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/anchor-empty-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/anchor-empty-focus-expected.txt
index 6b0d5378..3b450d2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/anchor-empty-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/anchor-empty-focus-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement is emptyAnchor1
 PASS document.activeElement is emptyAnchor2
 PASS successfullyParsed is true
 
 TEST COMPLETE
- 
+
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html-expected.txt
index 33320e54..2045e85 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html-expected.txt
@@ -1,7 +1,7 @@
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Document whose HTML or BODY tags have overflow:hidden should not autoscroll.
 PASSED: the autoscroll has not happened.
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-textarea-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-textarea-expected.txt
index f9f63bd8..598f735 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-textarea-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-in-textarea-expected.txt
@@ -2,6 +2,7 @@
 
 
 
+
 This tests autoscroll in text area correctly shows selection highlight. To manually test, scroll the text area down to the end. Slowly drag up your mouse starting from the line closest to the upper edge of the text area. Once the contents of the text area get scrolled a little, the selection should not jump down to the end.
 
 PASSED the selection did not jump down.
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
index 87ceb85..cc64f087 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
@@ -1,5 +1,4 @@
-
-rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451) 
+rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451)
 To do the test manually you have to try triggering the autoscroll by starting the dragging from within the blue iframe. If the autoscroll occurs the text has passed, if the autoscroll isn't working, the test has failed
 nb: Knowing that the iframe document has an overflow: hidden on its body but the whole iframe is embedded in a scrollable div, the scrollable div has to be able to trigger the autoscroll
 Though you should be able to write some long text in the input and to trigger the autoscroll within the input.
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-overflow-hidden-longhands-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-overflow-hidden-longhands-expected.txt
index e6bff901..ec801a2d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-overflow-hidden-longhands-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-overflow-hidden-longhands-expected.txt
@@ -1,4 +1,5 @@
 Test ensure overflow:hidden has the same effect that overflow-y:hidden has with respect to autoscroll.
 To test manually, text select by draggin the text below, and move the mouse downwards out of the div boundary. It should not scroll!
 Try to autoscroll this text.
+
 PASSED : the autoscroll did not happen!
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-should-not-stop-on-keypress-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-should-not-stop-on-keypress-expected.txt
index 4da138d..3ce9b70 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-should-not-stop-on-keypress-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-should-not-stop-on-keypress-expected.txt
@@ -1,4 +1,3 @@
-
 PASS frame.contentDocument.scrollingElement.scrollTop + frame.clientHeight is frame.contentDocument.scrollingElement.scrollHeight
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-expected.txt
index 07209e5c..8c404e3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-expected.txt
@@ -4,4 +4,5 @@
 Scrolling should not propagate to the container overflown div due to its "overflow:hidden"
 
  
+
 Test succeeded!
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-no-scroll-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-no-scroll-iframe-expected.txt
index fbbb915..49d8cec 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-no-scroll-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-no-scroll-iframe-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Document didn't scroll.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body-expected.txt
index a33c806..a8bce2b7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Document didn't scroll.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-with-non-scrollable-parent-expected.txt b/third_party/WebKit/LayoutTests/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
index 240f75c..ac99944c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
@@ -1,5 +1,4 @@
-
-rdar://problem/6049803 
+rdar://problem/6049803
 To do the test manually you have to try triggering the autoscroll by starting the dragging from within the text field. If the autoscroll occurs the text has FAILED since the containing iframe has scrolling=no else it has PASSED.
 Though you should be able to write some long text in the input and to trigger the autoscroll within the input.
 PASSED
diff --git a/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-ctrl-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-ctrl-click-expected.txt
index 9ca2043..01072e8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-ctrl-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-ctrl-click-expected.txt
@@ -1,4 +1,4 @@
 Default policy for navigation to 'notify-done.html' is 'new background tab'
 Tests that ctrl-clicking on a submit button results in a new background tab.
 
-  
+ 
diff --git a/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-synthesized-ctrl-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-synthesized-ctrl-click-expected.txt
index c3712c7..8785d6c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-synthesized-ctrl-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/background-tab-on-submit-synthesized-ctrl-click-expected.txt
@@ -1,4 +1,4 @@
 Default policy for navigation to 'notify-done.html' is 'new foreground tab'
 Tests that synthesizing ctrl-click on a submit button does not result in a new background tab.
 
-  
+ 
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-adopt-within-subframes-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-adopt-within-subframes-expected.txt
index d4bc9a5..ffdb12c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-adopt-within-subframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-adopt-within-subframes-expected.txt
@@ -8,3 +8,4 @@
 PASS: fired on b
 DONE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-crash-expected.txt
index 5d17e750..38f93d1f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-crash-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS if no crash
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-in-subframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-in-subframe-expected.txt
index d16afd4..b442c70 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-in-subframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-in-subframe-expected.txt
@@ -3,6 +3,7 @@
 PASS
 
 
+
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
 --------
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-remove-and-add-subframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-remove-and-add-subframe-expected.txt
index b21dd8c9..c9ffe43f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-remove-and-add-subframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-remove-and-add-subframe-expected.txt
@@ -5,3 +5,4 @@
 PASS: fired on c
 DONE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-return-bad-value-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-return-bad-value-expected.txt
index 2572605..94a9334d9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-return-bad-value-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-return-bad-value-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Exception was thrown
 PASS testMessage is "Uncaught Exception in toString()"
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-return-value-from-listener-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-return-value-from-listener-expected.txt
index b4d3619..bf26a63 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-return-value-from-listener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-return-value-from-listener-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testEvent.__proto__ is BeforeUnloadEvent.prototype
 PASS testEvent.returnValue is ""
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue-expected.txt
index 6aaad7a..23500375 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-returnValue-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testEvent.__proto__ is BeforeUnloadEvent.prototype
 PASS testEvent.returnValue is ""
 PASS testEvent.returnValue is "This is beforeunload from the top level frame."
diff --git a/third_party/WebKit/LayoutTests/fast/events/before-unload-with-subframes-expected.txt b/third_party/WebKit/LayoutTests/fast/events/before-unload-with-subframes-expected.txt
index 7212540a..6e83fcf 100644
--- a/third_party/WebKit/LayoutTests/fast/events/before-unload-with-subframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/before-unload-with-subframes-expected.txt
@@ -3,6 +3,7 @@
 PASS 1/2
 
 
+
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
 --------
diff --git a/third_party/WebKit/LayoutTests/fast/events/blur-focus-window-should-blur-focus-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/blur-focus-window-should-blur-focus-element-expected.txt
index df36a63..d6799f9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/blur-focus-window-should-blur-focus-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/blur-focus-window-should-blur-focus-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS thisObjects[0] is divElement
 PASS events[0] is "blur"
 PASS targets[0] is divElement
diff --git a/third_party/WebKit/LayoutTests/fast/events/bogus-dropEffect-effectAllowed-expected.txt b/third_party/WebKit/LayoutTests/fast/events/bogus-dropEffect-effectAllowed-expected.txt
index 67dca27..8b94492 100644
--- a/third_party/WebKit/LayoutTests/fast/events/bogus-dropEffect-effectAllowed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/bogus-dropEffect-effectAllowed-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.dataTransfer.effectAllowed is "all"
 PASS event.dataTransfer.effectAllowed is "copy"
 PASS event.dataTransfer.effectAllowed is "copy"
diff --git a/third_party/WebKit/LayoutTests/fast/events/button-mouse-active-expected.txt b/third_party/WebKit/LayoutTests/fast/events/button-mouse-active-expected.txt
index 33202e2..e168e9e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/button-mouse-active-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/button-mouse-active-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS getComputedStyle(button).backgroundColor is "rgb(0, 255, 0)"
 PASS getComputedStyle(button).backgroundColor is "rgb(0, 0, 255)"
diff --git a/third_party/WebKit/LayoutTests/fast/events/caller-access-from-event-listener-expected.txt b/third_party/WebKit/LayoutTests/fast/events/caller-access-from-event-listener-expected.txt
index 953566c..73253eb1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/caller-access-from-event-listener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/caller-access-from-event-listener-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test verifies that WebKit doesn't crash when accessing the 'caller' property from inside an event listener.
 
 PASS: WebKit didn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/events/capture-on-target-expected.txt b/third_party/WebKit/LayoutTests/fast/events/capture-on-target-expected.txt
index 46730b7e..3828c91 100644
--- a/third_party/WebKit/LayoutTests/fast/events/capture-on-target-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/capture-on-target-expected.txt
@@ -1,6 +1,7 @@
 This tests checks that capturing event handlers trigger on the node that is the target of the event, and that stopPropagation in such a handler prevents further bubble handlers from triggering.
 
 Click here
+
 targetClickFired: true
 containerClickFired: false
 test passed
diff --git a/third_party/WebKit/LayoutTests/fast/events/change-frame-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/change-frame-focus-expected.txt
index 82efc4e..b21c8ad 100644
--- a/third_party/WebKit/LayoutTests/fast/events/change-frame-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/change-frame-focus-expected.txt
@@ -1,15 +1,16 @@
-  
-Test the focus controller working properly when switching focused frame. Here are the cases tested: 
+ 
 
--. Correct frame is focused when switching focus from one frame to another: 
-1. main frame -> iframe 
-2. iframe to main frame 
-3. iframe 1 to iframe 2 
+Test the focus controller working properly when switching focused frame. Here are the cases tested:
 
--. New setting focus request will be ignored if the focus controller is in the middle of switching focused frame (onblur, onfocus events): 
-1. iframe 1 onblur sets iframe 2 focus. 
-2. iframe 1 onblur sets iframe 1 focus. 
-3. iframe 1 onfocus sets iframe 2 focus. 
+-. Correct frame is focused when switching focus from one frame to another:
+1. main frame -> iframe
+2. iframe to main frame
+3. iframe 1 to iframe 2
+
+-. New setting focus request will be ignored if the focus controller is in the middle of switching focused frame (onblur, onfocus events):
+1. iframe 1 onblur sets iframe 2 focus.
+2. iframe 1 onblur sets iframe 1 focus.
+3. iframe 1 onfocus sets iframe 2 focus.
 4. iframe 1 onfocus sets iframe 1 focus.
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt
index 43555a9..f0081c5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt
@@ -2,11 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-  
+ 
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS fired event is (firstInput, focus).
 PASS fired event is (firstInput, change).
 PASS fired event is (firstInput, blur).
diff --git a/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt b/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt
index ac3df6e..e391644 100644
--- a/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt
@@ -2,11 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-  
+ 
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS fired event is (firstInput, focus).
 PASS fired event is (firstInput, change).
 PASS fired event is (firstInput, blur).
diff --git a/third_party/WebKit/LayoutTests/fast/events/click-after-mousedown-cancel-expected.txt b/third_party/WebKit/LayoutTests/fast/events/click-after-mousedown-cancel-expected.txt
index ac11665..263842f1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/click-after-mousedown-cancel-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/click-after-mousedown-cancel-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Click event was dispatched.
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
  Button
diff --git a/third_party/WebKit/LayoutTests/fast/events/click-count-expected.txt b/third_party/WebKit/LayoutTests/fast/events/click-count-expected.txt
index 31a6f02..e16e8ffa 100644
--- a/third_party/WebKit/LayoutTests/fast/events/click-count-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/click-count-expected.txt
@@ -1,4 +1,5 @@
 Click inside this div
+
 Clicking 1 times
 [Mouse Down] Button: 0 Click Count: 1
 [Mouse Up] Button: 0 Click Count: 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/click-focus-anchor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/click-focus-anchor-expected.txt
index 69d6070..81b0de6c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/click-focus-anchor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/click-focus-anchor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 a1 received focus
 a3 received focus
 a4 received focus
diff --git a/third_party/WebKit/LayoutTests/fast/events/click-over-descendant-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/events/click-over-descendant-elements-expected.txt
index b4f3fcd6..817df7e6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/click-over-descendant-elements-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/click-over-descendant-elements-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 This test needs to run in a test environment.
 Very normal click on container:
 PASS lastClickTarget is container
diff --git a/third_party/WebKit/LayoutTests/fast/events/click-range-slider-expected.txt b/third_party/WebKit/LayoutTests/fast/events/click-range-slider-expected.txt
index 176746b..73fc512b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/click-range-slider-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/click-range-slider-expected.txt
@@ -4,4 +4,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS clickCount is 3
diff --git a/third_party/WebKit/LayoutTests/fast/events/clipboard-clearData-expected.txt b/third_party/WebKit/LayoutTests/fast/events/clipboard-clearData-expected.txt
index df83395..92db96e9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/clipboard-clearData-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/clipboard-clearData-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testDataTransfer.clearData(null) did not throw exception.
 PASS testDataTransfer.getData("text") is "sample"
 PASS testDataTransfer.getData("url") is "http://www.google.com/"
diff --git a/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-expected.txt b/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-expected.txt
index 51ee6a28..1e11685 100644
--- a/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-expected.txt
@@ -1,12 +1,16 @@
 To manually test, press your browser shortcut for copy and then for paste. Several lines that say 'PASS' should appear below.
 
-Copy handler: 
-Paste handler: 
+Copy handler:
+Legacy
+DataTransferItemList
+Paste handler:
+Legacy
+DataTransferItemList
+
 Tests copy / paste and DataTransferItemList
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Running test with Legacy copy handler and Legacy paste handler
 PASS testDataTransfer.getData("custom-data") is "hello world"
 PASS testDataTransfer.clearData(nonConvertibleToString) threw exception Exception in toString().
diff --git a/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-remove-expected.txt b/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-remove-expected.txt
index ed419d14..fc96e69 100644
--- a/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-remove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/clipboard-dataTransferItemList-remove-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 * copy event
 PASS dataTansferItemList.length is 4
 PASS dataTansferItemList[0].type is "text/plain"
diff --git a/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt b/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt
index 78b50545..725d67e3a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/composition-event-source-device-event-sender-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 compositionstart
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
@@ -16,3 +15,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/animation-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/animation-event-constructor-expected.txt
index f469cc3..48a8687 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/animation-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/animation-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new AnimationEvent('eventType').bubbles is false
 PASS new AnimationEvent('eventType').cancelable is false
 PASS new AnimationEvent('eventType').animationName is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/application-cache-error-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/application-cache-error-event-constructor-expected.txt
index ad01aba..24245e4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/application-cache-error-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/application-cache-error-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new ApplicationCacheErrorEvent('eventType').bubbles is false
 PASS new ApplicationCacheErrorEvent('eventType').cancelable is false
 PASS new ApplicationCacheErrorEvent('eventType').reason is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/close-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/close-event-constructor-expected.txt
index 33cdac4..ef8e9a2c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/close-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/close-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new CloseEvent('eventType').bubbles is false
 PASS new CloseEvent('eventType').cancelable is false
 PASS new CloseEvent('eventType').wasClean is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt
index 66d82fff..2682e18 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/composition-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new CompositionEvent('eventType').bubbles is false
 PASS new CompositionEvent('eventType').cancelable is false
 PASS new CompositionEvent('eventType').view is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/custom-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/custom-event-constructor-expected.txt
index eef277f0..2ce9684 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/custom-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/custom-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new CustomEvent('eventType').bubbles is false
 PASS new CustomEvent('eventType').cancelable is false
 PASS new CustomEvent('eventType').detail is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt
index e7f5d34..91bd8c0a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/error-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new ErrorEvent('eventType').bubbles is false
 PASS new ErrorEvent('eventType').cancelable is false
 PASS new ErrorEvent('eventType').message is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/event-constructors-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/event-constructors-expected.txt
index ff56f4c7d..079d34b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/event-constructors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/event-constructors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS (new Event('eventType')).bubbles is false
 PASS (new Event('eventType')).cancelable is false
 PASS (new Event('eventType', { bubbles: true, cancelable: true })).bubbles is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/focus-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/focus-event-constructor-expected.txt
index 128f140..336147f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/focus-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/focus-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new FocusEvent('eventType').bubbles is false
 PASS new FocusEvent('eventType').cancelable is false
 PASS new FocusEvent('eventType').view is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/gamepad-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/gamepad-event-constructor-expected.txt
index 4a956c1..9e6911c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/gamepad-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/gamepad-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new GamepadEvent('eventType').bubbles is false
 PASS new GamepadEvent('eventType').cancelable is false
 PASS new GamepadEvent('eventType').gamepad is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/hash-change-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/hash-change-event-constructor-expected.txt
index 06991341..a529afc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/hash-change-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/hash-change-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new HashChangeEvent('eventType').bubbles is false
 PASS new HashChangeEvent('eventType').cancelable is false
 PASS new HashChangeEvent('eventType').oldURL is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt
index 4a9f3cc2..4a4930d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/keyboard-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new KeyboardEvent('eventType').bubbles is false
 PASS new KeyboardEvent('eventType').cancelable is false
 PASS new KeyboardEvent('eventType').view is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/media-encrypted-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/media-encrypted-event-constructor-expected.txt
index 5ce9ec51e..fc8102f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/media-encrypted-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/media-encrypted-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MediaEncryptedEvent('eventType').bubbles is false
 PASS new MediaEncryptedEvent('eventType').cancelable is false
 PASS new MediaEncryptedEvent('eventType').initDataType is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/media-key-message-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/media-key-message-event-constructor-expected.txt
index 8e02191..e06a839 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/media-key-message-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/media-key-message-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MediaKeyMessageEvent('eventType', { messageType: 'license-request', message: arrayBuffer }).bubbles is false
 PASS new MediaKeyMessageEvent('eventType', { messageType: 'license-request', message: arrayBuffer }).cancelable is false
 PASS new MediaKeyMessageEvent('eventType', { bubbles: false, messageType: 'license-request', message: arrayBuffer }).bubbles is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/media-query-list-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/media-query-list-event-constructor-expected.txt
index a38912f7..8fd6859 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/media-query-list-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/media-query-list-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MediaQueryListEvent('eventType').bubbles is false
 PASS new MediaQueryListEvent('eventType').cancelable is false
 PASS new MediaQueryListEvent('eventType').media is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt
index 68d9195..4289e0b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/media-stream-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MediaStreamEvent('eventType').bubbles is false
 PASS new MediaStreamEvent('eventType').cancelable is false
 PASS new MediaStreamEvent('eventType').stream is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
index 50c4f60..5af7fcc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/message-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MessageEvent('eventType').bubbles is false
 PASS new MessageEvent('eventType').cancelable is false
 PASS new MessageEvent('eventType').data is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-connection-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-connection-event-constructor-expected.txt
index 1422cd5..b85aba4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-connection-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-connection-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MIDIConnectionEvent('eventType').bubbles is false
 PASS new MIDIConnectionEvent('eventType').cancelable is false
 PASS new MIDIConnectionEvent('eventType').port is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt
index 14b8b2b..3f2abbf2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/midi-message-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MIDIMessageEvent('eventType').bubbles is false
 PASS new MIDIMessageEvent('eventType').cancelable is false
 PASS new MIDIMessageEvent('eventType').data is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt
index 5f22e29..51e08b2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/mouse-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MouseEvent('eventType').bubbles is false
 PASS new MouseEvent('eventType').cancelable is false
 PASS new MouseEvent('eventType').view is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/page-transition-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/page-transition-event-constructor-expected.txt
index 66638021..e0c50d13 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/page-transition-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/page-transition-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new PageTransitionEvent('eventType').bubbles is false
 PASS new PageTransitionEvent('eventType').cancelable is false
 PASS new PageTransitionEvent('eventType').persisted is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt
index 07b0a94..c74c49e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/pointer-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- tests for intrinsic attributes plus screen & client coordinates ---
 -- no init --
 PASS new PointerEvent('eventType').pointerId is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/pop-state-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/pop-state-event-constructor-expected.txt
index 9a456e34..49c711a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/pop-state-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/pop-state-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new PopStateEvent('eventType').bubbles is false
 PASS new PopStateEvent('eventType').cancelable is false
 PASS new PopStateEvent('eventType').state is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/progress-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/progress-event-constructor-expected.txt
index 14b53a0c2..a59a459 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/progress-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/progress-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new ProgressEvent('eventType').bubbles is false
 PASS new ProgressEvent('eventType').cancelable is false
 PASS new ProgressEvent('eventType').lengthComputable is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/security-policy-violation-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/security-policy-violation-event-constructor-expected.txt
index ffef2bf..85f78a4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/security-policy-violation-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/security-policy-violation-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new SecurityPolicyViolationEvent('eventType').bubbles is true
 PASS new SecurityPolicyViolationEvent('eventType').cancelable is false
 PASS new SecurityPolicyViolationEvent('eventType').documentURI is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-error-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-error-constructor-expected.txt
index c9d80fbe..63589001 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-error-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-error-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new webkitSpeechRecognitionError('eventType').bubbles is false
 PASS new webkitSpeechRecognitionError('eventType').cancelable is false
 PASS new webkitSpeechRecognitionError('eventType').error is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-event-constructor-expected.txt
index 92cc143..b212f47 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/speech-recognition-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new webkitSpeechRecognitionEvent('eventType').bubbles is false
 PASS new webkitSpeechRecognitionEvent('eventType').cancelable is false
 PASS new webkitSpeechRecognitionEvent('eventType').results is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/storage-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/storage-event-constructor-expected.txt
index 9c439ee..2c4e2e2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/storage-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/storage-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new StorageEvent('eventType').bubbles is false
 PASS new StorageEvent('eventType').cancelable is false
 PASS new StorageEvent('eventType').key is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt
index 74a01c9a..3da0a8c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/track-event-constructor-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 *** No initializer passed ***
 PASS new TrackEvent('TrackEvent').bubbles is false
 PASS new TrackEvent('TrackEvent').cancelable is false
@@ -33,7 +32,9 @@
 *** Initialize 'track' with valid track object ***
 PASS new TrackEvent('TrackEvent', { track: trackElement.track }).track is trackElement.track
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt
index fc0cb4b..2d40dd0 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/transition-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new TransitionEvent('eventType').bubbles is false
 PASS new TransitionEvent('eventType').cancelable is false
 PASS new TransitionEvent('eventType').propertyName is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt
index 096a1d4..2d921e2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/ui-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new UIEvent('eventType').bubbles is false
 PASS new UIEvent('eventType').cancelable is false
 PASS new UIEvent('eventType').view is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/webgl-context-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/webgl-context-event-constructor-expected.txt
index 08ecd6a..4578972d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/webgl-context-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/webgl-context-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new WebGLContextEvent('eventType').bubbles is false
 PASS new WebGLContextEvent('eventType').cancelable is false
 PASS new WebGLContextEvent('eventType').statusMessage is ""
diff --git a/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor-expected.txt
index cd86a233..da04610 100644
--- a/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/constructors/wheel-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new WheelEvent('eventType').bubbles is false
 PASS new WheelEvent('eventType').cancelable is false
 PASS new WheelEvent('eventType').view is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/context-nodrag-expected.txt b/third_party/WebKit/LayoutTests/fast/events/context-nodrag-expected.txt
index 210680bd..287873cc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/context-nodrag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/context-nodrag-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getSelection().isCollapsed is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This is a test box. ABC 123
diff --git a/third_party/WebKit/LayoutTests/fast/events/context-onmousedown-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/context-onmousedown-event-expected.txt
index 2c8b755..fee63e98 100644
--- a/third_party/WebKit/LayoutTests/fast/events/context-onmousedown-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/context-onmousedown-event-expected.txt
@@ -1,2 +1,3 @@
 This tests to make sure that right clicking also sends a onmousedown event.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/controlclick-no-onclick-expected.txt b/third_party/WebKit/LayoutTests/fast/events/controlclick-no-onclick-expected.txt
index 6fc6b27b..2018dc8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/controlclick-no-onclick-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/controlclick-no-onclick-expected.txt
@@ -1,2 +1,3 @@
 This tests to make sure that a control click does not result in a click event on the Mac.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/crash-on-querying-event-path-expected.txt b/third_party/WebKit/LayoutTests/fast/events/crash-on-querying-event-path-expected.txt
index bb07cb3..02d02236 100644
--- a/third_party/WebKit/LayoutTests/fast/events/crash-on-querying-event-path-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/crash-on-querying-event-path-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 [object Window]
 PASS totally did not crash.
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/create-document-crash-on-attach-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/create-document-crash-on-attach-event-expected.txt
index 8e4cb05..c7c489d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/create-document-crash-on-attach-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/create-document-crash-on-attach-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Attached onload event handler to created document.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/dblclick-addEventListener-expected.txt b/third_party/WebKit/LayoutTests/fast/events/dblclick-addEventListener-expected.txt
index 1d8aaf6..9ee0dc8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/dblclick-addEventListener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/dblclick-addEventListener-expected.txt
@@ -1,3 +1,5 @@
 SUCCESS
 
+
+
 Double-click above to test.
diff --git a/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action-expected.txt b/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action-expected.txt
index 1f2be30..118dbea 100644
--- a/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-keyboardevent-no-action-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
  
 PASS document.getElementById('radio1').checked is true
 PASS document.getElementById('radio2').checked is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-mouseevent-expected.txt b/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-mouseevent-expected.txt
index 6e657a4..b6af247 100644
--- a/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-mouseevent-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/dispatch-synthetic-mouseevent-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 click event is fired.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/display-none-on-focus-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/display-none-on-focus-crash-expected.txt
index 1042c767..0383162 100644
--- a/third_party/WebKit/LayoutTests/fast/events/display-none-on-focus-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/display-none-on-focus-crash-expected.txt
@@ -1,2 +1 @@
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/div-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/div-focus-expected.txt
index dfb8cfe3..efdcf83 100644
--- a/third_party/WebKit/LayoutTests/fast/events/div-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/div-focus-expected.txt
@@ -1,4 +1,5 @@
 This test checks that non-form-control elements connect onfocus and onblur to the focus and blur events, which do not bubble, not DOMFocusIn and DOMFocusOut, which do bubble. focus and blur should show up once each below.
 focus
 blur
+
 Text 
diff --git a/third_party/WebKit/LayoutTests/fast/events/document-elementFromPoint-expected.txt b/third_party/WebKit/LayoutTests/fast/events/document-elementFromPoint-expected.txt
index 8ded8d1..02f322e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/document-elementFromPoint-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/document-elementFromPoint-expected.txt
@@ -2,7 +2,9 @@
 Relative
 Fixed
 x	x
+
 Table Content
+	
 In Columns
 Transformed
 In RTL overflow
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt
index 2634ec64..ea4f8b61 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-dataTransfer-types-nocrash-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.dataTransfer.types contains format "text/plain"
 PASS event.dataTransfer.getData("text/plain") contains "Square"
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-expected.txt
index 4dcc5721..925ba7d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-expected.txt
@@ -3,12 +3,13 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
 When effectAllowed == "uninitialized"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "copy"
 PASS event.dataTransfer.dropEffect is "move"
@@ -16,6 +17,7 @@
 PASS event.dataTransfer.dropEffect is "copy"
 
 When effectAllowed == "undefined"
+
 PASS event.dataTransfer.effectAllowed is "uninitialized"
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.effectAllowed is "uninitialized"
@@ -28,6 +30,7 @@
 PASS event.dataTransfer.dropEffect is "copy"
 
 When effectAllowed == "none"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "none"
@@ -35,6 +38,7 @@
 PASS event.dataTransfer.dropEffect is "none"
 
 When effectAllowed == "all"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "copy"
 PASS event.dataTransfer.dropEffect is "move"
@@ -42,6 +46,7 @@
 PASS event.dataTransfer.dropEffect is "copy"
 
 When effectAllowed == "copy"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "copy"
 PASS event.dataTransfer.dropEffect is "none"
@@ -49,6 +54,7 @@
 PASS event.dataTransfer.dropEffect is "copy"
 
 When effectAllowed == "move"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "move"
@@ -56,6 +62,7 @@
 PASS event.dataTransfer.dropEffect is "move"
 
 When effectAllowed == "link"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "none"
@@ -63,6 +70,7 @@
 PASS event.dataTransfer.dropEffect is "link"
 
 When effectAllowed == "copyMove"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "copy"
 PASS event.dataTransfer.dropEffect is "move"
@@ -70,6 +78,7 @@
 PASS event.dataTransfer.dropEffect is "move"
 
 When effectAllowed == "copyLink"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "copy"
 PASS event.dataTransfer.dropEffect is "none"
@@ -77,6 +86,7 @@
 PASS event.dataTransfer.dropEffect is "copy"
 
 When effectAllowed == "linkMove"
+
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.dropEffect is "move"
@@ -84,6 +94,7 @@
 PASS event.dataTransfer.dropEffect is "move"
 
 When effectAllowed == "dummy"
+
 PASS event.dataTransfer.effectAllowed is "uninitialized"
 PASS event.dataTransfer.dropEffect is "none"
 PASS event.dataTransfer.effectAllowed is "uninitialized"
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-fire-drag-dragover-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-fire-drag-dragover-expected.txt
index 80d7070..92d167b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-fire-drag-dragover-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-fire-drag-dragover-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS drag fired before dragover.
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-set-drag-data-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-set-drag-data-arguments-expected.txt
index 260ae36..415f91c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-set-drag-data-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-and-drop-set-drag-data-arguments-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS event.dataTransfer.setData() threw exception TypeError: Failed to execute 'setData' on 'DataTransfer': 2 arguments required, but only 0 present..
 PASS event.dataTransfer.setData("Text") threw exception TypeError: Failed to execute 'setData' on 'DataTransfer': 2 arguments required, but only 1 present..
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Drag me
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-expected.txt
index 3ad83a1..2e9bd6b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-expected.txt
@@ -2,13 +2,17 @@
 
 Drag Me
 Drop Here
-Drag handler: 
-Drop handler: 
+Drag handler:
+Legacy
+DataTransferItemList
+Drop handler:
+Legacy
+DataTransferItemList
+
 Tests drag'n drop and well as DataTransferItemList
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Running test with Legacy drag handler and Legacy drop handler
 PASS testDataTransfer.types.length is 4
 PASS testDataTransfer.types.indexOf("text/plain") >= 0 is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-file-handling-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-file-handling-expected.txt
index 649d322e9..fb6c77f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-file-handling-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-dataTransferItemList-file-handling-expected.txt
@@ -2,11 +2,11 @@
 
 Drag Me
 Drop Here
+
 Tests DataTransferItemList file handling
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testItem.kind is "file"
 PASS testItem.type is "text/plain"
 PASS testItems.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-in-frames-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-in-frames-expected.txt
index ba689b37..cabec5b69 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-in-frames-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-in-frames-expected.txt
@@ -13,4 +13,5 @@
 ondragover right target
 ondrop right target
 ondragend src
+
 These results are just "sensible" at the moment, meaning that all the events fire on the right elements, nothing more. The order in particular can rightfully change.
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-leak-document-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-leak-document-expected.txt
index 042e23d3..604a7ae 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-leak-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-leak-document-expected.txt
@@ -1,2 +1,3 @@
 Drag
+
 PASS if no leak is detected by the leak detector.
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-link-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-link-expected.txt
index 30b0fdeb..960da205 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-link-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-link-expected.txt
@@ -4,4 +4,5 @@
 Editable area
 Test Link
 
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-on-dragover-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-on-dragover-expected.txt
index a4f7be6..217a048 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-on-dragover-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-on-dragover-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-use-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-use-expected.txt
index 39176d2b..b282d0bd 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-use-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-nested-eventSender-use-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS runTest() threw exception Error: Nested beginDragWithFiles() not supported..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-parent-node-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-parent-node-expected.txt
index e13e2d4..70c0dd1b3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-parent-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-parent-node-expected.txt
@@ -2,4 +2,5 @@
 
 Bookmark
 
+
 Test passed.
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-selects-image-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drag-selects-image-expected.txt
index cecab69..83742996 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-selects-image-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-selects-image-expected.txt
@@ -2,6 +2,7 @@
 
 Editable area
 
+
 This tests that images are properly left selected or unselected when an image drag is started. Only the image in the editable area should be selected when an image drag is started.
 
 Starting test...
diff --git a/third_party/WebKit/LayoutTests/fast/events/dragevent-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/dragevent-constructor-expected.txt
index 152dca1..eab4f9e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/dragevent-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/dragevent-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testEvent = new DragEvent('dragstart') did not throw exception.
 PASS testEvent.__proto__ is DragEvent.prototype
 PASS testEvent.dataTransfer is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/drop-generate-user-gesture-expected.txt b/third_party/WebKit/LayoutTests/fast/events/drop-generate-user-gesture-expected.txt
index ca47203..35fbe46 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drop-generate-user-gesture-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/drop-generate-user-gesture-expected.txt
@@ -1,12 +1,13 @@
 Drag the following text into the rectangle:
 
 
+
 Drag me
+
 Test that drop event generates user gesture
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.open('about:blank') is defined.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-attribute-expected.txt
index 02289d4..b8503616 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-attribute-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS /*img*/ typeof (element["onclick"]) is "function"
 PASS /*img*/ typeof (element["oncontextmenu"]) is "function"
 PASS /*img*/ typeof (element["ondblclick"]) is "function"
@@ -271,3 +270,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt
index 7a41397..173560e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-creation-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.createEvent('AnimationEvent') instanceof window.AnimationEvent is true
 PASS document.createEvent('AnimationEvent') instanceof window.Event is true
 PASS document.createEvent('AnimationEvent').constructor === window.AnimationEvent is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-click-expected.txt
index 8498030..21165b5e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-click-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS clickedOnParent is true
 PASS clickedOnChild is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-custom-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-custom-event-expected.txt
index f85e8168..b157c9f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-custom-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-custom-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS eventReceivedOnParent is true
 PASS eventReceivedOnChild is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-mutation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-mutation-expected.txt
index 2c1b8d8a..7e682175 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-mutation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-bubbling-mutation-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS eventReceivedOnParent is true
 PASS eventReceivedOnChild is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-shadow-dom-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-shadow-dom-crash-expected.txt
index becd869..8e72aaf 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-shadow-dom-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-fire-disconnected-shadow-dom-crash-expected.txt
@@ -2,4 +2,4 @@
 ABC
 
 ABC
-
+ABC
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-function-toString-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-function-toString-expected.txt
index 6b08c25..cc6e8e2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-function-toString-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-function-toString-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS normalizedFunctionString(div.onclick.toString()) is "function onclick(event) {test();}"
 PASS normalizedFunctionString(path.onclick.toString()) is "function onclick(evt) {test();}"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-hit-testing-fallback-to-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-hit-testing-fallback-to-iframe-expected.txt
index 62e3105..55b5f93 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-hit-testing-fallback-to-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-hit-testing-fallback-to-iframe-expected.txt
@@ -1,12 +1,11 @@
-
 Test that when the hit test of input event in an iframe does not hit anything (not even the html/body), the input event is still captured the iframe's document
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 iframe's scroll top is 900
 Sending a gesture tap
 PASS click_triggered in iframe
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-input-contentEditable-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-input-contentEditable-expected.txt
index 957db32..5bcb4e59 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-input-contentEditable-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-input-contentEditable-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS event.target.id is 'target0'
 PASS event.target.innerHTML is 'Text'
 PASS event.target.id is 'target2'
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-clone-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-clone-expected.txt
index 6bebc6ea..9704eb45 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-clone-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-clone-expected.txt
@@ -11,5 +11,3 @@
 CONSOLE MESSAGE: PopStateEvent received in isolated world
 CONSOLE MESSAGE: state was {"foo":5,"bar":"hello","targetWorld":"isolated"}
 Tests that properties of various events are cloned between isolated worlds.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-expected.txt
index 5438e513..6e5624d4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-isolated-world-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS documentObject is null
 PASS document.pageDefinedVar is undefined.
 PASS documentObject is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-listener-list-mutation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-listener-list-mutation-expected.txt
index a2e4ed3..623bf758 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-listener-list-mutation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-listener-list-mutation-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 self-removal:
 PASS listener 0 removing listener 0
 PASS listener 1 removing listener 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-listener-map-rehash-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-listener-map-rehash-crash-expected.txt
index 2a7370e..6cec1eb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-listener-map-rehash-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-listener-map-rehash-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-listener-moving-documents-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-listener-moving-documents-expected.txt
index 587f68b..610a9ad1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-listener-moving-documents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-listener-moving-documents-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS addedCalls is 1
 PASS addedCalls is 2
 PASS removedCalls is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt
index 4a73ca7..62a2bd8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-listener-on-attribute-inside-shadow-dom-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 1
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 0
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-listener-sharing-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-listener-sharing-expected.txt
index 44d5dd6..2244e705 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-listener-sharing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-listener-sharing-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS clickCount is 100
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-on-culled_inline-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-on-culled_inline-expected.txt
index 55de3fa..99c76f5e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-on-culled_inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-on-culled_inline-expected.txt
@@ -1,19 +1,21 @@
 Click the empty area on the left
 Click the empty areain middle
+
 Click event should be fired when it occurs within culled inline.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.elementFromPoint(x, y).id is "clickme1"
 LABEL that is a parent of INPUT is clicked.
 LABEL that is a parent of INPUT is clicked.
 PASS gotClick is true
 
+
 PASS document.elementFromPoint(x, y).id is "clickme2"
 SPAN that is a parent of EM is clicked.
 PASS gotClick is true
 
+
 PASS document.getElementById("checkbox").checked is true
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-properties-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-properties-gc-expected.txt
index 3b9bad2..9df250b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-properties-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-properties-gc-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS event[prop] is "foo"
 PASS event[prop] is "foo"
 PASS event[prop] is "foo"
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-sender-mouse-moved-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-sender-mouse-moved-expected.txt
index 0f865903..16883efb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-sender-mouse-moved-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-sender-mouse-moved-expected.txt
@@ -1,2 +1,3 @@
 Test for http://bugzilla.opendarwin.org/show_bug.cgi?id=7589 Mouse moved events do not work in DumpRenderTree.
+
 Test result: PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-sender-mouseleave-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-sender-mouseleave-expected.txt
index fe761c3..e9db935 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-sender-mouseleave-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-sender-mouseleave-expected.txt
@@ -5,6 +5,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 Test that a mouse leave event is triggered when the OS tells us the mouse has left without changing position.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-trace-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-trace-expected.txt
index 2115d98..e64ecc0f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-trace-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-trace-expected.txt
@@ -14,5 +14,7 @@
 Target = [object HTMLDivElement] (ID: Self); Phase = BUBBLE; CurrentTarget = [object HTMLDocument];
 Target = [object HTMLDivElement] (ID: Self); Phase = BUBBLE; CurrentTarget = [object Window];
 
+
+
 Parent
 Self
diff --git a/third_party/WebKit/LayoutTests/fast/events/event-trusted-expected.txt b/third_party/WebKit/LayoutTests/fast/events/event-trusted-expected.txt
index 4717f41..9641da2b4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/event-trusted-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/event-trusted-expected.txt
@@ -1,4 +1,3 @@
-
 This tests that isTrusted returns the correct value under certain situations.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
@@ -14,6 +13,7 @@
 PASS originalEvent.isTrusted is false
 PASS originalEvent.isTrusted is false
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/file-input-hidden-in-ondrop-expected.txt b/third_party/WebKit/LayoutTests/fast/events/file-input-hidden-in-ondrop-expected.txt
index a965177..8549a824 100644
--- a/third_party/WebKit/LayoutTests/fast/events/file-input-hidden-in-ondrop-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/file-input-hidden-in-ondrop-expected.txt
@@ -1,4 +1,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS dropTarget.value is "C:\\fakepath\\abe.png"
diff --git a/third_party/WebKit/LayoutTests/fast/events/fire-mousedown-while-pressing-mouse-button-expected.txt b/third_party/WebKit/LayoutTests/fast/events/fire-mousedown-while-pressing-mouse-button-expected.txt
index a56065b..9e8c3bf 100644
--- a/third_party/WebKit/LayoutTests/fast/events/fire-mousedown-while-pressing-mouse-button-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/fire-mousedown-while-pressing-mouse-button-expected.txt
@@ -3,18 +3,20 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS received mousedown for the middle mouse button while pressing the left mouse button.
 PASS received mousedown for the right mouse button while pressing the left mouse button.
 
 When pressing and holding the "middle mouse button"
+
 PASS received mousedown for the left mouse button while pressing the middle mouse button.
 PASS received mousedown for the right mouse button while pressing the middle mouse button.
 
 When pressing and holding the "right mouse button"
+
 PASS received mousedown for the left mouse button while pressing the right mouse button.
 PASS received mousedown for the middle mouse button while pressing the right mouse button.
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/fire-popstate-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/fire-popstate-event-expected.txt
index e714b7f..1261ff6a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/fire-popstate-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/fire-popstate-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Popstate state: (Success)
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-element-expected.txt
index cfe6a56..51df9c2a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Scroll event bubbles: false
 PASS Scroll position: (0, 200)
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-expected.txt
index e766669..14ce585c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/fire-scroll-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Scroll event bubbles: true
 PASS Scroll position: (200, 200)
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/flags-unset-on-init-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/flags-unset-on-init-event-expected.txt
index 07dfef6..62fbbd3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/flags-unset-on-init-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/flags-unset-on-init-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS e.defaultPrevented is true
 Running e.initEvent again.
 PASS e.defaultPrevented is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element-expected.txt
index f169a8df..54d7beb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focus-click-on-non-mouse-focusable-element-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement is a
 PASS document.activeElement is document.body
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 link 
diff --git a/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-keyboard-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-keyboard-expected.txt
index 434c75b..3a78ad3d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-keyboard-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-keyboard-expected.txt
@@ -1,9 +1,7 @@
-
 Test that focus events from keyboard taps should have a sourceCapabilities and its firesTouchEvents should be false.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 tests on div
 focus
 PASS event.sourceCapabilities is non-null.
@@ -12,6 +10,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on input
 blur
 PASS event.sourceCapabilities is non-null.
@@ -26,6 +25,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on button
 blur
 PASS event.sourceCapabilities is non-null.
@@ -40,6 +40,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on textarea
 blur
 PASS event.sourceCapabilities is non-null.
@@ -54,6 +55,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on select
 blur
 PASS event.sourceCapabilities is non-null.
@@ -68,6 +70,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on a
 blur
 PASS event.sourceCapabilities is non-null.
@@ -82,6 +85,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-mouse-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-mouse-expected.txt
index 4383f3ee8..ccbc3b99 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-mouse-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-mouse-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 tests on div
 focus
 PASS event.sourceCapabilities is non-null.
@@ -17,6 +16,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on input
 focus
 PASS event.sourceCapabilities is non-null.
@@ -31,6 +31,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on button
 focus
 PASS event.sourceCapabilities is non-null.
@@ -45,6 +46,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on textarea
 focus
 PASS event.sourceCapabilities is non-null.
@@ -59,6 +61,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on select
 focus
 PASS event.sourceCapabilities is non-null.
@@ -73,6 +76,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 tests on a
 focus
 PASS event.sourceCapabilities is non-null.
@@ -87,6 +91,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-touch-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-touch-expected.txt
index 3c7d298..b5c682a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focus-event-source-device-from-touch-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 tests on div
 focus
 PASS event.sourceCapabilities is non-null.
@@ -17,6 +16,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is true
 
+
 tests on input
 focus
 PASS event.sourceCapabilities is non-null.
@@ -31,6 +31,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is true
 
+
 tests on button
 focus
 PASS event.sourceCapabilities is non-null.
@@ -45,6 +46,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is true
 
+
 tests on textarea
 focus
 PASS event.sourceCapabilities is non-null.
@@ -59,6 +61,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is true
 
+
 tests on a
 focus
 PASS event.sourceCapabilities is non-null.
@@ -73,6 +76,7 @@
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is true
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler-expected.txt
index fd51af3f..4a6047b4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focus-querySelector-in-focus-event-handler-expected.txt
@@ -3,3 +3,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/focus-remove-focuesed-node-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focus-remove-focuesed-node-expected.txt
index 452ab4b..238a119 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focus-remove-focuesed-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focus-remove-focuesed-node-expected.txt
@@ -1,3 +1 @@
 Test for making sure that a crash does not happen when a focused node is removed in processing focusin eventListner.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/focusinout-expected.txt b/third_party/WebKit/LayoutTests/fast/events/focusinout-expected.txt
index ef5b50d..00e8b92 100644
--- a/third_party/WebKit/LayoutTests/fast/events/focusinout-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/focusinout-expected.txt
@@ -1,4 +1,3 @@
-
 PASS
 PASS
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/form-onchange-expected.txt b/third_party/WebKit/LayoutTests/fast/events/form-onchange-expected.txt
index 9b6453d..9403504 100644
--- a/third_party/WebKit/LayoutTests/fast/events/form-onchange-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/form-onchange-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS input.onchange fired.
 PASS form.onchange fired.
 PASS div.onchange fired.
@@ -10,3 +9,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/frame-click-clear-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/frame-click-clear-focus-expected.txt
index 740d0c2..05bef89 100644
--- a/third_party/WebKit/LayoutTests/fast/events/frame-click-clear-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/frame-click-clear-focus-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 ===> Making a frame with a focused element inactive by focus() for another frame.
 PASS doc.activeElement is doc.body
 ===> Making a frame with a focused element inactive by mouse click for another frame.
@@ -12,4 +11,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
  
diff --git a/third_party/WebKit/LayoutTests/fast/events/frame-click-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/frame-click-focus-expected.txt
index 3378541..16faba3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/frame-click-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/frame-click-focus-expected.txt
@@ -1,4 +1,3 @@
-
 This page tests that frames receive focus events when a click occurs within their content area, and blur events when a click occurs outside their content area.
 
 To test, click in the frame and then click on this text.
diff --git a/third_party/WebKit/LayoutTests/fast/events/frame-detached-in-mousedown-expected.txt b/third_party/WebKit/LayoutTests/fast/events/frame-detached-in-mousedown-expected.txt
index b501b9e0..e772f07b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/frame-detached-in-mousedown-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/frame-detached-in-mousedown-expected.txt
@@ -1,4 +1,3 @@
 Test for bug 18595: Setting display:none on an iframe causes the ownerDocument to freeze.
 
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/frame-programmatic-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/frame-programmatic-focus-expected.txt
index ad58cb2b..e775e7b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/frame-programmatic-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/frame-programmatic-focus-expected.txt
@@ -1,4 +1,5 @@
-  
+ 
+
 This page tests that frames receive focus events when one of their child elements is programmatically focused, and receive blur events when an element not in that frame is programmatically focused.
 
 <input> focused
diff --git a/third_party/WebKit/LayoutTests/fast/events/frame-tab-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/events/frame-tab-focus-expected.txt
index 7bbbbedd..2ffc10be 100644
--- a/third_party/WebKit/LayoutTests/fast/events/frame-tab-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/frame-tab-focus-expected.txt
@@ -1,6 +1,6 @@
 This page tests tabbing between subframes. To test, click on this text to focus the main window. Then press Tab 7 times, then Shift-Tab 7 times, which should move focus forward and backward through all inputs and frames. Then press Option-Tab 11 times and Shift-Option-Tab 11 times, which should move focus forward and backward through all inputs, frames, and links.
 
-           [tabindex of one] [tabindex of three] [tabindex of two] [tabindex of three]
+       [tabindex of one] [tabindex of three] [tabindex of two] [tabindex of three]
 Tabbing forward...
 
 main window: INPUT #2 (tabindex=2) focused
diff --git a/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-expected.txt b/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-expected.txt
index 20f1126..0e2eaee 100644
--- a/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-expected.txt
@@ -2,11 +2,11 @@
 
 
 
+
 Ensure hit test cache works in correct scenarios of scrolling, dom and style changes.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-iframes-expected.txt b/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-iframes-expected.txt
index 44ffc37..f7028b3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-iframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-iframes-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.hitTestCacheHits(document) is 0
 PASS internals.hitTestCacheHits(document) is 0
 PASS internals.hitTestCacheHits(document) is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-scrollbar-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-scrollbar-no-crash-expected.txt
index 4fdb087b5..a8168b4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-scrollbar-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/hit-test-cache-scrollbar-no-crash-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.hitTestCacheHits(document) is expectedCount
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/hit-test-counts-expected.txt b/third_party/WebKit/LayoutTests/fast/events/hit-test-counts-expected.txt
index 18c5f3c8..17fd8c3a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/hit-test-counts-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/hit-test-counts-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
@@ -92,3 +91,4 @@
 TEST COMPLETE
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/iframe-mousewheel-expected.txt b/third_party/WebKit/LayoutTests/fast/events/iframe-mousewheel-expected.txt
index 827b1be..dbf71aa 100644
--- a/third_party/WebKit/LayoutTests/fast/events/iframe-mousewheel-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/iframe-mousewheel-expected.txt
@@ -3,8 +3,8 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS received mousewheel event.
diff --git a/third_party/WebKit/LayoutTests/fast/events/iframe-object-onload-expected.txt b/third_party/WebKit/LayoutTests/fast/events/iframe-object-onload-expected.txt
index 2b6a0c9..c782e9bc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/iframe-object-onload-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/iframe-object-onload-expected.txt
@@ -23,4 +23,5 @@
 Fired event on object
 Outer event same as inner: false
 ------
-        
+
+     
diff --git a/third_party/WebKit/LayoutTests/fast/events/iframe-onmousemove-expected.txt b/third_party/WebKit/LayoutTests/fast/events/iframe-onmousemove-expected.txt
index 29badb51..ca03c0e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/iframe-onmousemove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/iframe-onmousemove-expected.txt
@@ -3,10 +3,10 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS received mousemove event.
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/image-adoption-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/image-adoption-events-expected.txt
index 9178d7b..c6185ce 100644
--- a/third_party/WebKit/LayoutTests/fast/events/image-adoption-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/image-adoption-events-expected.txt
@@ -1,4 +1,3 @@
-
 PASS readystatechange event handler was executed when complete
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/imagemap-norender-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/imagemap-norender-crash-expected.txt
index 6086351..15d1b2f0 100644
--- a/third_party/WebKit/LayoutTests/fast/events/imagemap-norender-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/imagemap-norender-crash-expected.txt
@@ -4,7 +4,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement.id is 'area1'
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt b/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt
index 7a20a6d..31343275 100644
--- a/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/ime-composition-events-001-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS event.type is "compositionstart"
 PASS event.data is ""
 PASS event.type is "compositionupdate"
@@ -55,3 +54,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-custom-event-isolated-world-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-custom-event-isolated-world-expected.txt
index f9480da..5e9b82a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-custom-event-isolated-world-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-custom-event-isolated-world-expected.txt
@@ -3,5 +3,3 @@
 CONSOLE MESSAGE: CustomEvent received in isolated world
 CONSOLE MESSAGE: detail was {"foo":5,"bar":"hello","targetWorld":"isolated"}
 Tests that properties of CustomEvent initialized with initCustomEvent() are cloned when accessed in isolated worlds.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-event-after-dispatch-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-event-after-dispatch-expected.txt
index 1b1840b..dd458a7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-event-after-dispatch-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-event-after-dispatch-expected.txt
@@ -6,4 +6,3 @@
 Target is [object HTMLDocument]
 Trying to change the type to unload
 Event type is now load
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-event-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-event-exceptions-expected.txt
index e46f331..3bcd805 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-event-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-event-exceptions-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.createEvent('CompositionEvent').initCompositionEvent('', false, false, {}, '') threw exception TypeError: Failed to execute 'initCompositionEvent' on 'CompositionEvent': parameter 4 is not of type 'Window'..
 PASS document.createEvent('KeyboardEvent').initKeyboardEvent('', false, false, {}, '', 0, false, false, false, false) threw exception TypeError: Failed to execute 'initKeyboardEvent' on 'KeyboardEvent': parameter 4 is not of type 'Window'..
 PASS document.createEvent('MouseEvent').initMouseEvent('', false, false, null, 0, 0, 0, 0, 0, false, false, false, false, 0, {}) threw exception TypeError: Failed to execute 'initMouseEvent' on 'MouseEvent': parameter 15 is not of type 'EventTarget'..
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-event-null-view-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-event-null-view-expected.txt
index 412b983..f77319e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-event-null-view-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-event-null-view-expected.txt
@@ -1,5 +1,3 @@
 This is a regression test for bug 4298. Without the bug fix it causes a crash.
 
 Successfully created a mouse event object without a view and didn't crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-events-expected.txt
index 72ae769b..e63c1350 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testInitEvent('', '"a", false, false').type is 'a'
 PASS testInitEvent('', 'null, false, false').type is 'null'
 PASS testInitEvent('', '"a", false, false').bubbles is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-message-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-message-event-expected.txt
index befb6425..b74fc69 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-message-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-message-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS newEvent.initMessageEvent("message", true, true, "ff", "*", 43, window, {x:1}); threw exception TypeError: Failed to execute 'initMessageEvent' on 'MessageEvent': Iterator getter is not callable..
 PASS newEvent.initMessageEvent("message", true, true, "ff", "*", 43, window, null) did not throw exception.
 PASS [object MessageEvent] is an instance of function MessageEvent() { [native code] }
diff --git a/third_party/WebKit/LayoutTests/fast/events/init-message-event-isolated-world-expected.txt b/third_party/WebKit/LayoutTests/fast/events/init-message-event-isolated-world-expected.txt
index 88020a43..2e745a6d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/init-message-event-isolated-world-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/init-message-event-isolated-world-expected.txt
@@ -3,5 +3,3 @@
 CONSOLE MESSAGE: MessageEvent received in isolated world
 CONSOLE MESSAGE: detail was {"foo":5,"bar":"hello","targetWorld":"isolated"}
 Tests that properties of MessageEvents initialized with initMessageEvent() are cloned when accessed in isolated worlds.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/inputText-never-fired-on-keydown-cancel-expected.txt b/third_party/WebKit/LayoutTests/fast/events/inputText-never-fired-on-keydown-cancel-expected.txt
index 614f6c5..1ad4dec3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/inputText-never-fired-on-keydown-cancel-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/inputText-never-fired-on-keydown-cancel-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.targetNode is receivedEventTarget
 PASS null is receivedEventTarget
 PASS window.targetNode is receivedEventTarget
diff --git a/third_party/WebKit/LayoutTests/fast/events/invalid-001-expected.txt b/third_party/WebKit/LayoutTests/fast/events/invalid-001-expected.txt
index 5ac32750..3370df4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/invalid-001-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/invalid-001-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
   
 PASS Invalid control
 PASS v[i].checkValidity() is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/invalid-002-expected.txt b/third_party/WebKit/LayoutTests/fast/events/invalid-002-expected.txt
index c79ab1c..442a4a2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/invalid-002-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/invalid-002-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
   
 PASS Invalid control
 PASS Invalid control
diff --git a/third_party/WebKit/LayoutTests/fast/events/invalid-003-expected.txt b/third_party/WebKit/LayoutTests/fast/events/invalid-003-expected.txt
index 72c2b886..8ca9bd8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/invalid-003-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/invalid-003-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
   
 PASS Handled
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/invalid-004-expected.txt b/third_party/WebKit/LayoutTests/fast/events/invalid-004-expected.txt
index 5d8ea89..8b94ba38 100644
--- a/third_party/WebKit/LayoutTests/fast/events/invalid-004-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/invalid-004-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
   
 PASS Handled
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/invalid-005-expected.txt b/third_party/WebKit/LayoutTests/fast/events/invalid-005-expected.txt
index 5c414351..5e5e528 100644
--- a/third_party/WebKit/LayoutTests/fast/events/invalid-005-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/invalid-005-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
   
 PASS Invalid control
 PASS Invalid control
diff --git a/third_party/WebKit/LayoutTests/fast/events/javascript-uri-navigation-blocked-in-unload-handler-expected.txt b/third_party/WebKit/LayoutTests/fast/events/javascript-uri-navigation-blocked-in-unload-handler-expected.txt
index 695552ac..788efa974 100644
--- a/third_party/WebKit/LayoutTests/fast/events/javascript-uri-navigation-blocked-in-unload-handler-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/javascript-uri-navigation-blocked-in-unload-handler-expected.txt
@@ -1,2 +1,3 @@
 PASS: script executed
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/js-keyboard-event-creation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/js-keyboard-event-creation-expected.txt
index c1fd0413..3bb20fd54 100644
--- a/third_party/WebKit/LayoutTests/fast/events/js-keyboard-event-creation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/js-keyboard-event-creation-expected.txt
@@ -1,4 +1,5 @@
-  
+ 
+
 This tests that DOMKeyboardEvents are created correctly in the JavaScript API.
 
 keydown - key: Tab@DOM_KEY_LOCATION_STANDARD (keyCode/charCode: 9/0) modifiers: false,false,false,false
diff --git a/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-flexbox-expected.txt b/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-flexbox-expected.txt
index e3ecefb..92ee564 100644
--- a/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-flexbox-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-flexbox-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS targetDiv.innerText is "TEST"
 PASS targetDiv.innerText is ""
 PASS targetDiv.innerText is "TEST"
diff --git a/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-gridbox-expected.txt b/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-gridbox-expected.txt
index 4473f893..caa3cab 100644
--- a/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-gridbox-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/key-events-in-editable-gridbox-expected.txt
@@ -10,6 +10,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 TEST
 TEST
 TEST
diff --git a/third_party/WebKit/LayoutTests/fast/events/key-events-in-input-text-expected.txt b/third_party/WebKit/LayoutTests/fast/events/key-events-in-input-text-expected.txt
index 6f9cf86..7fafbab 100644
--- a/third_party/WebKit/LayoutTests/fast/events/key-events-in-input-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/key-events-in-input-text-expected.txt
@@ -1,6 +1,6 @@
 To test manually, press keys and compare results to other browsers.
 
-  
+ 
 target - type - ctrlKey,altKey,shiftKey,metaKey - key - keyCode - charCode
 Space:
 INPUT - keydown - false,false,false,false - - 32 - 0. Value: "".
diff --git a/third_party/WebKit/LayoutTests/fast/events/keyboard-event-source-device-event-sender-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keyboard-event-source-device-event-sender-expected.txt
index d9940c1..d067ab3e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keyboard-event-source-device-event-sender-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keyboard-event-source-device-event-sender-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 keydown
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/keyboard-scroll-by-page-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keyboard-scroll-by-page-expected.txt
index fc90cbd9..f7c3ca4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keyboard-scroll-by-page-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keyboard-scroll-by-page-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.scrollingElement.scrollTop >= window.innerHeight * 0.875 became true
 PASS document.scrollingElement.scrollTop became 0
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-code-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-code-expected.txt
index cc6a085e..598fa00 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-code-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-code-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 AlphaNumeric Keys
 PASS lastKeyboardDownEvent.code is 'KeyA'
 PASS lastKeyboardUpEvent.code is 'KeyA'
@@ -63,4 +62,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 - 
diff --git a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-getModifierState-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-getModifierState-expected.txt
index 26e5f1c..b1d6dfb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-getModifierState-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-getModifierState-expected.txt
@@ -1,9 +1,7 @@
-
 Tests KeyboardEvent.getModifierState()
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastKeyboardEvent.type is "keydown"
 PASS lastKeyboardEvent.keyCode is 33
 PASS typeof lastKeyboardEvent.getModifierState('Control') is 'boolean'
diff --git a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-location-constants-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-location-constants-expected.txt
index 9fd38a9c..0823f32 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-location-constants-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-location-constants-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS KeyboardEvent.DOM_KEY_LOCATION_STANDARD is 0x00
 PASS KeyboardEvent.DOM_KEY_LOCATION_LEFT is 0x01
 PASS KeyboardEvent.DOM_KEY_LOCATION_RIGHT is 0x02
diff --git a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-repeat-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-repeat-expected.txt
index 245fea1..442012cb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keyboardevent-repeat-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keyboardevent-repeat-expected.txt
@@ -1,9 +1,7 @@
-
 Tests KeyboardEvent.repeat attribute
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastKeyboardEvent.repeat is false
 PASS lastKeyboardEvent.repeat is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-focus-change-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-focus-change-expected.txt
index 2a38a1c..d89e8a7b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-focus-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-focus-change-expected.txt
@@ -1,5 +1,6 @@
 This tests that when the keydown event changes focus, the keypress event will go to the new focused node.
 To run this test manually, type a character in the first field.
-   
+ 
+
 Test Passed
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-preventDefault-expected.txt
index 4358124..53d4e95 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-preventDefault-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keydown-keypress-preventDefault-expected.txt
@@ -1,6 +1,7 @@
 This tests that preventing the default behavior for a keydown event will prevent the keypress event from firing, and will prevent text from being inserted.
 This matches IE7, but not Firefox, which still dispatches a keypress.
- 
+
+
 key down
 key down
 key down
diff --git a/third_party/WebKit/LayoutTests/fast/events/keydown-leftright-keys-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keydown-leftright-keys-expected.txt
index 1bf9cdef..f6088da 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keydown-leftright-keys-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keydown-leftright-keys-expected.txt
@@ -1,9 +1,7 @@
-
 This tests keyboard events with KeyLocationCode argument.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastKeyboardEvent.type is "keydown"
 PASS lastKeyboardEvent.keyCode is 16
 PASS lastKeyboardEvent.location is KeyboardEvent.DOM_KEY_LOCATION_LEFT
diff --git a/third_party/WebKit/LayoutTests/fast/events/keydown-numlock-standard-location-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keydown-numlock-standard-location-expected.txt
index b8e7edb..a23fffd 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keydown-numlock-standard-location-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keydown-numlock-standard-location-expected.txt
@@ -1,9 +1,7 @@
-
 Checks that KeyboardEvent.location is DOM_KEY_LOCATION_STANDARD for NumLock key.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastKeyboardEvent.type is "keydown"
 PASS lastKeyboardEvent.keyCode is VKEY_NUMLOCK
 PASS lastKeyboardEvent.location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
diff --git a/third_party/WebKit/LayoutTests/fast/events/keydown-numpad-keys-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keydown-numpad-keys-expected.txt
index 102aabc..22f9d530 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keydown-numpad-keys-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keydown-numpad-keys-expected.txt
@@ -1,9 +1,7 @@
-
 This tests keyboard events with KeyLocationCode argument.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastKeyboardEvent.type is "keydown"
 PASS lastKeyboardEvent.keyCode is 33
 PASS lastKeyboardEvent.location is KeyboardEvent.DOM_KEY_LOCATION_STANDARD
diff --git a/third_party/WebKit/LayoutTests/fast/events/keypress-focus-change-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keypress-focus-change-expected.txt
index 84faa03b..97b8007c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keypress-focus-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keypress-focus-change-expected.txt
@@ -1,4 +1,5 @@
 This tests that when the keyPress event handler changes focus to a new form field,
 that the key will not be inserted in the original field that was the target of the event.
-Note: Edge will not inserted. Firefox and WebKit will insert.    
+Note: Edge will not inserted. Firefox and WebKit will insert.  
+
 Test Passed
diff --git a/third_party/WebKit/LayoutTests/fast/events/keypress-insert-tab-expected.txt b/third_party/WebKit/LayoutTests/fast/events/keypress-insert-tab-expected.txt
index 83ef0dc..32077e4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/keypress-insert-tab-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/keypress-insert-tab-expected.txt
@@ -1,3 +1,4 @@
 This tests that you can insert a tab in a WebKit app that allows tab insertion
 
+
 Test Passed
diff --git a/third_party/WebKit/LayoutTests/fast/events/media-element-focus-tab-expected.txt b/third_party/WebKit/LayoutTests/fast/events/media-element-focus-tab-expected.txt
index dd3b9f27..f0f787f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/media-element-focus-tab-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/media-element-focus-tab-expected.txt
@@ -5,14 +5,15 @@
 SUCCESS: Tab-Key did tab to the Media Element (video3). TEST: WithoutControlsButWithTabIndexVideo.
 SUCCESS: Tab-Key did tab to the Media Element (audio1). TEST: WithoutTabIndexAudio.
 SUCCESS: Tab-Key did not tab to the Media Element (audio2). TEST: WithoutControlaAndTabIndexAudio.
- 
- 
- 
- 
- 
- 
- 
- 
- 
+
+
+
+
+
+
+
+
+
+
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-expected.txt b/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-expected.txt
index 7a0c1f9e4..969e2b9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-expected.txt
@@ -1,9 +1,9 @@
 Target
+
 This test checks if contextmenu event target is correct when handled at the document level. To test manually, first right-click on the "Target" text in the orange box, then press the menu key. Both interactions should result in the message: "PASS anchor is anchor".
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS anchor is anchor
 PASS anchor is anchor
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt b/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt
index 2810fa07..cc2f265b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.clientX is expectedX
 PASS event.clientY is expectedY
 PASS event.screenX is expectedScreenX
@@ -19,4 +19,3 @@
 PASS event.screenX is expectedScreenX
 PASS event.screenY is expectedScreenY
 Target
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-position-expected.txt b/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-position-expected.txt
index 31d9403..dcfc40f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-position-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/menu-key-context-menu-position-expected.txt
@@ -2,11 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.target is inputNode
 PASS event.clientX is X
 PASS event.clientY is Y
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-channel-listener-circular-ownership-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-channel-listener-circular-ownership-expected.txt
index c136f9fb1..2f3a82de 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-channel-listener-circular-ownership-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-channel-listener-circular-ownership-expected.txt
@@ -1,5 +1,3 @@
 Test that a leak is not created by assigning a MessagePort to a property of its own listener.
 
 Only works with run_web_tests.py --leaks.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-event-max-ports-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-event-max-ports-expected.txt
index a917356a..ae0f9d3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-event-max-ports-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-event-max-ports-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MessageEvent("message", {ports:ports}) threw exception RangeError: Failed to construct 'MessageEvent': Array length exceeds supported limit..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-clone-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-clone-expected.txt
index ebf6ea357..f657706 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-clone-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-clone-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS channel.port1.postMessage('msg', [channel.port1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Port at index 0 contains the source port..
 Posting port to entangled pair neuters the port and does nothing else:
 PASS channel2.port1.postMessage('msg', [channel.port2]) threw exception DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Port at index 0 is already neutered..
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-expected.txt
index 955ad37..e839f08 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-expected.txt
@@ -14,3 +14,4 @@
 MessageEvent.cancelable defaults to false: PASS
 DONE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-cloned-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-cloned-expected.txt
index 94a0a38..50f25a6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-cloned-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-cloned-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS iframeDocGC.wasCollected is true
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-expected.txt
index 94a0a38..50f25a6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-gc-closed-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS iframeDocGC.wasCollected is true
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-inactive-document-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-inactive-document-expected.txt
index ecb4e30..162968f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-inactive-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-inactive-document-expected.txt
@@ -2,3 +2,4 @@
 
 Didn't crash, freeze or respond: SUCCESS
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt b/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt
index 1132dd0..b1377d5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/message-port-multi-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS channel.port1.postMessage() threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': 1 argument required, but only 0 present..
 PASS channel.port1.postMessage("same port", [channel.port1]) threw exception DataCloneError: Failed to execute 'postMessage' on 'MessagePort': Port at index 0 contains the source port..
 PASS channel.port1.postMessage("null port", [channel3.port1, null, channel3.port2]) threw exception TypeError: Failed to execute 'postMessage' on 'MessagePort': Value at index 1 is an untransferable 'null' value..
@@ -14,6 +13,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.ports is non-null and zero length when no port sent
 PASS event.ports is non-null and zero length when empty array sent
 PASS event.ports contains two ports when two ports sent
diff --git a/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-click-hyperlink-expected.txt b/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-click-hyperlink-expected.txt
index db0dc38..329993eb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-click-hyperlink-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-click-hyperlink-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Link 1 wasn't clicked.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-drag-scrollable-iframe-div-expected.txt b/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-drag-scrollable-iframe-div-expected.txt
index d392c49..9531b22 100644
--- a/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-drag-scrollable-iframe-div-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-drag-scrollable-iframe-div-expected.txt
@@ -1,8 +1,10 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Starting Autoscroll test on iframe
 PASSED : the autoscroll has worked !
+
 Test for bug 336373.
 
 To test manually, hold the middle mouse button on the box with scrollbars and scroll by dragging the mouse outside the bounds of the box. If the bug occurs once the cursor leaves the bounds of the box it will remain stuck in the panning state.
diff --git a/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-modal-scrollable-iframe-div-expected.txt b/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-modal-scrollable-iframe-div-expected.txt
index d392c49..9531b22 100644
--- a/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-modal-scrollable-iframe-div-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/middleClickAutoscroll-modal-scrollable-iframe-div-expected.txt
@@ -1,8 +1,10 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Starting Autoscroll test on iframe
 PASSED : the autoscroll has worked !
+
 Test for bug 336373.
 
 To test manually, hold the middle mouse button on the box with scrollbars and scroll by dragging the mouse outside the bounds of the box. If the bug occurs once the cursor leaves the bounds of the box it will remain stuck in the panning state.
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-expected.txt
index 71ae8c30..056d5fa8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Left Mouse Button
 PASS eventLog is "mousedown(0) mouseup(0) click(0) mousedown(0) mouseup(0) click(0) dblclick(0) "
 Middle Mouse Button
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-pseudo-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-pseudo-element-expected.txt
index 948073b..11ae6d8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-pseudo-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-click-events-pseudo-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS eventLog is "mousedown mouseup click mousedown mouseup click dblclick "
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout-expected.txt
index e861cb8a..f0a90319 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Bug 26723
 
 
+
 Mouse move
 PASS internals.getCurrentCursorInfo() is "type=IBeam hotSpot=0,0"
 Adding overlay element
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-expected.txt
index 48b7abea..d81f8bf 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-expected.txt
@@ -2,22 +2,26 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Bug 53341
 
 
+
 Mouse move
 Cursor Info: type=Hand hotSpot=0,0
 
+
 Mouse down
 Cursor Info: type=Progress hotSpot=0,0
 
+
 Mouse hold down, move
 Cursor Info: type=Hand hotSpot=0,0
 
+
 Mouse up
 Cursor Info: type=Help hotSpot=0,0
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-expected.txt
index ece42d130..0ef9c7f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-expected.txt
@@ -2,88 +2,114 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Bug 100550
 
- 
+
+
 TEST CASE: Implicit default cursor
 Cursor Info: type=IBeam hotSpot=0,0
 
+
 TEST CASE: Explicit default
 Cursor Info: type=Pointer hotSpot=0,0
 
+
 TEST CASE: Explicit auto
 Cursor Info: type=IBeam hotSpot=0,0
 
+
 TEST CASE: No cursor
 Cursor Info: type=None hotSpot=0,0
 
+
 TEST CASE: Pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: grab
 Cursor Info: type=Grab hotSpot=0,0
 
+
 TEST CASE: grabbing
 Cursor Info: type=Grabbing hotSpot=0,0
 
+
 TEST CASE: -webkit-grab
 Cursor Info: type=Grab hotSpot=0,0
 
+
 TEST CASE: -webkit-grabbing
 Cursor Info: type=Grabbing hotSpot=0,0
 
+
 TEST CASE: Existing 25x25 image
 Cursor Info: type=IBeam hotSpot=0,0
 
+
 TEST CASE: Invalid URL with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Invalid with fallback to 25x25 image
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: Image with explicit hot spot at (0,0)
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: Image with explicit hot spot at (20,10)
 Cursor Info: type=Custom hotSpot=20,10 image=25x25
 
+
 TEST CASE: Image with explicit hot spot at (-1,-1)
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: Image with explicit hot spot outside image at (30,30)
 Cursor Info: type=Custom hotSpot=24,24 image=25x25
 
+
 TEST CASE: Image with implicit hot spot at (5,4)
 Cursor Info: type=Custom hotSpot=5,4 image=25x25
 
+
 TEST CASE: Image with explicit hot spot at (20,10) overriding implicit hot spot
 Cursor Info: type=Custom hotSpot=20,10 image=25x25
 
+
 TEST CASE: Image with implicit hot spot outside image at (35,4)
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: Over large image with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Local element reference
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Multiple invalid cursors with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Nonexistent local element reference with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: A link with default cursor
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Link with default cursor overriding wait
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Wait cursor which should not be affected by unknown cursor rule
 Cursor Info: type=Wait hotSpot=0,0
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-image-set-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-image-set-expected.txt
index 24fe3769..5b852a1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-image-set-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-image-set-expected.txt
@@ -2,80 +2,102 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Bug 99493
 
 
+
 Checking cursors with device pixel ratio of 1
 ----------------------------------------------
 TEST CASE: 25x25 image at 1x
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: 25x25 image at 2x
 Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
 
+
 TEST CASE: 25x25 image at 1x, 30x30 image at 2x
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
 Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=1.5
 
+
 TEST CASE: Invalid tiny scale with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Over-large image with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
 Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
 
+
 TEST CASE: Non-existent image in image-set with fallback to 25x25 image
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
 Cursor Info: type=Custom hotSpot=5,3 image=25x25
 
+
 TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
 Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
 
+
 TEST CASE: Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x
 Cursor Info: type=Custom hotSpot=5,4 image=25x25
 
+
 Checking cursors with device pixel ratio of 2
 ----------------------------------------------
 TEST CASE: 25x25 image at 1x
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: 25x25 image at 2x
 Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
 
+
 TEST CASE: 25x25 image at 1x, 30x30 image at 2x
 Cursor Info: type=Custom hotSpot=0,0 image=30x30 scale=2
 
+
 TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
 Cursor Info: type=Custom hotSpot=0,0 image=30x30 scale=5
 
+
 TEST CASE: Invalid tiny scale with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: Over-large image with fallback to pointer
 Cursor Info: type=Hand hotSpot=0,0
 
+
 TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
 Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
 
+
 TEST CASE: Non-existent image in image-set with fallback to 25x25 image
 Cursor Info: type=Custom hotSpot=0,0 image=25x25
 
+
 TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
 Cursor Info: type=Custom hotSpot=10,6 image=30x30 scale=2
 
+
 TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
 Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
 
+
 TEST CASE: Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x
 Cursor Info: type=Custom hotSpot=28,3 image=30x30 scale=2
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-multiframecur-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-multiframecur-expected.txt
index bb058035..0e64289a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-multiframecur-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-multiframecur-expected.txt
@@ -2,16 +2,18 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Bug 100059
 
 
+
 TEST CASE: Implicit default cursor
 Cursor Info: type=IBeam hotSpot=0,0
 
+
 TEST CASE: CUR file with 3 frames, largest of which (2nd frame) is 20x12 with hotspot at (18,11).
 Cursor Info: type=Custom hotSpot=18,11 image=20x12
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-no-mousemove-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-no-mousemove-expected.txt
index a5d0645..42d1dc5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-no-mousemove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-no-mousemove-expected.txt
@@ -2,14 +2,15 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Bug 85343
 
 
+
 TEST CASE: Mouse idle, change cursor should not fire mousemove event
 Cursor Info: type=Pointer hotSpot=0,0
 Cursor Info: type=Help hotSpot=0,0
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt
index 2b5618a..3f8b17d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 Mouse moved to cursor changing div
 PASS internals.getCurrentCursorInfo() is "type=Hand hotSpot=0,0"
 Changing cursor style
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-drag-from-frame-to-other-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-drag-from-frame-to-other-frame-expected.txt
index 1e8060f..031add6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-drag-from-frame-to-other-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-drag-from-frame-to-other-frame-expected.txt
@@ -1,5 +1,5 @@
 This tests that dragging from an element that returns false from its mousedown handler will not let the subsequent mousemove events be captured by the containing frame, and allows the mouse move to get to other subframes.
-  
+ 
 Drag Started
 received mousemove
 received mouseup
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute-expected.txt
index 26d40b1..31283144 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-event-buttons-attribute-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 ===== doubleClickAction with initial state=[] =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -15,6 +16,7 @@
 11. targetDiv received mouseout buttons: 0
 12. targetDiv received mouseleave buttons: 0
 
+
 ===== clickAction with initial state=[rightButton] =====
 1. targetDiv received mouseover buttons: 2
 2. targetDiv received mouseenter buttons: 2
@@ -25,6 +27,7 @@
 7. targetDiv received mouseout buttons: 2
 8. targetDiv received mouseleave buttons: 2
 
+
 ===== clickAction with initial state=[middleButton,rightButton] =====
 1. targetDiv received mouseover buttons: 6
 2. targetDiv received mouseenter buttons: 6
@@ -35,6 +38,7 @@
 7. targetDiv received mouseout buttons: 6
 8. targetDiv received mouseleave buttons: 6
 
+
 ===== moveAction with initial state=[leftButton,middleButton,rightButton] =====
 1. targetDiv received mouseover buttons: 7
 2. targetDiv received mouseenter buttons: 7
@@ -42,6 +46,7 @@
 4. targetDiv received mouseout buttons: 7
 5. targetDiv received mouseleave buttons: 7
 
+
 ===== rightClickAction with initial state=[] and showContextMenuOnMouseUp=false =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -52,6 +57,7 @@
 7. targetDiv received mouseout buttons: 0
 8. targetDiv received mouseleave buttons: 0
 
+
 ===== rightClickAction with initial state=[] and showContextMenuOnMouseUp=true =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -62,6 +68,7 @@
 7. targetDiv received mouseout buttons: 0
 8. targetDiv received mouseleave buttons: 0
 
+
 ===== wheelAction with initial state=[leftButton,rightButton] =====
 1. targetDiv received mouseover buttons: 3
 2. targetDiv received mouseenter buttons: 3
@@ -70,6 +77,7 @@
 5. targetDiv received mouseout buttons: 3
 6. targetDiv received mouseleave buttons: 3
 
+
 ===== doubleTapAction with initial state=[] =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -86,6 +94,7 @@
 13. targetDiv received mouseout buttons: 0
 14. targetDiv received mouseleave buttons: 0
 
+
 ===== tapAction with initial state=[] =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -96,6 +105,7 @@
 7. targetDiv received mouseout buttons: 0
 8. targetDiv received mouseleave buttons: 0
 
+
 ===== longPressAction with initial state=[] and showContextMenuOnMouseUp=false =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -104,8 +114,10 @@
 5. targetDiv received mouseout buttons: 0
 6. targetDiv received mouseleave buttons: 0
 
+
 ===== longPressAction with initial state=[] and showContextMenuOnMouseUp=true =====
 
+
 ===== longTapAction with initial state=[] and showContextMenuOnMouseUp=false =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -114,6 +126,7 @@
 5. targetDiv received mouseout buttons: 0
 6. targetDiv received mouseleave buttons: 0
 
+
 ===== longTapAction with initial state=[] and showContextMenuOnMouseUp=true =====
 1. targetDiv received mouseover buttons: 0
 2. targetDiv received mouseenter buttons: 0
@@ -122,6 +135,7 @@
 5. targetDiv received mouseout buttons: 0
 6. targetDiv received mouseleave buttons: 0
 
+
 ===== dragDropAction with initial state=[] =====
 1. dragImg received mouseover buttons: 0
 2. dragImg received mouseenter buttons: 0
@@ -148,6 +162,7 @@
 23. targetDiv received mouseout buttons: 0
 24. targetDiv received mouseleave buttons: 0
 
+
 ===== dragDropAction with initial state=[rightButton] =====
 1. dragImg received mouseover buttons: 2
 2. dragImg received mouseenter buttons: 2
@@ -174,6 +189,7 @@
 23. targetDiv received mouseout buttons: 2
 24. targetDiv received mouseleave buttons: 2
 
+
 ===== dragDropAction with initial state=[middleButton,rightButton] =====
 1. dragImg received mouseover buttons: 6
 2. dragImg received mouseenter buttons: 6
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-event-from-touch-source-device-event-sender-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-event-from-touch-source-device-event-sender-expected.txt
index a2344816..b10b968 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-event-from-touch-source-device-event-sender-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-event-from-touch-source-device-event-sender-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending gestureTap which synthesizes mousemove, mousedown, mouseup and click
 mousemove
 PASS event.sourceCapabilities is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-event-source-device-event-sender-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-event-source-device-event-sender-expected.txt
index 8c853f9..f71c04d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-event-source-device-event-sender-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-event-source-device-event-sender-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 mousemove
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-node-deletion-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-node-deletion-expected.txt
index c053c97b..0dc8081 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-node-deletion-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-node-deletion-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 outer received mouseover
 outer received mouseenter
 outer received mouseout
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-textarea-resize-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-textarea-resize-expected.txt
index cadd2772..dfdb729 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-textarea-resize-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-events-on-textarea-resize-expected.txt
@@ -1,15 +1,14 @@
-
 Verifies that correct mouse events are fired and when resizing an element
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- test with preventDefault on 'mousedown' ---
 --- move mouse into target ---
 --- start resizing ---
 Received mousedown
 --- mouse released ---
 
+
 --- test with preventDefault on '' ---
 --- move mouse into target ---
 --- start resizing ---
@@ -18,6 +17,7 @@
 Received mouseup
 Received click
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-events-within-no-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-events-within-no-element-expected.txt
index 8a06ca00..fbfd895 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-events-within-no-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-events-within-no-element-expected.txt
@@ -1,9 +1,7 @@
-
 Tests that the mouse event is fired when the mouse pointer stays in document but there is no element
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
@@ -13,6 +11,7 @@
 Frame: '<!--framePath //<!--frame0-->-->'
 --------
 POINTER
+
 PASS events[0] is "mousemove"
 PASS targets[0] is "#document"
 PASS events[1] is "mousemove"
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt
index 301e9f6..5bc3a60 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouse-focus-imagemap-expected.txt
@@ -1,9 +1,7 @@
-
 This tests that a link in an image map with tabindex < 0 is not mouse focusable.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement.id is 'focusable-area'
 PASS document.activeElement.id == 'focusable-area' || document.activeElement.id == 'body' is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt
index e0601480..df48c5d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseclick-target-and-positioning-expected.txt
@@ -1,6 +1,7 @@
 This page tests whether a click event propagates with the correct target and positioning. See rdar://problem/4477126.
 
-click inside the red box:[]
+click inside the red box:
+[]
 PASS: event target should be [object HTMLSpanElement] and is
 PASS: event.pageX should be 175 and is
 PASS: event.pageY should be 105 and is
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt
index 3f48144..169b2f1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseenter-mouseleave-on-drag-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- drag across inner ---
 outer received mouseover
 outer received mouseenter
@@ -21,6 +20,7 @@
 outer received mouseleave
 PASS wasInside['outer'] is true
 
+
 --- drag into inner ---
 outer received mouseover
 outer received mouseenter
@@ -32,6 +32,7 @@
 PASS wasInside['inner'] is false
 inner received mouseup
 
+
 --- drag out of inner ---
 inner received mousedown
 inner received mouseout
@@ -40,6 +41,7 @@
 outer received mouseover
 outer received mouseup
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseevent-getModifierState-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseevent-getModifierState-expected.txt
index d0c4aa4d..f5eae2eb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseevent-getModifierState-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseevent-getModifierState-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastMouseEvent.type is "mousedown"
 PASS lastMouseEvent.button is 0
 PASS typeof lastMouseEvent.getModifierState('Control') is 'boolean'
diff --git a/third_party/WebKit/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
index db3dcd0f..064b0d7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
@@ -1,5 +1,6 @@
 This tests that we continue to get mouse events after dragging past a scrollbar.
-Start a drag in this square, and drag past the scrollbar to the green square. Start a drag in this square, and drag past the scrollbar to the green square.  
+Start a drag in this square, and drag past the scrollbar to the green square. Start a drag in this square, and drag past the scrollbar to the green square. 
+
 
 Test Succeeded!
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/mousemove-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mousemove-expected.txt
index b0d1b271..ec9bb21a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mousemove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mousemove-expected.txt
@@ -3,5 +3,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-The test element
 
+The test element
diff --git a/third_party/WebKit/LayoutTests/fast/events/mousemove-from-iframe-to-top-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mousemove-from-iframe-to-top-element-expected.txt
index 7cb6a0f6..8eb63e2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mousemove-from-iframe-to-top-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mousemove-from-iframe-to-top-element-expected.txt
@@ -1,26 +1,32 @@
 TOP
 
+
 Tests that hover is lost from iframe when the mouse is moved from iframe to the element that stacked up on iframe
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS hoverBgColor is "rgb(255, 0, 0)"
 
+
 PASS events[0] is "mouseenter"
 PASS targetIds[0] is "target"
 
+
 PASS events[1] is "mousemove"
 PASS targetIds[1] is "target"
 
+
 PASS bgColor is "rgb(255, 255, 0)"
 
+
 FAIL events[2] should be mouseleave. Was mouseout.
 PASS targetIds[2] is "target"
 
+
 FAIL events[3] should be mouseout. Was mouseleave.
 PASS targetIds[3] is "target"
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/mousemove-to-resizer-changes-cursor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mousemove-to-resizer-changes-cursor-expected.txt
index 164d9b3..e9bb4b5e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mousemove-to-resizer-changes-cursor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mousemove-to-resizer-changes-cursor-expected.txt
@@ -1,5 +1,6 @@
-
 This tests that hovering over a TEXTAREA resizer turns the mouse cursor into the default pointer.
+
+
 Inside TEXTAREA: type=IBeam hotSpot=0,0
 Over dragger: type=Pointer hotSpot=0,0
 Over BODY: type=Hand hotSpot=0,0
diff --git a/third_party/WebKit/LayoutTests/fast/events/mousemove-to-scrollbar-changes-cursor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mousemove-to-scrollbar-changes-cursor-expected.txt
index 0cf9eed..bffc478 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mousemove-to-scrollbar-changes-cursor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mousemove-to-scrollbar-changes-cursor-expected.txt
@@ -1,3 +1,4 @@
 This tests that hovering over a scrollbar resets the mouse cursor to the default pointer.
+
 Hovered pointer: type=Hand hotSpot=0,0
 Scrollbar pointer: type=Pointer hotSpot=0,0
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-node-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-node-expected.txt
index 5b819a7..9c60bb2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-subframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-subframe-expected.txt
index 2ad7646..d95403e6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-subframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseout-dead-subframe-expected.txt
@@ -1,2 +1,3 @@
 
+
 PASSED
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseout-on-window-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseout-on-window-expected.txt
index fb8633bb1..1233852 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseout-on-window-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseout-on-window-expected.txt
@@ -1,2 +1,3 @@
 This test ensures that mouse out events are sent to the window.
+
 PASS: Received mouseout event.
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseover-button-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseover-button-expected.txt
index c54f75c..f317e62a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseover-button-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseover-button-expected.txt
@@ -4,11 +4,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.events['A-no-press'].which is 0
 PASS document.events['B-left'].which is 1
 PASS document.events['C-no-press'].which is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout-expected.txt
index df4081e..65703c8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout-expected.txt
@@ -2,8 +2,15 @@
 
 Move the mouse pointer from left to right:
 
-1               1               2345
+1              
+1              
+2
+3
+4
+5
+
 Log
+
 mouseover on t1_1
 mouseout on t1_1
 mouseover on t1_2
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout2-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout2-expected.txt
index 1560914..63ae4b5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseover-mouseout2-expected.txt
@@ -2,8 +2,12 @@
 
 Move the mouse pointer from left to right:
 
-3456
+3
+4
+5
+6
 Log
+
 mouseover on frame1
 mouseover on t1
 mouseout on t1
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-button-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-button-expected.txt
index decaa33..b44cec2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-button-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-button-expected.txt
@@ -8,4 +8,5 @@
 Move the mouse outside the button.
 Mouse up.
 
+
 PASS: mouse up event did not fire
diff --git a/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-document-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-document-expected.txt
index 5f531ba..50f641e4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mouseup-outside-document-expected.txt
@@ -7,5 +7,6 @@
 Mouse down inside the document.
 Move the mouse outside the window.
 Mouse up.
+
 PASS: mouseup event fired
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/move-element-with-wheel-and-touch-event-listeners-expected.txt b/third_party/WebKit/LayoutTests/fast/events/move-element-with-wheel-and-touch-event-listeners-expected.txt
index 73f132b5..d3516960 100644
--- a/third_party/WebKit/LayoutTests/fast/events/move-element-with-wheel-and-touch-event-listeners-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/move-element-with-wheel-and-touch-event-listeners-expected.txt
@@ -1,2 +1 @@
  This test passes if it doesn't crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/move-event-handler-between-framehosts-expected.txt b/third_party/WebKit/LayoutTests/fast/events/move-event-handler-between-framehosts-expected.txt
index 021907b..19ee0d9b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/move-event-handler-between-framehosts-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/move-event-handler-between-framehosts-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.scrollEventHandlerCount(document) is 0
 PASS internals.scrollEventHandlerCount(document) is 1
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/mutation-during-append-child-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mutation-during-append-child-expected.txt
index 8fdddd2..642cc0a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mutation-during-append-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mutation-during-append-child-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS newparent.appendChild(child); threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/mutation-during-insert-before-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mutation-during-insert-before-expected.txt
index 90cc5b75..d55c8b3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mutation-during-insert-before-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mutation-during-insert-before-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS newparent.insertBefore(child, beforeChild); threw exception HierarchyRequestError: Failed to execute 'insertBefore' on 'Node': The new child element contains the parent..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-2-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-2-expected.txt
index dc60e06..5b752ac 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-2-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS target.replaceChild(newChild, oldChild); threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': The new child element contains the parent..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-expected.txt b/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-expected.txt
index 2d093935..99812972 100644
--- a/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS target.replaceChild(newChild, oldChild); threw exception NotFoundError: Failed to execute 'replaceChild' on 'Node': The node to be removed is no longer a child of this node. Perhaps it was moved in response to a mutation?.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/nested-window-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/nested-window-event-expected.txt
index 9ff69c9d..3a83e111 100644
--- a/third_party/WebKit/LayoutTests/fast/events/nested-window-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/nested-window-event-expected.txt
@@ -1,2 +1,3 @@
-This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes. 
+This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/no-blur-on-enter-button-expected.txt b/third_party/WebKit/LayoutTests/fast/events/no-blur-on-enter-button-expected.txt
index a0abbb4..5edb3ff 100644
--- a/third_party/WebKit/LayoutTests/fast/events/no-blur-on-enter-button-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/no-blur-on-enter-button-expected.txt
@@ -1,6 +1,6 @@
 This test verifies that the ENTER key does not fire the blur event for input type="button" and button elements.
 
-  
+ 
 Test 1 Passed.
 Test 2 Passed.
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/node-event-anchor-lock-expected.txt b/third_party/WebKit/LayoutTests/fast/events/node-event-anchor-lock-expected.txt
index 28f0ed51..875bb00 100644
--- a/third_party/WebKit/LayoutTests/fast/events/node-event-anchor-lock-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/node-event-anchor-lock-expected.txt
@@ -4,4 +4,3 @@
 3. Force a repaint. If the lock to the anchor was properly released, the scroll caused by the PageDown will not be reverted and parentDiv.scrollTop will be greater than 600px (the offset of the anchor). If we return to the anchor, the test has failed.
 Go to anchor
 PASS: scrollTop is greater than 600px
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY-expected.txt b/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY-expected.txt
index 05ee333..3c500583 100644
--- a/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/offsetX-offsetY-expected.txt
@@ -3,15 +3,18 @@
 Fixed position
 First	Second
 This cell has borderTopExtra
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
 In columns
 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
 
 Div with transform
+
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
 
 In RTL overflow
+
 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
 
 PASS: event hit abs-box at offset (17, 22)
diff --git a/third_party/WebKit/LayoutTests/fast/events/onblur-remove-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onblur-remove-expected.txt
index 9d9fe19..d7bcd955 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onblur-remove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onblur-remove-expected.txt
@@ -1,12 +1,12 @@
-This tests that elements shouldn't emit any onblur events when they are being removed from the document. 
+This tests that elements shouldn't emit any onblur events when they are being removed from the document.
 Note, this test is expected to fail as of 04/25/2011. See bug #59379.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 FAIL Onblur handler called.
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/onchange-range-slider-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onchange-range-slider-expected.txt
index 88b1f25..da6fe0c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onchange-range-slider-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onchange-range-slider-expected.txt
@@ -4,5 +4,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS Change event fired.
 PASS slider.value is "0"
diff --git a/third_party/WebKit/LayoutTests/fast/events/onchange-select-popup-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onchange-select-popup-expected.txt
index a356530..7ce1605 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onchange-select-popup-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onchange-select-popup-expected.txt
@@ -1,7 +1,9 @@
 This test verifies that the ENTER key fires the change event for popups.
 
-
-
+abcd
+efgh
+abcd
+efgh
 PASS: change event fired.
 
 blur event fired.
diff --git a/third_party/WebKit/LayoutTests/fast/events/onclick-list-marker-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onclick-list-marker-expected.txt
index a0f8d76..4b831b6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onclick-list-marker-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onclick-list-marker-expected.txt
@@ -1,4 +1,5 @@
 text
+
 This is a testcase for hit testing over list markers. It uses the eventSender to do mouse clicks and programmatically adjusts the left margin of the span inside the list item and the list-style-position: of the list item.
 
 The onclick fire order should be: span, li, ul
diff --git a/third_party/WebKit/LayoutTests/fast/events/ondragenter-expected.txt b/third_party/WebKit/LayoutTests/fast/events/ondragenter-expected.txt
index 7f83323c..719ec9c0 100644
--- a/third_party/WebKit/LayoutTests/fast/events/ondragenter-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/ondragenter-expected.txt
@@ -1,2 +1,3 @@
 Success: Text
+
 This automated layout test checks to see that ondragenter events are being sent.
diff --git a/third_party/WebKit/LayoutTests/fast/events/onerror-bubbling-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onerror-bubbling-expected.txt
index 7020799..e930e6f1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onerror-bubbling-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onerror-bubbling-expected.txt
@@ -1,2 +1 @@
 PASS: script error handler invoked
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/onerror-img-after-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onerror-img-after-gc-expected.txt
index f061ebe..4e604ef 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onerror-img-after-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onerror-img-after-gc-expected.txt
@@ -2,4 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test ensures that a normal image error doesn't crash if GC occurs before the error event fires.
diff --git a/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-no-subresource-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-no-subresource-expected.txt
index 3132777..69b0f95e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-no-subresource-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-no-subresource-expected.txt
@@ -2,3 +2,4 @@
 
 PASS: onload fired
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-with-subresource-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-with-subresource-expected.txt
index e1cfdca8..f1fd87e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-with-subresource-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onload-after-document-close-with-subresource-expected.txt
@@ -3,3 +3,4 @@
 dimensions before onload (should be { 0 x 0 }, otherwise the test will falsely pass): { 0 x 0 }
 dimensions during onload (should be { 215 x 174 }, otherwise onload fired too early): { 215 x 174 }
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/onload-webkit-before-webcore-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onload-webkit-before-webcore-expected.txt
index 9dd2b7d..c623c8b7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onload-webkit-before-webcore-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onload-webkit-before-webcore-expected.txt
@@ -1,2 +1,2 @@
 ALERT: This should be the first line.
-This should be the second line. The first line should be an ALERT.  
+This should be the second line. The first line should be an ALERT. 
diff --git a/third_party/WebKit/LayoutTests/fast/events/onloadFrameCrash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onloadFrameCrash-expected.txt
index 593c9df..9befc0f1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onloadFrameCrash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onloadFrameCrash-expected.txt
@@ -3,5 +3,4 @@
 --------
 Frame: '<!--framePath //<!--frame0-->-->'
 --------
-ErrorCould not load the requested resource.
-Error code: -6 (net::ERR_FILE_NOT_FOUND)
+ErrorCould not load the requested resource.Error code: -6 (net::ERR_FILE_NOT_FOUND)
diff --git a/third_party/WebKit/LayoutTests/fast/events/onunload-postmessage-expected.txt b/third_party/WebKit/LayoutTests/fast/events/onunload-postmessage-expected.txt
index 7304b91..57e45f4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/onunload-postmessage-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/onunload-postmessage-expected.txt
@@ -1,2 +1 @@
-
 TEST PASS: If this test doesn't leak when run with --enable-leak-detection
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-expected.txt
index 7fe51b0b..0f3a724b9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-expected.txt
@@ -2,13 +2,14 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Unscaled
 PASS eventLog is "click(10, 10)"
 
+
 setPageScale(0.5)
 PASS eventLog is "click(20, 20)"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-iframe-expected.txt
index aecf06a..f8ba3f13 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-scaled-mouse-click-iframe-expected.txt
@@ -1,21 +1,23 @@
-
 This tests that page scaling and CSS transforms do not affect mouse event pageX and pageY coordinates for content embedded in an iframe.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Unscaled
 PASS eventLog is "click(10, 10)"
 
+
 setPageScale(0.5)
 PASS eventLog is "click(20, 20)"
 
+
 CSS scale(0.5, 2.0)
 PASS eventLog is "click(20, 5)"
 
+
 setPageScale(0.5), CSS scale(0.5, 2.0)
 PASS eventLog is "click(40, 10)"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-bubble-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-bubble-expected.txt
index 06c04f42..3b4cd77 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-bubble-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-bubble-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.visibilityState is "visible"
 PASS document.hidden is false
 PASS event.bubbles is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-delete-test-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-delete-test-expected.txt
index 5670afd..0372a0b9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-delete-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-delete-test-expected.txt
@@ -2,11 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Loaded all frames.
 Visibility of main document changed.
 Visibility of sub frame 2 changed.
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
   
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt
index 9c05f8a..a736692f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-move-test-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Window 1 Loaded
 Window 2 Loaded
 PASS window.document.hidden is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt
index 0e9a1f578..d2157af4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-propagation-test-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Main Page:
 PASS document.visibilityState is "visible"
 PASS document.hidden is false
@@ -25,3 +24,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-unload-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-unload-expected.txt
index 9c9597b..5e434196 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-unload-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-iframe-unload-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Loaded all frames.
 PASS frameDocs[0].visibilityState is "hidden"
 PASS frameDocs[1].visibilityState is "hidden"
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-null-view-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-null-view-expected.txt
index 232a16b..edd583b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-null-view-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-null-view-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS subdocument.defaultView == null is true
 PASS subdocument.visibilityState is "hidden"
 PASS subdocument.hidden is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-prefixed-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-prefixed-expected.txt
index c92665b..c84561c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-prefixed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-prefixed-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.webkitVisibilityState is "visible"
 PASS document.webkitHidden is false
 PASS document.webkitVisibilityState is "hidden"
diff --git a/third_party/WebKit/LayoutTests/fast/events/page-visibility-transition-test-expected.txt b/third_party/WebKit/LayoutTests/fast/events/page-visibility-transition-test-expected.txt
index 96ad1d11..9d602c7b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/page-visibility-transition-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/page-visibility-transition-test-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.visibilityState is "visible"
 PASS document.hidden is false
 PASS document.visibilityState is "hidden"
diff --git a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-div-expected.txt b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-div-expected.txt
index 0eb70b3..33b2a55 100644
--- a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-div-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-div-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.wheelDeltaY is 0
 PASS event.wheelDeltaX is window.givenScrollLeft*-3
 PASS event.wheelDelta is window.givenScrollLeft*-3
diff --git a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt
index caeb205c..2d9d80e6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-x-in-non-scrolling-page-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.wheelDeltaY is 0
 PASS event.wheelDeltaX is window.givenScrollLeft * -3
 PASS event.wheelDelta is window.givenScrollLeft * -3
diff --git a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-div-expected.txt b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-div-expected.txt
index 27bcdf7c..6daf6c7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-div-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-div-expected.txt
@@ -2,6 +2,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.wheelDeltaY is window.givenScrollTop*-3
 PASS event.wheelDeltaX is 0
 PASS event.wheelDelta is window.givenScrollTop*-3
diff --git a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt
index e981fee9..7e87927 100644
--- a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-paging-y-in-non-scrolling-page-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.wheelDeltaY is window.givenScrollTop * -3
 PASS event.wheelDeltaX is 0
 PASS event.wheelDelta is window.givenScrollTop * -3
diff --git a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-with-delta-zero-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-with-delta-zero-crash-expected.txt
index 76e8f973..784ff6a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-with-delta-zero-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/platform-wheelevent-with-delta-zero-crash-expected.txt
@@ -1,5 +1,3 @@
 Ensures that a mouse scrolling with (deltaX=0, deltaY=0) doesn't crash the browser.
 
 Passes if doesn't crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointer-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointer-events-expected.txt
index dfa2f8c..2c4289c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointer-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointer-events-expected.txt
@@ -1,3 +1,10 @@
 Testing the values of 'pointer-events' on HTML content
 The labels on the left will be clicked and the result is shown to the right
-auto-HIT-none-miss-
+
+auto
+
+-HIT-
+
+none
+
+-miss-
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/fake-mouse-event-pointer-types-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/fake-mouse-event-pointer-types-expected.txt
index 892c006..4d8dcab 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/fake-mouse-event-pointer-types-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/fake-mouse-event-pointer-types-expected.txt
@@ -1,10 +1,11 @@
 pointermove
 mousemove
+
+
 Verifies that fake mouse events have correct pointer type for pointer events.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- move mouse into target ---
 1 Received pointermove mouse
 2 Received mousemove
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-node-remove-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-node-remove-expected.txt
index dd76801..0a6de9fb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-node-remove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-node-remove-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
  ======= Nothing is removed  =======
    **** mouse move *****
 green received pointermove
@@ -14,6 +13,7 @@
 green received pointerup
 green received mouseup
 
+
  ======= Remove green on pointerdown  =======
    **** mouse move *****
 green received pointermove
@@ -26,6 +26,7 @@
 grey received pointerup
 grey received mouseup
 
+
  ======= Remove green on pointerup  =======
    **** mouse move *****
 green received pointermove
@@ -38,6 +39,7 @@
      ==> Green box removed
 grey received mouseup
 
+
  ======= Remove green on pointermove  =======
    **** mouse move *****
 green received pointermove
@@ -50,6 +52,7 @@
 grey received pointerup
 grey received mouseup
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-expected.txt
index 5f6372d..9ee13e23 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
  ======= Set pointer capture and release implicitly  =======
     **** Move to green box & mouse press & jiggle ***** 
 green received pointerover
@@ -60,6 +59,7 @@
 blue received mouseout
 blue received mouseleave
 
+
  ======= Set pointer capture and release implicitly outside of the page =======
     **** Move to green box & mouse press & jiggle ***** 
 green received pointerover
@@ -108,6 +108,7 @@
 blue received mouseout
 blue received mouseleave
 
+
  ======= Set pointer capture and release explicitly  =======
     **** Move to green box & mouse press & jiggle ***** 
 green received pointerover
@@ -186,6 +187,7 @@
 blue received mouseout
 blue received mouseleave
 
+
  ======= Set pointer capture and remove element  =======
     **** Move to green box & mouse press & jiggle ***** 
 green received pointerover
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-transition-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-transition-events-expected.txt
index 3c7fbd6..72286f2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-transition-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-capture-transition-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
     ==== 'none' is capturing and then 'blue' will capture; will move pointer to 'blue' ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -40,6 +39,7 @@
 blue received mouseleave
 grey received mouseleave
 
+
     ==== 'none' is capturing and then 'green' will capture; will move pointer to 'blue' ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -69,6 +69,7 @@
 green received mouseleave
 grey received mouseleave
 
+
     ==== 'blue' is capturing and then 'none' will capture; will move pointer to 'blue' ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -105,6 +106,7 @@
 blue received mouseleave
 grey received mouseleave
 
+
     ==== 'green' is capturing and then 'none' will capture; will move pointer to 'blue' ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -141,6 +143,7 @@
 blue received mouseleave
 grey received mouseleave
 
+
     ==== 'blue' is capturing and then 'green' will capture; will move pointer to 'blue' ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -189,6 +192,7 @@
 green received mouseleave
 grey received mouseleave
 
+
     ==== 'green' is capturing and then 'blue' will capture; will move pointer to 'blue' ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -229,6 +233,7 @@
 blue received mouseleave
 grey received mouseleave
 
+
     ==== 'none' is capturing and then 'blue' will capture ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -266,6 +271,7 @@
 blue received mouseleave
 grey received mouseleave
 
+
     ==== 'none' is capturing and then 'green' will capture ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -295,6 +301,7 @@
 green received mouseleave
 grey received mouseleave
 
+
     ==== 'blue' is capturing and then 'none' will capture ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -339,6 +346,7 @@
 green received mouseleave
 grey received mouseleave
 
+
     ==== 'green' is capturing and then 'none' will capture ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -367,6 +375,7 @@
 green received mouseleave
 grey received mouseleave
 
+
     ==== 'blue' is capturing and then 'green' will capture ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -415,6 +424,7 @@
 green received mouseleave
 grey received mouseleave
 
+
     ==== 'green' is capturing and then 'blue' will capture ====
  **** Move mouse to green and press *****
 green received pointerover
@@ -455,6 +465,7 @@
 blue received mouseleave
 grey received mouseleave
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-on-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-on-scrollbar-expected.txt
index b9a7dc8..20d0d45 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-on-scrollbar-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-on-scrollbar-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Received pointerdown
 Received mousedown
 Received pointerup
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-preventdefault-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-preventdefault-expected.txt
index a219d774..a89d5c75 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-preventdefault-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-preventdefault-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- test with preventDefault on none ---
 - start with mouse outside target -
 - move into target & click -
@@ -39,6 +38,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 --- test with preventDefault on pointerdown ---
 - start with mouse outside target -
 - move into target & click -
@@ -69,6 +69,7 @@
 23. target received mouseout
 24. target received mouseleave
 
+
 --- test with preventDefault on pointerup ---
 - start with mouse outside target -
 - move into target & click -
@@ -105,6 +106,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 --- test with preventDefault on pointerenter ---
 - start with mouse outside target -
 - move into target & click -
@@ -141,6 +143,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 --- test with preventDefault on pointerleave ---
 - start with mouse outside target -
 - move into target & click -
@@ -177,6 +180,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 --- test with preventDefault on pointerover ---
 - start with mouse outside target -
 - move into target & click -
@@ -213,6 +217,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 --- test with preventDefault on pointerout ---
 - start with mouse outside target -
 - move into target & click -
@@ -249,6 +254,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 --- test with preventDefault on pointermove ---
 - start with mouse outside target -
 - move into target & click -
@@ -285,6 +291,7 @@
 29. target received mouseout
 30. target received mouseleave
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-transition-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-transition-events-expected.txt
index a68cd20..515e955 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-transition-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-transition-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 green received pointerover, at phase=target
 grey received pointerover, at phase=bubble
 grey received pointerenter, at phase=target
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-updown-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-updown-events-expected.txt
index f7dcd79..bc6787b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-updown-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-updown-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 green received pointerdown
 lightgreen received pointerdown
 green received mousedown
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-preventdefault-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-preventdefault-expected.txt
index 60825cb9..69ee8172 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-preventdefault-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/multi-pointer-preventdefault-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- test with preventDefault on non-primary none ---
 - start with mouse, primary pen and non-primary pen outside target -
 - move mouse into target & press -
@@ -43,6 +42,7 @@
 27. target received pointerup primary pen
 28. target received mouseup
 
+
 --- test with preventDefault on primary mouse ---
 - start with mouse, primary pen and non-primary pen outside target -
 1. target received pointerout primary mouse
@@ -88,6 +88,7 @@
 32. target received pointerup primary pen
 33. target received mouseup
 
+
 --- test with preventDefault on primary pen ---
 - start with mouse, primary pen and non-primary pen outside target -
 1. target received pointerout primary mouse
@@ -133,6 +134,7 @@
 - release primary pen -
 33. target received pointerup primary pen
 
+
 --- test with preventDefault on non-primary pen ---
 - start with mouse, primary pen and non-primary pen outside target -
 1. target received pointerout primary mouse
@@ -181,6 +183,7 @@
 35. target received pointerup primary pen
 36. target received mouseup
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-properties-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-properties-in-iframe-expected.txt
index 86afc68d..3af8d2e1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-properties-in-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-event-properties-in-iframe-expected.txt
@@ -1,12 +1,11 @@
-
 This test verifies clientX/Y of pointer events inside iframe.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 ===== scrollX=25, scrollY=100, zoomFactor=1
  *** Mouse events inside iframe ***
 pointermove of mouse is received:
@@ -101,6 +100,7 @@
 screenX = 200
 screenY = 200
 
+
 ===== scrollX=40, scrollY=140, zoomFactor=1
  *** Mouse events inside iframe ***
 pointermove of mouse is received:
@@ -195,6 +195,7 @@
 screenX = 200
 screenY = 200
 
+
 ===== scrollX=40, scrollY=140, zoomFactor=2
  *** Mouse events inside iframe ***
 pointermove of mouse is received:
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-use-count-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-use-count-expected.txt
index 36a5181b..df17829e 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-use-count-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/pointer-use-count-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
     **** Move to grey box & mouse press *****
 grey received pointerdown
     **** read pointerID to trigger MeasureAs *****
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-expected.txt
index 5870c8e..22c11906 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
  ======= Touch and release =======
     **** First touch on green box & jiggle ****
 green received pointerover 2
@@ -26,6 +25,7 @@
 grey received pointerleave 2
 green received touchend
 
+
  ======= Touch and cancel =======
     **** First touch on green box & jiggle ****
 green received pointerover 3
@@ -49,6 +49,7 @@
 grey received pointerleave 3
 green received touchcancel
 
+
  ======= Multitouch and release =======
     **** First touch on green & second touch on blue & jiggle ****
 green received pointerover 4
@@ -88,6 +89,7 @@
 blue received pointerleave 5
 blue received touchend
 
+
  ======= Multitouch and cancel =======
     **** First touch on green & second touch on blue & jiggle ****
 green received pointerover 6
@@ -127,6 +129,7 @@
 blue received pointerleave 7
 blue received touchcancel
 
+
  ======= Touch and release with capture release =======
     **** First touch on green box & jiggle ****
 green received pointerover 8
@@ -155,6 +158,7 @@
 blue received pointerleave 8
 green received touchend
 
+
  ======= Touch and cancel with capture release =======
     **** First touch on green box & jiggle ****
 green received pointerover 9
@@ -183,6 +187,7 @@
 blue received pointerleave 9
 green received touchcancel
 
+
  ======= Multitouch and release with capture release =======
     **** First touch on green & second touch on blue & jiggle ****
 green received pointerover 10
@@ -229,6 +234,7 @@
 grey received pointerleave 11
 blue received touchend
 
+
  ======= Multitouch and cancel with capture release =======
     **** First touch on green & second touch on blue & jiggle ****
 green received pointerover 12
@@ -275,6 +281,7 @@
 grey received pointerleave 13
 blue received touchcancel
 
+
  ======= Touch and release with capture reset =======
     **** First touch on green box & jiggle ****
 green received pointerover 14
@@ -303,6 +310,7 @@
 blue received pointerleave 14
 green received touchend
 
+
  ======= Touch and cancel with capture reset =======
     **** First touch on green box & jiggle ****
 green received pointerover 15
@@ -331,6 +339,7 @@
 blue received pointerleave 15
 green received touchcancel
 
+
  ======= Multitouch and release with capture reset =======
     **** First touch on green & second touch on blue & jiggle ****
 green received pointerover 16
@@ -375,6 +384,7 @@
 blue received pointerleave 17
 blue received touchend
 
+
  ======= Multitouch and cancel with capture reset =======
     **** First touch on green & second touch on blue & jiggle ****
 green received pointerover 18
@@ -419,6 +429,7 @@
 blue received pointerleave 19
 blue received touchcancel
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-in-iframe-expected.txt
index 95a0363..3e15137 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-in-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-capture-in-iframe-expected.txt
@@ -1,12 +1,11 @@
-
 This test verifies touch and corresponding pointerevent targets inside and outside the iframe.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 ==== Finger1 in innerFrame and Finger2 in outerFrame ====
 *** Put first finger down in innerFrame and move ***
 innerFrame received pointerdown with id=2
@@ -17,19 +16,23 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Put second finger in outerFrame and move ***
 outerFrame received pointerdown with id=3
 outerFrame received gotpointercapture with id=3
 outerFrame received pointermove with id=3
 
+
 *** Move first finger to outerFrame ***
 innerFrame received pointermove with id=2
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Move second finger to innerFrame ***
 outerFrame received pointermove with id=3
 
+
 *** Releasing fingers ***
 innerFrame received pointerup with id=2
 innerFrame received lostpointercapture with id=2
@@ -38,6 +41,7 @@
 touchend is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 ==== Finger1 in outerFrame and Finger2 in innerFrame ====
 *** Put first finger down in outerFrame and move ***
 outerFrame received pointerdown with id=4
@@ -48,6 +52,7 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Put second finger in innerFrame and move ***
 innerFrame received pointerdown with id=5
 touchstart is received with changedTouches.length=1:
@@ -57,16 +62,19 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrameElement
 
+
 *** Move first finger to innerFrame ***
 outerFrame received pointermove with id=4
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Move second finger to outerFrame ***
 innerFrame received pointermove with id=5
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrameElement
 
+
 *** Releasing fingers ***
 outerFrame received pointerup with id=4
 outerFrame received lostpointercapture with id=4
@@ -79,6 +87,7 @@
   Touch with id=0 with target = outerFrame
   Touch with id=1 with target = innerFrameElement
 
+
 ==== Finger1 in innerFrame and Finger2 in innerFrame ====
 *** Put first finger down in innerFrame and move ***
 innerFrame received pointerdown with id=6
@@ -89,6 +98,7 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Put second finger in innerFrame and move ***
 innerFrame received pointerdown with id=7
 touchstart is received with changedTouches.length=1:
@@ -98,16 +108,19 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrame
 
+
 *** Move first finger to outerFrame ***
 innerFrame received pointermove with id=6
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Move second finger to outerFrame ***
 innerFrame received pointermove with id=7
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrame
 
+
 *** Releasing fingers ***
 innerFrame received pointerup with id=6
 innerFrame received lostpointercapture with id=6
@@ -117,6 +130,7 @@
   Touch with id=0 with target = innerFrame
   Touch with id=1 with target = innerFrame
 
+
 ==== Finger1 in outerFrame and Finger2 in outerFrame ====
 *** Put first finger down in outerFrame and move ***
 outerFrame received pointerdown with id=8
@@ -127,6 +141,7 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Put second finger in outerFrame and move ***
 outerFrame received pointerdown with id=9
 touchstart is received with changedTouches.length=1:
@@ -136,16 +151,19 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = outerFrame
 
+
 *** Move first finger to innerFrame ***
 outerFrame received pointermove with id=8
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Move second finger to innerFrame ***
 outerFrame received pointermove with id=9
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = outerFrame
 
+
 *** Releasing fingers ***
 outerFrame received pointerup with id=8
 outerFrame received lostpointercapture with id=8
@@ -155,6 +173,7 @@
   Touch with id=0 with target = outerFrame
   Touch with id=1 with target = outerFrame
 
+
 ==== Finger1 in innerFrame and Finger2 in outerFrame with releaseTouchCapture ====
 *** Put first finger down in innerFrame and move ***
 --- Release pointer capture for 10 ---
@@ -165,25 +184,30 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Put second finger in outerFrame and move ***
 --- Release pointer capture for 11 ---
 outerFrame received pointerdown with id=11
 outerFrame received pointermove with id=11
 
+
 *** Move first finger to outerFrame ***
 outerFrame received pointermove with id=10
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Move second finger to innerFrame ***
 innerFrame received pointermove with id=11
 
+
 *** Releasing fingers ***
 outerFrame received pointerup with id=10
 innerFrame received pointerup with id=11
 touchend is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 ==== Finger1 in outerFrame and Finger2 in innerFrame with releaseTouchCapture ====
 *** Put first finger down in outerFrame and move ***
 --- Release pointer capture for 12 ---
@@ -194,6 +218,7 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Put second finger in innerFrame and move ***
 --- Release pointer capture for 13 ---
 innerFrame received pointerdown with id=13
@@ -203,16 +228,19 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrameElement
 
+
 *** Move first finger to innerFrame ***
 innerFrame received pointermove with id=12
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Move second finger to outerFrame ***
 outerFrame received pointermove with id=13
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrameElement
 
+
 *** Releasing fingers ***
 innerFrame received pointerup with id=12
 outerFrame received pointerup with id=13
@@ -223,6 +251,7 @@
   Touch with id=0 with target = outerFrame
   Touch with id=1 with target = innerFrameElement
 
+
 ==== Finger1 in innerFrame and Finger2 in innerFrame with releaseTouchCapture ====
 *** Put first finger down in innerFrame and move ***
 --- Release pointer capture for 14 ---
@@ -233,6 +262,7 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Put second finger in innerFrame and move ***
 --- Release pointer capture for 15 ---
 innerFrame received pointerdown with id=15
@@ -242,16 +272,19 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrame
 
+
 *** Move first finger to outerFrame ***
 outerFrame received pointermove with id=14
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = innerFrame
 
+
 *** Move second finger to outerFrame ***
 outerFrame received pointermove with id=15
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = innerFrame
 
+
 *** Releasing fingers ***
 outerFrame received pointerup with id=14
 outerFrame received pointerup with id=15
@@ -259,6 +292,7 @@
   Touch with id=0 with target = innerFrame
   Touch with id=1 with target = innerFrame
 
+
 ==== Finger1 in outerFrame and Finger2 in outerFrame with releaseTouchCapture ====
 *** Put first finger down in outerFrame and move ***
 --- Release pointer capture for 16 ---
@@ -269,6 +303,7 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Put second finger in outerFrame and move ***
 --- Release pointer capture for 17 ---
 outerFrame received pointerdown with id=17
@@ -278,16 +313,19 @@
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = outerFrame
 
+
 *** Move first finger to innerFrame ***
 innerFrame received pointermove with id=16
 touchmove is received with changedTouches.length=1:
   Touch with id=0 with target = outerFrame
 
+
 *** Move second finger to innerFrame ***
 innerFrame received pointermove with id=17
 touchmove is received with changedTouches.length=1:
   Touch with id=1 with target = outerFrame
 
+
 *** Releasing fingers ***
 innerFrame received pointerup with id=16
 innerFrame received pointerup with id=17
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-events-expected.txt
index 3a6af878..ca9918b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- test PE+TE event sequences without preventDefault ---
 green received pointerover at phase=target
 lightgreen received pointerover at phase=bubbling
@@ -35,6 +34,7 @@
 lightgreen received touchend at phase=bubbling
 grey received touchend at phase=bubbling
 
+
 --- test PE+TE event sequences with PE preventDefault ---
 green received pointerover at phase=target
 lightgreen received pointerover at phase=bubbling
@@ -67,6 +67,7 @@
 lightgreen received touchend at phase=bubbling
 grey received touchend at phase=bubbling
 
+
 --- test PE params for single-touch ---
 green received pointerover at phase=target
 grey received pointerenter at phase=target
@@ -132,6 +133,7 @@
 PASS receivedPEsAtTarget[10].buttons is 0
 PASS receivedPEsAtTarget.length is 11
 
+
 --- test PE isPrimary values ---
 green received pointerover at phase=target
 grey received pointerenter at phase=target
@@ -241,6 +243,7 @@
 PASS receivedPEsAtTarget[36].isPrimary is true
 PASS receivedPEsAtTarget.length is 37
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse-expected.txt
index bdcd75729..783f5a99 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointer-mouse-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 === With primary pointerdown uncanceled ===
 -- Tap with paired GEs --
 Received pointerdown primary
@@ -44,6 +43,7 @@
 Received mousemove 
 Received mousemove 
 
+
 === With primary pointerdown canceled ===
 -- Tap with paired GEs --
 Received pointerdown primary,canceled
@@ -78,6 +78,7 @@
 Received mousemove 
 Received mousemove 
 
+
 === With primary pointerdown uncanceled ===
 -- Tap with paired GEs --
 Received pointerdown primary
@@ -119,6 +120,7 @@
 Received mousemove 
 Received mousemove 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt
index e3667694..8c2874a7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/pointerevents/touch-pointercancel-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- single drag tests ---
 
+
 -- preventDefault on none, without notifyStartOfTouchScroll --
 Received pointerover, pointerId=2
 Received pointerenter, pointerId=2
@@ -21,6 +21,7 @@
 Received pointerleave, pointerId=2
 Received touchend, touchIds=0
 
+
 -- preventDefault on pointermove, without notifyStartOfTouchScroll --
 Received pointerover, pointerId=3
 Received pointerenter, pointerId=3
@@ -37,6 +38,7 @@
 Received pointerleave, pointerId=3
 Received touchend, touchIds=0
 
+
 -- preventDefault on none, with notifyStartOfTouchScroll --
 Received pointerover, pointerId=4
 Received pointerenter, pointerId=4
@@ -51,6 +53,7 @@
 Received touchmove, touchIds=0
 Received touchend, touchIds=0
 
+
 -- preventDefault on pointermove, with notifyStartOfTouchScroll --
 Received pointerover, pointerId=5
 Received pointerenter, pointerId=5
@@ -65,8 +68,10 @@
 Received touchmove, touchIds=0
 Received touchend, touchIds=0
 
+
 --- multi drag tests ---
 
+
 -- preventDefault on none, without notifyStartOfTouchScroll --
 Received pointerover, pointerId=6
 Received pointerenter, pointerId=6
@@ -109,6 +114,7 @@
 Received pointerleave, pointerId=9
 Received touchend, touchIds=0123
 
+
 -- preventDefault on none, with notifyStartOfTouchScroll --
 Received pointerover, pointerId=10
 Received pointerenter, pointerId=10
@@ -141,8 +147,10 @@
 Received touchmove, touchIds=0123
 Received touchend, touchIds=0123
 
+
 --- multi cancel tests ---
 
+
 Received pointerover, pointerId=13
 Received pointerenter, pointerId=13
 Received pointerdown, pointerId=13
@@ -168,6 +176,7 @@
 Received pointerleave, pointerId=14
 Received touchcancel, touchIds=01
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-gesture-initiated-form-submit-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-gesture-initiated-form-submit-expected.txt
index aa44e7c..7ef22e9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-gesture-initiated-form-submit-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-allowed-from-gesture-initiated-form-submit-expected.txt
@@ -1,2 +1 @@
-
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocked-from-wrong-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocked-from-wrong-event-expected.txt
index a49186de..7713105 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocked-from-wrong-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocked-from-wrong-event-expected.txt
@@ -1,9 +1,9 @@
 click here 
+
 Tests that the plugin container doesn't generate user gestures
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.open('about:blank') is defined.
 PASS window.open('about:blank') is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-click-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-click-in-iframe-expected.txt
index c1a0c816..c6a6a35 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-click-in-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-click-in-iframe-expected.txt
@@ -1,4 +1,3 @@
-
 This tests that popup blocking does not suppress windows opened in an iframe if the event handler is a function from an enclosing frame.
 
 To run manually click the link in the iframe above with popup blocking enabled.
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers1-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers1-expected.txt
index 9068cd1..b89e0938 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers1-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers1-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() directly. A popup should be allowed.
 PASS newWindow is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers2-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers2-expected.txt
index 3153c56a..0a265cc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers2-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() with a 0 ms delay. A popup should be allowed.
 PASS newWindow is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers3-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers3-expected.txt
index efe9510..69bd521 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers3-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers3-expected.txt
@@ -2,6 +2,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval.
 PASS newWindow is non-null.
 Test calling window.open() in a 100 ms interval. A popup should only be allowed on the first execution of the interval.
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers4-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers4-expected.txt
index 2c4041a..d499ffa 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers4-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers4-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() in a nested call to setTimeout(). A popup should not be allowed.
 PASS newWindow is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers5-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers5-expected.txt
index 3aae462c..50fa68a9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers5-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers5-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() with a 900 ms delay. A popup should be allowed.
 PASS newWindow is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers6-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers6-expected.txt
index d62aed1..e5a528f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers6-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-blocking-timers6-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() with a 1001 ms delay. A popup should not be allowed.
 PASS newWindow is null
diff --git a/third_party/WebKit/LayoutTests/fast/events/popup-when-select-change-expected.txt b/third_party/WebKit/LayoutTests/fast/events/popup-when-select-change-expected.txt
index ae553961..5e08bc7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/popup-when-select-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/popup-when-select-change-expected.txt
@@ -1,5 +1,7 @@
 CONSOLE MESSAGE: line 1: PASSED
- If the pop-up was not blocked then there will be an PASS message. Otherwise, the test fails.
+abcd
+efgh
+If the pop-up was not blocked then there will be an PASS message. Otherwise, the test fails.
 
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/programmatic-check-no-change-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/programmatic-check-no-change-event-expected.txt
index a1c2c893..6a59190 100644
--- a/third_party/WebKit/LayoutTests/fast/events/programmatic-check-no-change-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/programmatic-check-no-change-event-expected.txt
@@ -2,3 +2,4 @@
 
 PASS: got exactly one change event.
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/related-target-focusevent-expected.txt b/third_party/WebKit/LayoutTests/fast/events/related-target-focusevent-expected.txt
index 874e79bc..ab1ace2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/related-target-focusevent-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/related-target-focusevent-expected.txt
@@ -9,9 +9,10 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 Checks that the relatedTarget attribute for FocusEvent objects is being set correctly when focusin/focusout events are dispatched. Press tab four times to dispatch a focusin and focusout event for each of the inputs below.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
   
diff --git a/third_party/WebKit/LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt
index 6a83fe1..2a2c789 100644
--- a/third_party/WebKit/LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/relative-offset-of-simulated-click-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Simulated click with .click():
 PASS event.offsetX is 0
 PASS event.offsetY is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/remove-first-event-listener-while-firing-expected.txt b/third_party/WebKit/LayoutTests/fast/events/remove-first-event-listener-while-firing-expected.txt
index fad0937b..543da2b7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/remove-first-event-listener-while-firing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/remove-first-event-listener-while-firing-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS messages.toString() is "l0,l2"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/remove-shadow-host-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/remove-shadow-host-crash-expected.txt
index 264969f..d67a64d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/remove-shadow-host-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/remove-shadow-host-crash-expected.txt
@@ -1,5 +1,3 @@
 Ensures that a "mouseout" event, fired on shadow DOM element of a destroyed host element doesn't crash the browser.
 
 Passes if doesn't crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/resize-events-count-expected.txt b/third_party/WebKit/LayoutTests/fast/events/resize-events-count-expected.txt
index 3b54052..e6d3a0cc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/resize-events-count-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/resize-events-count-expected.txt
@@ -2,4 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS resizeEventCount is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/resize-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/resize-events-expected.txt
index afcef1d..6ba98da 100644
--- a/third_party/WebKit/LayoutTests/fast/events/resize-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/resize-events-expected.txt
@@ -1,7 +1,9 @@
 Following actions must not emit resize events: page load, dynamic content generation, and page scaling.
 The spec DOM Level 2 Events states that the resize event occurs when document view size (a.k.a layout size) is changed. Refer to http://www.w3.org/TR/DOM-Level-2-Events/events.html
 However, showing/hiding scrollbars shouldn't be considered a layout size change. Refer to webkit.org/b/80242
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS resizeEventCount is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/resize-raf-timing-expected.txt b/third_party/WebKit/LayoutTests/fast/events/resize-raf-timing-expected.txt
index 06306969..5583881 100644
--- a/third_party/WebKit/LayoutTests/fast/events/resize-raf-timing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/resize-raf-timing-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS resizeEventCount is 1
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-body-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-body-expected.txt
index b7e7573a..17d5be51 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-body-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-body-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS window.document.scrollingElement.scrollTop is 100
 PASS window.document.scrollingElement.scrollLeft is 100
 PASS window.scrollX is 100
diff --git a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-div-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-div-expected.txt
index 65c64c2..54639d5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-div-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-div-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Scrolling unscaled div
 PASS scrollBox.scrollTop is within 0.1 of 10
 PASS scrollBox.scrollTop is within 0.1 of 10
diff --git a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-iframe-body-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-iframe-body-expected.txt
index c0e67a1..ca6662f2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-iframe-body-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-iframe-body-expected.txt
@@ -1,7 +1,7 @@
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS frame.contentDocument.scrollingElement.scrollTop is 100
 PASS frame.contentDocument.scrollingElement.scrollLeft is 100
 PASS frame.contentWindow.scrollX is 100
diff --git a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-window-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-window-expected.txt
index b7e7573a..17d5be51 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-window-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scale-and-scroll-window-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS window.document.scrollingElement.scrollTop is 100
 PASS window.document.scrollingElement.scrollLeft is 100
 PASS window.scrollX is 100
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-after-click-on-tab-index-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scroll-after-click-on-tab-index-expected.txt
index 0cecef6..e45ebcd 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-after-click-on-tab-index-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-after-click-on-tab-index-expected.txt
@@ -1,5 +1,6 @@
 ALERT: Scroll position 0
 Click the text below and then try to scroll.
+
 Scroll position is more than 0
 PASS document.scrollingElement.scrollTop > 0 became true
 PASS successfullyParsed is true
@@ -15,7 +16,8 @@
 
 
 
-My span 
+
+My span
 
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-div-with-prevent-default-in-subframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scroll-div-with-prevent-default-in-subframe-expected.txt
index fa7a9f6..22fde46a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-div-with-prevent-default-in-subframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-div-with-prevent-default-in-subframe-expected.txt
@@ -1,5 +1,5 @@
 PASS
- 
+
 This test does the following via EventSender:
 1. Click and drag the div scrollbar to a middle point.
 2. Click and drag again, this time down and to right, with the mouseup occurring in a parent frame.
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-count-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-count-expected.txt
index be754b64..cc1bc07 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-count-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-count-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.scrollEventHandlerCount(document) is 0
 PASS internals.scrollEventHandlerCount(document) is 1
 PASS internals.scrollEventHandlerCount(document) is 2
@@ -54,4 +53,3 @@
 
 TEST COMPLETE
 
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-reused-window-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-reused-window-expected.txt
index 9af3de2..06967700 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-reused-window-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-event-handler-reused-window-expected.txt
@@ -2,9 +2,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS internals.scrollEventHandlerCount(newWindow.document) is 1
 
+PASS internals.scrollEventHandlerCount(newWindow.document) is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-event-phase-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scroll-event-phase-expected.txt
index 3e94a30d..7639efa 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-event-phase-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-event-phase-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Both capture and bubble phase listeners were invoked.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt b/third_party/WebKit/LayoutTests/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
index 7ac75ded..8bda58f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
@@ -1,8 +1,9 @@
 Link to Bottom of the page
-https://bugs.webkit.org/show_bug.cgi?id=20270 
+https://bugs.webkit.org/show_bug.cgi?id=20270
 This test verifies that a anchor link overrides the overflow:hidden attribute by scrolling somewhere on a page.
 To do the test manually you have to click on the anchor link above. If the scroll occurs to the bottom of the page : the test has PASSED.
-If you stay here after the click, the test has failed. 
+If you stay here after the click, the test has failed.
+
 
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/select-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/select-element-expected.txt
index 32933e48..767e48d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/select-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/select-element-expected.txt
@@ -1,6 +1,28 @@
 This test verifies that the Home/End/PageUp/PageDown keys work correctly for <select> elements. Since it requires eventSender.keyDown, it will not run solo in the web browser; it must be run with run_web_tests.py.
 
-    
+0
+1
+2
+3
+4
+5
+6
+0
+1
+2
+3
+4
+5
+6
+7
+0
+1
+2
+3
+4
+5
+6
+
 PASS sendKeyAndExpectIndex("ss", "PageDown", 0, 3) is true
 PASS sendKeyAndExpectIndex("ss", "PageDown", 1, 4) is true
 PASS sendKeyAndExpectIndex("ss", "PageDown", 2, 5) is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/select-onchange-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/select-onchange-crash-expected.txt
index ad2372926..716dea1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/select-onchange-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/select-onchange-crash-expected.txt
@@ -1,4 +1,6 @@
 This test is to ensure that we do not crash when onchange handler changes the select from a menu list to a list box.
+
 PASS: Did not crash
 
-
+abcd
+efgh
diff --git a/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-expected.txt b/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-expected.txt
index a8da43b..61229ca3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-expected.txt
@@ -2,6 +2,7 @@
 
 If running this test manually, click on div ("Hello World") element and try to select the text using arrow keys.
 Expected result : SelectStart event will fire when user starts extending selection.
+
 Hello World
 Initial state: PASS
 Check (Right arrow): PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-prevent-default-expected.txt b/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-prevent-default-expected.txt
index e88d778..fca9424 100644
--- a/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-prevent-default-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/selectstart-by-arrow-keys-prevent-default-expected.txt
@@ -2,6 +2,7 @@
 
 If running this test manually, click on the div ("Hello World") and try to select the text using arrow keys.
 Expected result: SelectStart event will fire when user starts extending the selection, but due to script preventDefault it prevents the selection change.
+
 Hello World
 Check Right arrow + Shift: PASS
 Check Right arrow + Shift + Control: PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/setDragImage-with-detached-node-expected.txt b/third_party/WebKit/LayoutTests/fast/events/setDragImage-with-detached-node-expected.txt
index b967d5b9..71b64e1f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/setDragImage-with-detached-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/setDragImage-with-detached-node-expected.txt
@@ -4,5 +4,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Started drag.
 PASS Ended drag.
diff --git a/third_party/WebKit/LayoutTests/fast/events/show-context-menu-on-mouse-up-expected.txt b/third_party/WebKit/LayoutTests/fast/events/show-context-menu-on-mouse-up-expected.txt
index 083dee43..501cdb5d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/show-context-menu-on-mouse-up-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/show-context-menu-on-mouse-up-expected.txt
@@ -1,9 +1,11 @@
 setShowContextMenuOnMouseUp setting = false
 PASS eventLog is "mousedown contextmenu mouseup"
 
+
 setShowContextMenuOnMouseUp setting = true
 PASS eventLog is "mousedown mouseup contextmenu"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/space-scroll-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/space-scroll-event-expected.txt
index 24f0da5..e2cbda7e9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/space-scroll-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/space-scroll-event-expected.txt
@@ -1,5 +1,3 @@
 Test for bug 16241: REGRESSION(r28669): Page scrolls down when you hit space key in text area.
 
 To test manually, press Space - the page should not scroll.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/stop-immediate-propagation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/stop-immediate-propagation-expected.txt
index 69cfc5a9..7ef22e9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/stop-immediate-propagation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/stop-immediate-propagation-expected.txt
@@ -1,2 +1 @@
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-document-write-expected.txt b/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-document-write-expected.txt
index 69cfc5a9..9976b120 100644
--- a/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-document-write-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-document-write-expected.txt
@@ -1,2 +1,3 @@
 PASS
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-window-stop-expected.txt b/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-window-stop-expected.txt
index 69cfc5a9..9976b120 100644
--- a/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-window-stop-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/stop-load-in-unload-handler-using-window-stop-expected.txt
@@ -1,2 +1,3 @@
 PASS
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/stopPropagation-checkbox-expected.txt b/third_party/WebKit/LayoutTests/fast/events/stopPropagation-checkbox-expected.txt
index 179d0c4..512daa4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/stopPropagation-checkbox-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/stopPropagation-checkbox-expected.txt
@@ -1,6 +1,7 @@
 This test checks whether event.stopPropagation() prevents the default action. It should not! If the default was prevented, you'll see a link below and the text FAIL. On success you will see PASS. The test should say PASS 4 times.
 
  
+
 PASS
 PASS
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/submit-reset-nested-bubble-expected.txt b/third_party/WebKit/LayoutTests/fast/events/submit-reset-nested-bubble-expected.txt
index 9a7415b1..b72a2f82 100644
--- a/third_party/WebKit/LayoutTests/fast/events/submit-reset-nested-bubble-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/submit-reset-nested-bubble-expected.txt
@@ -1,9 +1,10 @@
 This tests that we stop propagation when bubbling a submit or reset event to more than one form. This matches Firefox behavior
 This can only occur when misnested tags cause forms to be nested.
 
-You can manually test the submit event, but this automated test will only test the reset event. 
+You can manually test the submit event, but this automated test will only test the reset event.
 
-  
+
+ 
 window reset capture
 outer_form reset capture
 div reset capture
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-crash-with-image-map-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-crash-with-image-map-expected.txt
index e2b35bb..cbcde621 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-crash-with-image-map-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-crash-with-image-map-expected.txt
@@ -1,4 +1,5 @@
 Test passes if there is no crash
+
 Google (tabindex 5)
 
 Yahoo (tabindex 2)
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-focus-anchor-tab-to-links-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-focus-anchor-tab-to-links-expected.txt
index 52c33232..74c3dfd8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-focus-anchor-tab-to-links-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-focus-anchor-tab-to-links-expected.txt
@@ -8,13 +8,12 @@
 
 Focusable
 
-
-
 Result
 
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS gave focus to focusable element
 PASS gave focus to focusable element
 PASS gave focus to focusable element
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-focus-hidden-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-focus-hidden-expected.txt
index 3eb177c..2ffec03 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-focus-hidden-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-focus-hidden-expected.txt
@@ -2,7 +2,9 @@
 
 Div 0
 Div 2
+Div 3
 Div 5
+
 Result
 
 PASS - Div 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt
index 63a9735..ed6ca5fb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-in-canvas-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement.id is "before"
 PASS document.activeElement.id is "canvas_link"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Before 
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-with-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-with-scroll-expected.txt
index 04ce90d9..138a3545 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-with-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-focus-link-with-scroll-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement.id is 'tab1'
 PASS document.activeElement.id is 'tab2'
 PASS document.activeElement.id is 'tab3'
@@ -11,6 +10,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Tab1
 Tab2
 Tab3
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-imagemap-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-imagemap-expected.txt
index 97add14..a5cd750 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-imagemap-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-imagemap-expected.txt
@@ -1,9 +1,7 @@
- 
 This tests that links in a image map are able to be reached through keyboard access and tabbing.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement.id is 'area1'
 PASS document.activeElement.id is 'area2'
 PASS document.activeElement.id is 'area3'
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-is-focusable-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-is-focusable-assert-expected.txt
index 4bc9740..c32dfce3 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-is-focusable-assert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-is-focusable-assert-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS No crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/tab-test-not-visible-imagemap-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tab-test-not-visible-imagemap-expected.txt
index 4019a64..1f6bef6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tab-test-not-visible-imagemap-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tab-test-not-visible-imagemap-expected.txt
@@ -1,11 +1,11 @@
 
 
 
+
 Test that tabbing does not focus area element when its associated image is not rendered.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement.id is 'input1'
 PASS document.activeElement.id is 'input2'
 PASS document.activeElement.id is 'input3'
diff --git a/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-all-negative-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-all-negative-expected.txt
index bd81231..f8fe0534f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-all-negative-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-all-negative-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.activeElement.id is "focusMe"
 PASS document.activeElement.id is "focusMe"
   
diff --git a/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-expected.txt b/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-expected.txt
index 7ab4fde..504cff9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/tabindex-no-focusable-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.activeElement.id is "MoveToMe"
 PASS document.activeElement.id is "MoveToMe"
    
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
index 5b3e53d..86ca806 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 multi touch sequence
 Two touchpoints pressed
 PASS lastEvent.type is "touchstart"
@@ -92,6 +91,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt
index 3fd1720..a1737d7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/basic-multi-touch-events-limited-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastEvent.type is "touchstart"
 PASS lastEvent.touches.length is 2
 PASS lastEvent.changedTouches.length is 2
@@ -88,6 +87,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
index 970ba77..71f10bb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/basic-single-touch-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS lastEvent.type is "touchstart"
 PASS lastEvent.touches.length is 1
 PASS lastEvent.changedTouches.length is 1
@@ -66,6 +65,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/compositor-touch-hit-rects-animation-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/compositor-touch-hit-rects-animation-expected.txt
index c4fb6a0..cef9e98 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/compositor-touch-hit-rects-animation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/compositor-touch-hit-rects-animation-expected.txt
@@ -6,6 +6,7 @@
 
 [object HTMLDivElement]: #document scrolling (175, 175, 100, 100)
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-press-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-press-expected.txt
index 583523c..387241a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-press-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-press-expected.txt
@@ -4,20 +4,25 @@
 
 TEST COMPLETE
 
+
+
 showContextMenuOnMouseUp = true
 Long press event sequence:
 Context Menu event received: false
 PASS
 
+
 Long tap event sequence: mouseover mouseenter mousemove contextmenu
 Context Menu event received: true
 PASS
 
+
 showContextMenuOnMouseUp = false
 Long press event sequence: mousemove contextmenu
 Context Menu event received: true
 PASS
 
+
 Long tap event sequence:
 Context Menu event received: false
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-tap-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-tap-expected.txt
index aeda9e8..b87570a4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-tap-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-long-tap-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test checks that the context menu is shown on long tap gesture.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-expected.txt
index 9f46929..56301038 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test checks that the context menu is shown on a two finger tap gesture.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-iframe-expected.txt
index 4d7be5d2..4c2d387 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/context-menu-on-two-finger-tap-iframe-expected.txt
@@ -1,12 +1,11 @@
-
 This test checks that the context menu is sent to the iframe on a two finger tap gesture.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS contextmenu in iframe
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/focus-selectionchange-on-tap-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/focus-selectionchange-on-tap-expected.txt
index 92c75a2..fcaa07b4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/focus-selectionchange-on-tap-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/focus-selectionchange-on-tap-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Tap on input field but consume mousedown
 Sending GestureTapDown
 Sending GestureShowPress
@@ -15,6 +14,7 @@
 PASS tapHandled is true
 PASS isFocused(target) is false
 
+
 Tap on input field without consuming mousedown
 Sending GestureTapDown
 Sending GestureShowPress
@@ -27,6 +27,7 @@
 Received selectionchange on #document anchor=BODY[2]
 PASS isFocused(target) is true
 
+
 Tap elsewhere to clear focus
 Sending GestureTapDown
 Sending GestureShowPress
@@ -36,6 +37,7 @@
 Received selectionchange on #document anchor=#text[0]
 PASS isFocused(target) is false
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-expected.txt
index c6b872bb..bb1b0ff2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.type is "mousemove"
 PASS event.clientX is 10
 PASS event.clientY is 12
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
index 07d4f1df..c5a48cc 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
@@ -1,9 +1,7 @@
- 
 The test succeeds if this does not hang or crash when getting the y conner's position from inline renderer. This test passes if it does not timeout.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-dblclick-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-dblclick-expected.txt
index 3b638ce..0386b1c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-dblclick-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-dblclick-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.type is "mousemove"
 PASS event.clientX is 10
 PASS event.clientY is 12
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt
index 61b0968..4bcf889 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-expected.txt
@@ -1,14 +1,15 @@
 Gestures go here
+
 Tests that tap gesture events set and clear the active state of elements.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
 
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Verify active isn't initially set
 PASS getHoverActiveState(box) is "default"
 Verify showPress, tap sets and clears active
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-hidden-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-hidden-iframe-expected.txt
index 2ea4f7e..e757e00 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-hidden-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-hidden-iframe-expected.txt
@@ -1,9 +1,9 @@
 Gestures go here
+
 Tests that tap gesture events on a an element covered by a hidden iframe set and clear the active state.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Verify active isn't initially set
 PASS getHoverActiveState(box) is "default"
 Verify showPress, tap sets and clears active
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt
index 5b4424e3..14e11c4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe-expected.txt
@@ -1,9 +1,7 @@
-
 Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 See https://bugs.webkit.org/show_bug.cgi?id=96060 for details
 
 Verify active isn't initially set
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-cancel-hover-state-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-cancel-hover-state-expected.txt
index 18c4804..a508305c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-cancel-hover-state-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-cancel-hover-state-expected.txt
@@ -1,14 +1,15 @@
 Gestures go here
+
 Tests that gesture tapcancel clears hover properly
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 See http://crbug.com/316974 for details
 
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Verify hover, active aren't initially set
 PASS getHoverActiveState(box) is "default"
 tapCancel on element when it is Active should keep hover
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-click-common-ancestor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-click-common-ancestor-expected.txt
index 406ccc0..0a0763d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-click-common-ancestor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-click-common-ancestor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending GestureTapDown
 Sending GestureShowPress
 Sending GestureTap
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-div-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-div-removed-expected.txt
index 34f926f1..372a960b6 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-div-removed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-div-removed-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Sending GestureTapDown
 Sending GestureShowPress
 Sending GestureTap
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-move-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-move-expected.txt
index dce0b31..c6fa80a4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-move-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-move-expected.txt
@@ -1,13 +1,12 @@
-
 Verifies mouse event co-ordinates from a tap in an iframe that changes position on each mouse event
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending GestureTapDown to 25,25
 Sending GestureShowPress
 Sending GestureTap
 
+
 Received mousemove in child frame with currentOffset=0 expectedOffset=0
 PASS event.screenX is 25
 PASS event.screenY is 25
@@ -22,6 +21,7 @@
 PASS targetRect.bottom is >= event.clientY
 PASS event.clientY is >= targetRect.top
 
+
 Received mousedown in child frame with currentOffset=5 expectedOffset=5
 PASS event.screenX is 25
 PASS event.screenY is 25
@@ -36,6 +36,7 @@
 PASS targetRect.bottom is >= event.clientY
 PASS event.clientY is >= targetRect.top
 
+
 Received mouseup in child frame with currentOffset=10 expectedOffset=10
 PASS event.screenX is 25
 PASS event.screenY is 25
@@ -50,6 +51,7 @@
 PASS targetRect.bottom is >= event.clientY
 PASS event.clientY is >= targetRect.top
 
+
 Received click in child frame with currentOffset=15 expectedOffset=10
 PASS event.screenX is 25
 PASS event.screenY is 25
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-removed-expected.txt
index d1fe6f4..f4b1038 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-removed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-removed-expected.txt
@@ -1,9 +1,7 @@
-
 Verifies that a tap occurring on an iframe that gets removed during tap handling doesn't cause a crash.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test case: Remove during mousemove
 Sending GestureTap
 Received mousemove in child frame
@@ -11,16 +9,19 @@
 PASS document.getElementById('target') is null
 iframe loaded
 
+
 Test case: Remove during mousedown
 Sending GestureTap
 FAIL document.getElementById('target') should be null. Was [object HTMLIFrameElement].
 iframe loaded
 
+
 Test case: Remove during mouseup
 Sending GestureTap
 FAIL document.getElementById('target') should be null. Was [object HTMLIFrameElement].
 iframe loaded
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar-expected.txt
index d1dcc906..10a10cee 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar-expected.txt
@@ -1,12 +1,11 @@
-
 Taps at a point that becomes a scrollbar (i.e. hit test with innerNode=null) during the tap and verifies we don't crash.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test case: Tap on consistent scrollbar
 Sending GestureTap
 
+
 Test case: Add scrollbars during mousemove
 Sending GestureTap
 Received mousemove in child frame
@@ -15,6 +14,7 @@
 Received mouseup in child frame
 Received click in child frame
 
+
 Test case: Add scrollbars during mousedown
 Sending GestureTap
 Received mousemove in child frame
@@ -23,6 +23,7 @@
 Received mouseup in child frame
 Received click in child frame
 
+
 Test case: Add scrollbars during mouseup
 Sending GestureTap
 Received mousemove in child frame
@@ -31,6 +32,7 @@
 Adding scrollbars to iframe
 Received click in child frame
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled-expected.txt
index 9f4a556..dbf8f758 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrolled-expected.txt
@@ -1,9 +1,7 @@
-
 Verifies that a tap occurring in a scrolled iframe has the correct co-ordinates
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending GestureTapDown to 30,27
 Sending GestureShowPress
 Sending GestureTap
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-clear-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-clear-expected.txt
index e52d2a8..c5aed17b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-clear-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-clear-expected.txt
@@ -1,10 +1,10 @@
 Hover over me
 Click me
+
 Tests that hover effects from a gesture tap down can be cleared by a gesture tap or mousemove outside of the hovered element.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 See https://bugs.webkit.org/show_bug.cgi?id=103283 for details.
 
 The Don't Click Me div should not be visible.
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-state-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-state-iframe-expected.txt
index d2f9289f..7c6cfa6d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-state-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-hover-state-iframe-expected.txt
@@ -1,9 +1,9 @@
 Gestures go here
+
 Tests that the hover effect is cleared by a gesture tap between iframe and document
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Verify the hover is not initially set
 PASS getHoverActiveState(box1) is "default"
 PASS getHoverActiveState(box2) is "default"
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-between-frames-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-between-frames-expected.txt
index 6a508025..772f38f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-between-frames-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-between-frames-expected.txt
@@ -1,9 +1,7 @@
-
 Verifies that mouse events are fired on tapping of gesture across frames in the correct order.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- Tap tests ---
 -- sending gestureTap to green --
 PASS fired event is (yellow, mouseover).
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-expected.txt
index e0851e4..d3ebd75 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-mouse-events-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 --- Tap-only tests ---
 -- sending gestureTap to green --
 green received mouseover
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-near-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-near-iframe-expected.txt
index daf4a9c..bb5411b5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-near-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-near-iframe-expected.txt
@@ -2,27 +2,32 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending GestureTap on top of iframe
 PASS sawClick is false
 
+
 Sending GestureTap above iframe
 Received click on DIV#container
 PASS sawClick is true
 
+
 Sending GestureTap to the left of iframe
 Received click on DIV#container
 PASS sawClick is true
 
+
 Sending GestureTap to the right of iframe
 Received click on DIV#container
 PASS sawClick is true
 
+
 Sending GestureTap below iframe
 Received click on DIV#container
 PASS sawClick is true
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-on-hover-element-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-on-hover-element-expected.txt
index 38ba9dac..32275d1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-on-hover-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-on-hover-element-expected.txt
@@ -1,11 +1,11 @@
 Hover over me
 Click me
 Don't click me
+
 Tests that a gesture tap is dispatched before the hover state on the active element is cleared.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 See https://bugs.webkit.org/show_bug.cgi?id=103283 for details.
 
 The Click Me div should not be visible.
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-paragraph-end-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-paragraph-end-expected.txt
index 12fd325..6a238aa 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-paragraph-end-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-paragraph-end-expected.txt
@@ -5,7 +5,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS point.x is > span.getBoundingClientRect().right
 PASS document.elementFromPoint(point.x, point.y).id is "target"
 Sending GestureTapDown
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt
index be06196..3014673 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-result-expected.txt
@@ -3,14 +3,15 @@
 This text consumes events using preventDefault()
 
 Clicking or tapping on the "consumes" section should have no effect on the selection, but clicking in the plain section should clear it.
+
 This tests Tap events being consumed by a handler.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS consumesResult is true
 PASS window.getSelection().toString() is not 
 PASS plainResult is false
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled-expected.txt
index ff0529f8..a3ae2e9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-scrolled-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending GestureTapDown to 50,50
 Sending GestureShowPress
 Sending GestureTap
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-expected.txt
index e583a49..5c4d323 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test checks long press behavior when both touch drag/drop and touch editing are enabled.
 1. Check that long press on a draggable element starts drag.
 2. Check that long press on non-draggable text selects the text.
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-in-iframe-expected.txt
index b2d55a1e..a39b7ef 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-in-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-drag-drop-touch-editing-combined-in-iframe-expected.txt
@@ -2,6 +2,8 @@
 
 TEST COMPLETE
 
+
+
 This test checks long press behavior inside an iframe when both touch drag/drop and touch editing are enabled.
 1. Check that long press on a draggable element starts drag.
 2. Check that long press on non-draggable text selects the text.
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt
index 79cf179f..64df201b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-focuses-frame-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.activeElement == frame1 is true
 PASS document.activeElement == frame2 is true
 PASS document.activeElement == document.body is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-iframe-triggers-drag-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-iframe-triggers-drag-expected.txt
index 1796a0ae..6c02d06 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-iframe-triggers-drag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-iframe-triggers-drag-expected.txt
@@ -2,6 +2,8 @@
 
 TEST COMPLETE
 
+
+
 This test checks that a long press gesture on a draggable element in an iframe starts a drag/drop session.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-nested-iframes-triggers-drag-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-nested-iframes-triggers-drag-expected.txt
index 1796a0ae..6c02d06 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-nested-iframes-triggers-drag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-in-nested-iframes-triggers-drag-expected.txt
@@ -2,6 +2,8 @@
 
 TEST COMPLETE
 
+
+
 This test checks that a long press gesture on a draggable element in an iframe starts a drag/drop session.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag-expected.txt
index 594426c..90956667 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-on-draggable-element-triggers-drag-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test checks that a long press gesture on a draggable element starts a drag/drop session.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled-expected.txt
index d6e48e3..5c08bd9b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/long-press-selects-word-when-touch-editing-enabled-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test checks that a long press gesture selects word when touch editing is enabled.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/no-context-menu-on-long-tap-alone-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/no-context-menu-on-long-tap-alone-expected.txt
index 388bf35..f1bd080 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/no-context-menu-on-long-tap-alone-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/no-context-menu-on-long-tap-alone-expected.txt
@@ -1,6 +1,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test checks that the context menu is not shown on long tap gesture without a long press.
 
 Testing
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/right-click-gestures-set-cursor-at-correct-position-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/right-click-gestures-set-cursor-at-correct-position-expected.txt
index 0cf0f92..05f98695 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/right-click-gestures-set-cursor-at-correct-position-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/right-click-gestures-set-cursor-at-correct-position-expected.txt
@@ -1,5 +1,4 @@
 This test checks that on a two finger tap gesture in a text area, the cursor is first set to the right position.
 
-
 Testing
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/tap-target-matches-active-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/tap-target-matches-active-expected.txt
index 41a76ef..ac469bd 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/gesture/tap-target-matches-active-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/gesture/tap-target-matches-active-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending gestureTapDown
 PASS getHoverActiveState(target) is "default"
 Sending gestureShowPress
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/layout-triggers-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/layout-triggers-expected.txt
index 7b2c6dab..715753d 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/layout-triggers-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/layout-triggers-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Forcing initial layout
 PASS internals.needsLayoutCount() is 0
 Sending touchstart
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-grouped-targets-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-grouped-targets-expected.txt
index dd54406..d271ebe1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-grouped-targets-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-grouped-targets-expected.txt
@@ -23,6 +23,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-iframes-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-iframes-expected.txt
index 65f662db..65e9859c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-iframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-iframes-expected.txt
@@ -1,12 +1,11 @@
-
 Test multi-touch is sent to the same iframe.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 First touch is on iframe1.
 PASS document.elementFromPoint(101, 101).id is "iframe1"
 PASS ev.type is "touchstart"
@@ -21,9 +20,11 @@
 PASS ev.changedTouches[0].target.ownerDocument.title is "iframe1"
 PASS ev.targetTouches[0].target.ownerDocument.title is "iframe1"
 
+
 Second touch is on iframe2, nothing should happen.
 PASS document.elementFromPoint(251, 101).id is "iframe2"
 
+
 Moves the first touch outside iframe1.
 PASS ev.type is "touchmove"
 PASS touchreceiver is "iframe1"
@@ -41,6 +42,7 @@
 PASS ev.touches[1].target.nodeName is "#document"
 PASS ev.touches[1].target.title is "iframe1"
 
+
 Release the first touch.
 PASS ev.type is "touchend"
 PASS touchreceiver is "iframe1"
@@ -53,9 +55,11 @@
 PASS ev.touches[0].target.title is "iframe1"
 PASS ev.touches[0].identifier is 1
 
+
 Third touch is on iframe2, nothing should happen.
 PASS document.elementFromPoint(261, 101).id is "iframe2"
 
+
 Release all touches on iframe2, and touch iframe2 again.
 PASS ev.type is "touchstart"
 PASS touchreceiver is "iframe2"
@@ -68,8 +72,10 @@
 PASS ev.changedTouches[0].target.ownerDocument.title is "iframe2"
 PASS ev.targetTouches[0].target.ownerDocument.title is "iframe2"
 
+
 Touch iframe1, nothing shoud happen.
 
+
 Release all touches.
 PASS ev.type is "touchend"
 PASS touchreceiver is "iframe2"
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes-expected.txt
index 088f0ed..fcbcad8 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-inside-nested-iframes-expected.txt
@@ -1,12 +1,11 @@
-
 Test multi-touch is sent to the same iframe.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 First touch is on inner iframe.
 PASS ev.type is "touchstart"
 PASS touchreceiver is "iframe1"
@@ -19,8 +18,10 @@
 PASS ev.changedTouches[0].target.ownerDocument.title is "iframe1"
 PASS ev.targetTouches[0].target.ownerDocument.title is "iframe1"
 
+
 Second touch is on outer iframe, nothing should happen.
 
+
 Moves the first touch outside inner iframe.
 PASS ev.type is "touchmove"
 PASS touchreceiver is "iframe1"
@@ -35,6 +36,7 @@
 PASS ev.touches[1].target.nodeName is "#document"
 PASS ev.touches[1].target.title is "iframe1"
 
+
 Release the first touch.
 PASS ev.type is "touchend"
 PASS touchreceiver is "iframe1"
@@ -47,8 +49,10 @@
 PASS ev.touches[0].target.nodeName is "#document"
 PASS ev.touches[0].target.title is "iframe1"
 
+
 Third touch is on outer iframe, nothing should happen.
 
+
 Release all touches on outer iframe, and touch outer iframe again.
 PASS ev.type is "touchstart"
 PASS touchreceiver is "iframe2"
@@ -61,6 +65,7 @@
 PASS ev.changedTouches[0].target.ownerDocument.title is "iframe2"
 PASS ev.targetTouches[0].target.ownerDocument.title is "iframe2"
 
+
 Touch inner iframe, this will trigger onTouch as it is inside outer iframe.
 PASS ev.type is "touchstart"
 PASS touchreceiver is "iframe2"
@@ -73,6 +78,7 @@
 PASS ev.changedTouches[0].target.ownerDocument.title is "iframe2"
 PASS ev.targetTouches[0].target.ownerDocument.title is "iframe2"
 
+
 Release all touches.
 PASS ev.type is "touchend"
 PASS touchreceiver is "iframe2"
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-partial-sequence-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-partial-sequence-expected.txt
index adbeb17..041ab144 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-partial-sequence-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/multi-touch-partial-sequence-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending touchstart event.
 PASS event.target is target
 PASS event.touches.length is 2
@@ -19,8 +18,10 @@
 PASS event.targetTouches.length is 1
 PASS event.targetTouches[0].identifier is 1
 
+
 Sending touchmove and touchend for unrelated touch point.
 
+
 Sending touchend.
 PASS event.target is target
 PASS event.touches.length is 0
@@ -31,6 +32,7 @@
 PASS event.changedTouches[0].target is target
 PASS event.targetTouches.length is 0
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/nested-document-with-touch-handler-detached-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/nested-document-with-touch-handler-detached-crash-expected.txt
index da0bbb51..48df229 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/nested-document-with-touch-handler-detached-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/nested-document-with-touch-handler-detached-crash-expected.txt
@@ -1,2 +1 @@
-
 Test passes if DRT doesn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/page-scaled-touch-gesture-click-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/page-scaled-touch-gesture-click-expected.txt
index d50a576..4fcbf249 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/page-scaled-touch-gesture-click-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/page-scaled-touch-gesture-click-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.type is "mousemove"
 PASS event.clientX is 20
 PASS event.clientY is 24
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/scroll-without-mouse-lacks-mousemove-events-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/scroll-without-mouse-lacks-mousemove-events-expected.txt
index 9924494f..57fd031 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/scroll-without-mouse-lacks-mousemove-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/scroll-without-mouse-lacks-mousemove-events-expected.txt
@@ -1,2 +1 @@
 This test passes if it doesn't alert a message containing the word "fail".
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt
index e3e809c0..3fec37f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/send-oncancel-event-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.type is "touchcancel"
 PASS cancelEvent is non-null.
 PASS cancelEvent.pageX is 25
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/tap-highlight-color-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/tap-highlight-color-expected.txt
index 0f56e78..802af0b0 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/tap-highlight-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/tap-highlight-color-expected.txt
@@ -1,9 +1,9 @@
 Touch Me!
+
 Check tap highlight color in touch event
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Event: touch start
 PASS event.targetTouches[0].target.tagName is "DIV"
 PASS event.targetTouches[0].target.id is "touchtarget"
@@ -14,6 +14,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-touch-handlers-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-touch-handlers-expected.txt
index a017a0b2..a060b25 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-touch-handlers-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-action-touch-handlers-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Should start with no handlers
 PASS getTouchHandlerCount(document) is 0
 touch-action: auto should not add any handlers
@@ -30,4 +31,3 @@
 touch-action on div inside frame should add a handler
 PASS getTouchHandlerCount(nestedDocument) is 2
 PASS getTouchHandlerCount(document) is 2
-
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-before-pressing-spin-button-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-before-pressing-spin-button-expected.txt
index 3cf57d1..3e68316 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-before-pressing-spin-button-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-before-pressing-spin-button-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS numberInput.value is "2"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-browser-zoom-scales-radius-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-browser-zoom-scales-radius-expected.txt
index a066c59..4814fab 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-browser-zoom-scales-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-browser-zoom-scales-radius-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 ===Initial Zoom===
 PASS radiusX is 4
 PASS radiusY is 10
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt
index 1e33f28b..7cb6cc98 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-coords-in-zoom-and-scroll-expected.txt
@@ -24,6 +24,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-event-source-device-event-sender-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-event-source-device-event-sender-expected.txt
index 3ddaa38..cabe4c2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-event-source-device-event-sender-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-event-source-device-event-sender-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending touchstart
 PASS event.sourceCapabilities is non-null.
 PASS event.sourceCapabilities.firesTouchEvents is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-fractional-coordinates-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-fractional-coordinates-expected.txt
index d8a7b342..6ccafd2a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-fractional-coordinates-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-fractional-coordinates-expected.txt
@@ -2,11 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-    
+  
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Testing simple fractional touch
 PASS eventCount is 1
 PASS lastEvent.type is "touchstart"
@@ -19,6 +19,7 @@
 PASS lastEvent.changedTouches[0].radiusX is within 0.00001 of 5.2
 PASS lastEvent.changedTouches[0].radiusY is within 0.00001 of 6.3
 
+
 Testing fractional touch inside simple iframe
 PASS eventCount is 1
 PASS lastEvent.type is "touchstart"
@@ -29,6 +30,7 @@
 PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 4.5
 PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 2.2
 
+
 Testing fractional touch inside rotated iframe
 PASS eventCount is 1
 PASS lastEvent.type is "touchstart"
@@ -39,6 +41,7 @@
 PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 95.5
 PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 97.8
 
+
 Testing fractional touch inside scaled iframe
 PASS eventCount is 1
 PASS lastEvent.type is "touchstart"
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-assert-input-range-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-assert-input-range-expected.txt
index 37a8eef..9420110 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-assert-input-range-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-assert-input-range-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS rects.length is 1
 PASS rects.length is 0
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-count-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-count-expected.txt
index cdcab5df..de7466a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-count-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-count-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test addEventListener/removeEventListener on the document.
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 0
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-plugin-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-plugin-assert-expected.txt
index 1522b7c..f4c383c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-plugin-assert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-plugin-assert-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-unload-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-unload-assert-expected.txt
index 151e74f..266b721 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-unload-assert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-handler-iframe-unload-assert-expected.txt
@@ -2,8 +2,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-input-element-change-documents-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-input-element-change-documents-expected.txt
index 5dec52cf..f880ed9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-input-element-change-documents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-input-element-change-documents-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 0
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 0
 PASS internals.touchStartOrMoveEventHandlerCount(document) is 2
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt
index 1536bf4..cc1df5b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-expected.txt
@@ -1,12 +1,11 @@
-
 Test iframes receive touches correctly.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS touch.pageX is 50
 PASS touch.pageY is 50
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-scrolled-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-scrolled-expected.txt
index fa2a6f3..e336b72c 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-scrolled-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-inside-iframe-scrolled-expected.txt
@@ -1,12 +1,11 @@
-
 Test iframes receive touches correctly when scrolled. https://bugs.webkit.org/show_bug.cgi?id=96541
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS correctDiv is true
 PASS touch.pageX is 150
 PASS touch.pageY is 350
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-over-hidden-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-over-hidden-iframe-expected.txt
index 24f2e194..b99e76f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-over-hidden-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-over-hidden-iframe-expected.txt
@@ -1,9 +1,9 @@
 Touches go here
+
 Tests that touch events on a an element covered by a hidden iframe trigger the touch handlers.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS touch.pageX is 50
 PASS touch.pageY is 50
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-assert-first-layer-special-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-assert-first-layer-special-expected.txt
index bc242bd..aaaf2e9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-assert-first-layer-special-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-assert-first-layer-special-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS rects.length is 1
 PASS rects[0].layerAssociatedNode.nodeName is "#document"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Foo
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer-expected.txt
index 639519c..a4d887ef 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-rect-crash-on-unpromote-layer-expected.txt
@@ -1,9 +1,9 @@
 A layer that may or may not be composited
+
 Make sure we don't crash when a layer with a touch event handler becomes non-composited
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS rects.length is 1
 PASS rects[0].layerAssociatedNode.id is "layer"
 PASS rects.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-expected.txt
index 6d71ced..c1764a7 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-expected.txt
@@ -2,8 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-
 PASS event.touches[0].target.id is "slider1"
 PASS sliderValue is "50"
 PASS sliderValue is "50"
@@ -25,6 +23,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt
index 77609ba..31ac627 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-slider-no-js-touch-listener-expected.txt
@@ -2,13 +2,12 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-
 PASS slider.value is "50"
 PASS slider.value is "0"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-expected.txt
index 092d5c2..913b08f 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-expected.txt
@@ -43,6 +43,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-limited-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-limited-expected.txt
index fbce00eb..7800bdb 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-limited-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-limited-expected.txt
@@ -47,6 +47,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-move-documents-expected.txt b/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-move-documents-expected.txt
index 6fcb694..620eae2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-move-documents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/touch/touch-target-move-documents-expected.txt
@@ -2,21 +2,25 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Sending touchstart
 Received touchstart on DIV-target
 Received touchstart on #document-Main
 
+
 Moving target node to new document
 
+
 Sending touchmove
 
+
 Re-adding target node to main document
 
+
 Sending touchend
 Received touchend on DIV-target
 Received touchend on #document-Main
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/uievent-with-inputdevice-expected.txt b/third_party/WebKit/LayoutTests/fast/events/uievent-with-inputdevice-expected.txt
index 457e013..ed01ccd 100644
--- a/third_party/WebKit/LayoutTests/fast/events/uievent-with-inputdevice-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/uievent-with-inputdevice-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS uievent is non-null.
 PASS uievent.sourceCapabilities is null
 PASS uievent.sourceCapabilities is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/wheel-event-dispatch-event-expected.txt b/third_party/WebKit/LayoutTests/fast/events/wheel/wheel-event-dispatch-event-expected.txt
index c9890279..77edaf5 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheel/wheel-event-dispatch-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/wheel-event-dispatch-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Wheelevent recevied
 PASS recevied is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-constructor-expected.txt
index 29a6f4a..3d060a9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testEvent = new WheelEvent('wheel') did not throw exception.
 PASS testEvent.__proto__ is WheelEvent.prototype
 PASS testEvent.deltaX is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-ctrl-expected.txt b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-ctrl-expected.txt
index 774399a..ba86e1cf 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-ctrl-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-ctrl-expected.txt
@@ -8,11 +8,11 @@
 
 END
 And scroll the document here
+
 Tests that wheel events with the ctrl modifier are handled properly
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test mousewheel events over scrollable div
 With ctrl modifier set and canScroll set to be false
 PASS wheelEventCount is 1
@@ -25,6 +25,7 @@
 PASS ctrlKey is false
 PASS testDiv.scrollTop is deltaY
 
+
 Test mousewheel events over the document
 With ctrl modifier set and canScroll set to be false
 PASS wheelEventCount is 1
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-document-createevent-expected.txt b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-document-createevent-expected.txt
index 952982c..da780c21 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-document-createevent-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-document-createevent-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS wheelEvent.deltaX is 0
 PASS wheelEvent.deltaY is 0
 PASS wheelEvent.deltaZ is 0
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-handler-count-expected.txt b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-handler-count-expected.txt
index 16de033d..3307e411 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-handler-count-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-handler-count-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.wheelEventHandlerCount(document) is 0
 PASS internals.wheelEventHandlerCount(document) is 1
 PASS internals.wheelEventHandlerCount(document) is 2
diff --git a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-mousewheel-interaction-expected.txt b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-mousewheel-interaction-expected.txt
index 3fd145e..2dcbc12 100644
--- a/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-mousewheel-interaction-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/wheel/wheelevent-mousewheel-interaction-expected.txt
@@ -2,11 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Standard wheel event was fired.
 PASS testEvent.__proto__ is WheelEvent.prototype
 PASS successfullyParsed is true
 
 TEST COMPLETE
-TOP TOP TOP TOP TOP TOP TOP Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here END END END END END END END
 
+TOP TOP TOP TOP TOP TOP TOP Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here Scroll mouse wheel over here END END END END END END END
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-errorevent-01-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-errorevent-01-expected.txt
index 5d72276..a6a1dd9b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-errorevent-01-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-errorevent-01-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-errorevent-02-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-errorevent-02-expected.txt
index 5baf035..6e38696 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-errorevent-02-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-errorevent-02-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-events-bubble-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-events-bubble-expected.txt
index f8805653..cda8617 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-events-bubble-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-events-bubble-expected.txt
@@ -1 +1,3 @@
-Test that stopPropagation() will not allow window events to bubble. Clicking on this should not fire window.onclick. This matches our old behavior and Firefox behavior. stopPropagation called. Test Passed.
+Test that stopPropagation() will not allow window events to bubble.
+Clicking on this should not fire window.onclick. This matches our old behavior and Firefox behavior.
+stopPropagation called. Test Passed.
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-events-bubble2-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-events-bubble2-expected.txt
index 3a3e3765..b63e2aa 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-events-bubble2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-events-bubble2-expected.txt
@@ -1 +1,3 @@
-Tests that preventDefault() will still allow window events to bubble. Clicking here should fire window.onclick. This will match Firefox behavior. Window.onClick fired. Test Passed.
+Tests that preventDefault() will still allow window events to bubble.
+Clicking here should fire window.onclick. This will match Firefox behavior.
+Window.onClick fired. Test Passed.
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-events-capture-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-events-capture-expected.txt
index 00207790..c297d78a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-events-capture-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-events-capture-expected.txt
@@ -1,4 +1,6 @@
-This tests that window events will fire in the capture phase. Click here
+This tests that window events will fire in the capture phase.
+Click here
+
 Capture: Window.onClick is called
 stopPropagation called.
 Default behavior for link
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-01-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-01-expected.txt
index 87bd853..51250a4 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-01-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-01-expected.txt
@@ -2,14 +2,15 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught ReferenceError: hahaha_good_luck_finding_me is not defined" at window-onerror-01.html (Line: 14, Column: 9)
 Stack Trace:
 ReferenceError: hahaha_good_luck_finding_me is not defined
     at window-onerror-01.html:14:9
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-02-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-02-expected.txt
index 15e4c8e..fb4d2627 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-02-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-02-expected.txt
@@ -2,14 +2,15 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught ReferenceError: unknownObject is not defined" at window-onerror-02.html (Line: 14, Column: 9)
 Stack Trace:
 ReferenceError: unknownObject is not defined
     at window-onerror-02.html:14:9
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-03-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-03-expected.txt
index b66fe97..0322832 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-03-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-03-expected.txt
@@ -2,14 +2,15 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught ReferenceError: Invalid left-hand side in assignment" at window-onerror-03.html (Line: 1, Column: 1)
 Stack Trace:
 ReferenceError: Invalid left-hand side in assignment
     at window-onerror-03.html:14:9
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-04-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-04-expected.txt
index 6450c24..5334858 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-04-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-04-expected.txt
@@ -2,14 +2,15 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught SyntaxError: Unexpected end of input" at window-onerror-04.html (Line: 1, Column: 3)
 Stack Trace:
 SyntaxError: Unexpected end of input
     at window-onerror-04.html:14:9
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-05-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-05-expected.txt
index 294ddbbb..d0aa6a9 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-05-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-05-expected.txt
@@ -1,9 +1,11 @@
 window.onerror: "Uncaught SyntaxError: Unexpected token )" at window-onerror-05.html (Line: 15, Column: 10)
 Stack Trace:
 SyntaxError: Unexpected token )
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-06-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-06-expected.txt
index 65de20d9..8e30d35 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-06-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-06-expected.txt
@@ -4,12 +4,12 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught Error: Original exception." at onerror-test.js (Line: 6, Column: 5)
 Stack Trace:
 Error: Original exception.
     at throwException onerror-test.js:6:11
     at window-onerror-06.html:22:9
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-07-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-07-expected.txt
index da28508b..be9fc6a 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-07-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-07-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS thisInsideOnerror is window
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-08-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-08-expected.txt
index abceaf7..ed7bc5b 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-08-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-08-expected.txt
@@ -6,4 +6,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This tests that when 'window.onerror' handler is called, 'window.event' is the corresponding ErrorEvent object.
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-09-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-09-expected.txt
index c28c5a9..3eef4617 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-09-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-09-expected.txt
@@ -2,12 +2,12 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "[object Event]" at undefined (Line: undefined, Column: undefined)
 No stack trace.
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-10-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-10-expected.txt
index b2d3004..c365e32 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-10-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-10-expected.txt
@@ -2,28 +2,32 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught Error: Inline exception." at onerror-test.js (Line: 6, Column: 5)
 Stack Trace:
 Error: Inline exception.
     at throwException onerror-test.js:6:11
     at window-onerror-10.html:22:9
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught Error: exception in onload" at onerror-test.js (Line: 6, Column: 5)
 Stack Trace:
 Error: exception in onload
     at throwException onerror-test.js:6:11
     at onload window-onerror-10.html:11:205
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught Error: exception in setTimeout" at onerror-test.js (Line: 6, Column: 5)
 Stack Trace:
 Error: exception in setTimeout
     at throwException onerror-test.js:6:11
     at window-onerror-10.html:11:155
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-11-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-11-expected.txt
index 58e6b91..96ccc76 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-11-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-11-expected.txt
@@ -2,29 +2,35 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught SyntaxError: Unexpected token %" at window-onerror-11.html (Line: 11, Column: 25)
 Stack Trace:
 SyntaxError: Unexpected token %
     at window-onerror-11.html:31:24
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught SyntaxError: Unexpected token %" at window-onerror-11.html (Line: 33, Column: 14)
 Stack Trace:
 SyntaxError: Unexpected token %
     at window-onerror-11.html:31:24
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught SyntaxError: Unexpected token %" at window-onerror-11.html (Line: 33, Column: 14)
 Stack Trace:
 SyntaxError: Unexpected token %
     at window-onerror-11.html:31:24
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
-Button.  Button 2 Button 3
+
+Button. Button 2 Button 3
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-12-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-12-expected.txt
index 48a3ac9d..b2822ea2 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-12-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-12-expected.txt
@@ -5,32 +5,38 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught TypeError: Cannot read property 'mu' of null" at window-onerror-12.html (Line: 12, Column: 38)
 Stack Trace:
 TypeError: Cannot read property 'mu' of null
     at HTMLButtonElement.onclick window-onerror-12.html:12:38
     at window-onerror-12.html:33:24
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught TypeError: Cannot read property 'mu' of null" at window-onerror-12.html (Line: 35, Column: 19)
 Stack Trace:
 TypeError: Cannot read property 'mu' of null
     at HTMLButtonElement.onclick window-onerror-12.html:35:19
     at window-onerror-12.html:33:24
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught TypeError: Cannot read property 'mu' of null" at window-onerror-12.html (Line: 35, Column: 19)
 Stack Trace:
 TypeError: Cannot read property 'mu' of null
     at HTMLButtonElement.onclick window-onerror-12.html:35:19
     at window-onerror-12.html:33:24
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
-Button.  Button 2 Button 3
+
+Button. Button 2 Button 3
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt
index 6cf2e998..131e1d00 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-isolatedworld-01-expected.txt
@@ -5,57 +5,68 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 window.onerror: "Uncaught Error: Error in main world inline script." at window-onerror-isolatedworld-01.html (Line: 49, Column: 13)
 Stack Trace:
 Error: Error in main world inline script.
     at exceptions window-onerror-isolatedworld-01.html:49:19
     at window-onerror-isolatedworld-01.html:55:9
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 Handling 'error' event (phase 2): "Uncaught Error: Error in main world inline script." at window-onerror-isolatedworld-01.html:49
 Stack Trace:
 Error: Error in main world inline script.
     at exceptions window-onerror-isolatedworld-01.html:49:19
     at window-onerror-isolatedworld-01.html:55:9
+
 PASS eventPassedToTheErrorListener is window.event
 PASS eventCurrentTarget is window
 Calling e.preventDefault(): the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught Error: Error in main world load handler." at window-onerror-isolatedworld-01.html (Line: 46, Column: 17)
 Stack Trace:
 Error: Error in main world load handler.
     at window-onerror-isolatedworld-01.html:46:23
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 Handling 'error' event (phase 2): "Uncaught Error: Error in main world load handler." at window-onerror-isolatedworld-01.html:46
 Stack Trace:
 Error: Error in main world load handler.
     at window-onerror-isolatedworld-01.html:46:23
+
 PASS eventPassedToTheErrorListener is window.event
 PASS eventCurrentTarget is window
 Calling e.preventDefault(): the error should not be reported in the console as an unhandled exception.
 
 
+
 window.onerror: "Uncaught Error: Error in main world setTimeout callback." at window-onerror-isolatedworld-01.html (Line: 44, Column: 21)
 Stack Trace:
 Error: Error in main world setTimeout callback.
     at window-onerror-isolatedworld-01.html:44:27
+
 Returning 'true': the error should not be reported in the console as an unhandled exception.
 
 
+
 Handling 'error' event (phase 2): "Uncaught Error: Error in main world setTimeout callback." at window-onerror-isolatedworld-01.html:44
 Stack Trace:
 Error: Error in main world setTimeout callback.
     at window-onerror-isolatedworld-01.html:44:27
+
 PASS eventPassedToTheErrorListener is window.event
 PASS eventCurrentTarget is window
 Calling e.preventDefault(): the error should not be reported in the console as an unhandled exception.
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/events/window-onerror-sandbox-01-expected.txt b/third_party/WebKit/LayoutTests/fast/events/window-onerror-sandbox-01-expected.txt
index d114ce76..189561df 100644
--- a/third_party/WebKit/LayoutTests/fast/events/window-onerror-sandbox-01-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/window-onerror-sandbox-01-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS message is "Uncaught ReferenceError: hahaha_good_luck_finding_me is not defined"
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/events/zoom-dblclick-expected.txt b/third_party/WebKit/LayoutTests/fast/events/zoom-dblclick-expected.txt
index 5c39dd37..5db9a801 100644
--- a/third_party/WebKit/LayoutTests/fast/events/zoom-dblclick-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/events/zoom-dblclick-expected.txt
@@ -1,5 +1,6 @@
 
 
+
 Zoomed
 PASS event.clientX is 166
 PASS event.clientY is 83
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/bracket-in-tag-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/bracket-in-tag-expected.txt
deleted file mode 100644
index b67629f3..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/bracket-in-tag-expected.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-PASS: windows-1252
-This test baselines charset sniffer behavior where the opening bracket inside a tag is consumed as part of the tag data, causing the meta tag to be missed.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/anchor-empty-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/anchor-empty-focus-expected.txt
deleted file mode 100644
index e3806784..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/anchor-empty-focus-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-This tests that focus() and sequential focus navigation work on empty anchors.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.activeElement is emptyAnchor1
-PASS document.activeElement is emptyAnchor2
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
deleted file mode 100644
index 76216aa..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451)
-To do the test manually you have to try triggering the autoscroll by starting the dragging from within the blue iframe. If the autoscroll occurs the text has passed, if the autoscroll isn't working, the test has failed
-nb: Knowing that the iframe document has an overflow: hidden on its body but the whole iframe is embedded in a scrollable div, the scrollable div has to be able to trigger the autoscroll
-Though you should be able to write some long text in the input and to trigger the autoscroll within the input.
-PASSED : the autoscroll has worked !
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/autoscroll-with-non-scrollable-parent-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
deleted file mode 100644
index dc4a767..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-rdar://problem/6049803
-To do the test manually you have to try triggering the autoscroll by starting the dragging from within the text field. If the autoscroll occurs the text has FAILED since the containing iframe has scrolling=no else it has PASSED.
-Though you should be able to write some long text in the input and to trigger the autoscroll within the input.
-PASSED
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/change-frame-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/change-frame-focus-expected.txt
deleted file mode 100644
index 2a1827f..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/change-frame-focus-expected.txt
+++ /dev/null
@@ -1,55 +0,0 @@
- 
-Test the focus controller working properly when switching focused frame. Here are the cases tested:
-
--. Correct frame is focused when switching focus from one frame to another:
-1. main frame -> iframe
-2. iframe to main frame
-3. iframe 1 to iframe 2
-
--. New setting focus request will be ignored if the focus controller is in the middle of switching focused frame (onblur, onfocus events):
-1. iframe 1 onblur sets iframe 2 focus.
-2. iframe 1 onblur sets iframe 1 focus.
-3. iframe 1 onfocus sets iframe 2 focus.
-4. iframe 1 onfocus sets iframe 1 focus.
-
-
-Test: main frame to iframe.
-main frame blurred.
-iframe1 focused.
-
-Test: iframe to main frame.
-iframe1 blurred.
-main frame focused.
-
-Test: iframe1 to iframe2.
-main frame blurred.
-iframe1 focused.
-iframe1 blurred.
-iframe2 focused.
-iframe2 blurred.
-iframe1 focused.
-
-Test: iframe1 onblur sets iframe2 focus.
-iframe1 blurred.
-main frame focused.
-main frame blurred.
-iframe1 focused.
-iframe1 blurred.
-main frame focused.
-
-Test: iframe1 onblur sets iframe1 focus.
-main frame blurred.
-iframe1 focused.
-iframe1 blurred.
-main frame focused.
-
-Test: iframe1 onfocus sets iframe2 focus.
-main frame blurred.
-iframe1 focused.
-
-Test: iframe1 onfocus sets iframe1 focus.
-iframe1 blurred.
-main frame focused.
-main frame blurred.
-iframe1 focused.
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt
deleted file mode 100644
index 58761036..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/check-defocus-event-order-when-triggered-by-mouse-click-expected.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-This test checks that when a user focuses on the "first input" text field, modifies its contents, and then defocuses it by clicking on the "second input" text field that the following DOM events are fired in order: Focus, Change, Blur, Focus (on "second input"), Click (on "second input"). Note, this test must be run by Dump Render Tree.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
- 
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS fired event is (firstInput, focus).
-PASS fired event is (firstInput, change).
-PASS fired event is (firstInput, blur).
-PASS fired event is (secondInput, focus).
-PASS fired event is (secondInput, click).
-
-TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt
deleted file mode 100644
index 28d4807..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/check-defocus-event-order-when-triggered-by-tab-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-This test checks that when a user focuses on the "first input" text field, modifies its contents, and then defocuses it by pressing the tab key that the following DOM events are fired in order: Focus, Change, Blur, Focus (on "second input"). Note, this test must be run by Dump Render Tree.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
- 
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS fired event is (firstInput, focus).
-PASS fired event is (firstInput, change).
-PASS fired event is (firstInput, blur).
-PASS fired event is (secondInput, focus).
-
-TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/frame-programmatic-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/frame-programmatic-focus-expected.txt
deleted file mode 100644
index ba1117d4..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/frame-programmatic-focus-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
- 
-This page tests that frames receive focus events when one of their child elements is programmatically focused, and receive blur events when an element not in that frame is programmatically focused.
-
-<input> focused
-<input> blurred
-main frame blurred
-iframe focused
-<input> in iframe focused
-<input> in iframe blurred
-iframe blurred
-main frame focused
-<input> focused
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/iframe-object-onload-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/iframe-object-onload-expected.txt
deleted file mode 100644
index 257575cb..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/iframe-object-onload-expected.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-This test checks that onload events fire on iframe and object elements when their contents finish loading, and that these are separate event objects from those that fire on the body inside the frame. If it passes, you will see 6 blocks below, each with a three-line message that ends in false.
-Fired load event on body inside iframe
-Fired event on iframe even though default was prevented
-Outer event same as inner: false
-------
-Fired load event on body inside iframe
-Fired event on iframe
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object even though default was prevented
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object even though propagation was stopped
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object even though propagation was stopped
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object
-Outer event same as inner: false
-------
-     
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keydown-keypress-focus-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keydown-keypress-focus-change-expected.txt
deleted file mode 100644
index 47e3157c..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keydown-keypress-focus-change-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests that when the keydown event changes focus, the keypress event will go to the new focused node.
-To run this test manually, type a character in the first field.
- 
-Test Passed
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keydown-keypress-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keydown-keypress-preventDefault-expected.txt
deleted file mode 100644
index dcf1b8d4..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keydown-keypress-preventDefault-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This tests that preventing the default behavior for a keydown event will prevent the keypress event from firing, and will prevent text from being inserted.
-This matches IE7, but not Firefox, which still dispatches a keypress.
-
-key down
-key down
-key down
-key down
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keypress-focus-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keypress-focus-change-expected.txt
deleted file mode 100644
index 9336021..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/keypress-focus-change-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This tests that when the keyPress event handler changes focus to a new form field,
-that the key will not be inserted in the original field that was the target of the event.
-Note: Edge will not inserted. Firefox and WebKit will insert.  
-Test Passed
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/media-element-focus-tab-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/media-element-focus-tab-expected.txt
deleted file mode 100644
index 421c122..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/media-element-focus-tab-expected.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-This tests that a media element ie: <Audio> or <video>, without tabindex can be selected with keyboard (TAB Key)
-
-SUCCESS: Tab-Key did tab to the Media Element (video1). TEST: WithTabIndexVideo.
-SUCCESS: Tab-Key did tab to the Media Element (video2). TEST: WithoutTabIndexVideo.
-SUCCESS: Tab-Key did tab to the Media Element (video3). TEST: WithoutControlsButWithTabIndexVideo.
-SUCCESS: Tab-Key did tab to the Media Element (audio1). TEST: WithoutTabIndexAudio.
-SUCCESS: Tab-Key did not tab to the Media Element (audio2). TEST: WithoutControlaAndTabIndexAudio.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/mousemove-after-drag-over-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
deleted file mode 100644
index 1af7814..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests that we continue to get mouse events after dragging past a scrollbar.
-Start a drag in this square, and drag past the scrollbar to the green square. Start a drag in this square, and drag past the scrollbar to the green square. 
-
-Test Succeeded!
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/mouseover-mouseout-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/mouseover-mouseout-expected.txt
deleted file mode 100644
index 7e257606..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/mouseover-mouseout-expected.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-Tests for bugs 3439, 5764, 7701 - Mouse events vs. DOM manipulation.
-
-Move the mouse pointer from left to right:
-
-1              1              2345
-Log
-mouseover on t1_1
-mouseout on t1_1
-mouseover on t1_2
-mouseout on t1_2
-mouseover on t2_1
-mouseout on t2_1
-mouseover on t2_2
-mouseout on t2_2
-mouseover on t3_1
-mouseover on t3_2
-mouseout on t3_2
-mouseover on t4_1
-mouseover on t4_2
-mouseout on t4_2
-mouseover on t5_1
-mouseover on t5_2
-mouseout on t5_2
-mouseover on frame6
-mouseover on t6
-mouseout on t6
-mouseout on frame6
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/onblur-remove-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/onblur-remove-expected.txt
deleted file mode 100644
index 84c596e..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/onblur-remove-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-This tests that elements shouldn't emit any onblur events when they are being removed from the document.
-Note, this test is expected to fail as of 04/25/2011. See bug #59379.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-FAIL Onblur handler called.
-
-TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/scroll-after-click-on-tab-index-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/scroll-after-click-on-tab-index-expected.txt
deleted file mode 100644
index 9daa358..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/scroll-after-click-on-tab-index-expected.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-ALERT: Scroll position 0
-Click the text below and then try to scroll.
-Scroll position is more than 0
-PASS document.scrollingElement.scrollTop > 0 became true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
-
-
-
-
-
-
-
-
-
-My span
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
deleted file mode 100644
index ba92854..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Link to Bottom of the page
-https://bugs.webkit.org/show_bug.cgi?id=20270
-This test verifies that a anchor link overrides the overflow:hidden attribute by scrolling somewhere on a page.
-To do the test manually you have to click on the anchor link above. If the scroll occurs to the bottom of the page : the test has PASSED.
-If you stay here after the click, the test has failed.
-
-
-
-Automated test : PASSED
-Bottom of the page Manual Test : PASSED
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/select-element-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/select-element-expected.txt
deleted file mode 100644
index 3e3724b..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/select-element-expected.txt
+++ /dev/null
@@ -1,118 +0,0 @@
-This test verifies that the Home/End/PageUp/PageDown keys work correctly for <select> elements. Since it requires eventSender.keyDown, it will not run solo in the web browser; it must be run with run_web_tests.py.
-
-  
-PASS sendKeyAndExpectIndex("ss", "PageDown", 0, 3) is true
-PASS sendKeyAndExpectIndex("ss", "PageDown", 1, 4) is true
-PASS sendKeyAndExpectIndex("ss", "PageDown", 2, 5) is true
-PASS sendKeyAndExpectIndex("ss", "PageDown", 3, 6) is true
-PASS sendKeyAndExpectIndex("ss", "PageDown", 4, 6) is true
-PASS sendKeyAndExpectIndex("ss", "PageDown", 5, 6) is true
-PASS sendKeyAndExpectIndex("ss", "PageDown", 6, 6) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 6, 3) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 5, 2) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 4, 1) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 3, 0) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 2, 0) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 1, 0) is true
-PASS sendKeyAndExpectIndex("ss", "PageUp", 0, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 6, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 5, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 4, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 3, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 2, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 1, 0) is true
-PASS sendKeyAndExpectIndex("ss", "Home", 0, 0) is true
-PASS sendKeyAndExpectIndex("ss", "End", 6, 6) is true
-PASS sendKeyAndExpectIndex("ss", "End", 5, 6) is true
-PASS sendKeyAndExpectIndex("ss", "End", 4, 6) is true
-PASS sendKeyAndExpectIndex("ss", "End", 3, 6) is true
-PASS sendKeyAndExpectIndex("ss", "End", 2, 6) is true
-PASS sendKeyAndExpectIndex("ss", "End", 1, 6) is true
-PASS sendKeyAndExpectIndex("ss", "End", 0, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 0, 4) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 1, 4) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 2, 5) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 4, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 5, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 6, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "PageDown", 7, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 7, 4) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 6, 2) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 5, 2) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 4, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 2, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 1, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "PageUp", 0, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 7, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 6, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 5, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 4, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 3, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 2, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 1, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "Home", 0, 1) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 7, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 6, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 5, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 4, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 3, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 2, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 1, 6) is true
-PASS sendKeyAndExpectIndex("ssd", "End", 0, 6) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageDown", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageDown", [0, 1, 2, 3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageDown", [0, 1, 2, 3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [0]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [0]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "End", [0, 1, 2, 3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "End", [0, 1, 2, 3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "Home", [0]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "Home", [0]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageDown", [3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageDown", [3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "PageUp", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "End", [3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "End", [3, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "Home", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ss", "Home", [0, 1, 2, 3]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageDown", [1, 2, 4]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageDown", [1, 2, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageDown", [1, 2, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageUp", [1, 2]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageUp", [1]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageUp", [1]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "End", [1, 2, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "End", [1, 2, 4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "Home", [1]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "Home", [1]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageDown", [4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageDown", [4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageUp", [2, 4]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageUp", [1, 2, 4]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "PageUp", [1, 2, 4]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "End", [4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "End", [4, 5, 6]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "Home", [1, 2, 4]) is true
-PASS sendWithShiftKeyAndExpectIndices("ssd", "Home", [1, 2, 4]) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 0, 3) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 1, 3) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 2, 4) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 3, 5) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 4, 6) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 5, 6) is true
-PASS sendKeyAndExpectIndex("ssg", "PageDown", 6, 6) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 6, 4) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 5, 3) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 4, 2) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 3, 1) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 2, 0) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 1, 0) is true
-PASS sendKeyAndExpectIndex("ssg", "PageUp", 0, 0) is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/submit-reset-nested-bubble-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/submit-reset-nested-bubble-expected.txt
deleted file mode 100644
index f045cb77..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/submit-reset-nested-bubble-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-This tests that we stop propagation when bubbling a submit or reset event to more than one form. This matches Firefox behavior
-This can only occur when misnested tags cause forms to be nested.
-
-You can manually test the submit event, but this automated test will only test the reset event.
-
- 
-window reset capture
-outer_form reset capture
-div reset capture
-inner_form reset target
-inner_form reset target
-div reset bubble
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/tab-imagemap-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/tab-imagemap-expected.txt
deleted file mode 100644
index 16e09aa..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/tab-imagemap-expected.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-This tests that links in a image map are able to be reached through keyboard access and tabbing.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.activeElement.id is 'area1'
-PASS document.activeElement.id is 'area2'
-PASS document.activeElement.id is 'area3'
-PASS document.activeElement.id is 'area5'
-PASS document.activeElement.id is 'area6'
-PASS document.activeElement.id == 'area1' || document.activeElement.id == 'body' is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
deleted file mode 100644
index ffa4441..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-
-The test succeeds if this does not hang or crash when getting the y conner's position from inline renderer. This test passes if it does not timeout.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/touch/touch-fractional-coordinates-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/touch/touch-fractional-coordinates-expected.txt
deleted file mode 100644
index 29af735..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/touch/touch-fractional-coordinates-expected.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-Tests non-integer TouchEvent co-ordinates and radii
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-  
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Testing simple fractional touch
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 30.33
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 30.33
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 33.33
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 14.5
-PASS lastEvent.changedTouches[0].radiusX is within 0.00001 of 5.2
-PASS lastEvent.changedTouches[0].radiusY is within 0.00001 of 6.3
-
-Testing fractional touch inside simple iframe
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 11.5
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 92.2
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 2.2
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 2.2
-
-Testing fractional touch inside rotated iframe
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 115.5
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 92.2
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 95.5
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 97.8
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 95.5
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 97.8
-
-Testing fractional touch inside scaled iframe
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 244.5
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 97.2
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 2.25
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 1.1
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 2.25
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 1.1
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-bubble-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-bubble-expected.txt
deleted file mode 100644
index 2b3df70e..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-bubble-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-Test that stopPropagation() will not allow window events to bubble.Clicking on this should not fire window.onclick. This matches our old behavior and Firefox behavior.stopPropagation called. Test Passed.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-bubble2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-bubble2-expected.txt
deleted file mode 100644
index bda508c..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-bubble2-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-Tests that preventDefault() will still allow window events to bubble.Clicking here should fire window.onclick. This will match Firefox behavior.Window.onClick fired. Test Passed.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-capture-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-capture-expected.txt
deleted file mode 100644
index 5cbf6d2..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-events-capture-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests that window events will fire in the capture phase.Click here
-Capture: Window.onClick is called
-stopPropagation called.
-Default behavior for link
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-onerror-11-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-onerror-11-expected.txt
deleted file mode 100644
index 67d8880..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-onerror-11-expected.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-This test should trigger 'window.onerror' for the syntax error in the attribute handler, regardless of how it's set.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-window.onerror: "Uncaught SyntaxError: Unexpected token %" at window-onerror-11.html (Line: 11, Column: 25)
-Stack Trace:
-SyntaxError: Unexpected token %
-    at window-onerror-11.html:31:24
-Returning 'true': the error should not be reported in the console as an unhandled exception.
-
-
-window.onerror: "Uncaught SyntaxError: Unexpected token %" at window-onerror-11.html (Line: 33, Column: 14)
-Stack Trace:
-SyntaxError: Unexpected token %
-    at window-onerror-11.html:31:24
-Returning 'true': the error should not be reported in the console as an unhandled exception.
-
-
-window.onerror: "Uncaught SyntaxError: Unexpected token %" at window-onerror-11.html (Line: 33, Column: 14)
-Stack Trace:
-SyntaxError: Unexpected token %
-    at window-onerror-11.html:31:24
-Returning 'true': the error should not be reported in the console as an unhandled exception.
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Button. Button 2 Button 3
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-onerror-12-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-onerror-12-expected.txt
deleted file mode 100644
index 705692d..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/events/window-onerror-12-expected.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-CONSOLE MESSAGE: line 17: 1
-CONSOLE MESSAGE: line 17: 2
-CONSOLE MESSAGE: line 17: 3
-This test should trigger 'window.onerror' for the exception in the attribute handler, regardless of how it's set.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-window.onerror: "Uncaught TypeError: Cannot read property 'mu' of null" at window-onerror-12.html (Line: 12, Column: 38)
-Stack Trace:
-TypeError: Cannot read property 'mu' of null
-    at HTMLButtonElement.onclick window-onerror-12.html:12:38
-    at window-onerror-12.html:33:24
-Returning 'true': the error should not be reported in the console as an unhandled exception.
-
-
-window.onerror: "Uncaught TypeError: Cannot read property 'mu' of null" at window-onerror-12.html (Line: 35, Column: 19)
-Stack Trace:
-TypeError: Cannot read property 'mu' of null
-    at HTMLButtonElement.onclick window-onerror-12.html:35:19
-    at window-onerror-12.html:33:24
-Returning 'true': the error should not be reported in the console as an unhandled exception.
-
-
-window.onerror: "Uncaught TypeError: Cannot read property 'mu' of null" at window-onerror-12.html (Line: 35, Column: 19)
-Stack Trace:
-TypeError: Cannot read property 'mu' of null
-    at HTMLButtonElement.onclick window-onerror-12.html:35:19
-    at window-onerror-12.html:33:24
-Returning 'true': the error should not be reported in the console as an unhandled exception.
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Button. Button 2 Button 3
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/access-key-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/access-key-expected.txt
index 4d5c15d..b692d9f 100644
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/access-key-expected.txt
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/access-key-expected.txt
@@ -18,7 +18,6 @@
 6 input type reset focussed
 6 input type reset clicked
 7 link clicked
-8 input type associated to legend focussed
 9 input type associated to label around input focussed
 a input type associated to label closed before input focussed
 b area 1 clicked
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-input-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-input-expected.txt
index 697e1406..9edb7ee9 100644
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-input-expected.txt
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-input-expected.txt
@@ -6,8 +6,6 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 <input type="text"> focus selection
 This test checks whether the selection is restored, cleared, or set to the full range when using different ways to focus a text field. These results all match Mozilla, except test 6, which selects the whole field contents to match all other cases of keyboard focus. When running manually, please follow the steps below. In the test harness, the test runs automatically.
 
@@ -18,9 +16,9 @@
 5) Click this label, only the word "SUCCESS" should be selected: 
 6) Hit Ctrl-Option-U (or Alt-U on Windows), the whole phrase "SUCCESS and SUCCESS" should be selected: 
 7) , only the word "SUCCESS" should be selected: 
-8) , the whole phrase "SUCCESS and SUCCESS" should be selected:
+8) , only the word "SUCCESS" should be selected:
 
-9)Hit Ctrl-Option-I (or Alt-I on Windows), the whole phrase "SUCCESS and SUCCESS" should be selected:
+9)Hit Ctrl-Option-I (or Alt-I on Windows), only the word "SUCCESS" should be selected:
 
 PASS successfullyParsed is true
 
@@ -53,11 +51,11 @@
 PASS seventh.selectionEnd is 18
 PASS seventh.selectionStart is 11
 PASS seventh.selectionEnd is 18
-PASS eighth.selectionStart is 12
-PASS eighth.selectionEnd is 19
-PASS eighth.selectionStart is 0
-PASS eighth.selectionEnd is 19
-PASS ninth.selectionStart is 12
-PASS ninth.selectionEnd is 19
-PASS ninth.selectionStart is 0
-PASS ninth.selectionEnd is 19
+PASS eighth.selectionStart is 11
+PASS eighth.selectionEnd is 18
+PASS eighth.selectionStart is 11
+PASS eighth.selectionEnd is 18
+PASS ninth.selectionStart is 11
+PASS ninth.selectionEnd is 18
+PASS ninth.selectionStart is 11
+PASS ninth.selectionEnd is 18
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-textarea-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-textarea-expected.txt
index 47fe16b9..1f05694c 100644
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-textarea-expected.txt
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/focus-selection-textarea-expected.txt
@@ -6,8 +6,6 @@
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
-EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 <textarea> focus selection
 This test checks whether the selection is restored, cleared, or set to the full range when using different ways to focus a text area. These results all match Mozilla. When running manually, please follow the steps below. In the test harness, the test runs automatically.
 
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/anchor-empty-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/anchor-empty-focus-expected.txt
deleted file mode 100644
index e3806784..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/anchor-empty-focus-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-This tests that focus() and sequential focus navigation work on empty anchors.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.activeElement is emptyAnchor1
-PASS document.activeElement is emptyAnchor2
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
deleted file mode 100644
index 76216aa..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-rdar://problem/6166435 Inspector doesn't auto scroll when selecting text (20451)
-To do the test manually you have to try triggering the autoscroll by starting the dragging from within the blue iframe. If the autoscroll occurs the text has passed, if the autoscroll isn't working, the test has failed
-nb: Knowing that the iframe document has an overflow: hidden on its body but the whole iframe is embedded in a scrollable div, the scrollable div has to be able to trigger the autoscroll
-Though you should be able to write some long text in the input and to trigger the autoscroll within the input.
-PASSED : the autoscroll has worked !
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/autoscroll-with-non-scrollable-parent-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
deleted file mode 100644
index dc4a767..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/autoscroll-with-non-scrollable-parent-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-rdar://problem/6049803
-To do the test manually you have to try triggering the autoscroll by starting the dragging from within the text field. If the autoscroll occurs the text has FAILED since the containing iframe has scrolling=no else it has PASSED.
-Though you should be able to write some long text in the input and to trigger the autoscroll within the input.
-PASSED
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/change-frame-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/change-frame-focus-expected.txt
deleted file mode 100644
index 2a1827f..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/change-frame-focus-expected.txt
+++ /dev/null
@@ -1,55 +0,0 @@
- 
-Test the focus controller working properly when switching focused frame. Here are the cases tested:
-
--. Correct frame is focused when switching focus from one frame to another:
-1. main frame -> iframe
-2. iframe to main frame
-3. iframe 1 to iframe 2
-
--. New setting focus request will be ignored if the focus controller is in the middle of switching focused frame (onblur, onfocus events):
-1. iframe 1 onblur sets iframe 2 focus.
-2. iframe 1 onblur sets iframe 1 focus.
-3. iframe 1 onfocus sets iframe 2 focus.
-4. iframe 1 onfocus sets iframe 1 focus.
-
-
-Test: main frame to iframe.
-main frame blurred.
-iframe1 focused.
-
-Test: iframe to main frame.
-iframe1 blurred.
-main frame focused.
-
-Test: iframe1 to iframe2.
-main frame blurred.
-iframe1 focused.
-iframe1 blurred.
-iframe2 focused.
-iframe2 blurred.
-iframe1 focused.
-
-Test: iframe1 onblur sets iframe2 focus.
-iframe1 blurred.
-main frame focused.
-main frame blurred.
-iframe1 focused.
-iframe1 blurred.
-main frame focused.
-
-Test: iframe1 onblur sets iframe1 focus.
-main frame blurred.
-iframe1 focused.
-iframe1 blurred.
-main frame focused.
-
-Test: iframe1 onfocus sets iframe2 focus.
-main frame blurred.
-iframe1 focused.
-
-Test: iframe1 onfocus sets iframe1 focus.
-iframe1 blurred.
-main frame focused.
-main frame blurred.
-iframe1 focused.
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/drag-selects-image-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/drag-selects-image-expected.txt
deleted file mode 100644
index cecab69..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/drag-selects-image-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-Non-editable area
-
-Editable area
-
-This tests that images are properly left selected or unselected when an image drag is started. Only the image in the editable area should be selected when an image drag is started.
-
-Starting test...
-0 range(s) selected
-Dragging image in non-editable area...
-0 range(s) selected
-Dragging image in editable area...
-1 range(s) selected
-imageTwo is selected
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/frame-programmatic-focus-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/frame-programmatic-focus-expected.txt
deleted file mode 100644
index ba1117d4..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/frame-programmatic-focus-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
- 
-This page tests that frames receive focus events when one of their child elements is programmatically focused, and receive blur events when an element not in that frame is programmatically focused.
-
-<input> focused
-<input> blurred
-main frame blurred
-iframe focused
-<input> in iframe focused
-<input> in iframe blurred
-iframe blurred
-main frame focused
-<input> focused
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/iframe-object-onload-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/iframe-object-onload-expected.txt
deleted file mode 100644
index 257575cb..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/iframe-object-onload-expected.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-This test checks that onload events fire on iframe and object elements when their contents finish loading, and that these are separate event objects from those that fire on the body inside the frame. If it passes, you will see 6 blocks below, each with a three-line message that ends in false.
-Fired load event on body inside iframe
-Fired event on iframe even though default was prevented
-Outer event same as inner: false
-------
-Fired load event on body inside iframe
-Fired event on iframe
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object even though default was prevented
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object even though propagation was stopped
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object even though propagation was stopped
-Outer event same as inner: false
-------
-Fired load event on body inside object
-Fired event on object
-Outer event same as inner: false
-------
-     
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keydown-keypress-focus-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keydown-keypress-focus-change-expected.txt
deleted file mode 100644
index 47e3157c..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keydown-keypress-focus-change-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests that when the keydown event changes focus, the keypress event will go to the new focused node.
-To run this test manually, type a character in the first field.
- 
-Test Passed
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keydown-keypress-preventDefault-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keydown-keypress-preventDefault-expected.txt
deleted file mode 100644
index dcf1b8d4..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keydown-keypress-preventDefault-expected.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-This tests that preventing the default behavior for a keydown event will prevent the keypress event from firing, and will prevent text from being inserted.
-This matches IE7, but not Firefox, which still dispatches a keypress.
-
-key down
-key down
-key down
-key down
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keypress-focus-change-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keypress-focus-change-expected.txt
deleted file mode 100644
index 9336021..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/keypress-focus-change-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This tests that when the keyPress event handler changes focus to a new form field,
-that the key will not be inserted in the original field that was the target of the event.
-Note: Edge will not inserted. Firefox and WebKit will insert.  
-Test Passed
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/media-element-focus-tab-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/media-element-focus-tab-expected.txt
deleted file mode 100644
index 421c122..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/media-element-focus-tab-expected.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-This tests that a media element ie: <Audio> or <video>, without tabindex can be selected with keyboard (TAB Key)
-
-SUCCESS: Tab-Key did tab to the Media Element (video1). TEST: WithTabIndexVideo.
-SUCCESS: Tab-Key did tab to the Media Element (video2). TEST: WithoutTabIndexVideo.
-SUCCESS: Tab-Key did tab to the Media Element (video3). TEST: WithoutControlsButWithTabIndexVideo.
-SUCCESS: Tab-Key did tab to the Media Element (audio1). TEST: WithoutTabIndexAudio.
-SUCCESS: Tab-Key did not tab to the Media Element (audio2). TEST: WithoutControlaAndTabIndexAudio.
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/mousemove-after-drag-over-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
deleted file mode 100644
index 1af7814..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/mousemove-after-drag-over-scrollbar-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests that we continue to get mouse events after dragging past a scrollbar.
-Start a drag in this square, and drag past the scrollbar to the green square. Start a drag in this square, and drag past the scrollbar to the green square. 
-
-Test Succeeded!
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/mouseover-mouseout-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/mouseover-mouseout-expected.txt
deleted file mode 100644
index 7e257606..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/mouseover-mouseout-expected.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-Tests for bugs 3439, 5764, 7701 - Mouse events vs. DOM manipulation.
-
-Move the mouse pointer from left to right:
-
-1              1              2345
-Log
-mouseover on t1_1
-mouseout on t1_1
-mouseover on t1_2
-mouseout on t1_2
-mouseover on t2_1
-mouseout on t2_1
-mouseover on t2_2
-mouseout on t2_2
-mouseover on t3_1
-mouseover on t3_2
-mouseout on t3_2
-mouseover on t4_1
-mouseover on t4_2
-mouseout on t4_2
-mouseover on t5_1
-mouseover on t5_2
-mouseout on t5_2
-mouseover on frame6
-mouseover on t6
-mouseout on t6
-mouseout on frame6
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/scroll-after-click-on-tab-index-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/scroll-after-click-on-tab-index-expected.txt
deleted file mode 100644
index 9daa358..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/scroll-after-click-on-tab-index-expected.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-ALERT: Scroll position 0
-Click the text below and then try to scroll.
-Scroll position is more than 0
-PASS document.scrollingElement.scrollTop > 0 became true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
-
-
-
-
-
-
-
-
-
-My span
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
deleted file mode 100644
index ba92854..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/scroll-to-anchor-in-overflow-hidden-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Link to Bottom of the page
-https://bugs.webkit.org/show_bug.cgi?id=20270
-This test verifies that a anchor link overrides the overflow:hidden attribute by scrolling somewhere on a page.
-To do the test manually you have to click on the anchor link above. If the scroll occurs to the bottom of the page : the test has PASSED.
-If you stay here after the click, the test has failed.
-
-
-
-Automated test : PASSED
-Bottom of the page Manual Test : PASSED
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/submit-reset-nested-bubble-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/submit-reset-nested-bubble-expected.txt
deleted file mode 100644
index f045cb77..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/submit-reset-nested-bubble-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-This tests that we stop propagation when bubbling a submit or reset event to more than one form. This matches Firefox behavior
-This can only occur when misnested tags cause forms to be nested.
-
-You can manually test the submit event, but this automated test will only test the reset event.
-
- 
-window reset capture
-outer_form reset capture
-div reset capture
-inner_form reset target
-inner_form reset target
-div reset bubble
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/tab-imagemap-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/tab-imagemap-expected.txt
deleted file mode 100644
index 16e09aa..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/tab-imagemap-expected.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-
-This tests that links in a image map are able to be reached through keyboard access and tabbing.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.activeElement.id is 'area1'
-PASS document.activeElement.id is 'area2'
-PASS document.activeElement.id is 'area3'
-PASS document.activeElement.id is 'area5'
-PASS document.activeElement.id is 'area6'
-PASS document.activeElement.id == 'area1' || document.activeElement.id == 'body' is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
deleted file mode 100644
index ffa4441..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-click-on-inline-continations-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-
-The test succeeds if this does not hang or crash when getting the y conner's position from inline renderer. This test passes if it does not timeout.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/touch/touch-fractional-coordinates-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/touch/touch-fractional-coordinates-expected.txt
deleted file mode 100644
index 29af735..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/touch/touch-fractional-coordinates-expected.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-Tests non-integer TouchEvent co-ordinates and radii
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-  
-PASS successfullyParsed is true
-
-TEST COMPLETE
-Testing simple fractional touch
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 30.33
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 30.33
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 33.33
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 14.5
-PASS lastEvent.changedTouches[0].radiusX is within 0.00001 of 5.2
-PASS lastEvent.changedTouches[0].radiusY is within 0.00001 of 6.3
-
-Testing fractional touch inside simple iframe
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 11.5
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 92.2
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 2.2
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 4.5
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 2.2
-
-Testing fractional touch inside rotated iframe
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 115.5
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 92.2
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 95.5
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 97.8
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 95.5
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 97.8
-
-Testing fractional touch inside scaled iframe
-PASS eventCount is 1
-PASS lastEvent.type is "touchstart"
-PASS lastEvent.changedTouches[0].screenX is within 0.00001 of 244.5
-PASS lastEvent.changedTouches[0].screenY is within 0.00001 of 97.2
-PASS lastEvent.changedTouches[0].clientX is within 0.00001 of 2.25
-PASS lastEvent.changedTouches[0].clientY is within 0.00001 of 1.1
-PASS lastEvent.changedTouches[0].pageX is within 0.00001 of 2.25
-PASS lastEvent.changedTouches[0].pageY is within 0.00001 of 1.1
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-bubble-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-bubble-expected.txt
deleted file mode 100644
index 2b3df70e..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-bubble-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-Test that stopPropagation() will not allow window events to bubble.Clicking on this should not fire window.onclick. This matches our old behavior and Firefox behavior.stopPropagation called. Test Passed.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-bubble2-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-bubble2-expected.txt
deleted file mode 100644
index bda508c..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-bubble2-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-Tests that preventDefault() will still allow window events to bubble.Clicking here should fire window.onclick. This will match Firefox behavior.Window.onClick fired. Test Passed.
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-capture-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-capture-expected.txt
deleted file mode 100644
index 5cbf6d2..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/mouseevent_fractional/fast/events/window-events-capture-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-This tests that window events will fire in the capture phase.Click here
-Capture: Window.onClick is called
-stopPropagation called.
-Default behavior for link
-
diff --git a/third_party/WebKit/LayoutTests/media/controls/click-anywhere-to-play-pause.html b/third_party/WebKit/LayoutTests/media/controls/click-anywhere-to-play-pause.html
new file mode 100644
index 0000000..6a12487
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/controls/click-anywhere-to-play-pause.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+<title>Test that the user can click anywhere to play/pause.</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../media-controls.js"></script>
+<video controls width=500 preload=none src="../content/60_sec_video.webm"></video>
+<script>
+async_test(t => {
+  const video = document.querySelector('video');
+
+  video.addEventListener('loadedmetadata', t.step_func(() => {
+    // Start playback normally.
+    singleTapOnControl(enabledPlayButton(video));
+  }), { once: true });
+
+  video.addEventListener('play', t.step_func(() => {
+    video.addEventListener('webkitfullscreenchange',
+        t.step_func(testFullscreenContinuesPlayback), { once: true });
+
+    // Double-tap to go fullscreen.
+    doubleTapAnywhere();
+  }), { once: true });
+
+  function testFullscreenContinuesPlayback() {
+    assert_equals(video, document.fullscreenElement, 'video should have gone fullscreen');
+    assert_false(video.paused, 'video should not be paused');
+
+    video.addEventListener('pause',
+        t.step_func(testSingleTapAnywherePauses), { once: true });
+
+    // Single-tap to pause.
+    singleTapAnywhere();
+  }
+
+  function testSingleTapAnywherePauses() {
+    assert_equals(video, document.fullscreenElement, 'video should remain in fullscreen');
+    assert_true(video.paused, 'video should be paused');
+
+    video.addEventListener('webkitfullscreenchange',
+        t.step_func(testFullscreenKeepsPaused), { once: true });
+
+    // Prevent these taps from being double-taps with the previous single-tap.
+    runAfterDoubleTapTimerFired(t.step_func(() => {
+      // Double-tap to exit fullscreen.
+      doubleTapAnywhere();
+    }));
+  }
+
+  function testFullscreenKeepsPaused() {
+    assert_equals(null, document.fullscreenElement, 'video should exit fullscreen');
+    assert_true(video.paused, 'video should still be paused');
+
+    video.addEventListener('playing',
+        t.step_func_done(testSingleTapAnywherePlays), { once: true });
+
+    // Single-tap to play.
+    singleTapAnywhere();
+  }
+
+  function testSingleTapAnywherePlays() {
+    assert_equals(null, document.fullscreenElement, 'video should remain out of fullscreen');
+    assert_false(video.paused, 'video should no longer be paused');
+  }
+
+  function doubleTapAnywhere() {
+    const coords = videoLeftEdgeCoordinates(video);
+    doubleTapAtCoordinates(coords[0], coords[1]);
+  }
+
+  function singleTapAnywhere() {
+    const coords = videoLeftEdgeCoordinates(video);
+    singleTapAtCoordinates(coords[0], coords[1]);
+  }
+
+  video.load();
+});
+</script>
+</html>
diff --git a/third_party/WebKit/LayoutTests/media/controls/modern/slow-doubletap.html b/third_party/WebKit/LayoutTests/media/controls/modern/slow-doubletap.html
index 9963eeef..2d4366c 100644
--- a/third_party/WebKit/LayoutTests/media/controls/modern/slow-doubletap.html
+++ b/third_party/WebKit/LayoutTests/media/controls/modern/slow-doubletap.html
@@ -13,13 +13,9 @@
     // Double tap on the left side.
     const coordinates = videoLeftEdgeCoordinates(video);
     doubleTapAtCoordinates(
-        coordinates[0], coordinates[1], 400, t.step_func_done(() => {
-      assert_false(video.paused);
-    }));
+        coordinates[0], coordinates[1], 400, t.done.bind(t));
   });
 
-  video.addEventListener('pause', t.unreached_func());
-
   video.addEventListener('webkitfullscreenchange', t.unreached_func());
 
   video.play();
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/events/constructors/midi-message-event-constructor-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/events/constructors/midi-message-event-constructor-expected.txt
index 5e399a2..65bfcb53 100644
--- a/third_party/WebKit/LayoutTests/platform/android/fast/events/constructors/midi-message-event-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/events/constructors/midi-message-event-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new MIDIMessageEvent('eventType').bubbles is false
 PASS new MIDIMessageEvent('eventType').cancelable is false
 PASS new MIDIMessageEvent('eventType').data is null
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/events/js-keyboard-event-creation-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/events/js-keyboard-event-creation-expected.txt
index 505f2f7..3bb20fd54 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/events/js-keyboard-event-creation-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/events/js-keyboard-event-creation-expected.txt
@@ -1,4 +1,5 @@
  
+
 This tests that DOMKeyboardEvents are created correctly in the JavaScript API.
 
 keydown - key: Tab@DOM_KEY_LOCATION_STANDARD (keyCode/charCode: 9/0) modifiers: false,false,false,false
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/events/mouseup-from-button2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/events/mouseup-from-button2-expected.txt
index 21491294..515cb28 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/events/mouseup-from-button2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/events/mouseup-from-button2-expected.txt
@@ -6,6 +6,7 @@
 
 Right mouse down inside the box.
 Right mouse up.
+
 box
 
 type: mousedown, button: 0, 
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/events/nested-window-event-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/events/nested-window-event-expected.txt
index d043b2b..3a83e111 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/events/nested-window-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/events/nested-window-event-expected.txt
@@ -1,2 +1,3 @@
 This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt
index 505f2f7..3bb20fd54 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt
@@ -1,4 +1,5 @@
  
+
 This tests that DOMKeyboardEvents are created correctly in the JavaScript API.
 
 keydown - key: Tab@DOM_KEY_LOCATION_STANDARD (keyCode/charCode: 9/0) modifiers: false,false,false,false
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
index d043b2b..3a83e111 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
@@ -1,2 +1,3 @@
 This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-nodrag-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-nodrag-expected.txt
index 7de7cbb..249a2c71 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-nodrag-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/events/context-nodrag-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 FAIL window.getSelection().isCollapsed should be true. Was false.
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This is a test box. ABC 123
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/events/hit-test-clip-path-reference-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/events/hit-test-clip-path-reference-expected.txt
index a4c4334..3cf28e7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/events/hit-test-clip-path-reference-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/events/hit-test-clip-path-reference-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS path contains point at (99, 238)
 PASS path contains point at (94, 233)
 PASS path contains point at (104, 243)
@@ -15,3 +15,4 @@
 PASS path does not contain point at (66, 205)
 PASS path does not contain point at (68, 207)
 
+
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt
index 70a74bb..a34d5e2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/events/menu-key-context-menu-document-pinch-zoom-expected.txt
@@ -2,9 +2,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
-Target
 
+Target
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/events/mouseup-from-button2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/events/mouseup-from-button2-expected.txt
index 21491294..515cb28 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/events/mouseup-from-button2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/events/mouseup-from-button2-expected.txt
@@ -6,6 +6,7 @@
 
 Right mouse down inside the box.
 Right mouse up.
+
 box
 
 type: mousedown, button: 0, 
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/events/hit-test-clip-path-reference-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/events/hit-test-clip-path-reference-expected.txt
index d38e48e..d259c5c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/events/hit-test-clip-path-reference-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/events/hit-test-clip-path-reference-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS path contains point at (99, 247)
 PASS path contains point at (94, 242)
 PASS path contains point at (104, 252)
@@ -15,3 +15,4 @@
 PASS path does not contain point at (66, 214)
 PASS path does not contain point at (68, 216)
 
+
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/events/mouseup-from-button2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/events/mouseup-from-button2-expected.txt
index afa6389..2e94866 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/events/mouseup-from-button2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/events/mouseup-from-button2-expected.txt
@@ -6,6 +6,7 @@
 
 Right mouse down inside the box.
 Right mouse up.
+
 box
 
 type: mousedown, button: 0, 
diff --git a/third_party/WebKit/LayoutTests/resources/accessibility-helper.js b/third_party/WebKit/LayoutTests/resources/accessibility-helper.js
index e3b18ac4..b953037 100644
--- a/third_party/WebKit/LayoutTests/resources/accessibility-helper.js
+++ b/third_party/WebKit/LayoutTests/resources/accessibility-helper.js
@@ -1,4 +1,13 @@
 function buildAccessibilityTree(accessibilityObject, indent, allAttributesRequired, rolesToIgnore, targetObject, targetString) {
+    // Progressively appending to a string is slow (https://crbug.com/900098),
+    // instead we build a list of lines and join that at the end.
+    var consoleLines = [];
+    var result = _buildAccessibilityTreeInner(accessibilityObject, indent, consoleLines, allAttributesRequired, rolesToIgnore, targetObject, targetString);
+    document.getElementById("console").innerText += consoleLines.join("");
+    return result;
+}
+
+function _buildAccessibilityTreeInner(accessibilityObject, indent, consoleLines, allAttributesRequired, rolesToIgnore, targetObject, targetString) {
     if (rolesToIgnore) {
         for (var i = 0; i < rolesToIgnore.length; i++) {
             if (accessibilityObject.role  == 'AXRole: ' + rolesToIgnore[i])
@@ -18,14 +27,14 @@
     str += targetObject && accessibilityObject.isEqual(targetObject) ? "     " + targetString : '';
     str += "\n";
 
-    document.getElementById("console").innerText += str;
+    consoleLines.push(str)
 
     if (accessibilityObject.name.indexOf('End of test') >= 0)
         return false;
 
     var count = accessibilityObject.childrenCount;
     for (var i = 0; i < count; i++) {
-        if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1, allAttributesRequired, rolesToIgnore, targetObject, targetString))
+        if (!_buildAccessibilityTreeInner(accessibilityObject.childAtIndex(i), indent + 1, consoleLines, allAttributesRequired, rolesToIgnore, targetObject, targetString))
             return false;
     }
 
@@ -37,4 +46,3 @@
     for (var i = 0; i < count; i++)
         traverseAccessibilityTree(accessibilityObject.childAtIndex(i));
 }
-
diff --git a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt
index 7fdad0e..df0cf8a 100644
--- a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/document-elementFromPoint-expected.txt
@@ -2,7 +2,9 @@
 Relative
 Fixed
 x	x
+
 Table Content
+	
 In Columns
 Transformed
 In RTL overflow
diff --git a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt
index c1fd0413..3bb20fd54 100644
--- a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/js-keyboard-event-creation-expected.txt
@@ -1,4 +1,5 @@
-  
+ 
+
 This tests that DOMKeyboardEvents are created correctly in the JavaScript API.
 
 keydown - key: Tab@DOM_KEY_LOCATION_STANDARD (keyCode/charCode: 9/0) modifiers: false,false,false,false
diff --git a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
index 9ff69c9d..3a83e111 100644
--- a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/nested-window-event-expected.txt
@@ -1,2 +1,3 @@
-This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes. 
+This tests window.event was kept the same when nested event handling was called. You should see 'PASS' if the test passes.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt
index e8e562f..df2d1f6e 100644
--- a/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/mouseevent_fractional/fast/events/offsetX-offsetY-expected.txt
@@ -3,15 +3,18 @@
 Fixed position
 First	Second
 This cell has borderTopExtra
-Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+	Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
 In columns
 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
 
 Div with transform
+
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
 
 In RTL overflow
+
 Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
 
 PASS: event hit abs-box at offset (17, 22)
diff --git a/third_party/WebKit/LayoutTests/virtual/user-activation-v2/fast/events/popup-blocking-timers4-expected.txt b/third_party/WebKit/LayoutTests/virtual/user-activation-v2/fast/events/popup-blocking-timers4-expected.txt
index 7f083e4..1653e92 100644
--- a/third_party/WebKit/LayoutTests/virtual/user-activation-v2/fast/events/popup-blocking-timers4-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/user-activation-v2/fast/events/popup-blocking-timers4-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test calling window.open() in a nested call to setTimeout(). A popup should be allowed.
 PASS newWindow is non-null.
diff --git a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/feature-policy/README.txt b/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/feature-policy/README.txt
deleted file mode 100644
index ba4315e..0000000
--- a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/feature-policy/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-This suite runs Feature Policy tests with the UseSurfaceLayerForVideo feature enabled.
diff --git a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/picture-in-picture/README.txt b/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/picture-in-picture/README.txt
deleted file mode 100644
index e808a099..0000000
--- a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/picture-in-picture/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-This suite runs Picture-in-Picture tests with the UseSurfaceLayerForVideo feature enabled.
diff --git a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/picture-in-picture/idlharness.window-expected.txt b/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/picture-in-picture/idlharness.window-expected.txt
deleted file mode 100644
index 4ccb15bb7..0000000
--- a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/external/wpt/picture-in-picture/idlharness.window-expected.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-This is a testharness.js-based test.
-PASS idl_test setup
-PASS Partial interface HTMLVideoElement: original interface defined
-PASS Partial interface Document: original interface defined
-PASS Partial interface DocumentOrShadowRoot: original interface defined
-PASS PictureInPictureWindow interface: existence and properties of interface object
-PASS PictureInPictureWindow interface object length
-PASS PictureInPictureWindow interface object name
-PASS PictureInPictureWindow interface: existence and properties of interface prototype object
-PASS PictureInPictureWindow interface: existence and properties of interface prototype object's "constructor" property
-PASS PictureInPictureWindow interface: existence and properties of interface prototype object's @@unscopables property
-PASS PictureInPictureWindow interface: attribute width
-PASS PictureInPictureWindow interface: attribute height
-PASS PictureInPictureWindow interface: attribute onresize
-PASS PictureInPictureWindow must be primary interface of pipw
-PASS Stringification of pipw
-PASS PictureInPictureWindow interface: pipw must inherit property "width" with the proper type
-PASS PictureInPictureWindow interface: pipw must inherit property "height" with the proper type
-PASS PictureInPictureWindow interface: pipw must inherit property "onresize" with the proper type
-PASS EnterPictureInPictureEvent interface: existence and properties of interface object
-PASS EnterPictureInPictureEvent interface object length
-PASS EnterPictureInPictureEvent interface object name
-PASS EnterPictureInPictureEvent interface: existence and properties of interface prototype object
-PASS EnterPictureInPictureEvent interface: existence and properties of interface prototype object's "constructor" property
-PASS EnterPictureInPictureEvent interface: existence and properties of interface prototype object's @@unscopables property
-PASS EnterPictureInPictureEvent interface: attribute pictureInPictureWindow
-PASS HTMLVideoElement interface: operation requestPictureInPicture()
-PASS HTMLVideoElement interface: attribute onenterpictureinpicture
-PASS HTMLVideoElement interface: attribute onleavepictureinpicture
-PASS HTMLVideoElement interface: attribute disablePictureInPicture
-PASS HTMLVideoElement interface: video must inherit property "requestPictureInPicture()" with the proper type
-PASS HTMLVideoElement interface: video must inherit property "onenterpictureinpicture" with the proper type
-PASS HTMLVideoElement interface: video must inherit property "onleavepictureinpicture" with the proper type
-PASS HTMLVideoElement interface: video must inherit property "disablePictureInPicture" with the proper type
-PASS DocumentOrShadowRoot interface: document must inherit property "pictureInPictureElement" with the proper type
-PASS Document interface: attribute pictureInPictureEnabled
-PASS Document interface: operation exitPictureInPicture()
-PASS Document interface: attribute pictureInPictureElement
-PASS Document interface: document must inherit property "pictureInPictureEnabled" with the proper type
-PASS Document interface: document must inherit property "exitPictureInPicture()" with the proper type
-PASS Document interface: document must inherit property "pictureInPictureElement" with the proper type
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/README.txt b/third_party/WebKit/LayoutTests/virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/README.txt
deleted file mode 100644
index c87fdcf..0000000
--- a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/README.txt
+++ /dev/null
@@ -1 +0,0 @@
-This suite runs Picture-in-Picture DevTools tests with the UseSurfaceLayerForVideo feature enabled.
diff --git a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/picture-in-picture-event-listener-breakpoints-expected.txt b/third_party/WebKit/LayoutTests/virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/picture-in-picture-event-listener-breakpoints-expected.txt
deleted file mode 100644
index a012bde..0000000
--- a/third_party/WebKit/LayoutTests/virtual/video-surface-layer/http/tests/devtools/sources/debugger-breakpoints/picture-in-picture-event-listener-breakpoints-expected.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-Tests Picture-in-Picture event listener breakpoints.
-
-
-Running: testPlayVideoEventBreakpoint
-Script execution paused.
-Call stack:
-    0) onVideoPlay (picture-in-picture-event-listener-breakpoints.js:22)
-Event target: VIDEO
-Script execution resumed.
-
-Running: testEnterPictureInPictureEventBreakpoint
-Script execution paused.
-Call stack:
-    0) onEnterPictureInPicture (picture-in-picture-event-listener-breakpoints.js:34)
-Event target: VIDEO
-Script execution resumed.
-
-Running: testLeavePictureInPictureEventBreakpoint
-Script execution paused.
-Call stack:
-    0) onLeavePictureInPicture (picture-in-picture-event-listener-breakpoints.js:46)
-Event target: VIDEO
-Script execution resumed.
-
diff --git a/third_party/blink/public/platform/mac/web_scrollbar_theme.h b/third_party/blink/public/platform/mac/web_scrollbar_theme.h
index 639e9608..9af5197c 100644
--- a/third_party/blink/public/platform/mac/web_scrollbar_theme.h
+++ b/third_party/blink/public/platform/mac/web_scrollbar_theme.h
@@ -32,14 +32,9 @@
 #define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MAC_WEB_SCROLLBAR_THEME_H_
 
 #include "third_party/blink/public/platform/web_common.h"
-#include "third_party/blink/public/platform/web_scrollbar_buttons_placement.h"
 
 namespace blink {
 
-#if INSIDE_BLINK
-class WebScrollbarThemeClient;
-#endif
-
 // This enum must match NSScrollerStyle in the 10.7 SDK.
 enum ScrollerStyle { kScrollerStyleLegacy = 0, kScrollerStyleOverlay = 1 };
 
@@ -60,18 +55,6 @@
       ScrollerStyle preferred_scroller_style,
       bool redraw,
       bool jump_on_track_click);
-
-// Registered clients will receive a callback whenever
-// UpdateScrollbarsWithNSDefaults is called.
-#if INSIDE_BLINK
-  static float InitialButtonDelay();
-  static float AutoscrollButtonDelay();
-  static ScrollerStyle PreferredScrollerStyle();
-  static bool JumpOnTrackClick();
-
-  static void RegisterClient(WebScrollbarThemeClient& client);
-  static void UnregisterClient(WebScrollbarThemeClient& client);
-#endif
 };
 
 }  // namespace blink
diff --git a/third_party/blink/public/platform/web_video_frame_submitter.h b/third_party/blink/public/platform/web_video_frame_submitter.h
index e6c71e70..94bc7a55 100644
--- a/third_party/blink/public/platform/web_video_frame_submitter.h
+++ b/third_party/blink/public/platform/web_video_frame_submitter.h
@@ -7,13 +7,16 @@
 
 #include "cc/layers/video_frame_provider.h"
 #include "components/viz/common/surfaces/surface_id.h"
-#include "media/base/video_rotation.h"
 #include "third_party/blink/public/platform/web_common.h"
 
 namespace cc {
 class LayerTreeSettings;
 }
 
+namespace media {
+enum VideoRotation : int;
+}
+
 namespace viz {
 class ContextProvider;
 }  // namespace viz
diff --git a/third_party/blink/renderer/build/scripts/make_instrumenting_probes.py b/third_party/blink/renderer/build/scripts/make_instrumenting_probes.py
index 6288ae1..514a0dc 100644
--- a/third_party/blink/renderer/build/scripts/make_instrumenting_probes.py
+++ b/third_party/blink/renderer/build/scripts/make_instrumenting_probes.py
@@ -60,7 +60,8 @@
 def agent_name_to_include(config, agent_name):
     include_path = agent_config(config, agent_name, "include_path") or config["settings"]["include_path"]
     agent_class = agent_name_to_class(config, agent_name)
-    return os.path.join(include_path, NameStyleConverter(agent_class).to_snake_case() + ".h")
+    include_file = os.path.join(include_path, NameStyleConverter(agent_class).to_snake_case() + ".h")
+    return include_file.replace("dev_tools", "devtools")
 
 
 def initialize_jinja_env(config, cache_dir):
diff --git a/third_party/blink/renderer/core/core_initializer.cc b/third_party/blink/renderer/core/core_initializer.cc
index f62cee21f..48f0ecb 100644
--- a/third_party/blink/renderer/core/core_initializer.cc
+++ b/third_party/blink/renderer/core/core_initializer.cc
@@ -99,7 +99,7 @@
       kQualifiedNamesCount + EventNames::kNamesCount +
       EventTargetNames::kNamesCount + EventTypeNames::kNamesCount +
       FetchInitiatorTypeNames::kNamesCount + FontFamilyNames::kNamesCount +
-      HTMLTokenizerNames::kNamesCount + http_names::kNamesCount +
+      html_tokenizer_names::kNamesCount + http_names::kNamesCount +
       input_mode_names::kNamesCount + input_type_names::kNamesCount +
       media_feature_names::kNamesCount + media_type_names::kNamesCount +
       performance_entry_names::kNamesCount;
@@ -122,7 +122,7 @@
   EventTypeNames::init();
   FetchInitiatorTypeNames::init();
   FontFamilyNames::init();
-  HTMLTokenizerNames::init();
+  html_tokenizer_names::init();
   http_names::init();
   input_mode_names::init();
   input_type_names::init();
diff --git a/third_party/blink/renderer/core/core_initializer.h b/third_party/blink/renderer/core/core_initializer.h
index 0012e0e..467bb2b 100644
--- a/third_party/blink/renderer/core/core_initializer.h
+++ b/third_party/blink/renderer/core/core_initializer.h
@@ -39,11 +39,11 @@
 
 namespace blink {
 
+class DevToolsSession;
 class Document;
 class HTMLMediaElement;
 class InspectedFrames;
 class InspectorDOMAgent;
-class InspectorSession;
 class LocalFrame;
 class MediaControls;
 class Page;
@@ -94,7 +94,7 @@
   // These methods typically create agents and append them to a session.
   // TODO(nverne): remove this and restore to WebDevToolsAgentImpl once that
   // class is a controller/ crbug:731490
-  virtual void InitInspectorAgentSession(InspectorSession*,
+  virtual void InitInspectorAgentSession(DevToolsSession*,
                                          bool,
                                          InspectorDOMAgent*,
                                          InspectedFrames*,
diff --git a/third_party/blink/renderer/core/css/css_primitive_value.h b/third_party/blink/renderer/core/css/css_primitive_value.h
index feddff5..e8ed235 100644
--- a/third_party/blink/renderer/core/css/css_primitive_value.h
+++ b/third_party/blink/renderer/core/css/css_primitive_value.h
@@ -214,6 +214,7 @@
     return type >= UnitType::kDotsPerPixel &&
            type <= UnitType::kDotsPerCentimeter;
   }
+  bool IsResolution() const { return IsResolution(GetType()); }
   static bool IsFlex(UnitType unit) { return unit == UnitType::kFraction; }
   bool IsFlex() const { return IsFlex(GetType()); }
 
diff --git a/third_party/blink/renderer/core/css/css_primitive_value_test.cc b/third_party/blink/renderer/core/css/css_primitive_value_test.cc
index 4de530e..b1c55ff 100644
--- a/third_party/blink/renderer/core/css/css_primitive_value_test.cc
+++ b/third_party/blink/renderer/core/css/css_primitive_value_test.cc
@@ -48,5 +48,12 @@
   }
 }
 
+TEST(CSSPrimitiveValueTest, IsResolution) {
+  EXPECT_FALSE(Create({5.0, UnitType::kNumber})->IsResolution());
+  EXPECT_FALSE(Create({5.0, UnitType::kDegrees})->IsResolution());
+  EXPECT_TRUE(Create({5.0, UnitType::kDotsPerPixel})->IsResolution());
+  EXPECT_TRUE(Create({5.0, UnitType::kDotsPerCentimeter})->IsResolution());
+}
+
 }  // namespace
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
index 7219119..9c654a7 100644
--- a/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
+++ b/third_party/blink/renderer/core/css/resolver/style_builder_converter.cc
@@ -1724,6 +1724,12 @@
       return *CSSPrimitiveValue::Create(primitive_value.ComputeSeconds(),
                                         CSSPrimitiveValue::UnitType::kSeconds);
     }
+
+    if (primitive_value.IsResolution()) {
+      return *CSSPrimitiveValue::Create(
+          primitive_value.ComputeDotsPerPixel(),
+          CSSPrimitiveValue::UnitType::kDotsPerPixel);
+    }
   }
 
   if (value.IsIdentifierValue()) {
diff --git a/third_party/blink/renderer/core/dom/events/listener_leak_test.cc b/third_party/blink/renderer/core/dom/events/listener_leak_test.cc
index f858879..bf97de00 100644
--- a/third_party/blink/renderer/core/dom/events/listener_leak_test.cc
+++ b/third_party/blink/renderer/core/dom/events/listener_leak_test.cc
@@ -27,12 +27,13 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/public/platform/web_url_loader_mock_factory.h"
 #include "third_party/blink/public/web/web_view.h"
+#include "third_party/blink/renderer/bindings/core/v8/v8_gc_controller.h"
 #include "third_party/blink/renderer/core/frame/frame_test_helpers.h"
+#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
 #include "third_party/blink/renderer/platform/testing/unit_test_helpers.h"
 #include "third_party/blink/renderer/platform/testing/url_test_helpers.h"
 #include "v8/include/v8-profiler.h"
@@ -40,6 +41,8 @@
 
 namespace blink {
 
+namespace {
+
 const v8::HeapGraphNode* GetProperty(v8::Isolate* isolate,
                                      const v8::HeapGraphNode* node,
                                      v8::HeapGraphEdge::Type type,
@@ -55,8 +58,7 @@
   return nullptr;
 }
 
-int GetNumObjects(const char* constructor) {
-  v8::Isolate* isolate = v8::Isolate::GetCurrent();
+int GetNumObjects(v8::Isolate* isolate, const char* constructor) {
   v8::HandleScope scope(isolate);
   v8::HeapProfiler* profiler = isolate->GetHeapProfiler();
   const v8::HeapSnapshot* snapshot = profiler->TakeHeapSnapshot();
@@ -84,15 +86,23 @@
   return count;
 }
 
+}  // namespace
+
 class ListenerLeakTest : public testing::Test {
  public:
-  void RunTest(const std::string& filename) {
+  void RunTestAndGC(const std::string& filename) {
     std::string base_url("http://www.example.com/");
     std::string file_name(filename);
     url_test_helpers::RegisterMockedURLLoadFromBase(
         WebString::FromUTF8(base_url), blink::test::CoreTestDataPath(),
         WebString::FromUTF8(file_name));
     web_view_helper.InitializeAndLoad(base_url + file_name);
+    V8GCController::CollectAllGarbageForTesting(
+        isolate(), v8::EmbedderHeapTracer::EmbedderStackState::kEmpty);
+  }
+
+  v8::Isolate* isolate() const {
+    return ToIsolate(web_view_helper.LocalMainFrame()->GetFrame());
   }
 
   void TearDown() override {
@@ -108,15 +118,15 @@
 // This test tries to create a reference cycle between node and its listener.
 // See http://crbug/17400.
 TEST_F(ListenerLeakTest, ReferenceCycle) {
-  RunTest("listener/listener_leak1.html");
-  ASSERT_EQ(0, GetNumObjects("EventListenerLeakTestObject1"));
+  RunTestAndGC("listener/listener_leak1.html");
+  ASSERT_EQ(0, GetNumObjects(isolate(), "EventListenerLeakTestObject1"));
 }
 
 // This test sets node onclick many times to expose a possible memory
 // leak where all listeners get referenced by the node.
 TEST_F(ListenerLeakTest, HiddenReferences) {
-  RunTest("listener/listener_leak2.html");
-  ASSERT_EQ(1, GetNumObjects("EventListenerLeakTestObject2"));
+  RunTestAndGC("listener/listener_leak2.html");
+  ASSERT_EQ(1, GetNumObjects(isolate(), "EventListenerLeakTestObject2"));
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc b/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
index 41db169..36909617 100644
--- a/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.cc
@@ -55,6 +55,7 @@
 #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
 #include "third_party/blink/renderer/core/inspector/dev_tools_emulator.h"
 #include "third_party/blink/renderer/core/inspector/devtools_agent.h"
+#include "third_party/blink/renderer/core/inspector/devtools_session.h"
 #include "third_party/blink/renderer/core/inspector/inspected_frames.h"
 #include "third_party/blink/renderer/core/inspector/inspector_animation_agent.h"
 #include "third_party/blink/renderer/core/inspector/inspector_application_cache_agent.h"
@@ -74,7 +75,6 @@
 #include "third_party/blink/renderer/core/inspector/inspector_performance_agent.h"
 #include "third_party/blink/renderer/core/inspector/inspector_resource_container.h"
 #include "third_party/blink/renderer/core/inspector/inspector_resource_content_loader.h"
-#include "third_party/blink/renderer/core/inspector/inspector_session.h"
 #include "third_party/blink/renderer/core/inspector/inspector_task_runner.h"
 #include "third_party/blink/renderer/core/inspector/inspector_testing_agent.h"
 #include "third_party/blink/renderer/core/inspector/main_thread_debugger.h"
@@ -184,10 +184,9 @@
 
 ClientMessageLoopAdapter* ClientMessageLoopAdapter::instance_ = nullptr;
 
-InspectorSession* WebDevToolsAgentImpl::AttachSession(
-    InspectorSession::Client* session_client,
-    mojom::blink::DevToolsSessionStatePtr reattach_session_state) {
-  if (!sessions_.size())
+void WebDevToolsAgentImpl::AttachSession(DevToolsSession* session,
+                                         bool restore) {
+  if (!network_agents_.size())
     Platform::Current()->CurrentThread()->AddTaskObserver(this);
 
   ClientMessageLoopAdapter::EnsureMainThreadDebuggerCreated();
@@ -195,98 +194,85 @@
   v8::Isolate* isolate = V8PerIsolateData::MainThreadIsolate();
   InspectedFrames* inspected_frames = inspected_frames_.Get();
 
-  bool should_reattach = !reattach_session_state.is_null();
+  int context_group_id =
+      main_thread_debugger->ContextGroupId(inspected_frames->Root());
+  session->ConnectToV8(main_thread_debugger->GetV8Inspector(),
+                       context_group_id);
 
-  InspectorSession* inspector_session = new InspectorSession(
-      session_client, probe_sink_.Get(), inspected_frames, 0,
-      main_thread_debugger->GetV8Inspector(),
-      main_thread_debugger->ContextGroupId(inspected_frames->Root()),
-      std::move(reattach_session_state));
-
-  InspectorDOMAgent* dom_agent = new InspectorDOMAgent(
-      isolate, inspected_frames, inspector_session->V8Session());
-  inspector_session->Append(dom_agent);
+  InspectorDOMAgent* dom_agent =
+      new InspectorDOMAgent(isolate, inspected_frames, session->V8Session());
+  session->Append(dom_agent);
 
   InspectorLayerTreeAgent* layer_tree_agent =
       InspectorLayerTreeAgent::Create(inspected_frames, this);
-  inspector_session->Append(layer_tree_agent);
+  session->Append(layer_tree_agent);
 
   InspectorNetworkAgent* network_agent = new InspectorNetworkAgent(
-      inspected_frames, nullptr, inspector_session->V8Session());
-  inspector_session->Append(network_agent);
+      inspected_frames, nullptr, session->V8Session());
+  session->Append(network_agent);
 
   InspectorCSSAgent* css_agent = InspectorCSSAgent::Create(
       dom_agent, inspected_frames, network_agent,
       resource_content_loader_.Get(), resource_container_.Get());
-  inspector_session->Append(css_agent);
+  session->Append(css_agent);
 
-  InspectorDOMDebuggerAgent* dom_debugger_agent = new InspectorDOMDebuggerAgent(
-      isolate, dom_agent, inspector_session->V8Session());
-  inspector_session->Append(dom_debugger_agent);
+  InspectorDOMDebuggerAgent* dom_debugger_agent =
+      new InspectorDOMDebuggerAgent(isolate, dom_agent, session->V8Session());
+  session->Append(dom_debugger_agent);
 
-  inspector_session->Append(
+  session->Append(
       InspectorDOMSnapshotAgent::Create(inspected_frames, dom_debugger_agent));
 
-  inspector_session->Append(new InspectorAnimationAgent(
-      inspected_frames, css_agent, inspector_session->V8Session()));
+  session->Append(new InspectorAnimationAgent(inspected_frames, css_agent,
+                                              session->V8Session()));
 
-  inspector_session->Append(InspectorMemoryAgent::Create(inspected_frames));
+  session->Append(InspectorMemoryAgent::Create(inspected_frames));
 
-  inspector_session->Append(
-      InspectorPerformanceAgent::Create(inspected_frames));
+  session->Append(InspectorPerformanceAgent::Create(inspected_frames));
 
-  inspector_session->Append(
-      InspectorApplicationCacheAgent::Create(inspected_frames));
+  session->Append(InspectorApplicationCacheAgent::Create(inspected_frames));
 
   InspectorPageAgent* page_agent = InspectorPageAgent::Create(
       inspected_frames, this, resource_content_loader_.Get(),
-      inspector_session->V8Session());
-  inspector_session->Append(page_agent);
+      session->V8Session());
+  session->Append(page_agent);
 
-  inspector_session->Append(new InspectorLogAgent(
+  session->Append(new InspectorLogAgent(
       &inspected_frames->Root()->GetPage()->GetConsoleMessageStorage(),
-      inspected_frames->Root()->GetPerformanceMonitor(),
-      inspector_session->V8Session()));
+      inspected_frames->Root()->GetPerformanceMonitor(), session->V8Session()));
 
   InspectorOverlayAgent* overlay_agent =
       new InspectorOverlayAgent(web_local_frame_impl_.Get(), inspected_frames,
-                                inspector_session->V8Session(), dom_agent);
-  inspector_session->Append(overlay_agent);
+                                session->V8Session(), dom_agent);
+  session->Append(overlay_agent);
 
-  inspector_session->Append(
-      new InspectorIOAgent(isolate, inspector_session->V8Session()));
+  session->Append(new InspectorIOAgent(isolate, session->V8Session()));
 
-  inspector_session->Append(new InspectorAuditsAgent(network_agent));
+  session->Append(new InspectorAuditsAgent(network_agent));
 
   // TODO(dgozman): we should actually pass the view instead of frame, but
   // during remote->local transition we cannot access mainFrameImpl() yet, so
   // we have to store the frame which will become the main frame later.
-  inspector_session->Append(
-      new InspectorEmulationAgent(web_local_frame_impl_.Get()));
+  session->Append(new InspectorEmulationAgent(web_local_frame_impl_.Get()));
 
-  inspector_session->Append(new InspectorTestingAgent(inspected_frames));
+  session->Append(new InspectorTestingAgent(inspected_frames));
 
-  // Call session init callbacks registered from higher layers
+  // Call session init callbacks registered from higher layers.
   CoreInitializer::GetInstance().InitInspectorAgentSession(
-      inspector_session, include_view_agents_, dom_agent, inspected_frames,
+      session, include_view_agents_, dom_agent, inspected_frames,
       web_local_frame_impl_->ViewImpl()->GetPage());
 
-  if (should_reattach) {
-    inspector_session->Restore();
-    if (worker_client_)
-      worker_client_->ResumeStartup();
-  }
+  if (restore && worker_client_)
+    worker_client_->ResumeStartup();
 
   if (node_to_inspect_) {
     overlay_agent->Inspect(node_to_inspect_);
     node_to_inspect_ = nullptr;
   }
 
-  sessions_.insert(inspector_session);
-  network_agents_.insert(inspector_session, network_agent);
-  page_agents_.insert(inspector_session, page_agent);
-  overlay_agents_.insert(inspector_session, overlay_agent);
-  return inspector_session;
+  network_agents_.insert(session, network_agent);
+  page_agents_.insert(session, page_agent);
+  overlay_agents_.insert(session, overlay_agent);
 }
 
 // static
@@ -316,7 +302,8 @@
       include_view_agents_(include_view_agents) {
   DCHECK(IsMainThread());
   agent_ = new DevToolsAgent(
-      this, web_local_frame_impl_->GetFrame()->GetInspectorTaskRunner(),
+      this, inspected_frames_.Get(), probe_sink_.Get(),
+      web_local_frame_impl_->GetFrame()->GetInspectorTaskRunner(),
       Platform::Current()->GetIOTaskRunner());
 }
 
@@ -326,7 +313,6 @@
 
 void WebDevToolsAgentImpl::Trace(blink::Visitor* visitor) {
   visitor->Trace(agent_);
-  visitor->Trace(sessions_);
   visitor->Trace(network_agents_);
   visitor->Trace(page_agents_);
   visitor->Trace(overlay_agents_);
@@ -354,12 +340,11 @@
       web_local_frame_impl_->GetTaskRunner(TaskType::kInternalInspector));
 }
 
-void WebDevToolsAgentImpl::DetachSession(InspectorSession* session) {
+void WebDevToolsAgentImpl::DetachSession(DevToolsSession* session) {
   network_agents_.erase(session);
   page_agents_.erase(session);
   overlay_agents_.erase(session);
-  sessions_.erase(session);
-  if (!sessions_.size())
+  if (!network_agents_.size())
     Platform::Current()->CurrentThread()->RemoveTaskObserver(this);
 }
 
@@ -413,8 +398,6 @@
 void WebDevToolsAgentImpl::DidCommitLoadForLocalFrame(LocalFrame* frame) {
   resource_container_->DidCommitLoadForLocalFrame(frame);
   resource_content_loader_->DidCommitLoadForLocalFrame(frame);
-  for (auto& session : sessions_)
-    session->DidCommitLoadForLocalFrame(frame);
 }
 
 bool WebDevToolsAgentImpl::ScreencastEnabled() {
@@ -478,14 +461,14 @@
 
 void WebDevToolsAgentImpl::WillProcessTask(
     const base::PendingTask& pending_task) {
-  if (sessions_.IsEmpty())
+  if (network_agents_.IsEmpty())
     return;
   ThreadDebugger::IdleFinished(V8PerIsolateData::MainThreadIsolate());
 }
 
 void WebDevToolsAgentImpl::DidProcessTask(
     const base::PendingTask& pending_task) {
-  if (sessions_.IsEmpty())
+  if (network_agents_.IsEmpty())
     return;
   ThreadDebugger::IdleStarted(V8PerIsolateData::MainThreadIsolate());
   FlushProtocolNotifications();
diff --git a/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.h b/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.h
index e2735a9..4f9cc566 100644
--- a/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.h
+++ b/third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.h
@@ -96,10 +96,8 @@
                        WorkerClient*);
 
   // DevToolsAgent::Client implementation.
-  InspectorSession* AttachSession(
-      InspectorSession::Client*,
-      mojom::blink::DevToolsSessionStatePtr reattach_session_state) override;
-  void DetachSession(InspectorSession*) override;
+  void AttachSession(DevToolsSession*, bool restore) override;
+  void DetachSession(DevToolsSession*) override;
   void InspectElement(const WebPoint& point_in_local_root) override;
   void DebuggerTaskStarted() override;
   void DebuggerTaskFinished() override;
@@ -115,12 +113,10 @@
   void DidProcessTask(const base::PendingTask&) override;
 
   Member<DevToolsAgent> agent_;
-  HeapHashSet<Member<InspectorSession>> sessions_;
-  HeapHashMap<Member<InspectorSession>, Member<InspectorNetworkAgent>>
+  HeapHashMap<Member<DevToolsSession>, Member<InspectorNetworkAgent>>
       network_agents_;
-  HeapHashMap<Member<InspectorSession>, Member<InspectorPageAgent>>
-      page_agents_;
-  HeapHashMap<Member<InspectorSession>, Member<InspectorOverlayAgent>>
+  HeapHashMap<Member<DevToolsSession>, Member<InspectorPageAgent>> page_agents_;
+  HeapHashMap<Member<DevToolsSession>, Member<InspectorOverlayAgent>>
       overlay_agents_;
   WorkerClient* worker_client_;
   Member<WebLocalFrameImpl> web_local_frame_impl_;
diff --git a/third_party/blink/renderer/core/html/media/html_video_element.h b/third_party/blink/renderer/core/html/media/html_video_element.h
index 4b929950..40d7096 100644
--- a/third_party/blink/renderer/core/html/media/html_video_element.h
+++ b/third_party/blink/renderer/core/html/media/html_video_element.h
@@ -192,6 +192,11 @@
 
   void SetIsEffectivelyFullscreen(blink::WebFullscreenVideoStatus);
 
+  void SetImageForTest(ImageResourceContent* content) {
+    DCHECK(image_loader_);
+    image_loader_->SetImageForTest(content);
+  }
+
  protected:
   // EventTarget overrides.
   void AddedEventListener(const AtomicString& event_type,
diff --git a/third_party/blink/renderer/core/html/parser/html_tokenizer.cc b/third_party/blink/renderer/core/html/parser/html_tokenizer.cc
index 9a1cbe2e..65b4bc446 100644
--- a/third_party/blink/renderer/core/html/parser/html_tokenizer.cc
+++ b/third_party/blink/renderer/core/html/parser/html_tokenizer.cc
@@ -935,7 +935,7 @@
     HTML_BEGIN_STATE(kMarkupDeclarationOpenState) {
       if (cc == '-') {
         SegmentedString::LookAheadResult result =
-            source.LookAhead(HTMLTokenizerNames::dashDash);
+            source.LookAhead(html_tokenizer_names::kDashDash);
         if (result == SegmentedString::kDidMatch) {
           source.AdvanceAndASSERT('-');
           source.AdvanceAndASSERT('-');
@@ -945,7 +945,7 @@
           return HaveBufferedCharacterToken();
       } else if (cc == 'D' || cc == 'd') {
         SegmentedString::LookAheadResult result =
-            source.LookAheadIgnoringCase(HTMLTokenizerNames::doctype);
+            source.LookAheadIgnoringCase(html_tokenizer_names::kDoctype);
         if (result == SegmentedString::kDidMatch) {
           AdvanceStringAndASSERTIgnoringCase(source, "doctype");
           HTML_SWITCH_TO(kDOCTYPEState);
@@ -953,7 +953,7 @@
           return HaveBufferedCharacterToken();
       } else if (cc == '[' && ShouldAllowCDATA()) {
         SegmentedString::LookAheadResult result =
-            source.LookAhead(HTMLTokenizerNames::cdata);
+            source.LookAhead(html_tokenizer_names::kCdata);
         if (result == SegmentedString::kDidMatch) {
           AdvanceStringAndASSERT(source, "[CDATA[");
           HTML_SWITCH_TO(kCDATASectionState);
@@ -1132,7 +1132,7 @@
       } else {
         if (cc == 'P' || cc == 'p') {
           SegmentedString::LookAheadResult result =
-              source.LookAheadIgnoringCase(HTMLTokenizerNames::publicString);
+              source.LookAheadIgnoringCase(html_tokenizer_names::kPublic);
           if (result == SegmentedString::kDidMatch) {
             AdvanceStringAndASSERTIgnoringCase(source, "public");
             HTML_SWITCH_TO(kAfterDOCTYPEPublicKeywordState);
@@ -1140,7 +1140,7 @@
             return HaveBufferedCharacterToken();
         } else if (cc == 'S' || cc == 's') {
           SegmentedString::LookAheadResult result =
-              source.LookAheadIgnoringCase(HTMLTokenizerNames::system);
+              source.LookAheadIgnoringCase(html_tokenizer_names::kSystem);
           if (result == SegmentedString::kDidMatch) {
             AdvanceStringAndASSERTIgnoringCase(source, "system");
             HTML_SWITCH_TO(kAfterDOCTYPESystemKeywordState);
diff --git a/third_party/blink/renderer/core/html/parser/html_tokenizer_names.json5 b/third_party/blink/renderer/core/html/parser/html_tokenizer_names.json5
index a31d43b6..d2b1c4d 100644
--- a/third_party/blink/renderer/core/html/parser/html_tokenizer_names.json5
+++ b/third_party/blink/renderer/core/html/parser/html_tokenizer_names.json5
@@ -1,23 +1,19 @@
 {
   metadata: {
-    namespace: "HTMLTokenizer",
+    namespace: "html_tokenizer_names",
   },
 
   data: [
     {
       name: "--",
-      Symbol: "dashDash",
+      Symbol: "kDashDash",
     },
     "doctype",
     {
       name: "[CDATA[",
-      Symbol: "cdata",
+      Symbol: "kCdata",
     },
-    // The symbol "public" conflicts with the C++ keyword.
-    {
-      name: "public",
-      Symbol: "publicString",
-    },
+    "public",
     "system",
   ],
 }
diff --git a/third_party/blink/renderer/core/inspector/BUILD.gn b/third_party/blink/renderer/core/inspector/BUILD.gn
index 6365f54f..49980be 100644
--- a/third_party/blink/renderer/core/inspector/BUILD.gn
+++ b/third_party/blink/renderer/core/inspector/BUILD.gn
@@ -25,6 +25,8 @@
     "dev_tools_host.h",
     "devtools_agent.cc",
     "devtools_agent.h",
+    "devtools_session.cc",
+    "devtools_session.h",
     "dom_editor.cc",
     "dom_editor.h",
     "dom_patch_support.cc",
@@ -77,8 +79,6 @@
     "inspector_resource_container.h",
     "inspector_resource_content_loader.cc",
     "inspector_resource_content_loader.h",
-    "inspector_session.cc",
-    "inspector_session.h",
     "inspector_session_state.cc",
     "inspector_session_state.h",
     "inspector_style_sheet.cc",
diff --git a/third_party/blink/renderer/core/inspector/devtools_agent.cc b/third_party/blink/renderer/core/inspector/devtools_agent.cc
index 3b86c2fc..46f930a9 100644
--- a/third_party/blink/renderer/core/inspector/devtools_agent.cc
+++ b/third_party/blink/renderer/core/inspector/devtools_agent.cc
@@ -7,206 +7,22 @@
 #include <v8-inspector.h>
 #include <memory>
 
-#include "mojo/public/cpp/bindings/binding.h"
 #include "third_party/blink/renderer/core/dom/document.h"
 #include "third_party/blink/renderer/core/exported/web_dev_tools_agent_impl.h"
 #include "third_party/blink/renderer/core/frame/local_frame.h"
 #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
-#include "third_party/blink/renderer/core/inspector/inspector_session.h"
+#include "third_party/blink/renderer/core/inspector/devtools_session.h"
+#include "third_party/blink/renderer/core/inspector/inspected_frames.h"
 #include "third_party/blink/renderer/core/inspector/inspector_task_runner.h"
 #include "third_party/blink/renderer/core/inspector/worker_inspector_controller.h"
+#include "third_party/blink/renderer/core/probe/core_probes.h"
 #include "third_party/blink/renderer/core/workers/worker_global_scope.h"
 #include "third_party/blink/renderer/core/workers/worker_thread.h"
-#include "third_party/blink/renderer/platform/cross_thread_functional.h"
 #include "third_party/blink/renderer/platform/heap/persistent.h"
-#include "third_party/blink/renderer/platform/layout_test_support.h"
-#include "third_party/blink/renderer/platform/web_task_runner.h"
 #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
 
 namespace blink {
 
-// --------- DevToolsAgent::Session -------------
-
-class DevToolsAgent::Session : public GarbageCollectedFinalized<Session>,
-                               public mojom::blink::DevToolsSession,
-                               public InspectorSession::Client {
- public:
-  Session(DevToolsAgent*,
-          mojom::blink::DevToolsSessionHostAssociatedPtrInfo host_ptr_info,
-          mojom::blink::DevToolsSessionAssociatedRequest main_request,
-          mojom::blink::DevToolsSessionRequest io_request,
-          mojom::blink::DevToolsSessionStatePtr reattach_session_state);
-  ~Session() override;
-
-  virtual void Trace(blink::Visitor*);
-  void Detach();
-
-  InspectorSession* inspector_session() { return inspector_session_.Get(); }
-
- private:
-  class IOSession;
-
-  // mojom::blink::DevToolsSession implementation.
-  void DispatchProtocolCommand(int call_id,
-                               const String& method,
-                               const String& message) override;
-
-  // InspectorSession::Client implementation.
-  void SendProtocolResponse(
-      int session_id,
-      int call_id,
-      const String& response,
-      mojom::blink::DevToolsSessionStatePtr updates) override;
-  void SendProtocolNotification(
-      int session_id,
-      const String& message,
-      mojom::blink::DevToolsSessionStatePtr updates) override;
-
-  void DispatchProtocolCommandInternal(int call_id,
-                                       const String& method,
-                                       const String& message);
-
-  Member<DevToolsAgent> agent_;
-  mojo::AssociatedBinding<mojom::blink::DevToolsSession> binding_;
-  mojom::blink::DevToolsSessionHostAssociatedPtr host_ptr_;
-  IOSession* io_session_;
-  Member<InspectorSession> inspector_session_;
-
-  DISALLOW_COPY_AND_ASSIGN(Session);
-};
-
-// Created and stored in unique_ptr on UI.
-// Binds request, receives messages and destroys on IO.
-class DevToolsAgent::Session::IOSession : public mojom::blink::DevToolsSession {
- public:
-  IOSession(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
-            scoped_refptr<InspectorTaskRunner> inspector_task_runner,
-            CrossThreadWeakPersistent<DevToolsAgent::Session> session,
-            mojom::blink::DevToolsSessionRequest request)
-      : io_task_runner_(io_task_runner),
-        inspector_task_runner_(inspector_task_runner),
-        session_(std::move(session)),
-        binding_(this) {
-    io_task_runner->PostTask(
-        FROM_HERE, ConvertToBaseCallback(CrossThreadBind(
-                       &IOSession::BindInterface, CrossThreadUnretained(this),
-                       WTF::Passed(std::move(request)))));
-  }
-
-  ~IOSession() override {}
-
-  void BindInterface(mojom::blink::DevToolsSessionRequest request) {
-    binding_.Bind(std::move(request), io_task_runner_);
-  }
-
-  void DeleteSoon() { io_task_runner_->DeleteSoon(FROM_HERE, this); }
-
-  // mojom::blink::DevToolsSession implementation.
-  void DispatchProtocolCommand(int call_id,
-                               const String& method,
-                               const String& message) override {
-    DCHECK(InspectorSession::ShouldInterruptForMethod(method));
-    // Crash renderer.
-    if (method == "Page.crash")
-      CHECK(false);
-    inspector_task_runner_->AppendTask(
-        CrossThreadBind(&DevToolsAgent::Session::DispatchProtocolCommand,
-                        session_, call_id, method, message));
-  }
-
- private:
-  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
-  scoped_refptr<InspectorTaskRunner> inspector_task_runner_;
-  CrossThreadWeakPersistent<DevToolsAgent::Session> session_;
-  mojo::Binding<mojom::blink::DevToolsSession> binding_;
-
-  DISALLOW_COPY_AND_ASSIGN(IOSession);
-};
-
-DevToolsAgent::Session::Session(
-    DevToolsAgent* agent,
-    mojom::blink::DevToolsSessionHostAssociatedPtrInfo host_ptr_info,
-    mojom::blink::DevToolsSessionAssociatedRequest request,
-    mojom::blink::DevToolsSessionRequest io_request,
-    mojom::blink::DevToolsSessionStatePtr reattach_session_state)
-    : agent_(agent), binding_(this, std::move(request)) {
-  io_session_ =
-      new IOSession(agent_->io_task_runner_, agent_->inspector_task_runner_,
-                    WrapCrossThreadWeakPersistent(this), std::move(io_request));
-
-  host_ptr_.Bind(std::move(host_ptr_info));
-  host_ptr_.set_connection_error_handler(
-      WTF::Bind(&DevToolsAgent::Session::Detach, WrapWeakPersistent(this)));
-  inspector_session_ =
-      agent_->client_->AttachSession(this, std::move(reattach_session_state));
-}
-
-DevToolsAgent::Session::~Session() {
-  DCHECK(!host_ptr_.is_bound());
-}
-
-void DevToolsAgent::Session::Trace(blink::Visitor* visitor) {
-  visitor->Trace(agent_);
-  visitor->Trace(inspector_session_);
-}
-
-void DevToolsAgent::Session::Detach() {
-  agent_->client_->DebuggerTaskStarted();
-  agent_->client_->DetachSession(inspector_session_.Get());
-  agent_->sessions_.erase(this);
-  binding_.Close();
-  host_ptr_.reset();
-  io_session_->DeleteSoon();
-  io_session_ = nullptr;
-  inspector_session_->Dispose();
-  agent_->client_->DebuggerTaskFinished();
-}
-
-void DevToolsAgent::Session::SendProtocolResponse(
-    int session_id,
-    int call_id,
-    const String& response,
-    mojom::blink::DevToolsSessionStatePtr updates) {
-  if (!host_ptr_.is_bound())
-    return;
-  // Make tests more predictable by flushing all sessions before sending
-  // protocol response in any of them.
-  if (LayoutTestSupport::IsRunningLayoutTest())
-    agent_->FlushProtocolNotifications();
-  host_ptr_->DispatchProtocolResponse(response, call_id, std::move(updates));
-}
-
-void DevToolsAgent::Session::SendProtocolNotification(
-    int session_id,
-    const String& message,
-    mojom::blink::DevToolsSessionStatePtr updates) {
-  if (!host_ptr_.is_bound())
-    return;
-  host_ptr_->DispatchProtocolNotification(message, std::move(updates));
-}
-
-void DevToolsAgent::Session::DispatchProtocolCommand(int call_id,
-                                                     const String& method,
-                                                     const String& message) {
-  // IOSession does not provide ordering guarantees relative to
-  // Session, so a command may come to IOSession after Session is detached,
-  // and get posted to main thread to this method.
-  //
-  // At the same time, Session may not be garbage collected yet
-  // (even though already detached), and CrossThreadWeakPersistent<Session>
-  // will still be valid.
-  //
-  // Both these factors combined may lead to this method being called after
-  // detach, so we have to check it here.
-  if (!host_ptr_.is_bound())
-    return;
-  agent_->client_->DebuggerTaskStarted();
-  inspector_session_->DispatchProtocolMessage(call_id, method, message);
-  agent_->client_->DebuggerTaskFinished();
-}
-
-// --------- DevToolsAgent -------------
-
 // static
 DevToolsAgent* DevToolsAgent::From(ExecutionContext* execution_context) {
   if (!execution_context)
@@ -231,22 +47,28 @@
 
 DevToolsAgent::DevToolsAgent(
     Client* client,
+    InspectedFrames* inspected_frames,
+    CoreProbeSink* probe_sink,
     scoped_refptr<InspectorTaskRunner> inspector_task_runner,
     scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
     : client_(client),
       binding_(this),
       associated_binding_(this),
+      inspected_frames_(inspected_frames),
+      probe_sink_(probe_sink),
       inspector_task_runner_(std::move(inspector_task_runner)),
       io_task_runner_(std::move(io_task_runner)) {}
 
 DevToolsAgent::~DevToolsAgent() {}
 
 void DevToolsAgent::Trace(blink::Visitor* visitor) {
+  visitor->Trace(inspected_frames_);
+  visitor->Trace(probe_sink_);
   visitor->Trace(sessions_);
 }
 
 void DevToolsAgent::Dispose() {
-  HeapHashSet<Member<Session>> copy(sessions_);
+  HeapHashSet<Member<DevToolsSession>> copy(sessions_);
   for (auto& session : copy)
     session->Detach();
   CleanupConnection();
@@ -282,7 +104,7 @@
     mojom::blink::DevToolsSessionRequest io_session_request,
     mojom::blink::DevToolsSessionStatePtr reattach_session_state) {
   client_->DebuggerTaskStarted();
-  Session* session = new Session(
+  DevToolsSession* session = new DevToolsSession(
       this, std::move(host), std::move(session_request),
       std::move(io_session_request), std::move(reattach_session_state));
   sessions_.insert(session);
@@ -295,7 +117,7 @@
 
 void DevToolsAgent::FlushProtocolNotifications() {
   for (auto& session : sessions_)
-    session->inspector_session()->flushProtocolNotifications();
+    session->FlushProtocolNotifications();
 }
 
 void DevToolsAgent::ReportChildWorkers(bool report, bool wait_for_debugger) {
diff --git a/third_party/blink/renderer/core/inspector/devtools_agent.h b/third_party/blink/renderer/core/inspector/devtools_agent.h
index c02b3d17..7669f68 100644
--- a/third_party/blink/renderer/core/inspector/devtools_agent.h
+++ b/third_party/blink/renderer/core/inspector/devtools_agent.h
@@ -13,14 +13,16 @@
 #include "mojo/public/cpp/bindings/binding.h"
 #include "third_party/blink/public/web/devtools_agent.mojom-blink.h"
 #include "third_party/blink/renderer/core/core_export.h"
-#include "third_party/blink/renderer/core/inspector/inspector_session.h"
 #include "third_party/blink/renderer/platform/heap/handle.h"
 #include "third_party/blink/renderer/platform/wtf/forward.h"
 #include "third_party/blink/renderer/platform/wtf/ref_counted.h"
 
 namespace blink {
 
+class CoreProbeSink;
+class DevToolsSession;
 class ExecutionContext;
+class InspectedFrames;
 class InspectorTaskRunner;
 class WorkerThread;
 
@@ -31,10 +33,8 @@
   class Client {
    public:
     virtual ~Client() {}
-    virtual InspectorSession* AttachSession(
-        InspectorSession::Client*,
-        mojom::blink::DevToolsSessionStatePtr reattach_session_state) = 0;
-    virtual void DetachSession(InspectorSession*) = 0;
+    virtual void AttachSession(DevToolsSession*, bool restore) = 0;
+    virtual void DetachSession(DevToolsSession*) = 0;
     virtual void InspectElement(const WebPoint&) = 0;
     virtual void DebuggerTaskStarted() = 0;
     virtual void DebuggerTaskFinished() = 0;
@@ -42,6 +42,8 @@
 
   static DevToolsAgent* From(ExecutionContext*);
   DevToolsAgent(Client*,
+                InspectedFrames*,
+                CoreProbeSink*,
                 scoped_refptr<InspectorTaskRunner> inspector_task_runner,
                 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner);
   ~DevToolsAgent() override;
@@ -63,7 +65,7 @@
   virtual void Trace(blink::Visitor*);
 
  private:
-  class Session;
+  friend class DevToolsSession;
 
   // mojom::blink::DevToolsAgent implementation.
   void AttachDevToolsSession(
@@ -90,7 +92,9 @@
   mojo::AssociatedBinding<mojom::blink::DevToolsAgent> associated_binding_;
   mojom::blink::DevToolsAgentHostPtr host_ptr_;
   mojom::blink::DevToolsAgentHostAssociatedPtr associated_host_ptr_;
-  HeapHashSet<Member<Session>> sessions_;
+  Member<InspectedFrames> inspected_frames_;
+  Member<CoreProbeSink> probe_sink_;
+  HeapHashSet<Member<DevToolsSession>> sessions_;
   scoped_refptr<InspectorTaskRunner> inspector_task_runner_;
   scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
   HashMap<WorkerThread*, std::unique_ptr<WorkerData>>
diff --git a/third_party/blink/renderer/core/inspector/devtools_session.cc b/third_party/blink/renderer/core/inspector/devtools_session.cc
new file mode 100644
index 0000000..be57971
--- /dev/null
+++ b/third_party/blink/renderer/core/inspector/devtools_session.cc
@@ -0,0 +1,316 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "third_party/blink/renderer/core/inspector/devtools_session.h"
+
+#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
+#include "third_party/blink/renderer/core/frame/local_frame.h"
+#include "third_party/blink/renderer/core/frame/use_counter.h"
+#include "third_party/blink/renderer/core/inspector/devtools_agent.h"
+#include "third_party/blink/renderer/core/inspector/inspected_frames.h"
+#include "third_party/blink/renderer/core/inspector/inspector_base_agent.h"
+#include "third_party/blink/renderer/core/inspector/inspector_session_state.h"
+#include "third_party/blink/renderer/core/inspector/inspector_task_runner.h"
+#include "third_party/blink/renderer/core/inspector/protocol/Protocol.h"
+#include "third_party/blink/renderer/core/inspector/v8_inspector_string.h"
+#include "third_party/blink/renderer/core/probe/core_probes.h"
+#include "third_party/blink/renderer/platform/cross_thread_functional.h"
+#include "third_party/blink/renderer/platform/heap/persistent.h"
+#include "third_party/blink/renderer/platform/layout_test_support.h"
+#include "third_party/blink/renderer/platform/web_task_runner.h"
+
+namespace blink {
+
+namespace {
+const char kV8StateKey[] = "v8";
+bool ShouldInterruptForMethod(const String& method) {
+  // Keep in sync with DevToolsSession::ShouldSendOnIO.
+  // TODO(dgozman): find a way to share this.
+  return method == "Debugger.pause" || method == "Debugger.setBreakpoint" ||
+         method == "Debugger.setBreakpointByUrl" ||
+         method == "Debugger.removeBreakpoint" ||
+         method == "Debugger.setBreakpointsActive" ||
+         method == "Performance.getMetrics" || method == "Page.crash" ||
+         method == "Runtime.terminateExecution" ||
+         method == "Emulation.setScriptExecutionDisabled";
+}
+}  // namespace
+
+// Created and stored in unique_ptr on UI.
+// Binds request, receives messages and destroys on IO.
+class DevToolsSession::IOSession : public mojom::blink::DevToolsSession {
+ public:
+  IOSession(scoped_refptr<base::SingleThreadTaskRunner> io_task_runner,
+            scoped_refptr<InspectorTaskRunner> inspector_task_runner,
+            CrossThreadWeakPersistent<::blink::DevToolsSession> session,
+            mojom::blink::DevToolsSessionRequest request)
+      : io_task_runner_(io_task_runner),
+        inspector_task_runner_(inspector_task_runner),
+        session_(std::move(session)),
+        binding_(this) {
+    io_task_runner->PostTask(
+        FROM_HERE, ConvertToBaseCallback(CrossThreadBind(
+                       &IOSession::BindInterface, CrossThreadUnretained(this),
+                       WTF::Passed(std::move(request)))));
+  }
+
+  ~IOSession() override {}
+
+  void BindInterface(mojom::blink::DevToolsSessionRequest request) {
+    binding_.Bind(std::move(request), io_task_runner_);
+  }
+
+  void DeleteSoon() { io_task_runner_->DeleteSoon(FROM_HERE, this); }
+
+  // mojom::blink::DevToolsSession implementation.
+  void DispatchProtocolCommand(int call_id,
+                               const String& method,
+                               const String& message) override {
+    DCHECK(ShouldInterruptForMethod(method));
+    // Crash renderer.
+    if (method == "Page.crash")
+      CHECK(false);
+    inspector_task_runner_->AppendTask(
+        CrossThreadBind(&DevToolsSession::DispatchProtocolCommand, session_,
+                        call_id, method, message));
+  }
+
+ private:
+  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
+  scoped_refptr<InspectorTaskRunner> inspector_task_runner_;
+  CrossThreadWeakPersistent<::blink::DevToolsSession> session_;
+  mojo::Binding<mojom::blink::DevToolsSession> binding_;
+
+  DISALLOW_COPY_AND_ASSIGN(IOSession);
+};
+
+DevToolsSession::DevToolsSession(
+    DevToolsAgent* agent,
+    mojom::blink::DevToolsSessionHostAssociatedPtrInfo host_ptr_info,
+    mojom::blink::DevToolsSessionAssociatedRequest main_request,
+    mojom::blink::DevToolsSessionRequest io_request,
+    mojom::blink::DevToolsSessionStatePtr reattach_session_state)
+    : agent_(agent),
+      binding_(this, std::move(main_request)),
+      inspector_backend_dispatcher_(new protocol::UberDispatcher(this)),
+      session_state_(std::move(reattach_session_state)),
+      v8_session_state_(kV8StateKey),
+      v8_session_state_json_(&v8_session_state_, /*default_value=*/String()) {
+  io_session_ =
+      new IOSession(agent_->io_task_runner_, agent_->inspector_task_runner_,
+                    WrapCrossThreadWeakPersistent(this), std::move(io_request));
+
+  host_ptr_.Bind(std::move(host_ptr_info));
+  host_ptr_.set_connection_error_handler(
+      WTF::Bind(&DevToolsSession::Detach, WrapWeakPersistent(this)));
+
+  bool restore = !!session_state_.ReattachState();
+  v8_session_state_.InitFrom(&session_state_);
+  agent_->client_->AttachSession(this, restore);
+  agent_->probe_sink_->addDevToolsSession(this);
+  if (restore) {
+    for (wtf_size_t i = 0; i < agents_.size(); i++)
+      agents_[i]->Restore();
+  }
+}
+
+DevToolsSession::~DevToolsSession() {
+  DCHECK(IsDetached());
+}
+
+void DevToolsSession::ConnectToV8(v8_inspector::V8Inspector* inspector,
+                                  int context_group_id) {
+  v8_session_ =
+      inspector->connect(context_group_id, this,
+                         ToV8InspectorStringView(v8_session_state_json_.Get()));
+}
+
+bool DevToolsSession::IsDetached() {
+  return !host_ptr_.is_bound();
+}
+
+void DevToolsSession::Append(InspectorAgent* agent) {
+  agents_.push_back(agent);
+  agent->Init(agent_->probe_sink_.Get(), inspector_backend_dispatcher_.get(),
+              &session_state_);
+}
+
+void DevToolsSession::Detach() {
+  agent_->client_->DebuggerTaskStarted();
+  agent_->client_->DetachSession(this);
+  agent_->sessions_.erase(this);
+  binding_.Close();
+  host_ptr_.reset();
+  io_session_->DeleteSoon();
+  io_session_ = nullptr;
+  agent_->probe_sink_->removeDevToolsSession(this);
+  inspector_backend_dispatcher_.reset();
+  for (wtf_size_t i = agents_.size(); i > 0; i--)
+    agents_[i - 1]->Dispose();
+  agents_.clear();
+  v8_session_.reset();
+  agent_->client_->DebuggerTaskFinished();
+}
+
+void DevToolsSession::FlushProtocolNotifications() {
+  flushProtocolNotifications();
+}
+
+void DevToolsSession::DispatchProtocolCommand(int call_id,
+                                              const String& method,
+                                              const String& message) {
+  // IOSession does not provide ordering guarantees relative to
+  // Session, so a command may come to IOSession after Session is detached,
+  // and get posted to main thread to this method.
+  //
+  // At the same time, Session may not be garbage collected yet
+  // (even though already detached), and CrossThreadWeakPersistent<Session>
+  // will still be valid.
+  //
+  // Both these factors combined may lead to this method being called after
+  // detach, so we have to check it here.
+  if (IsDetached())
+    return;
+  agent_->client_->DebuggerTaskStarted();
+  if (v8_inspector::V8InspectorSession::canDispatchMethod(
+          ToV8InspectorStringView(method))) {
+    v8_session_->dispatchProtocolMessage(ToV8InspectorStringView(message));
+  } else {
+    inspector_backend_dispatcher_->dispatch(
+        call_id, method, protocol::StringUtil::parseJSON(message), message);
+  }
+  agent_->client_->DebuggerTaskFinished();
+}
+
+void DevToolsSession::DidStartProvisionalLoad(LocalFrame* frame) {
+  if (v8_session_ && agent_->inspected_frames_->Root() == frame) {
+    v8_session_->setSkipAllPauses(true);
+    v8_session_->resume();
+  }
+}
+
+void DevToolsSession::DidFailProvisionalLoad(LocalFrame* frame) {
+  if (v8_session_ && agent_->inspected_frames_->Root() == frame)
+    v8_session_->setSkipAllPauses(false);
+}
+
+void DevToolsSession::DidCommitLoad(LocalFrame* frame, DocumentLoader*) {
+  for (wtf_size_t i = 0; i < agents_.size(); i++)
+    agents_[i]->DidCommitLoadForLocalFrame(frame);
+  if (v8_session_ && agent_->inspected_frames_->Root() == frame)
+    v8_session_->setSkipAllPauses(false);
+}
+
+void DevToolsSession::sendProtocolResponse(
+    int call_id,
+    std::unique_ptr<protocol::Serializable> message) {
+  SendProtocolResponse(call_id, message->serialize());
+}
+
+void DevToolsSession::fallThrough(int call_id,
+                                  const String& method,
+                                  const String& message) {
+  // There's no other layer to handle the command.
+  NOTREACHED();
+}
+
+void DevToolsSession::sendResponse(
+    int call_id,
+    std::unique_ptr<v8_inspector::StringBuffer> message) {
+  // We can potentially avoid copies if WebString would convert to utf8 right
+  // from StringView, but it uses StringImpl itself, so we don't create any
+  // extra copies here.
+  SendProtocolResponse(call_id, ToCoreString(message->string()));
+}
+
+void DevToolsSession::SendProtocolResponse(int call_id, const String& message) {
+  if (IsDetached())
+    return;
+  flushProtocolNotifications();
+  if (v8_session_)
+    v8_session_state_json_.Set(ToCoreString(v8_session_->stateJSON()));
+  // Make tests more predictable by flushing all sessions before sending
+  // protocol response in any of them.
+  if (LayoutTestSupport::IsRunningLayoutTest())
+    agent_->FlushProtocolNotifications();
+  host_ptr_->DispatchProtocolResponse(message, call_id,
+                                      session_state_.TakeUpdates());
+}
+
+class DevToolsSession::Notification {
+ public:
+  static std::unique_ptr<Notification> CreateForBlink(
+      std::unique_ptr<protocol::Serializable> notification) {
+    return std::unique_ptr<Notification>(
+        new Notification(std::move(notification)));
+  }
+
+  static std::unique_ptr<Notification> CreateForV8(
+      std::unique_ptr<v8_inspector::StringBuffer> notification) {
+    return std::unique_ptr<Notification>(
+        new Notification(std::move(notification)));
+  }
+
+  String Serialize() {
+    if (blink_notification_) {
+      serialized_ = blink_notification_->serialize();
+      blink_notification_.reset();
+    } else if (v8_notification_) {
+      serialized_ = ToCoreString(v8_notification_->string());
+      v8_notification_.reset();
+    }
+    return serialized_;
+  }
+
+ private:
+  explicit Notification(std::unique_ptr<protocol::Serializable> notification)
+      : blink_notification_(std::move(notification)) {}
+
+  explicit Notification(
+      std::unique_ptr<v8_inspector::StringBuffer> notification)
+      : v8_notification_(std::move(notification)) {}
+
+  std::unique_ptr<protocol::Serializable> blink_notification_;
+  std::unique_ptr<v8_inspector::StringBuffer> v8_notification_;
+  String serialized_;
+};
+
+void DevToolsSession::sendProtocolNotification(
+    std::unique_ptr<protocol::Serializable> notification) {
+  if (IsDetached())
+    return;
+  notification_queue_.push_back(
+      Notification::CreateForBlink(std::move(notification)));
+}
+
+void DevToolsSession::sendNotification(
+    std::unique_ptr<v8_inspector::StringBuffer> notification) {
+  if (IsDetached())
+    return;
+  notification_queue_.push_back(
+      Notification::CreateForV8(std::move(notification)));
+}
+
+void DevToolsSession::flushProtocolNotifications() {
+  if (IsDetached())
+    return;
+  for (wtf_size_t i = 0; i < agents_.size(); i++)
+    agents_[i]->FlushPendingProtocolNotifications();
+  if (!notification_queue_.size())
+    return;
+  if (v8_session_)
+    v8_session_state_json_.Set(ToCoreString(v8_session_->stateJSON()));
+  for (wtf_size_t i = 0; i < notification_queue_.size(); ++i) {
+    host_ptr_->DispatchProtocolNotification(notification_queue_[i]->Serialize(),
+                                            session_state_.TakeUpdates());
+  }
+  notification_queue_.clear();
+}
+
+void DevToolsSession::Trace(blink::Visitor* visitor) {
+  visitor->Trace(agent_);
+  visitor->Trace(agents_);
+}
+
+}  // namespace blink
diff --git a/third_party/blink/renderer/core/inspector/inspector_session.h b/third_party/blink/renderer/core/inspector/devtools_session.h
similarity index 62%
rename from third_party/blink/renderer/core/inspector/inspector_session.h
rename to third_party/blink/renderer/core/inspector/devtools_session.h
index 332da5d..b187664e 100644
--- a/third_party/blink/renderer/core/inspector/inspector_session.h
+++ b/third_party/blink/renderer/core/inspector/devtools_session.h
@@ -2,10 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_SESSION_H_
-#define THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_INSPECTOR_SESSION_H_
+#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_DEVTOOLS_SESSION_H_
+#define THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_DEVTOOLS_SESSION_H_
 
 #include "base/macros.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
 #include "third_party/blink/public/web/devtools_agent.mojom-blink.h"
 #include "third_party/blink/renderer/core/core_export.h"
 #include "third_party/blink/renderer/core/inspector/inspector_session_state.h"
@@ -18,66 +19,56 @@
 
 namespace blink {
 
+class DevToolsAgent;
+class DocumentLoader;
 class InspectorAgent;
-class InspectedFrames;
-class CoreProbeSink;
 class LocalFrame;
 
-class CORE_EXPORT InspectorSession
-    : public GarbageCollectedFinalized<InspectorSession>,
+class CORE_EXPORT DevToolsSession
+    : public GarbageCollectedFinalized<DevToolsSession>,
+      public mojom::blink::DevToolsSession,
       public protocol::FrontendChannel,
       public v8_inspector::V8Inspector::Channel {
  public:
-  class Client {
-   public:
-    virtual void SendProtocolResponse(
-        int session_id,
-        int call_id,
-        const String& response,
-        mojom::blink::DevToolsSessionStatePtr updates) = 0;
-    virtual void SendProtocolNotification(
-        int session_id,
-        const String& message,
-        mojom::blink::DevToolsSessionStatePtr updates) = 0;
-    virtual ~Client() = default;
-  };
-
-  InspectorSession(
-      Client*,
-      CoreProbeSink*,
-      InspectedFrames*,
-      int session_id,
-      v8_inspector::V8Inspector*,
-      int context_group_id,
+  DevToolsSession(
+      DevToolsAgent*,
+      mojom::blink::DevToolsSessionHostAssociatedPtrInfo host_ptr_info,
+      mojom::blink::DevToolsSessionAssociatedRequest main_request,
+      mojom::blink::DevToolsSessionRequest io_request,
       mojom::blink::DevToolsSessionStatePtr reattach_session_state);
-  ~InspectorSession() override;
-  // TODO(dgozman): remove session id once WokrerInspectorController
-  // does not use it anymore.
-  int SessionId() { return session_id_; }
+  ~DevToolsSession() override;
+
+  void ConnectToV8(v8_inspector::V8Inspector*, int context_group_id);
   v8_inspector::V8InspectorSession* V8Session() { return v8_session_.get(); }
 
   void Append(InspectorAgent*);
-  void Restore();
-  void Dispose();
-  void DidStartProvisionalLoad(LocalFrame*);
-  void DidFailProvisionalLoad(LocalFrame*);
-  void DidCommitLoadForLocalFrame(LocalFrame*);
-  void DispatchProtocolMessage(int call_id,
-                               const String& method,
-                               const String& message);
-  void flushProtocolNotifications() override;
-
+  void Detach();
+  void FlushProtocolNotifications();
   void Trace(blink::Visitor*);
 
-  static bool ShouldInterruptForMethod(const String& method);
+  // Core probes.
+  void DidStartProvisionalLoad(LocalFrame*);
+  void DidFailProvisionalLoad(LocalFrame*);
+  void DidCommitLoad(LocalFrame*, DocumentLoader*);
 
  private:
+  class IOSession;
+
+  // mojom::blink::DevToolsSession implementation.
+  void DispatchProtocolCommand(int call_id,
+                               const String& method,
+                               const String& message) override;
+
   // protocol::FrontendChannel implementation.
   void sendProtocolResponse(
       int call_id,
       std::unique_ptr<protocol::Serializable> message) override;
   void sendProtocolNotification(
       std::unique_ptr<protocol::Serializable> message) override;
+  void fallThrough(int call_id,
+                   const String& method,
+                   const String& message) override;
+  void flushProtocolNotifications() override;
 
   // v8_inspector::V8Inspector::Channel implementation.
   void sendResponse(
@@ -86,17 +77,14 @@
   void sendNotification(
       std::unique_ptr<v8_inspector::StringBuffer> message) override;
 
+  bool IsDetached();
   void SendProtocolResponse(int call_id, const String& message);
-  void fallThrough(int call_id,
-                   const String& method,
-                   const String& message) override;
 
-  Client* client_;
+  Member<DevToolsAgent> agent_;
+  mojo::AssociatedBinding<mojom::blink::DevToolsSession> binding_;
+  mojom::blink::DevToolsSessionHostAssociatedPtr host_ptr_;
+  IOSession* io_session_;
   std::unique_ptr<v8_inspector::V8InspectorSession> v8_session_;
-  int session_id_;
-  bool disposed_;
-  Member<CoreProbeSink> instrumenting_agents_;
-  Member<InspectedFrames> inspected_frames_;
   std::unique_ptr<protocol::UberDispatcher> inspector_backend_dispatcher_;
   InspectorSessionState session_state_;
   HeapVector<Member<InspectorAgent>> agents_;
@@ -105,9 +93,9 @@
   InspectorAgentState v8_session_state_;
   InspectorAgentState::String v8_session_state_json_;
 
-  DISALLOW_COPY_AND_ASSIGN(InspectorSession);
+  DISALLOW_COPY_AND_ASSIGN(DevToolsSession);
 };
 
 }  // namespace blink
 
-#endif  // !defined(InspectorSession_h)
+#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_INSPECTOR_DEVTOOLS_SESSION_H_
diff --git a/third_party/blink/renderer/core/inspector/inspector_session.cc b/third_party/blink/renderer/core/inspector/inspector_session.cc
deleted file mode 100644
index f9ebccd..0000000
--- a/third_party/blink/renderer/core/inspector/inspector_session.cc
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "third_party/blink/renderer/core/inspector/inspector_session.h"
-
-#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
-#include "third_party/blink/renderer/core/frame/local_frame.h"
-#include "third_party/blink/renderer/core/frame/use_counter.h"
-#include "third_party/blink/renderer/core/inspector/inspected_frames.h"
-#include "third_party/blink/renderer/core/inspector/inspector_base_agent.h"
-#include "third_party/blink/renderer/core/inspector/inspector_session_state.h"
-#include "third_party/blink/renderer/core/inspector/protocol/Protocol.h"
-#include "third_party/blink/renderer/core/inspector/v8_inspector_string.h"
-#include "third_party/blink/renderer/core/probe/core_probes.h"
-
-namespace blink {
-
-namespace {
-const char kV8StateKey[] = "v8";
-}
-
-// static
-bool InspectorSession::ShouldInterruptForMethod(const String& method) {
-  // Keep in sync with DevToolsSession::ShouldSendOnIO.
-  // TODO(dgozman): find a way to share this.
-  return method == "Debugger.pause" || method == "Debugger.setBreakpoint" ||
-         method == "Debugger.setBreakpointByUrl" ||
-         method == "Debugger.removeBreakpoint" ||
-         method == "Debugger.setBreakpointsActive" ||
-         method == "Performance.getMetrics" || method == "Page.crash" ||
-         method == "Runtime.terminateExecution" ||
-         method == "Emulation.setScriptExecutionDisabled";
-}
-
-InspectorSession::InspectorSession(
-    Client* client,
-    CoreProbeSink* instrumenting_agents,
-    InspectedFrames* inspected_frames,
-    int session_id,
-    v8_inspector::V8Inspector* inspector,
-    int context_group_id,
-    mojom::blink::DevToolsSessionStatePtr reattach_session_state)
-    : client_(client),
-      v8_session_(nullptr),
-      session_id_(session_id),
-      disposed_(false),
-      instrumenting_agents_(instrumenting_agents),
-      inspected_frames_(inspected_frames),
-      inspector_backend_dispatcher_(new protocol::UberDispatcher(this)),
-      session_state_(std::move(reattach_session_state)),
-      v8_session_state_(kV8StateKey),
-      v8_session_state_json_(&v8_session_state_, /*default_value=*/String()) {
-  v8_session_state_.InitFrom(&session_state_);
-
-  // inspector->connect may result in calls to |this| against the
-  // V8Inspector::Channel interface for receiving responses / notifications,
-  // while v8_session_ is still nullptr.
-  v8_session_ =
-      inspector->connect(context_group_id, /*channel*/ this,
-                         ToV8InspectorStringView(v8_session_state_json_.Get()));
-
-  instrumenting_agents_->addInspectorSession(this);
-}
-
-InspectorSession::~InspectorSession() {
-  DCHECK(disposed_);
-}
-
-void InspectorSession::Append(InspectorAgent* agent) {
-  agents_.push_back(agent);
-  agent->Init(instrumenting_agents_.Get(), inspector_backend_dispatcher_.get(),
-              &session_state_);
-}
-
-void InspectorSession::Restore() {
-  DCHECK(!disposed_);
-  for (wtf_size_t i = 0; i < agents_.size(); i++)
-    agents_[i]->Restore();
-}
-
-void InspectorSession::Dispose() {
-  DCHECK(!disposed_);
-  disposed_ = true;
-  instrumenting_agents_->removeInspectorSession(this);
-  inspector_backend_dispatcher_.reset();
-  for (wtf_size_t i = agents_.size(); i > 0; i--)
-    agents_[i - 1]->Dispose();
-  agents_.clear();
-  v8_session_.reset();
-}
-
-void InspectorSession::DispatchProtocolMessage(int call_id,
-                                               const String& method,
-                                               const String& message) {
-  DCHECK(!disposed_);
-  if (v8_inspector::V8InspectorSession::canDispatchMethod(
-          ToV8InspectorStringView(method))) {
-    v8_session_->dispatchProtocolMessage(ToV8InspectorStringView(message));
-  } else {
-    inspector_backend_dispatcher_->dispatch(
-        call_id, method, protocol::StringUtil::parseJSON(message), message);
-  }
-}
-
-void InspectorSession::DidStartProvisionalLoad(LocalFrame* frame) {
-  if (inspected_frames_->Root() == frame) {
-    v8_session_->setSkipAllPauses(true);
-    v8_session_->resume();
-  }
-}
-
-void InspectorSession::DidFailProvisionalLoad(LocalFrame* frame) {
-  if (inspected_frames_->Root() == frame)
-    v8_session_->setSkipAllPauses(false);
-}
-
-void InspectorSession::DidCommitLoadForLocalFrame(LocalFrame* frame) {
-  for (wtf_size_t i = 0; i < agents_.size(); i++)
-    agents_[i]->DidCommitLoadForLocalFrame(frame);
-  if (inspected_frames_->Root() == frame)
-    v8_session_->setSkipAllPauses(false);
-}
-
-void InspectorSession::sendProtocolResponse(
-    int call_id,
-    std::unique_ptr<protocol::Serializable> message) {
-  SendProtocolResponse(call_id, message->serialize());
-}
-
-void InspectorSession::fallThrough(int call_id,
-                                   const String& method,
-                                   const String& message) {
-  // There's no other layer to handle the command.
-  NOTREACHED();
-}
-
-void InspectorSession::sendResponse(
-    int call_id,
-    std::unique_ptr<v8_inspector::StringBuffer> message) {
-  // We can potentially avoid copies if WebString would convert to utf8 right
-  // from StringView, but it uses StringImpl itself, so we don't create any
-  // extra copies here.
-  SendProtocolResponse(call_id, ToCoreString(message->string()));
-}
-
-void InspectorSession::SendProtocolResponse(int call_id,
-                                            const String& message) {
-  if (disposed_)
-    return;
-  flushProtocolNotifications();
-  if (v8_session_)
-    v8_session_state_json_.Set(ToCoreString(v8_session_->stateJSON()));
-  client_->SendProtocolResponse(session_id_, call_id, message,
-                                session_state_.TakeUpdates());
-}
-
-class InspectorSession::Notification {
- public:
-  static std::unique_ptr<Notification> CreateForBlink(
-      std::unique_ptr<protocol::Serializable> notification) {
-    return std::unique_ptr<Notification>(
-        new Notification(std::move(notification)));
-  }
-
-  static std::unique_ptr<Notification> CreateForV8(
-      std::unique_ptr<v8_inspector::StringBuffer> notification) {
-    return std::unique_ptr<Notification>(
-        new Notification(std::move(notification)));
-  }
-
-  String Serialize() {
-    if (blink_notification_) {
-      serialized_ = blink_notification_->serialize();
-      blink_notification_.reset();
-    } else if (v8_notification_) {
-      serialized_ = ToCoreString(v8_notification_->string());
-      v8_notification_.reset();
-    }
-    return serialized_;
-  }
-
- private:
-  explicit Notification(std::unique_ptr<protocol::Serializable> notification)
-      : blink_notification_(std::move(notification)) {}
-
-  explicit Notification(
-      std::unique_ptr<v8_inspector::StringBuffer> notification)
-      : v8_notification_(std::move(notification)) {}
-
-  std::unique_ptr<protocol::Serializable> blink_notification_;
-  std::unique_ptr<v8_inspector::StringBuffer> v8_notification_;
-  String serialized_;
-};
-
-void InspectorSession::sendProtocolNotification(
-    std::unique_ptr<protocol::Serializable> notification) {
-  if (disposed_)
-    return;
-  notification_queue_.push_back(
-      Notification::CreateForBlink(std::move(notification)));
-}
-
-void InspectorSession::sendNotification(
-    std::unique_ptr<v8_inspector::StringBuffer> notification) {
-  if (disposed_)
-    return;
-  notification_queue_.push_back(
-      Notification::CreateForV8(std::move(notification)));
-}
-
-void InspectorSession::flushProtocolNotifications() {
-  if (disposed_)
-    return;
-  for (wtf_size_t i = 0; i < agents_.size(); i++)
-    agents_[i]->FlushPendingProtocolNotifications();
-  if (!notification_queue_.size())
-    return;
-  if (v8_session_)
-    v8_session_state_json_.Set(ToCoreString(v8_session_->stateJSON()));
-  for (wtf_size_t i = 0; i < notification_queue_.size(); ++i) {
-    client_->SendProtocolNotification(session_id_,
-                                      notification_queue_[i]->Serialize(),
-                                      session_state_.TakeUpdates());
-  }
-  notification_queue_.clear();
-}
-
-void InspectorSession::Trace(blink::Visitor* visitor) {
-  visitor->Trace(instrumenting_agents_);
-  visitor->Trace(inspected_frames_);
-  visitor->Trace(agents_);
-}
-
-}  // namespace blink
diff --git a/third_party/blink/renderer/core/inspector/worker_inspector_controller.cc b/third_party/blink/renderer/core/inspector/worker_inspector_controller.cc
index 9a3eecda..dc50f9a 100644
--- a/third_party/blink/renderer/core/inspector/worker_inspector_controller.cc
+++ b/third_party/blink/renderer/core/inspector/worker_inspector_controller.cc
@@ -32,10 +32,10 @@
 
 #include "base/single_thread_task_runner.h"
 #include "third_party/blink/renderer/core/core_probe_sink.h"
+#include "third_party/blink/renderer/core/inspector/devtools_session.h"
 #include "third_party/blink/renderer/core/inspector/inspector_emulation_agent.h"
 #include "third_party/blink/renderer/core/inspector/inspector_log_agent.h"
 #include "third_party/blink/renderer/core/inspector/inspector_network_agent.h"
-#include "third_party/blink/renderer/core/inspector/inspector_session.h"
 #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
 #include "third_party/blink/renderer/core/inspector/protocol/Protocol.h"
 #include "third_party/blink/renderer/core/inspector/worker_thread_debugger.h"
@@ -70,7 +70,10 @@
     scoped_refptr<InspectorTaskRunner> inspector_task_runner,
     mojom::blink::DevToolsAgentRequest agent_request,
     mojom::blink::DevToolsAgentHostPtrInfo host_ptr_info)
-    : debugger_(debugger), thread_(thread), probe_sink_(new CoreProbeSink()) {
+    : debugger_(debugger),
+      thread_(thread),
+      inspected_frames_(nullptr),
+      probe_sink_(new CoreProbeSink()) {
   probe_sink_->addInspectorTraceEvents(new InspectorTraceEvents());
   if (auto* scope = DynamicTo<WorkerGlobalScope>(thread->GlobalScope())) {
     worker_devtools_token_ = thread->GetDevToolsWorkerToken();
@@ -82,7 +85,8 @@
       Platform::Current()->GetIOTaskRunner();
   if (!parent_devtools_token_.is_empty() && io_task_runner) {
     // There may be no io task runner in unit tests.
-    agent_ = new DevToolsAgent(this, std::move(inspector_task_runner),
+    agent_ = new DevToolsAgent(this, inspected_frames_.Get(), probe_sink_.Get(),
+                               std::move(inspector_task_runner),
                                std::move(io_task_runner));
     agent_->BindRequest(std::move(host_ptr_info), std::move(agent_request),
                         thread->GetTaskRunner(TaskType::kInternalInspector));
@@ -96,38 +100,26 @@
   TraceEvent::RemoveEnabledStateObserver(this);
 }
 
-InspectorSession* WorkerInspectorController::AttachSession(
-    InspectorSession::Client* session_client,
-    mojom::blink::DevToolsSessionStatePtr reattach_session_state) {
-  if (!sessions_.size())
+void WorkerInspectorController::AttachSession(DevToolsSession* session,
+                                              bool restore) {
+  if (!session_count_)
     thread_->GetWorkerBackingThread().BackingThread().AddTaskObserver(this);
-
-  bool should_reattach = !reattach_session_state.is_null();
-
-  InspectedFrames* inspected_frames = new InspectedFrames(nullptr);
-  InspectorSession* inspector_session = new InspectorSession(
-      session_client, probe_sink_.Get(), inspected_frames, 0,
-      debugger_->GetV8Inspector(), debugger_->ContextGroupId(thread_),
-      std::move(reattach_session_state));
-  inspector_session->Append(
-      new InspectorLogAgent(thread_->GetConsoleMessageStorage(), nullptr,
-                            inspector_session->V8Session()));
+  session->ConnectToV8(debugger_->GetV8Inspector(),
+                       debugger_->ContextGroupId(thread_));
+  session->Append(new InspectorLogAgent(thread_->GetConsoleMessageStorage(),
+                                        nullptr, session->V8Session()));
   if (auto* scope = DynamicTo<WorkerGlobalScope>(thread_->GlobalScope())) {
     DCHECK(scope->EnsureFetcher());
-    inspector_session->Append(new InspectorNetworkAgent(
-        inspected_frames, scope, inspector_session->V8Session()));
-    inspector_session->Append(new InspectorEmulationAgent(nullptr));
+    session->Append(new InspectorNetworkAgent(inspected_frames_.Get(), scope,
+                                              session->V8Session()));
+    session->Append(new InspectorEmulationAgent(nullptr));
   }
-
-  if (should_reattach)
-    inspector_session->Restore();
-  sessions_.insert(inspector_session);
-  return inspector_session;
+  ++session_count_;
 }
 
-void WorkerInspectorController::DetachSession(InspectorSession* session) {
-  sessions_.erase(session);
-  if (!sessions_.size())
+void WorkerInspectorController::DetachSession(DevToolsSession*) {
+  --session_count_;
+  if (!session_count_)
     thread_->GetWorkerBackingThread().BackingThread().RemoveTaskObserver(this);
 }
 
@@ -181,8 +173,8 @@
 
 void WorkerInspectorController::Trace(blink::Visitor* visitor) {
   visitor->Trace(agent_);
+  visitor->Trace(inspected_frames_);
   visitor->Trace(probe_sink_);
-  visitor->Trace(sessions_);
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/inspector/worker_inspector_controller.h b/third_party/blink/renderer/core/inspector/worker_inspector_controller.h
index 694322d1..8445b41 100644
--- a/third_party/blink/renderer/core/inspector/worker_inspector_controller.h
+++ b/third_party/blink/renderer/core/inspector/worker_inspector_controller.h
@@ -47,6 +47,7 @@
 namespace blink {
 
 class CoreProbeSink;
+class InspectedFrames;
 class WorkerThread;
 class WorkerThreadDebugger;
 
@@ -87,10 +88,8 @@
   void EmitTraceEvent();
 
   // DevToolsAgent::Client implementation.
-  InspectorSession* AttachSession(
-      InspectorSession::Client*,
-      mojom::blink::DevToolsSessionStatePtr reattach_session_state) override;
-  void DetachSession(InspectorSession*) override;
+  void AttachSession(DevToolsSession*, bool restore) override;
+  void DetachSession(DevToolsSession*) override;
   void InspectElement(const WebPoint&) override;
   void DebuggerTaskStarted() override;
   void DebuggerTaskFinished() override;
@@ -98,8 +97,9 @@
   Member<DevToolsAgent> agent_;
   WorkerThreadDebugger* debugger_;
   WorkerThread* thread_;
+  Member<InspectedFrames> inspected_frames_;
   Member<CoreProbeSink> probe_sink_;
-  HeapHashSet<Member<InspectorSession>> sessions_;
+  int session_count_ = 0;
 
   // These fields are set up in the constructor and then read
   // on a random thread from EmitTraceEvent().
diff --git a/third_party/blink/renderer/core/layout/layout_box.cc b/third_party/blink/renderer/core/layout/layout_box.cc
index 1707ab9..f5312cf4 100644
--- a/third_party/blink/renderer/core/layout/layout_box.cc
+++ b/third_party/blink/renderer/core/layout/layout_box.cc
@@ -693,13 +693,6 @@
     absolute_rect_for_parent =
         area_to_scroll->ScrollIntoView(absolute_rect_to_scroll, params);
 
-    // TODO(bokan): This is a hack to reconcile the fact that scrolling a
-    // FrameView pre-RLS and post-RLS resulted in different absolute coordinate
-    // changes to the target. This line and PendingOffsetToScroll can be
-    // removed once RLS is stable. https://crbug.com/823365.
-    if (params.is_for_scroll_sequence)
-      absolute_rect_for_parent.Move(PendingOffsetToScroll());
-
     // If the parent is a local iframe, convert to the absolute coordinate
     // space of its document. For remote frames, this will happen on the other
     // end of the IPC call.
@@ -6002,10 +5995,6 @@
   rare_data_->layout_child_ = nullptr;
 }
 
-void LayoutBox::SetPendingOffsetToScroll(LayoutSize offset) {
-  EnsureRareData().pending_offset_to_scroll_ = offset;
-}
-
 LayoutRect LayoutBox::DebugRect() const {
   LayoutRect rect = FrameRect();
 
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h
index af08e08d..1c9ecc85 100644
--- a/third_party/blink/renderer/core/layout/layout_box.h
+++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -118,13 +118,6 @@
   LayoutRect previous_physical_content_box_rect_;
   LayoutRect previous_physical_layout_overflow_rect_;
 
-  // Used by LocalFrameView::ScrollIntoView. When the scroll is sequenced
-  // rather than instantly performed, we need the pending_offset_to_scroll
-  // to calculate the next rect_to_scroll as if the scroll has been performed.
-  // TODO(sunyunjia): We should get rid of this variable and move the next
-  // rect_to_scroll calculation into ScrollRectToVisible. crbug.com/741830
-  LayoutSize pending_offset_to_scroll_;
-
   // Used by CSSLayoutDefinition::Instance::Layout. Represents the script
   // object for this box that web developers can query style, and perform
   // layout upon. Only created if IsCustomItem() is true.
@@ -845,11 +838,6 @@
   }
   void SetOffsetToNextPage(LayoutUnit);
 
-  LayoutSize PendingOffsetToScroll() const {
-    return rare_data_ ? rare_data_->pending_offset_to_scroll_ : LayoutSize();
-  }
-  void SetPendingOffsetToScroll(LayoutSize);
-
   // Specify which page or column to associate with an offset, if said offset is
   // exactly at a page or column boundary.
   enum PageBoundaryRule { kAssociateWithFormerPage, kAssociateWithLatterPage };
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_box_state.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_box_state.cc
index 04c62e2a..c5794730 100644
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_box_state.cc
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_box_state.cc
@@ -394,6 +394,7 @@
   // origins at (0, 0). Accumulate inline offset from left to right.
   LayoutUnit position;
   for (NGLineBoxFragmentBuilder::Child& child : *line_box) {
+    child.margin_line_left = child.offset.inline_offset;
     child.offset.inline_offset += position;
     // Box margins/boders/paddings will be processed later.
     // TODO(kojii): we could optimize this if the reordering did not occur.
@@ -439,7 +440,8 @@
     // boxes, while accumulating its margin/border/padding.
     unsigned start = box_data.fragment_start;
     NGLineBoxFragmentBuilder::Child& start_child = (*line_box)[start];
-    LayoutUnit line_left_offset = start_child.offset.inline_offset;
+    LayoutUnit line_left_offset =
+        start_child.offset.inline_offset - start_child.margin_line_left;
     LinePadding& start_padding = accumulated_padding[start];
     start_padding.line_left += box_data.margin_border_padding_line_left;
     line_left_offset -= start_padding.line_left - box_data.margin_line_left;
@@ -447,8 +449,9 @@
     DCHECK_GT(box_data.fragment_end, start);
     unsigned last = box_data.fragment_end - 1;
     NGLineBoxFragmentBuilder::Child& last_child = (*line_box)[last];
-    LayoutUnit line_right_offset =
-        last_child.offset.inline_offset + last_child.inline_size;
+    LayoutUnit line_right_offset = last_child.offset.inline_offset -
+                                   last_child.margin_line_left +
+                                   last_child.inline_size;
     LinePadding& last_padding = accumulated_padding[last];
     last_padding.line_right += box_data.margin_border_padding_line_right;
     line_right_offset += last_padding.line_right - box_data.margin_line_right;
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h b/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
index 6ccf142f..623f813f 100644
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_box_fragment_builder.h
@@ -66,8 +66,14 @@
     scoped_refptr<const NGPhysicalFragment> fragment;
     LayoutObject* out_of_flow_positioned_box = nullptr;
     LayoutObject* out_of_flow_containing_box = nullptr;
+    // The offset of the border box, initially in this child coordinate system.
+    // |ComputeInlinePositions()| converts it to the offset within the line box.
     NGLogicalOffset offset;
+    // The inline size of the margin box.
     LayoutUnit inline_size;
+    LayoutUnit margin_line_left;
+    // The index of |box_data_list_|, used in |PrepareForReorder()| and
+    // |UpdateAfterReorder()| to track children of boxes across BiDi reorder.
     unsigned box_data_index = 0;
     UBiDiLevel bidi_level = 0xff;
 
diff --git a/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc b/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc
index 28fa2aa..fcdd5ab5 100644
--- a/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc
+++ b/third_party/blink/renderer/core/paint/image_paint_timing_detector.cc
@@ -7,7 +7,9 @@
 #include "third_party/blink/renderer/core/frame/local_frame_view.h"
 #include "third_party/blink/renderer/core/inspector/identifiers_factory.h"
 #include "third_party/blink/renderer/core/layout/layout_image.h"
+#include "third_party/blink/renderer/core/layout/layout_image_resource.h"
 #include "third_party/blink/renderer/core/layout/layout_view.h"
+#include "third_party/blink/renderer/core/layout/svg/layout_svg_image.h"
 #include "third_party/blink/renderer/core/page/chrome_client.h"
 #include "third_party/blink/renderer/core/page/page.h"
 #include "third_party/blink/renderer/core/paint/paint_layer.h"
@@ -234,11 +236,22 @@
   if (size_zero_ids_.Contains(node_id))
     return;
 
-  const LayoutImage* image = ToLayoutImage(&object);
+  ImageResourceContent* cachedImg;
+  if (object.IsSVGImage()) {
+    const LayoutImageResource* imageResource =
+        ToLayoutSVGImage(&object)->ImageResource();
+    if (imageResource)
+      cachedImg = imageResource->CachedImage();
+  } else {
+    DCHECK(object.IsImage() || object.IsVideo());
+    // Both image and video can be casted to LayoutImage, since LayoutVideo
+    // inherits from LayoutImage.
+    cachedImg = ToLayoutImage(&object)->CachedImage();
+  }
   if (!id_record_map_.Contains(node_id)) {
     recorded_node_count_++;
     if (recorded_node_count_ < kImageNodeNumberLimit) {
-      LayoutRect invalidated_rect = image->FirstFragment().VisualRect();
+      LayoutRect invalidated_rect = object.FirstFragment().VisualRect();
       // Do not record first size until invalidated_rect's size becomes
       // non-empty.
       if (invalidated_rect.IsEmpty())
@@ -259,7 +272,6 @@
       record->frame_index = frame_index_;
       record->first_size = rect_size;
       record->first_paint_index = ++first_paint_index_max_;
-      ImageResourceContent* cachedImg = image->CachedImage();
       record->image_url =
           !cachedImg ? "" : cachedImg->Url().StrippedForUseAsReferrer();
       largest_image_heap_.push(record->AsWeakPtr());
@@ -275,15 +287,15 @@
   }
 
   if (id_record_map_.Contains(node_id) &&
-      IsJustLoaded(image, *id_record_map_.at(node_id))) {
+      IsJustLoaded(cachedImg, *id_record_map_.at(node_id))) {
     records_pending_timing_.push(node_id);
     id_record_map_.at(node_id)->loaded = true;
   }
 }
 
-bool ImagePaintTimingDetector::IsJustLoaded(const LayoutImage* image,
-                                            const ImageRecord& record) const {
-  ImageResourceContent* cachedImg = image->CachedImage();
+bool ImagePaintTimingDetector::IsJustLoaded(
+    const ImageResourceContent* cachedImg,
+    const ImageRecord& record) const {
   return cachedImg && cachedImg->IsLoaded() && !record.loaded;
 }
 
diff --git a/third_party/blink/renderer/core/paint/image_paint_timing_detector.h b/third_party/blink/renderer/core/paint/image_paint_timing_detector.h
index c3e360df..f373018 100644
--- a/third_party/blink/renderer/core/paint/image_paint_timing_detector.h
+++ b/third_party/blink/renderer/core/paint/image_paint_timing_detector.h
@@ -21,7 +21,7 @@
 class LayoutObject;
 class TracedValue;
 class LocalFrameView;
-class LayoutImage;
+class ImageResourceContent;
 
 class ImageRecord : public base::SupportsWeakPtr<ImageRecord> {
  public:
@@ -64,9 +64,8 @@
   friend class ImagePaintTimingDetectorTest;
 
  public:
-  ImagePaintTimingDetector(LocalFrameView* frame_view);
-  void RecordImage(const LayoutObject& object,
-                   const PaintLayer& painting_layer);
+  ImagePaintTimingDetector(LocalFrameView*);
+  void RecordImage(const LayoutObject&, const PaintLayer&);
   void OnPrePaintFinished();
   void NotifyNodeRemoved(DOMNodeId);
   base::TimeTicks LargestImagePaint() const { return largest_image_paint_; }
@@ -76,11 +75,11 @@
  private:
   ImageRecord* FindLargestPaintCandidate();
   ImageRecord* FindLastPaintCandidate();
-  void PopulateTraceValue(TracedValue& value,
+  void PopulateTraceValue(TracedValue&,
                           const ImageRecord& first_image_paint,
                           unsigned report_count) const;
   IntRect CalculateTransformedRect(LayoutRect& visual_rect,
-                                   const PaintLayer& painting_layer) const;
+                                   const PaintLayer&) const;
   // This is provided for unit test to force invoking swap promise callback.
   void ReportSwapTime(unsigned max_frame_index_to_time,
                       WebLayerTreeView::SwapResult,
@@ -89,7 +88,8 @@
   void OnLargestImagePaintDetected(const ImageRecord&);
   void OnLastImagePaintDetected(const ImageRecord&);
 
-  bool IsJustLoaded(const LayoutImage*, const ImageRecord&) const;
+  bool IsJustLoaded(const ImageResourceContent* cachedImg,
+                    const ImageRecord&) const;
   void Analyze();
 
   base::RepeatingCallback<void(WebLayerTreeView::ReportTimeCallback)>
diff --git a/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc b/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc
index a231137..cf63a0d 100644
--- a/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc
+++ b/third_party/blink/renderer/core/paint/image_paint_timing_detector_test.cc
@@ -5,7 +5,9 @@
 #include "third_party/blink/renderer/core/paint/image_paint_timing_detector.h"
 #include "build/build_config.h"
 #include "third_party/blink/renderer/core/html/html_image_element.h"
+#include "third_party/blink/renderer/core/html/media/html_video_element.h"
 #include "third_party/blink/renderer/core/paint/paint_tracker.h"
+#include "third_party/blink/renderer/core/svg/svg_image_element.h"
 #include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"
 #include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
 #include "third_party/blink/renderer/platform/runtime_enabled_features.h"
@@ -71,14 +73,29 @@
   void SetImageAndPaint(AtomicString id, int width, int height) {
     Element* element = GetDocument().getElementById(id);
     // Set image and make it loaded.
-    SetImageForTest(ToHTMLImageElement(element), width, height);
+    ImageResourceContent* content = CreateImageForTest(width, height);
+    ToHTMLImageElement(element)->SetImageForTest(content);
+  }
+
+  void SetVideoImageAndPaint(AtomicString id, int width, int height) {
+    Element* element = GetDocument().getElementById(id);
+    // Set image and make it loaded.
+    ImageResourceContent* content = CreateImageForTest(width, height);
+    ToHTMLVideoElement(element)->SetImageForTest(content);
+  }
+
+  void SetSVGImageAndPaint(AtomicString id, int width, int height) {
+    Element* element = GetDocument().getElementById(id);
+    // Set image and make it loaded.
+    ImageResourceContent* content = CreateImageForTest(width, height);
+    ToSVGImageElement(element)->SetImageForTest(content);
   }
 
  private:
   void FakeNotifySwapTime(WebLayerTreeView::ReportTimeCallback callback) {
     callback_queue_.push(std::move(callback));
   }
-  void SetImageForTest(HTMLImageElement* image_element, int width, int height) {
+  ImageResourceContent* CreateImageForTest(int width, int height) {
     sk_sp<SkColorSpace> src_rgb_color_space = SkColorSpace::MakeSRGB();
     SkImageInfo raster_image_info =
         SkImageInfo::MakeN32Premul(width, height, src_rgb_color_space);
@@ -87,7 +104,7 @@
     ImageResourceContent* original_image_resource =
         ImageResourceContent::CreateLoaded(
             StaticBitmapImage::Create(image).get());
-    image_element->SetImageForTest(original_image_resource);
+    return original_image_resource;
   }
 
   CallbackQueue callback_queue_;
@@ -406,4 +423,45 @@
   EXPECT_GE(time3, result2);
 }
 
+TEST_F(ImagePaintTimingDetectorTest, VideoImage) {
+  SetBodyInnerHTML(R"HTML(
+    <video id="target" poster="http://example.com/nonexistant.gif"></video>
+  )HTML");
+
+  SetVideoImageAndPaint("target", 5, 5);
+
+  UpdateAllLifecyclePhasesAndInvokeCallbackIfAny();
+  ImageRecord* record = FindLastPaintCandidate();
+  EXPECT_TRUE(record);
+  EXPECT_GT(record->first_size, 0);
+  EXPECT_TRUE(record->loaded);
+}
+
+TEST_F(ImagePaintTimingDetectorTest, VideoImage_ImageNotLoaded) {
+  SetBodyInnerHTML(R"HTML(
+    <video id="target" poster="http://example.com/nonexistant.gif"></video>
+  )HTML");
+
+  UpdateAllLifecyclePhasesAndInvokeCallbackIfAny();
+  ImageRecord* record = FindLastPaintCandidate();
+  EXPECT_FALSE(record);
+}
+
+TEST_F(ImagePaintTimingDetectorTest, SVGImage) {
+  SetBodyInnerHTML(R"HTML(
+    <svg>
+      <image id="target" width="10" height="10"
+        xlink:href="http://example.com/nonexistant.jpg"/>
+    </svg>
+  )HTML");
+
+  SetSVGImageAndPaint("target", 5, 5);
+
+  UpdateAllLifecyclePhasesAndInvokeCallbackIfAny();
+  ImageRecord* record = FindLastPaintCandidate();
+  EXPECT_TRUE(record);
+  EXPECT_GT(record->first_size, 0);
+  EXPECT_TRUE(record->loaded);
+}
+
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/paint/paint_tracker.cc b/third_party/blink/renderer/core/paint/paint_tracker.cc
index f5514ad..86947ac5 100644
--- a/third_party/blink/renderer/core/paint/paint_tracker.cc
+++ b/third_party/blink/renderer/core/paint/paint_tracker.cc
@@ -32,7 +32,7 @@
   if (object.IsText()) {
     text_paint_timing_detector_->RecordText(object, painting_layer);
   }
-  if (object.IsImage()) {
+  if (object.IsImage() || object.IsVideo() || object.IsSVGImage()) {
     image_paint_timing_detector_->RecordImage(object, painting_layer);
   }
   // Todo(maxlg): add other detectors here.
diff --git a/third_party/blink/renderer/core/probe/core_probes.json5 b/third_party/blink/renderer/core/probe/core_probes.json5
index 37748538..f95bfba5 100644
--- a/third_party/blink/renderer/core/probe/core_probes.json5
+++ b/third_party/blink/renderer/core/probe/core_probes.json5
@@ -208,10 +208,12 @@
         "willSendRequest",
       ]
     },
-    InspectorSession: {
+    DevToolsSession: {
+      class: "DevToolsSession",
       probes: [
         "didStartProvisionalLoad",
         "didFailProvisionalLoad",
+        "didCommitLoad",
       ]
     },
   }
diff --git a/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.h b/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.h
index a67a4e59..16ff4a8c 100644
--- a/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.h
+++ b/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.h
@@ -30,7 +30,6 @@
 
 #include "third_party/blink/renderer/core/scroll/ns_scroller_imp_details.h"
 #include "third_party/blink/renderer/core/scroll/scrollbar_theme.h"
-#include "third_party/blink/renderer/platform/scroll/web_scrollbar_theme_client.h"
 
 typedef id ScrollbarPainter;
 
@@ -38,8 +37,7 @@
 
 class Pattern;
 
-class PLATFORM_EXPORT ScrollbarThemeMac : public ScrollbarTheme,
-                                          public WebScrollbarThemeClient {
+class PLATFORM_EXPORT ScrollbarThemeMac : public ScrollbarTheme {
  public:
   ScrollbarThemeMac();
   ~ScrollbarThemeMac() override;
@@ -94,10 +92,15 @@
 
   float ThumbOpacity(const Scrollbar&) const override;
 
-  void PreferencesChanged() override;
-
   static NSScrollerStyle RecommendedScrollerStyle();
-  static void SetJumpOnTrackClick(bool);
+
+  // See WebScrollbarTheme for parameters description.
+  static void UpdateScrollbarsWithNSDefaults(
+      float initial_button_delay,
+      float autoscroll_button_delay,
+      NSScrollerStyle preferred_scroller_style,
+      bool redraw,
+      bool jump_on_track_click);
 
  protected:
   int MaxOverlapBetweenPages() override { return 40; }
diff --git a/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm b/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm
index 7ec35a7..3d47a35 100644
--- a/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm
+++ b/third_party/blink/renderer/core/scroll/scrollbar_theme_mac.mm
@@ -104,6 +104,11 @@
 
 namespace blink {
 
+static float s_initial_button_delay = 0.5f;
+static float s_autoscroll_button_delay = 0.05f;
+static NSScrollerStyle s_preferred_scroller_style = NSScrollerStyleLegacy;
+static bool s_jump_on_track_click = false;
+
 typedef HeapHashSet<WeakMember<Scrollbar>> ScrollbarSet;
 
 static ScrollbarSet& GetScrollbarSet() {
@@ -130,7 +135,6 @@
 }
 
 ScrollbarThemeMac::ScrollbarThemeMac() {
-  WebScrollbarTheme::RegisterClient(*this);
 }
 
 ScrollbarTheme& ScrollbarTheme::NativeTheme() {
@@ -151,19 +155,18 @@
                                             const WebMouseEvent& event) {
   bool alt_key_pressed = event.GetModifiers() & WebInputEvent::kAltKey;
   return (event.button == WebPointerProperties::Button::kLeft) &&
-         (WebScrollbarTheme::JumpOnTrackClick() != alt_key_pressed);
+         (s_jump_on_track_click != alt_key_pressed);
 }
 
 ScrollbarThemeMac::~ScrollbarThemeMac() {
-  WebScrollbarTheme::UnregisterClient(*this);
 }
 
 TimeDelta ScrollbarThemeMac::InitialAutoscrollTimerDelay() {
-  return TimeDelta::FromSecondsD(WebScrollbarTheme::InitialButtonDelay());
+  return TimeDelta::FromSecondsD(s_initial_button_delay);
 }
 
 TimeDelta ScrollbarThemeMac::AutoscrollTimerDelay() {
-  return TimeDelta::FromSecondsD(WebScrollbarTheme::AutoscrollButtonDelay());
+  return TimeDelta::FromSecondsD(s_autoscroll_button_delay);
 }
 
 bool ScrollbarThemeMac::ShouldDragDocumentInsteadOfThumb(
@@ -412,10 +415,22 @@
   return [scrollbar_painter knobAlpha];
 }
 
-void ScrollbarThemeMac::PreferencesChanged() {
-  for (const auto& scrollbar : GetScrollbarSet()) {
-    scrollbar->StyleChanged();
-    scrollbar->SetNeedsPaintInvalidation(kAllParts);
+// static
+void ScrollbarThemeMac::UpdateScrollbarsWithNSDefaults(
+    float initial_button_delay,
+    float autoscroll_button_delay,
+    NSScrollerStyle preferred_scroller_style,
+    bool redraw,
+    bool jump_on_track_click) {
+  s_initial_button_delay = initial_button_delay;
+  s_autoscroll_button_delay = autoscroll_button_delay;
+  s_preferred_scroller_style = preferred_scroller_style;
+  s_jump_on_track_click = jump_on_track_click;
+  if (redraw) {
+    for (const auto& scrollbar : GetScrollbarSet()) {
+      scrollbar->StyleChanged();
+      scrollbar->SetNeedsPaintInvalidation(kAllParts);
+    }
   }
 }
 
@@ -423,8 +438,7 @@
 NSScrollerStyle ScrollbarThemeMac::RecommendedScrollerStyle() {
   if (RuntimeEnabledFeatures::OverlayScrollbarsEnabled())
     return NSScrollerStyleOverlay;
-  return static_cast<NSScrollerStyle>(
-      WebScrollbarTheme::PreferredScrollerStyle());
+  return s_preferred_scroller_style;
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/scroll/web_scrollbar_theme.mm b/third_party/blink/renderer/core/scroll/web_scrollbar_theme.mm
index 86a570a4..55530f5 100644
--- a/third_party/blink/renderer/core/scroll/web_scrollbar_theme.mm
+++ b/third_party/blink/renderer/core/scroll/web_scrollbar_theme.mm
@@ -44,58 +44,16 @@
                   NSScrollerStyleOverlay,
               "ScrollerStyleOverlay must match NSScrollerStyleOverlay");
 
-typedef WTF::HashSet<WebScrollbarThemeClient*> ClientSet;
-
-static ClientSet& GetClientSet() {
-  DEFINE_STATIC_LOCAL(ClientSet, set, ());
-  return set;
-}
-
-static float s_initial_button_delay = 0.5f;
-static float s_autoscroll_button_delay = 0.05f;
-static ScrollerStyle s_preferred_scroller_style = kScrollerStyleLegacy;
-static bool s_jump_on_track_click = false;
-
 void WebScrollbarTheme::UpdateScrollbarsWithNSDefaults(
     float initial_button_delay,
     float autoscroll_button_delay,
     ScrollerStyle preferred_scroller_style,
     bool redraw,
     bool jump_on_track_click) {
-  s_initial_button_delay = initial_button_delay;
-  s_autoscroll_button_delay = autoscroll_button_delay;
-  s_preferred_scroller_style = preferred_scroller_style;
-  s_jump_on_track_click = jump_on_track_click;
-
-  if (redraw && !GetClientSet().IsEmpty()) {
-    for (auto* client : GetClientSet()) {
-      client->PreferencesChanged();
-    }
-  }
-}
-
-float WebScrollbarTheme::InitialButtonDelay() {
-  return s_initial_button_delay;
-}
-
-float WebScrollbarTheme::AutoscrollButtonDelay() {
-  return s_autoscroll_button_delay;
-}
-
-ScrollerStyle WebScrollbarTheme::PreferredScrollerStyle() {
-  return s_preferred_scroller_style;
-}
-
-bool WebScrollbarTheme::JumpOnTrackClick() {
-  return s_jump_on_track_click;
-}
-
-void WebScrollbarTheme::RegisterClient(WebScrollbarThemeClient& client) {
-  GetClientSet().insert(&client);
-}
-
-void WebScrollbarTheme::UnregisterClient(WebScrollbarThemeClient& client) {
-  GetClientSet().erase(&client);
+  ScrollbarThemeMac::UpdateScrollbarsWithNSDefaults(
+      initial_button_delay, autoscroll_button_delay,
+      static_cast<NSScrollerStyle>(preferred_scroller_style), redraw,
+      jump_on_track_click);
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/svg/svg_image_element.h b/third_party/blink/renderer/core/svg/svg_image_element.h
index 711256c..333eb0d 100644
--- a/third_party/blink/renderer/core/svg/svg_image_element.h
+++ b/third_party/blink/renderer/core/svg/svg_image_element.h
@@ -73,6 +73,10 @@
     return is_default_overridden_intrinsic_size_;
   }
 
+  void SetImageForTest(ImageResourceContent* content) {
+    GetImageLoader().SetImageForTest(content);
+  }
+
  private:
   explicit SVGImageElement(Document&);
 
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc
index eacec448..8b14ed18 100644
--- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc
+++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.cc
@@ -1542,7 +1542,21 @@
       ExitFullscreen();
     else
       EnterFullscreen();
+
+    // If we paused for the first click of this double-click, then we need to
+    // resume playback, since the user was just toggling fullscreen.
+    if (is_paused_for_double_tap_) {
+      MediaElement().Play();
+      is_paused_for_double_tap_ = false;
+    }
   } else {
+    // If the video is not paused, assume the user is clicking to pause the
+    // video. If the user clicks again for a fullscreen-toggling double-tap, we
+    // will resume playback.
+    if (!MediaElement().paused()) {
+      MediaElement().pause();
+      is_paused_for_double_tap_ = true;
+    }
     tap_timer_.StartOneShot(kDoubleTapDelay, FROM_HERE);
   }
 }
@@ -1624,8 +1638,23 @@
 }
 
 void MediaControlsImpl::TapTimerFired(TimerBase*) {
-  if (is_touch_interaction_)
+  if (is_touch_interaction_) {
     MaybeToggleControlsFromTap();
+  } else if (MediaElement().paused()) {
+    // If this is not a touch interaction and the video is paused, then either
+    // the user has just paused via click (in which case we've already paused
+    // and there's nothing to do), or the user is playing by click (in which
+    // case we need to start playing).
+    if (is_paused_for_double_tap_) {
+      // TODO(https://crbug.com/896255): Add and record useraction.
+      // TODO(https://crbug.com/896252): Show overlay pause animation.
+      is_paused_for_double_tap_ = false;
+    } else {
+      // TODO(https://crbug.com/896255): Add and record useraction.
+      // TODO(https://crbug.com/896252): Show overlay play animation.
+      MediaElement().Play();
+    }
+  }
 }
 
 void MediaControlsImpl::HideMediaControlsTimerFired(TimerBase*) {
diff --git a/third_party/blink/renderer/modules/media_controls/media_controls_impl.h b/third_party/blink/renderer/modules/media_controls/media_controls_impl.h
index 43f3a294..c56aa083 100644
--- a/third_party/blink/renderer/modules/media_controls/media_controls_impl.h
+++ b/third_party/blink/renderer/modules/media_controls/media_controls_impl.h
@@ -413,6 +413,7 @@
 
   // Timer for distinguishing double-taps.
   TaskRunnerTimer<MediaControlsImpl> tap_timer_;
+  bool is_paused_for_double_tap_ = false;
 
   bool is_test_mode_ = false;
 };
diff --git a/third_party/blink/renderer/modules/modules_initializer.cc b/third_party/blink/renderer/modules/modules_initializer.cc
index 9faf47ed..14f7893 100644
--- a/third_party/blink/renderer/modules/modules_initializer.cc
+++ b/third_party/blink/renderer/modules/modules_initializer.cc
@@ -22,7 +22,7 @@
 #include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
 #include "third_party/blink/renderer/core/html/canvas/html_canvas_element.h"
 #include "third_party/blink/renderer/core/html/media/html_media_element.h"
-#include "third_party/blink/renderer/core/inspector/inspector_session.h"
+#include "third_party/blink/renderer/core/inspector/devtools_session.h"
 #include "third_party/blink/renderer/core/offscreencanvas/offscreen_canvas.h"
 #include "third_party/blink/renderer/core/origin_trials/origin_trials.h"
 #include "third_party/blink/renderer/core/page/chrome_client.h"
@@ -211,7 +211,7 @@
 }
 
 void ModulesInitializer::InitInspectorAgentSession(
-    InspectorSession* session,
+    DevToolsSession* session,
     bool allow_view_agents,
     InspectorDOMAgent* dom_agent,
     InspectedFrames* inspected_frames,
diff --git a/third_party/blink/renderer/modules/modules_initializer.h b/third_party/blink/renderer/modules/modules_initializer.h
index 4a7fc6c..e67c306 100644
--- a/third_party/blink/renderer/modules/modules_initializer.h
+++ b/third_party/blink/renderer/modules/modules_initializer.h
@@ -28,7 +28,7 @@
                                      ShadowRoot&) const override;
   PictureInPictureController* CreatePictureInPictureController(
       Document&) const override;
-  void InitInspectorAgentSession(InspectorSession*,
+  void InitInspectorAgentSession(DevToolsSession*,
                                  bool,
                                  InspectorDOMAgent*,
                                  InspectedFrames*,
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn
index 8d1bd60..fa192ab 100644
--- a/third_party/blink/renderer/platform/BUILD.gn
+++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -1242,7 +1242,6 @@
     "scroll/scroll_alignment.h",
     "scroll/scroll_snap_data.h",
     "scroll/scroll_types.h",
-    "scroll/web_scrollbar_theme_client.h",
     "serialized_resource.h",
     "shared_buffer.cc",
     "shared_buffer.h",
diff --git a/third_party/blink/renderer/platform/bindings/DEPS b/third_party/blink/renderer/platform/bindings/DEPS
index 87cfbf26..60bef51 100644
--- a/third_party/blink/renderer/platform/bindings/DEPS
+++ b/third_party/blink/renderer/platform/bindings/DEPS
@@ -7,6 +7,7 @@
 
     # Dependencies.
     "+gin/public",
+    "+third_party/blink/renderer/platform/cross_thread_functional.h",
     "+third_party/blink/renderer/platform/heap",
     "+third_party/blink/renderer/platform/instance_counters.h",
     "+third_party/blink/renderer/platform/instrumentation",
@@ -14,6 +15,8 @@
     "+third_party/blink/renderer/platform/runtime_enabled_features.h",
     "+third_party/blink/renderer/platform/scheduler",
     "+third_party/blink/renderer/platform/testing",
+    "+third_party/blink/renderer/platform/web_task_runner.h",
     "+third_party/blink/renderer/platform/weborigin",
     "+third_party/blink/renderer/platform/wtf",
+    "+third_party/zlib/google/compression_utils.h",
 ]
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string.cc b/third_party/blink/renderer/platform/bindings/parkable_string.cc
index 94855c7..a8f35c5 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string.cc
+++ b/third_party/blink/renderer/platform/bindings/parkable_string.cc
@@ -4,15 +4,23 @@
 
 #include "third_party/blink/renderer/platform/bindings/parkable_string.h"
 
+#include <string>
+
 #include "base/bind.h"
 #include "base/logging.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/single_thread_task_runner.h"
+#include "base/trace_event/trace_event.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/renderer/platform/bindings/parkable_string_manager.h"
+#include "third_party/blink/renderer/platform/cross_thread_functional.h"
+#include "third_party/blink/renderer/platform/scheduler/public/background_scheduler.h"
 #include "third_party/blink/renderer/platform/scheduler/public/thread.h"
+#include "third_party/blink/renderer/platform/web_task_runner.h"
 #include "third_party/blink/renderer/platform/wtf/address_sanitizer.h"
 #include "third_party/blink/renderer/platform/wtf/thread_specific.h"
+#include "third_party/blink/renderer/platform/wtf/vector.h"
+#include "third_party/zlib/google/compression_utils.h"
 
 namespace blink {
 
@@ -24,6 +32,8 @@
 
 void AsanPoisonString(const String& string) {
 #if defined(ADDRESS_SANITIZER)
+  if (string.IsNull())
+    return;
   // Since |string| is not deallocated, it remains in the per-thread
   // AtomicStringTable, where its content can be accessed for equality
   // comparison for instance, triggering a poisoned memory access.
@@ -31,24 +41,48 @@
   if (string.Impl()->IsAtomic())
     return;
 
-  const void* start = string.Is8Bit()
-                          ? static_cast<const void*>(string.Characters8())
-                          : static_cast<const void*>(string.Characters16());
-  ASAN_POISON_MEMORY_REGION(start, string.CharactersSizeInBytes());
+  ASAN_POISON_MEMORY_REGION(string.Bytes(), string.CharactersSizeInBytes());
 #endif  // defined(ADDRESS_SANITIZER)
 }
 
 void AsanUnpoisonString(const String& string) {
 #if defined(ADDRESS_SANITIZER)
-  const void* start = string.Is8Bit()
-                          ? static_cast<const void*>(string.Characters8())
-                          : static_cast<const void*>(string.Characters16());
-  ASAN_UNPOISON_MEMORY_REGION(start, string.CharactersSizeInBytes());
+  if (string.IsNull())
+    return;
+
+  ASAN_UNPOISON_MEMORY_REGION(string.Bytes(), string.CharactersSizeInBytes());
 #endif  // defined(ADDRESS_SANITIZER)
 }
 
 }  // namespace
 
+// Created and destroyed on the same thread, accessed on a background thread as
+// well. |string|'s reference counting is *not* thread-safe, hence |string|'s
+// reference count must *not* change on the background thread.
+struct CompressionTaskParams final {
+  CompressionTaskParams(
+      scoped_refptr<ParkableStringImpl> string,
+      const void* data,
+      size_t size,
+      scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner)
+      : string(string),
+        data(data),
+        size(size),
+        callback_task_runner(std::move(callback_task_runner)) {
+    DCHECK(IsMainThread());
+  }
+
+  ~CompressionTaskParams() { DCHECK(IsMainThread()); }
+
+  const scoped_refptr<ParkableStringImpl> string;
+  const void* data;
+  const size_t size;
+  const scoped_refptr<base::SingleThreadTaskRunner> callback_task_runner;
+
+  DISALLOW_COPY_AND_ASSIGN(CompressionTaskParams);
+  CompressionTaskParams(CompressionTaskParams&&) = delete;
+};
+
 // Valid transitions are:
 // 1. kUnparked -> kParkingInProgress: Parking started asynchronously
 // 2. kParkingInProgress -> kUnparked: Parking did not complete
@@ -65,9 +99,7 @@
       lock_depth_(0),
       state_(State::kUnparked),
       string_(std::move(impl)),
-#if DCHECK_IS_ON()
-      parked_string_(),
-#endif
+      compressed_(nullptr),
       may_be_parked_(parkable == ParkableState::kParkable),
       is_8bit_(string_.Is8Bit()),
       length_(string_.length())
@@ -137,12 +169,15 @@
   MutexLocker locker(mutex_);
   DCHECK(may_be_parked_);
   if (state_ == State::kUnparked && CanParkNow()) {
+    // |string_|'s data should not be touched except in the compression task.
     AsanPoisonString(string_);
-    auto task_runner = Platform::Current()->CurrentThread()->GetTaskRunner();
-    task_runner->PostTask(
-        FROM_HERE,
-        base::BindOnce(&ParkableStringImpl::OnParkingCompleteOnMainThread,
-                       this));
+    // |params| keeps |this| alive until |OnParkingCompleteOnMainThread()|.
+    auto params = std::make_unique<CompressionTaskParams>(
+        this, string_.Bytes(), string_.CharactersSizeInBytes(),
+        Platform::Current()->CurrentThread()->GetTaskRunner());
+    background_scheduler::PostOnBackgroundThread(
+        FROM_HERE, CrossThreadBind(&ParkableStringImpl::CompressInBackground,
+                                   WTF::Passed(std::move(params))));
     state_ = State::kParkingInProgress;
   }
 
@@ -169,21 +204,51 @@
   if (state_ != State::kParked)
     return;
 
-#if DCHECK_IS_ON()
-  string_ = parked_string_;
-  parked_string_ = String();
-#endif
+  TRACE_EVENT1("blink", "ParkableStringImpl::Unpark", "size",
+               CharactersSizeInBytes());
+  DCHECK(compressed_);
+
+  base::StringPiece compressed_string_piece(
+      reinterpret_cast<const char*>(compressed_->data()),
+      compressed_->size() * sizeof(uint8_t));
+  String uncompressed;
+  base::StringPiece uncompressed_string_piece;
+  size_t size = CharactersSizeInBytes();
+  if (is_8bit()) {
+    LChar* data;
+    uncompressed = String::CreateUninitialized(length(), data);
+    uncompressed_string_piece =
+        base::StringPiece(reinterpret_cast<const char*>(data), size);
+  } else {
+    UChar* data;
+    uncompressed = String::CreateUninitialized(length(), data);
+    uncompressed_string_piece =
+        base::StringPiece(reinterpret_cast<const char*>(data), size);
+  }
+
+  // If decompression fails, this is either because:
+  // 1. The output buffer is too small
+  // 2. Compressed data is corrupted
+  // 3. Cannot allocate memory in zlib
+  //
+  // (1-2) are data corruption, and (3) is OOM. In all cases, we cannot recover
+  // the string we need, nothing else to do than to abort.
+  CHECK(compression::GzipUncompress(compressed_string_piece,
+                                    uncompressed_string_piece));
+  compressed_ = nullptr;
+  string_ = uncompressed;
   state_ = State::kUnparked;
 
   bool backgrounded =
       ParkableStringManager::Instance().IsRendererBackgrounded();
   RecordParkingAction(backgrounded ? ParkingAction::kUnparkedInBackground
                                    : ParkingAction::kUnparkedInForeground);
-  auto& manager = ParkableStringManager::Instance();
-  manager.OnUnparked(this, string_.Impl());
+  ParkableStringManager::Instance().OnUnparked(this, string_.Impl());
 }
 
-void ParkableStringImpl::OnParkingCompleteOnMainThread() {
+void ParkableStringImpl::OnParkingCompleteOnMainThread(
+    std::unique_ptr<CompressionTaskParams> params,
+    std::unique_ptr<Vector<uint8_t>> compressed) {
   MutexLocker locker(mutex_);
   DCHECK_EQ(State::kParkingInProgress, state_);
   // Between |Park()| and now, things may have happened:
@@ -197,26 +262,55 @@
   // Finally, since this is a distinct task from any one that can call
   // |ToString()|, the invariant that the pointer stays valid until the next
   // task is preserved.
-  if (CanParkNow()) {
+  if (CanParkNow() && compressed) {
     RecordParkingAction(ParkingAction::kParkedInBackground);
     state_ = State::kParked;
     ParkableStringManager::Instance().OnParked(this, string_.Impl());
-#if DCHECK_IS_ON()
-    AsanUnpoisonString(string_);  // Will touch the string below.
-    parked_string_ = string_.IsolatedCopy();
-    // Poison the previous allocation.
-    // |string_| is kept to make sure the memory is not reused.
-    const void* data = is_8bit()
-                           ? static_cast<const void*>(string_.Characters8())
-                           : static_cast<const void*>(string_.Characters16());
-    memset(const_cast<void*>(data), 0xcc, string_.CharactersSizeInBytes());
-#endif  // DCHECK_IS_ON()
-    AsanPoisonString(string_);
+
+    compressed_ = std::move(compressed);
+    // Must unpoison the memory before releasing it.
+    AsanUnpoisonString(string_);
+    string_ = String();
   } else {
     state_ = State::kUnparked;
   }
 }
 
+// static
+void ParkableStringImpl::CompressInBackground(
+    std::unique_ptr<CompressionTaskParams> params) {
+  TRACE_EVENT1("blink", "ParkableStringImpl::CompressInBackground", "size",
+               params->size);
+
+  // Compression touches the string.
+  AsanUnpoisonString(params->string->string_);
+  base::StringPiece data(reinterpret_cast<const char*>(params->data),
+                         params->size);
+  std::string compressed_string;
+  bool ok = compression::GzipCompress(data, &compressed_string);
+
+  std::unique_ptr<Vector<uint8_t>> compressed = nullptr;
+  if (ok && compressed_string.size() < params->size) {
+    compressed = std::make_unique<Vector<uint8_t>>();
+    compressed->Append(
+        reinterpret_cast<const uint8_t*>(compressed_string.c_str()),
+        compressed_string.size());
+  }
+  AsanPoisonString(params->string->string_);
+
+  auto* task_runner = params->callback_task_runner.get();
+  PostCrossThreadTask(
+      *task_runner, FROM_HERE,
+      CrossThreadBind(
+          [](std::unique_ptr<CompressionTaskParams> params,
+             std::unique_ptr<Vector<uint8_t>> compressed) {
+            auto* string = params->string.get();
+            string->OnParkingCompleteOnMainThread(std::move(params),
+                                                  std::move(compressed));
+          },
+          WTF::Passed(std::move(params)), WTF::Passed(std::move(compressed))));
+}
+
 ParkableString::ParkableString(scoped_refptr<StringImpl>&& impl) {
   if (!impl) {
     impl_ = nullptr;
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string.h b/third_party/blink/renderer/platform/bindings/parkable_string.h
index 24713b93..e6ea226 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string.h
+++ b/third_party/blink/renderer/platform/bindings/parkable_string.h
@@ -6,6 +6,7 @@
 #define THIRD_PARTY_BLINK_RENDERER_PLATFORM_BINDINGS_PARKABLE_STRING_H_
 
 #include <map>
+#include <memory>
 #include <set>
 #include <utility>
 
@@ -32,6 +33,8 @@
 
 namespace blink {
 
+struct CompressionTaskParams;
+
 // A parked string is parked by calling |Park()|, and unparked by calling
 // |ToString()| on a parked string.
 // |Lock()| does *not* unpark a string, and |ToString()| must be called on
@@ -85,7 +88,15 @@
   // and the return value is valid as long as the mutex is held.
   bool CanParkNow() const;
   void Unpark();
-  void OnParkingCompleteOnMainThread();
+  // Called on the main thread after compression is done.
+  // |params| is the same as the one passed to |CompressInBackground()|,
+  // |compressed| is the compressed data, nullptr if compression failed.
+  void OnParkingCompleteOnMainThread(
+      std::unique_ptr<CompressionTaskParams> params,
+      std::unique_ptr<Vector<uint8_t>> compressed);
+
+  // Background thread.
+  static void CompressInBackground(std::unique_ptr<CompressionTaskParams>);
 
   Mutex mutex_;  // protects lock_depth_.
   int lock_depth_;
@@ -93,9 +104,7 @@
   // Main thread only.
   State state_;
   String string_;
-#if DCHECK_IS_ON()
-  String parked_string_;
-#endif
+  std::unique_ptr<Vector<uint8_t>> compressed_;
 
   const bool may_be_parked_;
   const bool is_8bit_;
@@ -119,6 +128,7 @@
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, TableSimple);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, TableMultiple);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, AsanPoisoning);
+  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, Compression);
   DISALLOW_COPY_AND_ASSIGN(ParkableStringImpl);
 };
 
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string_test.cc b/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
index 58671ad..754ebf6 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
+++ b/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
@@ -9,7 +9,6 @@
 #include <thread>
 #include <vector>
 
-#include "base/run_loop.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/test/scoped_task_environment.h"
@@ -26,23 +25,18 @@
   return String(String(data.data(), data.size()).ReleaseImpl());
 }
 
-void RunPostedTasks() {
-  base::RunLoop run_loop;
-  blink::scheduler::GetSingleThreadTaskRunnerForTesting()->PostTask(
-      FROM_HERE, run_loop.QuitClosure());
-  run_loop.Run();
-}
-
-bool ParkAndWait(const ParkableString& string) {
-  bool return_value = string.Impl()->Park();
-  RunPostedTasks();
-  return return_value;
-}
-
 }  // namespace
 
 class ParkableStringTest : public ::testing::Test {
  protected:
+  void RunPostedTasks() { scoped_task_environment_.RunUntilIdle(); }
+
+  bool ParkAndWait(const ParkableString& string) {
+    bool return_value = string.Impl()->Park();
+    RunPostedTasks();
+    return return_value;
+  }
+
   void SetUp() override {
     ParkableStringManager::Instance().SetRendererBackgrounded(false);
     scoped_feature_list_.InitAndEnableFeature(
@@ -355,4 +349,19 @@
 }
 #endif  // defined(ADDRESS_SANITIZER)
 
+TEST_F(ParkableStringTest, Compression) {
+  ParkableString parkable(MakeLargeString().Impl());
+  ParkableStringImpl* impl = parkable.Impl();
+  EXPECT_TRUE(impl->Park());
+  EXPECT_FALSE(impl->is_parked());
+  RunPostedTasks();
+
+  EXPECT_TRUE(impl->is_parked());
+  EXPECT_TRUE(impl->compressed_);
+  EXPECT_LT(impl->compressed_->size(), impl->CharactersSizeInBytes());
+  parkable.ToString();
+  EXPECT_FALSE(impl->is_parked());
+  EXPECT_EQ(nullptr, impl->compressed_);
+}
+
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/heap/heap_allocator.h b/third_party/blink/renderer/platform/heap/heap_allocator.h
index 95bcacf2..2c3c76ef 100644
--- a/third_party/blink/renderer/platform/heap/heap_allocator.h
+++ b/third_party/blink/renderer/platform/heap/heap_allocator.h
@@ -562,10 +562,8 @@
                                                                eagerly_sweep);
   }
 
-  // TODO(keishi): Delete new/delete after transition to MakeGarbageCollected is
-  // complete.
-  void* operator new(size_t size) { return Base::operator new(size); }
-  void operator delete(void* p) { return Base::operator delete(p); };
+  void* operator new(size_t size) = delete;
+  void operator delete(void* p) = delete;
   void* operator new[](size_t size) = delete;
   void operator delete[](void* p) = delete;
   void* operator new(size_t size, NotNullTag null_tag, void* location) {
diff --git a/third_party/blink/renderer/platform/heap/heap_compact_test.cc b/third_party/blink/renderer/platform/heap/heap_compact_test.cc
index b38b72b..e5e7e2ef 100644
--- a/third_party/blink/renderer/platform/heap/heap_compact_test.cc
+++ b/third_party/blink/renderer/platform/heap/heap_compact_test.cc
@@ -345,7 +345,7 @@
 }
 
 TEST(HeapCompactTest, CompactDeques) {
-  Persistent<IntDeque> deque = new IntDeque;
+  Persistent<IntDeque> deque = MakeGarbageCollected<IntDeque>();
   for (int i = 0; i < 8; ++i) {
     deque->push_front(IntWrapper::Create(i, VectorsAreCompacted));
   }
@@ -362,7 +362,8 @@
 }
 
 TEST(HeapCompactTest, CompactDequeVectors) {
-  Persistent<HeapDeque<IntVector>> deque = new HeapDeque<IntVector>;
+  Persistent<HeapDeque<IntVector>> deque =
+      MakeGarbageCollected<HeapDeque<IntVector>>();
   for (int i = 0; i < 8; ++i) {
     IntWrapper* value = IntWrapper::Create(i, VectorsAreCompacted);
     IntVector vector = IntVector(8, value);
diff --git a/third_party/blink/renderer/platform/heap/heap_test.cc b/third_party/blink/renderer/platform/heap/heap_test.cc
index 2ba9a35..9d146ad 100644
--- a/third_party/blink/renderer/platform/heap/heap_test.cc
+++ b/third_party/blink/renderer/platform/heap/heap_test.cc
@@ -2627,12 +2627,12 @@
   Persistent<VectorWU> vector_wu2 = MakeGarbageCollected<VectorWU>();
   Persistent<VectorUW> vector_uw = MakeGarbageCollected<VectorUW>();
   Persistent<VectorUW> vector_uw2 = MakeGarbageCollected<VectorUW>();
-  Persistent<MemberDeque> deque = new MemberDeque();
-  Persistent<MemberDeque> deque2 = new MemberDeque();
-  Persistent<DequeWU> deque_wu = new DequeWU();
-  Persistent<DequeWU> deque_wu2 = new DequeWU();
-  Persistent<DequeUW> deque_uw = new DequeUW();
-  Persistent<DequeUW> deque_uw2 = new DequeUW();
+  Persistent<MemberDeque> deque = MakeGarbageCollected<MemberDeque>();
+  Persistent<MemberDeque> deque2 = MakeGarbageCollected<MemberDeque>();
+  Persistent<DequeWU> deque_wu = MakeGarbageCollected<DequeWU>();
+  Persistent<DequeWU> deque_wu2 = MakeGarbageCollected<DequeWU>();
+  Persistent<DequeUW> deque_uw = MakeGarbageCollected<DequeUW>();
+  Persistent<DequeUW> deque_uw2 = MakeGarbageCollected<DequeUW>();
   Persistent<Container> container = Container::Create();
 
   ClearOutOldGarbage();
@@ -4187,7 +4187,7 @@
   typedef HeapVector<Member<IntWrapper>> IntVector;
   typedef HeapDeque<Member<IntWrapper>> IntDeque;
   HeapVector<IntVector>* vector = MakeGarbageCollected<HeapVector<IntVector>>();
-  HeapDeque<IntDeque>* deque = new HeapDeque<IntDeque>();
+  HeapDeque<IntDeque>* deque = MakeGarbageCollected<HeapDeque<IntDeque>>();
 
   vector->push_back(IntVector());
   deque->push_back(IntDeque());
@@ -4244,9 +4244,9 @@
   SimpleFinalizedObject::destructor_calls_ = 0;
   {
     Persistent<HeapDeque<VectorObject, 2>> inline_deque =
-        new HeapDeque<VectorObject, 2>;
+        MakeGarbageCollected<HeapDeque<VectorObject, 2>>();
     Persistent<HeapDeque<VectorObject>> outline_deque =
-        new HeapDeque<VectorObject>;
+        MakeGarbageCollected<HeapDeque<VectorObject>>();
     VectorObject i1, i2;
     inline_deque->push_back(i1);
     inline_deque->push_back(i2);
@@ -4256,7 +4256,7 @@
     outline_deque->push_back(o2);
 
     Persistent<HeapDeque<VectorObjectInheritedTrace>> deque_inherited_trace =
-        new HeapDeque<VectorObjectInheritedTrace>;
+        MakeGarbageCollected<HeapDeque<VectorObjectInheritedTrace>>();
     VectorObjectInheritedTrace it1, it2;
     deque_inherited_trace->push_back(it1);
     deque_inherited_trace->push_back(it2);
@@ -6049,7 +6049,7 @@
 
   typedef HeapDeque<Member<IntWrapper>> IntDeque;
 
-  Persistent<IntDeque> deque = new IntDeque();
+  Persistent<IntDeque> deque = MakeGarbageCollected<IntDeque>();
 
   // Append a sequence, bringing about repeated expansions of the
   // deque's buffer.
@@ -6131,9 +6131,9 @@
 
   using PartDeque = HeapDeque<PartObjectWithRef>;
 
-  Persistent<PartDeque> deque = new PartDeque();
+  Persistent<PartDeque> deque = MakeGarbageCollected<PartDeque>();
   // Auxillary Deque used to prevent 'inline' buffer expansion.
-  Persistent<PartDeque> deque_unused = new PartDeque();
+  Persistent<PartDeque> deque_unused = MakeGarbageCollected<PartDeque>();
 
   // Append a sequence, bringing about repeated expansions of the
   // deque's buffer.
diff --git a/third_party/blink/renderer/platform/scroll/web_scrollbar_theme_client.h b/third_party/blink/renderer/platform/scroll/web_scrollbar_theme_client.h
deleted file mode 100644
index 6a9952eac..0000000
--- a/third_party/blink/renderer/platform/scroll/web_scrollbar_theme_client.h
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCROLL_WEB_SCROLLBAR_THEME_CLIENT_H_
-#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCROLL_WEB_SCROLLBAR_THEME_CLIENT_H_
-
-namespace blink {
-
-class WebScrollbarThemeClient {
- protected:
-  WebScrollbarThemeClient() = default;
-
- public:
-  virtual void PreferencesChanged() {}
-};
-
-}  // namespace blink
-
-#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_SCROLL_WEB_SCROLLBAR_THEME_CLIENT_H_
diff --git a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py
index f31fec0..27da899 100644
--- a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py
+++ b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py
@@ -239,12 +239,6 @@
                 help=('Passes that environment variable to the tests '
                       '(--additional-env-var=NAME=VALUE)')),
             optparse.make_option(
-                '--batch-size',
-                type='int',
-                default=None,
-                help=('Run a the tests in batches (n), after every n tests, the driver is '
-                      'relaunched.')),
-            optparse.make_option(
                 '--build',
                 dest='build',
                 action='store_true',
@@ -337,23 +331,18 @@
                 help='Output per-test profile information, using the specified profiler.'),
             optparse.make_option(
                 '--restart-shell-between-tests',
-                action='store_true',
-                default=False,
-                help='Restarting the shell between tests causes the tests to '
-                     'take twice as long to run on average, but provides more '
-                     'consistent results. This is automatically enabled if '
-                     '--repeat-each or --gtest_repeat is specified with '
-                     'iterations > 1. This is equivalent to setting '
-                     '--batch-size=1'),
-            optparse.make_option(
-                '--reuse-shell-between-tests',
-                action='store_true',
-                default=False,
-                help='Reusing the shell between tests causes tests to run more '
-                     'quickly but has less consistent results. This is '
-                     'primarily useful for debugging flakiness that only '
-                     'occurs when content shell is reused. This is equivalent '
-                     'to setting --batch-size=0.'),
+                type='choice',
+                action='store',
+                choices=['always', 'never', 'on_retry',],
+                default='on_retry',
+                help=(
+                    'Restarting the shell between tests produces more '
+                    'consistent results, as it prevents state from carrying over '
+                    'from previous tests. It also increases test run time by at '
+                    'least 2X. By default, the shell is restarted when tests get '
+                    'retried, since leaking state between retries can sometimes '
+                    'mask underlying flakiness, and the whole point of retries is '
+                    'to look for flakiness.')),
             optparse.make_option(
                 '--repeat-each',
                 type='int',
@@ -524,26 +513,14 @@
 
 def _set_up_derived_options(port, options, args):
     """Sets the options values that depend on other options values."""
-    if options.restart_shell_between_tests:
-        # --restart-shell-between-tests is identical to setting --batch-size=1.
-        assert not options.reuse_shell_between_tests, (
-            '--restart-shell-between-tests is not compatible with '
-            '--reuse-shell-between-tests.')
-        assert options.batch_size is None, (
-            '--restart-shell-between-tests is not compatible with --batch-size')
+    # --restart-shell-between-tests is implemented by changing the batch size.
+    if options.restart_shell_between_tests == 'always':
         options.derived_batch_size = 1
         options.must_use_derived_batch_size = True
-    elif options.reuse_shell_between_tests:
-        # --reuse-shell-between-tests is identical to setting --batch-size=0
-        assert options.batch_size is None, (
-            '--reuse-shell-between-tests is not compatible with --batch-size')
+    elif options.restart_shell_between_tests == 'never':
         options.derived_batch_size = 0
         options.must_use_derived_batch_size = True
-    elif options.batch_size is not None:
-        options.derived_batch_size = options.batch_size
-        options.must_use_derived_batch_size = True
     else:
-        # No flag has explicitly set the batch size.
         # If 'repeat_each' or 'iterations' has been set, then implicitly set the
         # batch size to 1. If we're already repeating the tests more than once,
         # then we're not particularly concerned with speed. Restarting content
diff --git a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py
index e8cd9081..eb40311 100644
--- a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py
+++ b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py
@@ -215,11 +215,6 @@
 
         self.assertEqual(host.user.opened_urls, [abspath_to_uri(MockHost().platform, '/tmp/layout-test-results/results.html')])
 
-    def test_batch_size(self):
-        batch_tests_run = get_test_batches(['--batch-size', '2'])
-        for batch in batch_tests_run:
-            self.assertTrue(len(batch) <= 2, '%s had too many tests' % ', '.join(batch))
-
     def test_max_locked_shards(self):
         # Tests for the default of using one locked shard even in the case of more than one child process.
         _, regular_output, _ = logging_run(['--debug-rwt-logging', '--jobs', '2'], shared_port=False)
diff --git a/third_party/crc32c/BUILD.gn b/third_party/crc32c/BUILD.gn
index 3632b99e..f9ba00d 100644
--- a/third_party/crc32c/BUILD.gn
+++ b/third_party/crc32c/BUILD.gn
@@ -7,6 +7,8 @@
 
 # Only applied to CRC32C source and tests. (not exported)
 config("crc32c_config") {
+  visibility = [ ":*" ]
+
   include_dirs = [
     "config",
     "src/include",
@@ -64,30 +66,26 @@
 
 source_set("crc32c") {
   sources = [
-    "config/crc32c/crc32c_config.h",
     "src/include/crc32c/crc32c.h",
     "src/src/crc32c.cc",
-    "src/src/crc32c_arm64_linux_check.h",
-    "src/src/crc32c_internal.h",
     "src/src/crc32c_portable.cc",
-    "src/src/crc32c_prefetch.h",
-    "src/src/crc32c_read_le.h",
-    "src/src/crc32c_round_up.h",
-    "src/src/crc32c_sse42_check.h",
   ]
 
   configs += [ ":crc32c_config" ]
   deps = [
     ":crc32c_arm64",
+    ":crc32c_internal_headers",
     ":crc32c_sse42",
   ]
 }
 
 source_set("crc32c_sse42") {
+  visibility = [ ":*" ]
+
   sources = [
-    "config/crc32c/crc32c_config.h",
     "src/src/crc32c_sse42.cc",
     "src/src/crc32c_sse42.h",
+    "src/src/crc32c_sse42_check.h",
   ]
 
   configs += [ ":crc32c_config" ]
@@ -98,19 +96,39 @@
       cflags = [ "-msse4.2" ]
     }
   }
+
+  deps = [
+    ":crc32c_internal_headers",
+  ]
 }
 
 source_set("crc32c_arm64") {
+  visibility = [ ":*" ]
+
   sources = [
-    "config/crc32c/crc32c_config.h",
     "src/src/crc32c_arm64.cc",
     "src/src/crc32c_arm64.h",
+    "src/src/crc32c_arm64_linux_check.h",
   ]
 
   configs += [ ":crc32c_config" ]
   if (current_cpu == "arm64") {
     cflags = [ "-march=armv8-a+crc+crypto" ]
   }
+
+  deps = [
+    ":crc32c_internal_headers",
+  ]
+}
+
+source_set("crc32c_internal_headers") {
+  sources = [
+    "config/crc32c/crc32c_config.h",
+    "src/src/crc32c_internal.h",
+    "src/src/crc32c_prefetch.h",
+    "src/src/crc32c_read_le.h",
+    "src/src/crc32c_round_up.h",
+  ]
 }
 
 test("crc32c_tests") {
@@ -128,6 +146,10 @@
   configs += [ ":crc32c_config" ]
   deps = [
     ":crc32c",
+    ":crc32c_arm64",
+    ":crc32c_internal_headers",
+    ":crc32c_sse42",
     "//testing/gtest:gtest_main",
+    "//third_party/googletest:gtest",
   ]
 }
diff --git a/tools/binary_size/trybot_commit_size_checker.py b/tools/binary_size/trybot_commit_size_checker.py
index 07f1844..7d367595 100755
--- a/tools/binary_size/trybot_commit_size_checker.py
+++ b/tools/binary_size/trybot_commit_size_checker.py
@@ -39,8 +39,10 @@
 https://chromium.googlesource.com/chromium/src/+/master/docs/speed/apk_size_regressions.md#Debugging-Apk-Size-Increase
 
 If the growth is expected / justified, then you can bypass this bot failure by
-adding "Binary-Size: $JUSTIFICATION" to your commit description. Here are some
-examples:
+adding "Binary-Size: $JUSTIFICATION" footer to your commit message (must go at
+the bottom of the message, similar to "Bug:").
+
+Here are some examples:
 
 Binary-Size: Increase is due to translations and so cannot be avoided.
 Binary-Size: Increase is due to new images, which are already optimally encoded.
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index 6389201..dd33e0c 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -30077,6 +30077,8 @@
       label="ChromeHomePersonalizedOmniboxSuggestions:enabled"/>
   <int value="84911198" label="ScanCardsInWebPayments:disabled"/>
   <int value="88437020" label="FeaturePolicy:enabled"/>
+  <int value="89785725"
+      label="DataReductionProxyEnabledWithNetworkService:disabled"/>
   <int value="91938915" label="enable-suggestions-service"/>
   <int value="92327255" label="DisplayMoveWindowAccels:disabled"/>
   <int value="98134240" label="material-design-ink-drop-animation-speed"/>
@@ -30842,6 +30844,8 @@
   <int value="1567839560"
       label="ChromeHomePersonalizedOmniboxSuggestions:disabled"/>
   <int value="1571998166" label="DetectingHeavyPages:disabled"/>
+  <int value="1577205328"
+      label="DataReductionProxyEnabledWithNetworkService:enabled"/>
   <int value="1579461102" label="MemoryCoordinator:disabled"/>
   <int value="1586022426" label="AutofillCreditCardAssist:enabled"/>
   <int value="1587521886" label="SSLCommittedInterstitials:enabled"/>
@@ -36741,6 +36745,15 @@
       label="Account was not seeded before FireRefreshTokenAvailable"/>
 </enum>
 
+<enum name="OAuthMultiloginResponseStatus">
+  <int value="0" label="UNKNOWN_STATUS"/>
+  <int value="1" label="OK"/>
+  <int value="2" label="RETRY"/>
+  <int value="3" label="INVALID_INPUT"/>
+  <int value="4" label="INVALID_TOKENS"/>
+  <int value="5" label="ERROR"/>
+</enum>
+
 <enum name="OCSPResponseStatus">
   <int value="0" label="Not checked"/>
   <int value="1" label="Missing"/>
@@ -51667,6 +51680,12 @@
   <int value="1" label="Chrome Tab"/>
 </enum>
 
+<enum name="VizHitTestResultsMatchEnums">
+  <int value="0" label="Results do not match"/>
+  <int value="1" label="Results match"/>
+  <int value="2" label="Results changed"/>
+</enum>
+
 <enum name="VoiceInteractionEventSource">
   <int value="0" label="Omnibox"/>
   <int value="1" label="NTP"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index b6af614..4236fae 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -15939,6 +15939,26 @@
   </summary>
 </histogram>
 
+<histogram name="ContextualSuggestions.SuggestionClickPosition.Cluster"
+    units="index" expires_after="2019-05-30">
+  <owner>twellington@chromium.org</owner>
+  <owner>huayinz@chromium.org</owner>
+  <summary>
+    Android: The position of the clicked contextual suggestion card within its
+    cluster.
+  </summary>
+</histogram>
+
+<histogram name="ContextualSuggestions.SuggestionClickPosition.Global"
+    units="index" expires_after="2019-05-30">
+  <owner>twellington@chromium.org</owner>
+  <owner>huayinz@chromium.org</owner>
+  <summary>
+    Android: The position of the clicked contextual suggestion card within the
+    entire list of suggestions.
+  </summary>
+</histogram>
+
 <histogram base="true" name="Cookie.AgeFor" units="days">
   <owner>mkwst@chromium.org</owner>
   <owner>tnagel@chromium.org</owner>
@@ -28795,7 +28815,8 @@
   </summary>
 </histogram>
 
-<histogram name="Event.VizHitTestSurfaceLayer.ResultsMatch" enum="Boolean">
+<histogram name="Event.VizHitTestSurfaceLayer.ResultsMatch"
+    enum="VizHitTestResultsMatchEnums">
   <owner>sunxd@chormium.org</owner>
   <owner>event-targeting@chromium.org</owner>
   <summary>
@@ -100313,6 +100334,19 @@
   </summary>
 </histogram>
 
+<histogram name="Signin.Multilogin.NumberOfAccounts" expires_after="2019-11-01">
+  <owner>droger@chromium.org</owner>
+  <owner>msarda@chromium.org</owner>
+  <summary>Number of accounts in tokens sent to Gaia Multilogin.</summary>
+</histogram>
+
+<histogram name="Signin.Multilogin.ResponseStatus"
+    enum="OAuthMultiloginResponseStatus" expires_after="2019-11-01">
+  <owner>droger@chromium.org</owner>
+  <owner>msarda@chromium.org</owner>
+  <summary>Response status received from gaia Multilogin.</summary>
+</histogram>
+
 <histogram name="Signin.MultiloginFinished" enum="GoogleServiceAuthError"
     expires_after="2019-11-01">
   <owner>droger@chromium.org</owner>
diff --git a/tools/perf/benchmarks/loading.py b/tools/perf/benchmarks/loading.py
index 61caa2c..9de446e 100644
--- a/tools/perf/benchmarks/loading.py
+++ b/tools/perf/benchmarks/loading.py
@@ -18,11 +18,6 @@
 
   options = {'pageset_repeat': 2}
 
-  def SetExtraBrowserOptions(self, options):
-    options.AppendExtraBrowserArgs([
-        '--enable-features=TracingPerfettoBackend',
-    ])
-
   def CreateCoreTimelineBasedMeasurementOptions(self):
     tbm_options = timeline_based_measurement.Options()
     loading_metrics_category.AugmentOptionsForLoadingMetrics(tbm_options)
diff --git a/tools/perf/benchmarks/startup_mobile.py b/tools/perf/benchmarks/startup_mobile.py
index d1a326b..65750fa 100644
--- a/tools/perf/benchmarks/startup_mobile.py
+++ b/tools/perf/benchmarks/startup_mobile.py
@@ -191,7 +191,6 @@
 
     options = timeline_based_measurement.Options(cat_filter)
     options.config.enable_chrome_trace = True
-    options.config.enable_atrace_trace = True
     options.SetTimelineBasedMetrics([
         'tracingMetric',
         'androidStartupMetric',
diff --git a/tools/perf/benchmarks/thread_times.py b/tools/perf/benchmarks/thread_times.py
deleted file mode 100644
index 5828bd15..0000000
--- a/tools/perf/benchmarks/thread_times.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from core import perf_benchmark
-from measurements import thread_times
-
-
-class _ThreadTimes(perf_benchmark.PerfBenchmark):
-
-  @classmethod
-  def Name(cls):
-    return 'thread_times'
-
-  @classmethod
-  def ShouldAddValue(cls, name, from_first_story_run):
-    del from_first_story_run  # unused
-    # Default to only reporting per-frame metrics.
-    return 'per_second' not in name
-
-  def CreatePageTest(self, options):
-    return thread_times.ThreadTimes(report_silk_details=True)
diff --git a/tools/perf/contrib/oop_raster/OWNERS b/tools/perf/contrib/oop_raster/OWNERS
deleted file mode 100644
index 2fd2c35..0000000
--- a/tools/perf/contrib/oop_raster/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-enne@chromium.org
-khushal@chromium.org
-vmpstr@chromium.org
diff --git a/tools/perf/contrib/oop_raster/__init__.py b/tools/perf/contrib/oop_raster/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tools/perf/contrib/oop_raster/__init__.py
+++ /dev/null
diff --git a/tools/perf/contrib/oop_raster/oop_raster.py b/tools/perf/contrib/oop_raster/oop_raster.py
deleted file mode 100644
index 1d2313b9..0000000
--- a/tools/perf/contrib/oop_raster/oop_raster.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2018 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-from benchmarks import smoothness,thread_times
-import page_sets
-from telemetry import benchmark
-
-# pylint: disable=protected-access
-
-def CustomizeBrowserOptionsForOopRasterization(options):
-  """Enables flags needed for out of process rasterization."""
-  options.AppendExtraBrowserArgs('--force-gpu-rasterization')
-  options.AppendExtraBrowserArgs('--enable-oop-rasterization')
-
-
-@benchmark.Info(emails=['enne@chromium.org'])
-class SmoothnessOopRasterizationTop25(smoothness._Smoothness):
-  """Measures rendering statistics for the top 25 with oop rasterization.
-  """
-  tag = 'oop_rasterization'
-  page_set = page_sets.Top25SmoothPageSet
-
-  def SetExtraBrowserOptions(self, options):
-    CustomizeBrowserOptionsForOopRasterization(options)
-
-  @classmethod
-  def Name(cls):
-    return 'smoothness.oop_rasterization.top_25_smooth'
-
-
-@benchmark.Info(emails=['enne@chromium.org'])
-class ThreadTimesOopRasterKeyMobile(thread_times._ThreadTimes):
-  """Measure timeline metrics for key mobile pages while using out of process
-  raster."""
-  tag = 'oop_rasterization'
-  page_set = page_sets.KeyMobileSitesSmoothPageSet
-  options = {'story_tag_filter': 'fastpath'}
-
-  def SetExtraBrowserOptions(self, options):
-    super(ThreadTimesOopRasterKeyMobile, self).SetExtraBrowserOptions(options)
-    CustomizeBrowserOptionsForOopRasterization(options)
-
-  @classmethod
-  def Name(cls):
-    return 'thread_times.oop_rasterization.key_mobile'
diff --git a/tools/perf/core/perf_benchmark.py b/tools/perf/core/perf_benchmark.py
index 400a4ea..a358680 100644
--- a/tools/perf/core/perf_benchmark.py
+++ b/tools/perf/core/perf_benchmark.py
@@ -106,12 +106,18 @@
     options.AppendExtraBrowserArgs(
         '--disable-gpu-process-for-dx12-vulkan-info-collection')
 
-
     # TODO(crbug.com/881469): remove this once Webview support surface
     # synchronization and viz.
     if options.browser_type and 'android-webview' in options.browser_type:
       options.AppendExtraBrowserArgs(
           '--disable-features=SurfaceSynchronization,VizDisplayCompositor')
+
+    # Switch Chrome to use Perfetto instead of TraceLog as the tracing backend,
+    # needed until the feature gets turned on by default everywhere.
+    if options.browser_type != 'reference':
+      options.AppendExtraBrowserArgs(
+          '--enable-features=TracingPerfettoBackend')
+
     self.SetExtraBrowserOptions(options)
 
   @staticmethod
diff --git a/tools/perf/measurements/thread_times.py b/tools/perf/measurements/thread_times.py
deleted file mode 100644
index 24365e30..0000000
--- a/tools/perf/measurements/thread_times.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from telemetry.page import legacy_page_test
-from telemetry.timeline import chrome_trace_category_filter
-
-from measurements import timeline_controller
-from metrics import timeline
-
-
-class ThreadTimes(legacy_page_test.LegacyPageTest):
-
-  def __init__(self, report_silk_details=False):
-    super(ThreadTimes, self).__init__()
-    self._timeline_controller = None
-    self._report_silk_details = report_silk_details
-
-  def WillNavigateToPage(self, page, tab):
-    self._timeline_controller = timeline_controller.TimelineController(
-        enable_auto_issuing_record=False)
-    if self._report_silk_details:
-      # We need the other traces in order to have any details to report.
-      self._timeline_controller.trace_categories = None
-      if self.options and self.options.extra_chrome_categories:
-        assert False, ('--extra_chrome_categories cannot be combined with'
-                       '--report-silk-details')
-    else:
-      category_filter = chrome_trace_category_filter.CreateLowOverheadFilter()
-      if self.options and self.options.extra_chrome_categories:
-        category_filter.AddFilterString(self.options.extra_chrome_categories)
-      if self.options and self.options.enable_systrace:
-        self._timeline_controller.enable_systrace = True
-      self._timeline_controller.trace_categories = category_filter.filter_string
-    self._timeline_controller.SetUp(page, tab)
-
-  def DidNavigateToPage(self, page, tab):
-    del page  # unused
-    self._timeline_controller.Start(tab)
-
-  def ValidateAndMeasurePage(self, page, tab, results):
-    del page  # unused
-    self._timeline_controller.Stop(tab, results)
-    metric = timeline.ThreadTimesTimelineMetric()
-    renderer_thread = \
-        self._timeline_controller.model.GetFirstRendererThread(tab.id)
-    if self._report_silk_details:
-      metric.details_to_report = timeline.ReportSilkDetails
-    metric.AddResults(self._timeline_controller.model, renderer_thread,
-                      self._timeline_controller.smooth_records, results)
-
-  def DidRunPage(self, platform):
-    if self._timeline_controller:
-      self._timeline_controller.CleanUp(platform)
diff --git a/tools/perf/measurements/thread_times_unittest.py b/tools/perf/measurements/thread_times_unittest.py
deleted file mode 100644
index 7f7a8cf..0000000
--- a/tools/perf/measurements/thread_times_unittest.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from telemetry import decorators
-from telemetry.page import page
-from telemetry.testing import options_for_unittests
-from telemetry.testing import page_test_test_case
-from telemetry.util import wpr_modes
-
-from measurements import thread_times
-from metrics import timeline
-
-
-class AnimatedPage(page.Page):
-
-  def __init__(self, page_set):
-    super(AnimatedPage, self).__init__(
-        url='file://animated_page.html',
-        page_set=page_set, base_dir=page_set.base_dir)
-
-  def RunPageInteractions(self, action_runner):
-    action_runner.Wait(.2)
-
-
-class ThreadTimesUnitTest(page_test_test_case.PageTestTestCase):
-
-  def setUp(self):
-    self._options = options_for_unittests.GetCopy()
-    self._options.browser_options.wpr_mode = wpr_modes.WPR_OFF
-
-  @decorators.Disabled('android')
-  def testBasic(self):
-    ps = self.CreateStorySetFromFileInUnittestDataDir('scrollable_page.html')
-    measurement = thread_times.ThreadTimes()
-    timeline_options = self._options
-    results = self.RunMeasurement(measurement, ps, options=timeline_options)
-    self.assertFalse(results.had_failures)
-
-    for category in timeline.TimelineThreadCategories.values():
-      cpu_time_name = timeline.ThreadCpuTimeResultName(category)
-      cpu_time = results.FindAllPageSpecificValuesNamed(cpu_time_name)
-      self.assertEquals(len(cpu_time), 1)
-
-  @decorators.Disabled('chromeos')  # crbug.com/483212
-  def testWithSilkDetails(self):
-    ps = self.CreateStorySetFromFileInUnittestDataDir('scrollable_page.html')
-    measurement = thread_times.ThreadTimes(report_silk_details=True)
-    results = self.RunMeasurement(measurement, ps, options=self._options)
-    self.assertFalse(results.had_failures)
-
-    main_thread = 'renderer_main'
-    expected_trace_categories = ['blink', 'cc', 'idle']
-    for trace_category in expected_trace_categories:
-      value_name = timeline.ThreadDetailResultName(
-          main_thread, trace_category)
-      values = results.FindAllPageSpecificValuesNamed(value_name)
-      self.assertEquals(len(values), 1)
-
-  def testCleanUpTrace(self):
-    self.TestTracingCleanedUp(thread_times.ThreadTimes, self._options)
diff --git a/tools/perf/measurements/timeline_controller.py b/tools/perf/measurements/timeline_controller.py
deleted file mode 100644
index e6309e72a..0000000
--- a/tools/perf/measurements/timeline_controller.py
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from telemetry.page import legacy_page_test
-from telemetry.timeline.model import TimelineModel
-from telemetry.timeline import tracing_config
-from telemetry.value import trace
-from telemetry.web_perf import smooth_gesture_util
-from telemetry.web_perf import timeline_interaction_record as tir_module
-
-
-RUN_SMOOTH_ACTIONS = 'RunSmoothAllActions'
-
-
-class TimelineController(object):
-
-  def __init__(self, enable_auto_issuing_record=True):
-    super(TimelineController, self).__init__()
-    self.trace_categories = None
-    self.enable_systrace = False
-    self._model = None
-    self._renderer_process = None
-    self._smooth_records = []
-    self._interaction = None
-    self._enable_auto_issuing_record = enable_auto_issuing_record
-
-  def SetUp(self, page, tab):
-    """Starts gathering timeline data.
-
-    """
-    del page  # unused
-    # Resets these member variables incase this object is reused.
-    self._model = None
-    self._renderer_process = None
-    if not tab.browser.platform.tracing_controller.IsChromeTracingSupported():
-      raise Exception('Not supported')
-    config = tracing_config.TracingConfig()
-    config.chrome_trace_config.category_filter.AddFilterString(
-        self.trace_categories)
-    if self.enable_systrace:
-      config.chrome_trace_config.SetEnableSystrace()
-    config.enable_chrome_trace = True
-    tab.browser.platform.tracing_controller.StartTracing(config)
-
-  def Start(self, tab):
-    # Start the smooth marker for all actions.
-    if self._enable_auto_issuing_record:
-      self._interaction = tab.action_runner.CreateInteraction(
-          RUN_SMOOTH_ACTIONS)
-      self._interaction.Begin()
-
-  def Stop(self, tab, results):
-    # End the smooth marker for all actions.
-    if self._enable_auto_issuing_record:
-      self._interaction.End()
-    # Stop tracing.
-    timeline_data = tab.browser.platform.tracing_controller.StopTracing()[0]
-
-    # TODO(#763375): Rely on results.telemetry_info.trace_local_path/etc.
-    kwargs = {}
-    if hasattr(results.telemetry_info, 'trace_local_path'):
-      kwargs['file_path'] = results.telemetry_info.trace_local_path
-      kwargs['remote_path'] = results.telemetry_info.trace_remote_path
-      kwargs['upload_bucket'] = results.telemetry_info.upload_bucket
-      kwargs['cloud_url'] = results.telemetry_info.trace_remote_url
-    results.AddValue(trace.TraceValue(
-        results.current_page, timeline_data, **kwargs))
-
-    self._model = TimelineModel(timeline_data)
-    renderer_thread = self.model.GetFirstRendererThread(tab.id)
-    self._renderer_process = renderer_thread.parent
-
-    run_smooth_actions_record = None
-    self._smooth_records = []
-    for event in renderer_thread.async_slices:
-      if not tir_module.IsTimelineInteractionRecord(event.name):
-        continue
-      r = tir_module.TimelineInteractionRecord.FromAsyncEvent(event)
-      if r.label == RUN_SMOOTH_ACTIONS:
-        assert run_smooth_actions_record is None, (
-            'TimelineController cannot issue more than 1 %s record' %
-            RUN_SMOOTH_ACTIONS)
-        run_smooth_actions_record = r
-      else:
-        self._smooth_records.append(
-            smooth_gesture_util.GetAdjustedInteractionIfContainGesture(
-                self.model, r))
-
-    # If there is no other smooth records, we make measurements on time range
-    # marked by timeline_controller itself.
-    # TODO(nednguyen): when crbug.com/239179 is marked fixed, makes sure that
-    # page sets are responsible for issueing the markers themselves.
-    if len(self._smooth_records) == 0 and run_smooth_actions_record:
-      self._smooth_records = [run_smooth_actions_record]
-
-    if len(self._smooth_records) == 0:
-      raise legacy_page_test.Failure('No interaction record was created.')
-
-  def CleanUp(self, platform):
-    if platform.tracing_controller.is_tracing_running:
-      platform.tracing_controller.StopTracing()
-
-  @property
-  def model(self):
-    return self._model
-
-  @property
-  def renderer_process(self):
-    return self._renderer_process
-
-  @property
-  def smooth_records(self):
-    return self._smooth_records
diff --git a/ui/android/delegated_frame_host_android_unittest.cc b/ui/android/delegated_frame_host_android_unittest.cc
index a6c9ca1..994b57d 100644
--- a/ui/android/delegated_frame_host_android_unittest.cc
+++ b/ui/android/delegated_frame_host_android_unittest.cc
@@ -106,7 +106,8 @@
         viz::CompositorFrameBuilder()
             .AddRenderPass(gfx::Rect(frame_size), gfx::Rect(frame_size))
             .Build();
-    frame_host_->SubmitCompositorFrame(allocator_.GenerateId(),
+    allocator_.GenerateId();
+    frame_host_->SubmitCompositorFrame(allocator_.GetCurrentLocalSurfaceId(),
                                        std::move(frame), base::nullopt);
   }
 
@@ -312,7 +313,8 @@
     frame_host_->EvictDelegatedFrame();
   }
   EXPECT_FALSE(frame_host_->HasSavedFrame());
-  viz::LocalSurfaceId id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  viz::LocalSurfaceId id = allocator_.GetCurrentLocalSurfaceId();
   gfx::Size size(100, 100);
   frame_host_->WasHidden();
   frame_host_->EmbedSurface(id, size, cc::DeadlinePolicy::UseDefaultDeadline());
@@ -327,7 +329,8 @@
 TEST_F(DelegatedFrameHostAndroidSurfaceSynchronizationTest,
        FullSurfaceCapture) {
   // First embed a surface to make sure we have something to copy from.
-  viz::LocalSurfaceId id = allocator_.GenerateId();
+  allocator_.GenerateId();
+  viz::LocalSurfaceId id = allocator_.GetCurrentLocalSurfaceId();
   gfx::Size size(100, 100);
   frame_host_->EmbedSurface(id, size, cc::DeadlinePolicy::UseDefaultDeadline());
 
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index f43a2db4..d461df8 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -428,7 +428,9 @@
     const gfx::Size& surface_size_in_pixels) {
   if (last_surface_size_in_pixels_ != surface_size_in_pixels ||
       !local_surface_id_.is_valid()) {
-    local_surface_id_ = parent_local_surface_id_allocator_.GenerateId();
+    parent_local_surface_id_allocator_.GenerateId();
+    local_surface_id_ =
+        parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
     last_surface_size_in_pixels_ = surface_size_in_pixels;
   }
 
@@ -501,7 +503,9 @@
 }
 
 void WindowPortMus::AllocateLocalSurfaceId() {
-  local_surface_id_ = parent_local_surface_id_allocator_.GenerateId();
+  parent_local_surface_id_allocator_.GenerateId();
+  local_surface_id_ =
+      parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
   UpdatePrimarySurfaceId();
   if (local_layer_tree_frame_sink_)
     local_layer_tree_frame_sink_->SetLocalSurfaceId(local_surface_id_);
@@ -586,7 +590,9 @@
                                                float new_device_scale_factor) {
   if (!window_->IsRootWindow() && local_surface_id_.is_valid() &&
       local_layer_tree_frame_sink_) {
-    local_surface_id_ = parent_local_surface_id_allocator_.GenerateId();
+    parent_local_surface_id_allocator_.GenerateId();
+    local_surface_id_ =
+        parent_local_surface_id_allocator_.GetCurrentLocalSurfaceId();
     local_layer_tree_frame_sink_->SetLocalSurfaceId(local_surface_id_);
   }
 
diff --git a/ui/aura/mus/window_port_mus_unittest.cc b/ui/aura/mus/window_port_mus_unittest.cc
index 336a841..f8b2aa1 100644
--- a/ui/aura/mus/window_port_mus_unittest.cc
+++ b/ui/aura/mus/window_port_mus_unittest.cc
@@ -121,7 +121,8 @@
   viz::ParentLocalSurfaceIdAllocator* parent_allocator =
       WindowPortMusTestHelper(&window).GetParentLocalSurfaceIdAllocator();
   parent_allocator->Reset(current_id);
-  viz::LocalSurfaceId updated_id = parent_allocator->GenerateId();
+  parent_allocator->GenerateId();
+  viz::LocalSurfaceId updated_id = parent_allocator->GetCurrentLocalSurfaceId();
   ASSERT_TRUE(updated_id.is_valid());
   EXPECT_NE(updated_id, current_id);
   window.UpdateLocalSurfaceIdFromEmbeddedClient(
diff --git a/ui/compositor/compositor.cc b/ui/compositor/compositor.cc
index d96fe94..aaa7a05 100644
--- a/ui/compositor/compositor.cc
+++ b/ui/compositor/compositor.cc
@@ -114,15 +114,6 @@
   // Disable edge anti-aliasing in order to increase support for HW overlays.
   settings.enable_edge_anti_aliasing = false;
 
-  if (command_line->HasSwitch(switches::kLimitFps)) {
-    std::string fps_str =
-        command_line->GetSwitchValueASCII(switches::kLimitFps);
-    double fps;
-    if (base::StringToDouble(fps_str, &fps) && fps > 0) {
-      forced_refresh_rate_ = fps;
-    }
-  }
-
   if (command_line->HasSwitch(cc::switches::kUIShowCompositedLayerBorders)) {
     std::string layer_borders_string = command_line->GetSwitchValueASCII(
         cc::switches::kUIShowCompositedLayerBorders);
@@ -468,10 +459,6 @@
   if (is_frame_rate_limit_disabled)
     return;
 
-  if (forced_refresh_rate_) {
-    timebase = base::TimeTicks();
-    interval = base::TimeDelta::FromSeconds(1) / forced_refresh_rate_;
-  }
   if (interval.is_zero()) {
     // TODO(brianderson): We should not be receiving 0 intervals.
     interval = viz::BeginFrameArgs::DefaultInterval();
diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
index 6b0c569..28fdf9b 100644
--- a/ui/compositor/compositor.h
+++ b/ui/compositor/compositor.h
@@ -468,9 +468,6 @@
   // Current vsync refresh rate per second.
   float refresh_rate_ = 0.f;
 
-  // If nonzero, this is the refresh rate forced from the command-line.
-  double forced_refresh_rate_ = 0.f;
-
   // A map from child id to parent id.
   std::unordered_set<viz::FrameSinkId, viz::FrameSinkIdHash> child_frame_sinks_;
   bool widget_valid_ = false;
diff --git a/ui/compositor/compositor_switches.cc b/ui/compositor/compositor_switches.cc
index f09ec54..a61a7ba 100644
--- a/ui/compositor/compositor_switches.cc
+++ b/ui/compositor/compositor_switches.cc
@@ -18,10 +18,6 @@
 // Forces tests to produce pixel output when they normally wouldn't.
 const char kEnablePixelOutputInTests[] = "enable-pixel-output-in-tests";
 
-// Limits the compositor to output a certain number of frames per second,
-// maximum.
-const char kLimitFps[] = "limit-fps";
-
 const char kUIEnableRGBA4444Textures[] = "ui-enable-rgba-4444-textures";
 
 const char kUIEnableZeroCopy[] = "ui-enable-zero-copy";
diff --git a/ui/compositor/compositor_switches.h b/ui/compositor/compositor_switches.h
index 2f02b8e0..8757e22e 100644
--- a/ui/compositor/compositor_switches.h
+++ b/ui/compositor/compositor_switches.h
@@ -12,7 +12,6 @@
 
 COMPOSITOR_EXPORT extern const char kEnableHardwareOverlays[];
 COMPOSITOR_EXPORT extern const char kEnablePixelOutputInTests[];
-COMPOSITOR_EXPORT extern const char kLimitFps[];
 COMPOSITOR_EXPORT extern const char kUIEnableRGBA4444Textures[];
 COMPOSITOR_EXPORT extern const char kUIEnableZeroCopy[];
 COMPOSITOR_EXPORT extern const char kUIDisableZeroCopy[];
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 4b073ec..dbbfe29 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -113,6 +113,7 @@
       device_scale_factor_(1.0f),
       cache_render_surface_requests_(0),
       deferred_paint_requests_(0),
+      backdrop_filter_quality_(1.0f),
       trilinear_filtering_request_(0),
       weak_ptr_factory_(this) {
   CreateCcLayer();
@@ -141,6 +142,7 @@
       device_scale_factor_(1.0f),
       cache_render_surface_requests_(0),
       deferred_paint_requests_(0),
+      backdrop_filter_quality_(1.0f),
       trilinear_filtering_request_(0),
       weak_ptr_factory_(this) {
   CreateCcLayer();
@@ -638,6 +640,7 @@
   cc_layer_->SetContentsOpaque(fills_bounds_opaquely_);
   cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN);
   cc_layer_->SetHideLayerAndSubtree(!visible_);
+  cc_layer_->SetBackdropFilterQuality(backdrop_filter_quality_);
   cc_layer_->SetElementId(cc::ElementId(cc_layer_->id()));
 
   SetLayerFilters();
@@ -673,6 +676,10 @@
     cc_layer_->SetCacheRenderSurface(false);
 }
 
+void Layer::SetBackdropFilterQuality(const float quality) {
+  backdrop_filter_quality_ = quality / GetDeviceScaleFactor();
+  cc_layer_->SetBackdropFilterQuality(backdrop_filter_quality_);
+}
 void Layer::AddDeferredPaintRequest() {
   ++deferred_paint_requests_;
   TRACE_COUNTER_ID1("ui", "DeferredPaintRequests", this,
diff --git a/ui/compositor/layer.h b/ui/compositor/layer.h
index 54c04338..0f9cc33 100644
--- a/ui/compositor/layer.h
+++ b/ui/compositor/layer.h
@@ -428,6 +428,14 @@
   void AddDeferredPaintRequest();
   void RemoveDeferredPaintRequest();
 
+  // |quality| is used as a multiplier to scale the temporary surface
+  // that might be created by the compositor to apply the backdrop filters.
+  // The filter will be applied on a surface |quality|^2 times the area of the
+  // original background.
+  // |quality| lower than one will decrease memory usage and increase
+  // performance.
+  void SetBackdropFilterQuality(const float quality);
+
   bool IsPaintDeferredForTesting() const { return deferred_paint_requests_; }
 
   // Request trilinear filtering for layer.
@@ -624,6 +632,8 @@
   // means we should paint the layer.
   unsigned deferred_paint_requests_;
 
+  float backdrop_filter_quality_;
+
   // The counter to maintain how many trilinear filtering requests we have. If
   // the value > 0, means we need to perform trilinear filtering on the layer.
   // If the value == 0, means we should not perform trilinear filtering on the
diff --git a/ui/compositor/layer_unittest.cc b/ui/compositor/layer_unittest.cc
index 5f422bd..ed00eaa 100644
--- a/ui/compositor/layer_unittest.cc
+++ b/ui/compositor/layer_unittest.cc
@@ -906,7 +906,8 @@
   viz::ParentLocalSurfaceIdAllocator allocator;
   std::unique_ptr<Layer> layer(CreateLayer(LAYER_SOLID_COLOR));
 
-  viz::LocalSurfaceId local_surface_id = allocator.GenerateId();
+  allocator.GenerateId();
+  viz::LocalSurfaceId local_surface_id = allocator.GetCurrentLocalSurfaceId();
   viz::SurfaceId surface_id_one(arbitrary_frame_sink, local_surface_id);
   layer->SetShowSurface(surface_id_one, gfx::Size(10, 10), SK_ColorWHITE,
                         cc::DeadlinePolicy::UseDefaultDeadline(), false);
@@ -917,7 +918,8 @@
   auto mirror = layer->Mirror();
   EXPECT_FALSE(mirror->StretchContentToFillBounds());
 
-  local_surface_id = allocator.GenerateId();
+  allocator.GenerateId();
+  local_surface_id = allocator.GetCurrentLocalSurfaceId();
   viz::SurfaceId surface_id_two(arbitrary_frame_sink, local_surface_id);
   layer->SetShowSurface(surface_id_two, gfx::Size(10, 10), SK_ColorWHITE,
                         cc::DeadlinePolicy::UseDefaultDeadline(), true);
@@ -1891,18 +1893,22 @@
   viz::FrameSinkId frame_sink_id(1u, 1u);
   viz::ParentLocalSurfaceIdAllocator allocator;
   before = child->cc_layer_for_testing();
-  child->SetShowSurface(viz::SurfaceId(frame_sink_id, allocator.GenerateId()),
-                        gfx::Size(10, 10), SK_ColorWHITE,
-                        cc::DeadlinePolicy::UseDefaultDeadline(), false);
+  allocator.GenerateId();
+  child->SetShowSurface(
+      viz::SurfaceId(frame_sink_id, allocator.GetCurrentLocalSurfaceId()),
+      gfx::Size(10, 10), SK_ColorWHITE,
+      cc::DeadlinePolicy::UseDefaultDeadline(), false);
   scoped_refptr<cc::Layer> after = child->cc_layer_for_testing();
   const auto* surface = static_cast<cc::SurfaceLayer*>(after.get());
   EXPECT_TRUE(after.get());
   EXPECT_NE(before.get(), after.get());
   EXPECT_EQ(base::nullopt, surface->deadline_in_frames());
 
-  child->SetShowSurface(viz::SurfaceId(frame_sink_id, allocator.GenerateId()),
-                        gfx::Size(10, 10), SK_ColorWHITE,
-                        cc::DeadlinePolicy::UseSpecifiedDeadline(4u), false);
+  allocator.GenerateId();
+  child->SetShowSurface(
+      viz::SurfaceId(frame_sink_id, allocator.GetCurrentLocalSurfaceId()),
+      gfx::Size(10, 10), SK_ColorWHITE,
+      cc::DeadlinePolicy::UseSpecifiedDeadline(4u), false);
   EXPECT_EQ(4u, surface->deadline_in_frames());
 }
 
diff --git a/ui/compositor/recyclable_compositor_mac.cc b/ui/compositor/recyclable_compositor_mac.cc
index 45690fc..6257f86 100644
--- a/ui/compositor/recyclable_compositor_mac.cc
+++ b/ui/compositor/recyclable_compositor_mac.cc
@@ -73,8 +73,9 @@
   if (size_pixels != size_pixels_ || scale_factor != scale_factor_) {
     size_pixels_ = size_pixels;
     scale_factor_ = scale_factor;
+    local_surface_id_allocator_.GenerateId();
     viz::LocalSurfaceId local_surface_id =
-        local_surface_id_allocator_.GenerateId();
+        local_surface_id_allocator_.GetCurrentLocalSurfaceId();
     compositor()->SetScaleAndSize(
         scale_factor_, size_pixels_, local_surface_id,
         local_surface_id_allocator_.allocation_time());
diff --git a/ui/file_manager/file_manager/common/js/BUILD.gn b/ui/file_manager/file_manager/common/js/BUILD.gn
index fcc077e6..f2487d8 100644
--- a/ui/file_manager/file_manager/common/js/BUILD.gn
+++ b/ui/file_manager/file_manager/common/js/BUILD.gn
@@ -62,6 +62,7 @@
 js_unittest("files_app_entry_types_unittest") {
   deps = [
     ":files_app_entry_types",
+    ":util",
     ":volume_manager_common",
     "//ui/file_manager/base/js:test_error_reporting",
   ]
diff --git a/ui/file_manager/file_manager/common/js/files_app_entry_types.js b/ui/file_manager/file_manager/common/js/files_app_entry_types.js
index 3dff678..a6fe6ac 100644
--- a/ui/file_manager/file_manager/common/js/files_app_entry_types.js
+++ b/ui/file_manager/file_manager/common/js/files_app_entry_types.js
@@ -114,33 +114,92 @@
  * that reads a static list of entries, provided at construction time.
  * https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader
  * It can be used by DirectoryEntry-like such as EntryList to return its
- * children entries.
+ * entries.
+ * @extends {DirectoryReader}
  */
 class StaticReader {
   /**
-   * @param {!Array<!Entry|!FilesAppEntry>} children: Array of Entry-like
+   * @param {!Array<!Entry|!FilesAppEntry>} entries: Array of Entry-like
    * instances that will be returned/read by this reader.
    */
-  constructor(children) {
-    this.children_ = children;
+  constructor(entries) {
+    this.entries_ = entries;
   }
 
   /**
    * Reads array of entries via |success| callback.
    *
-   * @param {function(Array<Entry|FilesAppEntry>)} success: A callback that will
-   * be called multiple times with the entries, last call will be called with an
-   * empty array indicating that no more entries available.
-   * @param {function(Array<Entry|FilesAppEntry>)} error: A callback that's
-   * never called, it's here to match the signature from the Web Standards.
+   * @param {function(!Array<!Entry|!FilesAppEntry>)} success: A callback that
+   *     will be called multiple times with the entries, last call will be
+   *     called with an empty array indicating that no more entries available.
+   * @param {function(!FileError)=} error: A callback that's never
+   *     called, it's here to match the signature from the Web Standards.
+   * @override
    */
   readEntries(success, error) {
-    const children = this.children_;
+    const entries = this.entries_;
     // readEntries is suppose to return empty result when there are no more
-    // files to return, so we clear the children_ attribute for next call.
-    this.children_ = [];
+    // files to return, so we clear the entries_ attribute for next call.
+    this.entries_ = [];
     // Triggers callback asynchronously.
-    setTimeout(success, 0, children);
+    setTimeout(success, 0, entries);
+  }
+}
+
+/**
+ * A reader compatible with DirectoryEntry.createReader (from Web Standards),
+ * It chains entries from one reader to another, creating a combined set of
+ * entries from all readers.
+ * @extends {DirectoryReader}
+ */
+class CombinedReaders {
+  /**
+   * @param {!Array<!DirectoryReader>} readers Array of all readers that will
+   * have their entries combined.
+   */
+  constructor(readers) {
+    /**
+     * @private {!Array<!DirectoryReader>} Reversed readers so the readEntries
+     *     can just use pop() to get the next
+     */
+    this.readers_ = readers.reverse();
+
+    /** @private {!DirectoryReader} */
+    this.currentReader_ = readers.pop();
+  }
+
+  /**
+   * @param {function(!Array<!Entry|!FilesAppEntry>)} success returning entries
+   *     of all readers, it's called with empty Array when there is no more
+   *     entries to return.
+   * @param {function(!FileError)=} error called when error happens when reading
+   *    from readers.
+   * for this implementation.
+   * @override
+   */
+  readEntries(success, error) {
+    if (!this.currentReader_) {
+      // If there is no more reader to consume, just return an empty result
+      // which indicates that read has finished.
+      success([]);
+      return;
+    }
+    this.currentReader_.readEntries((results) => {
+      if (results.length) {
+        success(results);
+      } else {
+        // If there isn't no more readers, finish by calling success with no
+        // results.
+        if (!this.readers_.length) {
+          success([]);
+          return;
+        }
+        // Move to next reader and start consuming it.
+        this.currentReader_ = this.readers_.pop();
+        this.readEntries(success, error);
+      }
+
+    }, error);
   }
 }
 
@@ -171,7 +230,7 @@
   }
 
   /**
-   * @return {!StaticReader|!DirectoryReader} Returns a reader compatible with
+   * @return {!DirectoryReader} Returns a reader compatible with
    * DirectoryEntry.createReader (from Web Standards) that reads the children of
    * this instance.
    * This method is defined on DirectoryEntry.
@@ -277,7 +336,7 @@
   }
 
   /**
-   * @return {!StaticReader} Returns a reader compatible with
+   * @return {!DirectoryReader} Returns a reader compatible with
    * DirectoryEntry.createReader (from Web Standards) that reads the children of
    * this EntryList instance.
    * This method is defined on DirectoryEntry.
@@ -464,8 +523,8 @@
   }
 
   /**
-   * @return {!StaticReader|!DirectoryReader} Returns a reader from root entry,
-   * which is compatible with DirectoryEntry.createReader (from Web Standards).
+   * @return {!DirectoryReader} Returns a reader from root entry, which is
+   * compatible with DirectoryEntry.createReader (from Web Standards).
    * This method is defined on DirectoryEntry.
    * @override
    */
@@ -563,7 +622,7 @@
   }
 
   /**
-   * @return {!StaticReader} Returns a reader compatible with
+   * @return {!DirectoryReader} Returns a reader compatible with
    * DirectoryEntry.createReader (from Web Standards) that reads 0 entries.
    * @override
    */
diff --git a/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js b/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js
index 698dc43..75dbef4 100644
--- a/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js
+++ b/ui/file_manager/file_manager/common/js/files_app_entry_types_unittest.js
@@ -203,6 +203,86 @@
       testReportCallback);
 }
 
+/** Tests CombinedReader.readEntries. */
+function testCombinedReader(testReportCallback) {
+  const innerReaders = [
+    new StaticReader(['file1']),
+    new StaticReader(['file2']),
+  ];
+  const reader = new CombinedReaders(innerReaders);
+  const testResults = [];
+  // How many times the reader callback |accumulateResults| has been called?
+  let callCounter = 0;
+  const accumulateResults = (readerResult) => {
+    callCounter++;
+    // merge on testResults.
+    readerResult.map(f => testResults.push(f));
+    if (readerResult.length > 0)
+      reader.readEntries(accumulateResults, () => {});
+  };
+
+  reader.readEntries(accumulateResults, () => {});
+  // readEntries runs asynchronously, so let's wait it to be called.
+  reportPromise(
+      waitUntil(() => {
+        // accumulateResults should be called 2x in normal conditions;
+        return callCounter >= 3;
+      }).then(() => {
+        // Now we can check the final result.
+        assertEquals(3, callCounter);
+        assertEquals(2, testResults.length);
+        assertEquals('file1', testResults[0]);
+        assertEquals('file2', testResults[1]);
+      }),
+      testReportCallback);
+}
+
+function testCombinedReaderError(testReportCallback) {
+  const expectedError = new Error('a fake error');
+  const alwaysFailReader = {
+    readEntries: (success, error) => {
+      error(expectedError);
+    },
+  };
+  const innerReaders = [
+    new StaticReader(['file1']),
+    alwaysFailReader,
+  ];
+  const reader = new CombinedReaders(innerReaders);
+  const errors = [];
+  const accumulateFailures = (error) => {
+    errors.push(error);
+  };
+
+  let callCounter = 0;
+  const testResults = [];
+  const accumulateResults = (readerResult) => {
+    callCounter++;
+    // merge on testResults.
+    readerResult.map(f => testResults.push(f));
+    if (readerResult.length > 0)
+      reader.readEntries(accumulateResults, accumulateFailures);
+  };
+
+
+  reader.readEntries(accumulateResults, accumulateFailures);
+  // readEntries runs asynchronously, so let's wait it to be called.
+  reportPromise(
+      waitUntil(() => {
+        // accumulateResults should be called 2x in normal conditions;
+        return callCounter >= 1 && errors.length >= 1;
+      }).then(() => {
+        // Now we can check the final result.
+        assertEquals(1, callCounter);
+        assertEquals(1, testResults.length);
+        assertEquals('file1', testResults[0]);
+
+        assertEquals(1, errors.length);
+        assertEquals(expectedError, errors[0]);
+      }),
+      testReportCallback);
+}
+
 /**
  * Returns an object that can be used as displayRoot on a FakeVolumeInfo.
  * VolumeEntry delegates many attributes and methods to displayRoot.
diff --git a/ui/file_manager/file_manager/foreground/js/navigation_list_model.js b/ui/file_manager/file_manager/foreground/js/navigation_list_model.js
index e68ab47a..d3ee5e83 100644
--- a/ui/file_manager/file_manager/foreground/js/navigation_list_model.js
+++ b/ui/file_manager/file_manager/foreground/js/navigation_list_model.js
@@ -386,42 +386,6 @@
 };
 
 /**
- * Reorder navigation items in the following order:
- *  1. Volumes.
- *  2. If Downloads exists, then immediately after Downloads should be:
- *  2a. Recent if it exists.
- *  2b. Linux files if it exists and is not mounted.
- *      When mounted, it will be located in Volumes at this position.
- *  3. Shortcuts.
- *  4. Add new services if it exists.
- * @private
- */
-NavigationListModel.prototype.flatNavigationItems_ = function() {
-  // Check if Linux files already mounted.
-  let linuxFilesMounted = false;
-  for (let i = 0; i < this.volumeList_.length; i++) {
-    if (this.volumeList_[i].volumeInfo.volumeType ===
-        VolumeManagerCommon.VolumeType.CROSTINI) {
-      linuxFilesMounted = true;
-      break;
-    }
-  }
-
-  // Items as per required order.
-  this.navigationItems_ = this.volumeList_.slice();
-  var downloadsVolumeIndex = this.findDownloadsVolumeIndex_();
-  if (this.linuxFilesItem_ && !linuxFilesMounted && downloadsVolumeIndex >= 0)
-    this.navigationItems_.splice(
-        downloadsVolumeIndex + 1, 0, this.linuxFilesItem_);
-  if (this.recentModelItem_ && downloadsVolumeIndex >= 0)
-    this.navigationItems_.splice(
-        downloadsVolumeIndex + 1, 0, this.recentModelItem_);
-  Array.prototype.push.apply(this.navigationItems_, this.shortcutList_);
-  if (this.addNewServicesItem_)
-    this.navigationItems_.push(this.addNewServicesItem_);
-};
-
-/**
  * Reorder navigation items and nest some within "Downloads"
  * which will be displayed as "My-Files". Desired order:
  *  1. Recents.
diff --git a/ui/message_center/views/message_view.cc b/ui/message_center/views/message_view.cc
index e6185bba..8677210 100644
--- a/ui/message_center/views/message_view.cc
+++ b/ui/message_center/views/message_view.cc
@@ -316,6 +316,12 @@
   return is_nested_ ? layer() : GetWidget()->GetLayer();
 }
 
+void MessageView::OnSlideStarted() {
+  for (auto* observer : slide_observers_) {
+    observer->OnSlideStarted(notification_id_);
+  }
+}
+
 void MessageView::OnSlideChanged(bool in_progress) {
   for (auto* observer : slide_observers_) {
     observer->OnSlideChanged(notification_id_);
diff --git a/ui/message_center/views/message_view.h b/ui/message_center/views/message_view.h
index c49da09..a0ea2ae 100644
--- a/ui/message_center/views/message_view.h
+++ b/ui/message_center/views/message_view.h
@@ -50,7 +50,10 @@
 
   class SlideObserver {
    public:
-    virtual void OnSlideChanged(const std::string& notification_id) = 0;
+    virtual ~SlideObserver() = default;
+
+    virtual void OnSlideStarted(const std::string& notification_id) {}
+    virtual void OnSlideChanged(const std::string& notification_id) {}
   };
 
   enum class Mode {
@@ -126,6 +129,7 @@
 
   // message_center::SlideOutController::Delegate:
   ui::Layer* GetSlideOutLayer() override;
+  void OnSlideStarted() override;
   void OnSlideChanged(bool in_progress) override;
   void OnSlideOut() override;
 
diff --git a/ui/message_center/views/slide_out_controller.cc b/ui/message_center/views/slide_out_controller.cc
index 2f76731..4bd60341 100644
--- a/ui/message_center/views/slide_out_controller.cc
+++ b/ui/message_center/views/slide_out_controller.cc
@@ -44,11 +44,13 @@
     if (mode_ == SlideMode::FULL &&
         fabsf(event->details().velocity_x()) > kFlingThresholdForClose) {
       SlideOutAndClose(event->details().velocity_x());
+      delegate_->OnSlideChanged(false);
       event->StopPropagation();
       return;
     }
     CaptureControlOpenState();
     RestoreVisualState();
+    delegate_->OnSlideChanged(false);
     return;
   }
 
@@ -69,7 +71,7 @@
       default:
         NOTREACHED();
     }
-    delegate_->OnSlideChanged(true);
+    delegate_->OnSlideStarted();
   } else if (event->type() == ui::ET_GESTURE_SCROLL_UPDATE) {
     // The scroll-update events include the incremental scroll amount.
     gesture_amount_ += event->details().scroll_x();
@@ -108,11 +110,13 @@
     if (mode_ == SlideMode::FULL &&
         scrolled_ratio >= scroll_amount_for_closing_notification / width) {
       SlideOutAndClose(gesture_amount_);
+      delegate_->OnSlideChanged(false);
       event->StopPropagation();
       return;
     }
     CaptureControlOpenState();
     RestoreVisualState();
+    delegate_->OnSlideChanged(false);
   }
 
   event->SetHandled();
@@ -140,10 +144,7 @@
   }
 
   if (layer->transform() == transform && opacity_ == 1.f) {
-    // Here, nothing are changed and no animation starts. In this case, just
-    // calls OnSlideChanged(in_progress = false) to notify end of horizontal
-    // slide (including animations) to observers.
-    delegate_->OnSlideChanged(false);
+    // Nothing are changed and no animation starts.
     return;
   }
 
@@ -181,8 +182,6 @@
 }
 
 void SlideOutController::OnImplicitAnimationsCompleted() {
-  delegate_->OnSlideChanged(false);
-
   // Call Delegate::OnSlideOut() if this animation came from SlideOutAndClose().
   if (opacity_ == 0)
     delegate_->OnSlideOut();
diff --git a/ui/message_center/views/slide_out_controller.h b/ui/message_center/views/slide_out_controller.h
index 100cbfb..1a1ec5c 100644
--- a/ui/message_center/views/slide_out_controller.h
+++ b/ui/message_center/views/slide_out_controller.h
@@ -30,9 +30,11 @@
     // Returns the layer for slide operations.
     virtual ui::Layer* GetSlideOutLayer() = 0;
 
-    // Called when a slide starts, ends, or is updated.
-    // The argument is true if the slide starts or in progress, false if it
-    // ends.
+    // Called when a manual slide starts.
+    virtual void OnSlideStarted() {}
+
+    // Called when a manual slide updates or ends. The argument is true if the
+    // slide starts or in progress, false if it ends.
     virtual void OnSlideChanged(bool in_progress) = 0;
 
     // Called when user intends to close the View by sliding it out.
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js b/ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js
index 974bb293..9b46b54 100644
--- a/ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js
+++ b/ui/webui/resources/cr_elements/policy/cr_policy_pref_behavior.js
@@ -32,6 +32,9 @@
    * @return {boolean} True if |this.pref| has a recommended or enforced policy.
    */
   hasPrefPolicyIndicator: function() {
+    if (!this.pref) {
+      return false;
+    }
     if (this.noExtensionIndicator &&
         this.pref.controlledBy ==
             chrome.settingsPrivate.ControlledBy.EXTENSION) {
diff --git a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
index b83f949..2cb88b2f 100644
--- a/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
+++ b/ui/webui/resources/cr_elements/policy/cr_policy_pref_indicator.js
@@ -71,7 +71,7 @@
    * @private
    */
   getIndicatorTooltipForPref_: function(indicatorType) {
-    if (this.pref === undefined)
+    if (!this.pref)
       return '';
 
     var matches = this.pref && this.pref.value == this.pref.recommendedValue;