diff --git a/DEPS b/DEPS
index 18093c71..070b8b6f 100644
--- a/DEPS
+++ b/DEPS
@@ -78,11 +78,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': '6f1151140f331c78d99ede3cac10462dc8b32cde',
+  'skia_revision': '8716b50aae949d5ad3af680c2530e9285f6491cc',
   # 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': '658c0b5671f9a4badf465811a6b58ea2d4c4840a',
+  'v8_revision': 'bfbaf6ac936de840bc95eca1e41f629d80737431',
   # 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.
@@ -90,7 +90,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': 'b8cb939f5817e558ca29b9f9c2e2e15c20342eb7',
+  'angle_revision': '8c3988c59ebe97f03c376d30aa94fb6062f4ae48',
   # 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.
@@ -643,7 +643,7 @@
     Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd458ada06171a85af00367251a4ed55db7fe2018',
 
   'src/third_party/webrtc':
-    Var('webrtc_git') + '/src.git' + '@' + '04766e733eb36cc38784c388a0f4499561ae5203', # commit position 20628
+    Var('webrtc_git') + '/src.git' + '@' + '5f99e656792b47d30277666ad31c7e3e2c4a6c2a', # commit position 20628
 
   'src/third_party/xdg-utils': {
       'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
diff --git a/android_webview/BUILD.gn b/android_webview/BUILD.gn
index 8e7adbd3..9ade46c 100644
--- a/android_webview/BUILD.gn
+++ b/android_webview/BUILD.gn
@@ -103,7 +103,10 @@
 jinja_template("system_webview_manifest") {
   input = "apk/java/AndroidManifest.xml"
   output = system_webview_android_manifest
-  variables = [ "package=$system_webview_package_name" ]
+  variables = [
+    "package=$system_webview_package_name",
+    "sandboxed_service_extra_flags=android:visibleToInstantApps=\"true\"",
+  ]
 }
 
 webview_repack_locales("repack_locales") {
diff --git a/android_webview/browser/aw_quota_manager_bridge.cc b/android_webview/browser/aw_quota_manager_bridge.cc
index 48bd984f..b73e3f6 100644
--- a/android_webview/browser/aw_quota_manager_bridge.cc
+++ b/android_webview/browser/aw_quota_manager_bridge.cc
@@ -16,8 +16,8 @@
 #include "content/public/common/content_client.h"
 #include "jni/AwQuotaManagerBridge_jni.h"
 #include "storage/browser/quota/quota_manager.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 using base::android::AttachCurrentThread;
@@ -48,7 +48,7 @@
   ~GetOriginsTask();
 
   void OnOriginsObtained(const std::set<GURL>& origins,
-                         storage::StorageType type);
+                         blink::StorageType type);
 
   void OnUsageAndQuotaObtained(const GURL& origin,
                                blink::QuotaStatusCode status_code,
@@ -85,13 +85,13 @@
   BrowserThread::PostTask(
       BrowserThread::IO, FROM_HERE,
       base::Bind(&QuotaManager::GetOriginsModifiedSince, quota_manager_,
-                 storage::kStorageTypeTemporary,
+                 blink::StorageType::kTemporary,
                  base::Time() /* Since beginning of time. */,
                  base::Bind(&GetOriginsTask::OnOriginsObtained, this)));
 }
 
 void GetOriginsTask::OnOriginsObtained(const std::set<GURL>& origins,
-                                       storage::StorageType type) {
+                                       blink::StorageType type) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   num_callbacks_to_wait_ = origins.size();
   num_callbacks_received_ = 0u;
@@ -313,7 +313,7 @@
   BrowserThread::PostTask(
       BrowserThread::IO, FROM_HERE,
       base::Bind(&QuotaManager::GetUsageAndQuota, GetQuotaManager(),
-                 GURL(origin), storage::kStorageTypeTemporary,
+                 GURL(origin), blink::StorageType::kTemporary,
                  base::Bind(&OnUsageAndQuotaObtained, ui_callback)));
 }
 
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java
index f2f42008..4585a4de 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContents.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java
@@ -72,6 +72,7 @@
 import org.chromium.content_public.browser.GestureStateListener;
 import org.chromium.content_public.browser.ImeEventObserver;
 import org.chromium.content_public.browser.JavaScriptCallback;
+import org.chromium.content_public.browser.JavascriptInjector;
 import org.chromium.content_public.browser.LoadUrlParams;
 import org.chromium.content_public.browser.MessagePort;
 import org.chromium.content_public.browser.NavigationController;
@@ -412,6 +413,8 @@
     // used by WebContents, and AwContents doesn't have to know what's inside the holder.
     private WebContentsInternals mWebContentsInternals;
 
+    private JavascriptInjector mJavascriptInjector;
+
     private static class WebContentsInternalsHolder implements WebContents.InternalsHolder {
         private final WeakReference<AwContents> mAwContentsRef;
 
@@ -1225,7 +1228,7 @@
         Map<String, Pair<Object, Class>> javascriptInterfaces =
                 new HashMap<String, Pair<Object, Class>>();
         if (mContentViewCore != null) {
-            javascriptInterfaces.putAll(mWebContents.getJavascriptInterfaces());
+            javascriptInterfaces.putAll(getJavascriptInjector().getInterfaces());
         }
 
         setNewAwContents(popupNativeAwContents);
@@ -1251,11 +1254,18 @@
         for (Map.Entry<String, Pair<Object, Class>> entry : javascriptInterfaces.entrySet()) {
             @SuppressWarnings("unchecked")
             Class<? extends Annotation> requiredAnnotation = entry.getValue().second;
-            mWebContents.addPossiblyUnsafeJavascriptInterface(
+            getJavascriptInjector().addPossiblyUnsafeInterface(
                     entry.getValue().first, entry.getKey(), requiredAnnotation);
         }
     }
 
+    private JavascriptInjector getJavascriptInjector() {
+        if (mJavascriptInjector == null) {
+            mJavascriptInjector = JavascriptInjector.fromWebContents(mWebContents);
+        }
+        return mJavascriptInjector;
+    }
+
     @VisibleForTesting
     @CalledByNative
     protected void onRenderProcessGone(int childProcessID) {
@@ -1419,7 +1429,7 @@
      */
     public void disableJavascriptInterfacesInspection() {
         if (!isDestroyedOrNoOperation(WARN)) {
-            mWebContents.setAllowJavascriptInterfacesInspection(false);
+            getJavascriptInjector().setAllowInspection(false);
         }
     }
 
@@ -2674,7 +2684,7 @@
     }
 
     /**
-     * @see WebContents#addPossiblyUnsafeJavascriptInterface(Object, String, Class)
+     * @see JavascriptInjector#addPossiblyUnsafeInterface(Object, String, Class)
      */
     @SuppressLint("NewApi")  // JavascriptInterface requires API level 17.
     public void addJavascriptInterface(Object object, String name) {
@@ -2685,17 +2695,17 @@
             requiredAnnotation = JavascriptInterface.class;
         }
 
-        mWebContents.addPossiblyUnsafeJavascriptInterface(object, name, requiredAnnotation);
+        getJavascriptInjector().addPossiblyUnsafeInterface(object, name, requiredAnnotation);
     }
 
     /**
      * @see android.webkit.WebView#removeJavascriptInterface(String)
      */
     public void removeJavascriptInterface(String interfaceName) {
-        if (TRACE) Log.i(TAG, "%s removeJavascriptInterface=%s", this, interfaceName);
+        if (TRACE) Log.i(TAG, "%s removeInterface=%s", this, interfaceName);
         if (isDestroyedOrNoOperation(WARN)) return;
 
-        mWebContents.removeJavascriptInterface(interfaceName);
+        getJavascriptInjector().removeInterface(interfaceName);
     }
 
     /**
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
index ca1dca7..8739674 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsClient.java
@@ -270,7 +270,7 @@
             if (mAcceptTypes == null) {
                 return new String[0];
             }
-            return mAcceptTypes.split(";");
+            return mAcceptTypes.split(",");
         }
 
         public boolean isCaptureEnabled() {
@@ -288,7 +288,7 @@
         public Intent createIntent() {
             String mimeType = "*/*";
             if (mAcceptTypes != null && !mAcceptTypes.trim().isEmpty()) {
-                mimeType = mAcceptTypes.split(";")[0];
+                mimeType = mAcceptTypes.split(",")[0];
             }
 
             Intent i = new Intent(Intent.ACTION_GET_CONTENT);
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/VisualStateTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/VisualStateTest.java
index 9afe04e..5857ff1 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/VisualStateTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/VisualStateTest.java
@@ -31,6 +31,7 @@
 import org.chromium.base.test.util.Feature;
 import org.chromium.content.browser.ContentViewCore;
 import org.chromium.content.browser.test.util.DOMUtils;
+import org.chromium.content_public.browser.JavascriptInjector;
 import org.chromium.content_public.browser.LoadUrlParams;
 
 import java.io.ByteArrayInputStream;
@@ -440,8 +441,8 @@
         };
 
         InstrumentationRegistry.getInstrumentation().runOnMainSync(() -> {
-            awContents.getWebContents().addPossiblyUnsafeJavascriptInterface(
-                    pageChangeNotifier, "pageChangeNotifier", null);
+            JavascriptInjector.fromWebContents(awContents.getWebContents())
+                    .addPossiblyUnsafeInterface(pageChangeNotifier, "pageChangeNotifier", null);
             awContents.loadUrl(WAIT_FOR_JS_DETACHED_TEST_URL);
         });
 
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/util/JavascriptEventObserver.java b/android_webview/javatests/src/org/chromium/android_webview/test/util/JavascriptEventObserver.java
index 862615a6..90a8493b 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/util/JavascriptEventObserver.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/util/JavascriptEventObserver.java
@@ -4,6 +4,7 @@
 
 package org.chromium.android_webview.test.util;
 
+import org.chromium.content_public.browser.JavascriptInjector;
 import org.chromium.content_public.browser.WebContents;
 
 /**
@@ -25,7 +26,8 @@
      * @param name the name of object used in javascript
      */
     public void register(WebContents webContents, String name) {
-        webContents.addPossiblyUnsafeJavascriptInterface(this, name, null);
+        JavascriptInjector.fromWebContents(webContents)
+                .addPossiblyUnsafeInterface(this, name, null);
     }
 
     /**
diff --git a/build/secondary/third_party/android_platform/development/scripts/BUILD.gn b/build/secondary/third_party/android_platform/development/scripts/BUILD.gn
index d808824..6de67e8 100644
--- a/build/secondary/third_party/android_platform/development/scripts/BUILD.gn
+++ b/build/secondary/third_party/android_platform/development/scripts/BUILD.gn
@@ -13,5 +13,8 @@
   sources = _py_files
   data = sources
 
-  data += [ "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer" ]
+  data += [
+    "//third_party/android_platform/development/scripts/stack",
+    "//third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer",
+  ]
 }
diff --git a/build/secondary/third_party/android_platform/development/scripts/stack.pydeps b/build/secondary/third_party/android_platform/development/scripts/stack.pydeps
index 1b3ecbb..82d4f07 100644
--- a/build/secondary/third_party/android_platform/development/scripts/stack.pydeps
+++ b/build/secondary/third_party/android_platform/development/scripts/stack.pydeps
@@ -1,5 +1,5 @@
 # Generated by running:
-#   build/print_python_deps.py --root third_party/android_platform/development/scripts --output build/secondary/third_party/android_platform/development/scripts/stack.pydeps third_party/android_platform/development/scripts/stack
+#   build/print_python_deps.py --root third_party/android_platform/development/scripts --output build/secondary/third_party/android_platform/development/scripts/stack.pydeps third_party/android_platform/development/scripts/stack.py
 ../../../../build/android/pylib/__init__.py
 ../../../../build/android/pylib/constants/__init__.py
 ../../../../build/android/pylib/symbols/__init__.py
@@ -14,7 +14,7 @@
 ../../../catapult/devil/devil/android/sdk/version_codes.py
 ../../../catapult/devil/devil/constants/__init__.py
 ../../../catapult/devil/devil/constants/exit_codes.py
-stack
+stack.py
 stack_core.py
 stack_libs.py
 symbol.py
diff --git a/chrome/VERSION b/chrome/VERSION
index 52e2726e..fc4a00c 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=65
 MINOR=0
-BUILD=3308
+BUILD=3310
 PATCH=0
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java
index 32866322..fd7ab749 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/ntp/cards/AllDismissedItemTest.java
@@ -15,6 +15,7 @@
 
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.chrome.browser.ChromeActivity;
 import org.chromium.chrome.browser.ChromeSwitches;
@@ -69,8 +70,10 @@
     }
 
     @Test
-    @MediumTest
-    @Feature({"Cards", "RenderTest"})
+    //@MediumTest
+    //@Feature({"Cards", "RenderTest"})
+    // crbug.com/780555
+    @DisabledTest
     @ChromeHome.Enable
     public void testChromeHomeAppearance() throws IOException {
         renderAtHour(new ViewHolder(mContentView, null), 0, "modern");
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareMenuActionHandlerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareMenuActionHandlerTest.java
index 0083ea2..80518bf 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareMenuActionHandlerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/share/ShareMenuActionHandlerTest.java
@@ -9,7 +9,6 @@
 import android.os.Handler;
 import android.os.Parcel;
 import android.support.test.filters.SmallTest;
-import android.util.Pair;
 
 import org.junit.Assert;
 import org.junit.Rule;
@@ -35,8 +34,6 @@
 import org.chromium.ui.base.EventForwarder;
 import org.chromium.ui.base.WindowAndroid;
 
-import java.lang.annotation.Annotation;
-import java.util.Map;
 import java.util.concurrent.ExecutionException;
 
 /**
@@ -399,21 +396,6 @@
 
         @Override
         public void setSize(int width, int height) {}
-
-        @Override
-        public Map<String, Pair<Object, Class>> getJavascriptInterfaces() {
-            return null;
-        }
-
-        @Override
-        public void setAllowJavascriptInterfacesInspection(boolean allow) {}
-
-        @Override
-        public void addPossiblyUnsafeJavascriptInterface(
-                Object object, String name, Class<? extends Annotation> requiredAnnotation) {}
-
-        @Override
-        public void removeJavascriptInterface(String name) {}
     }
 
     private static class MockRenderFrameHost implements RenderFrameHost {
diff --git a/chrome/android/monochrome_android_manifest_jinja_variables.gni b/chrome/android/monochrome_android_manifest_jinja_variables.gni
index dcbfa967..820ce4f 100644
--- a/chrome/android/monochrome_android_manifest_jinja_variables.gni
+++ b/chrome/android/monochrome_android_manifest_jinja_variables.gni
@@ -6,4 +6,5 @@
   "min_sdk_version=24",
   "sandboxed_service_exported=true",
   "use32bitAbi=android:use32bitAbi=\"true\"",
+  "sandboxed_service_extra_flags=android:visibleToInstantApps=\"true\"",
 ]
diff --git a/chrome/browser/android/preferences/website_preference_bridge.cc b/chrome/browser/android/preferences/website_preference_bridge.cc
index 417b373..d838d68 100644
--- a/chrome/browser/android/preferences/website_preference_bridge.cc
+++ b/chrome/browser/android/preferences/website_preference_bridge.cc
@@ -46,6 +46,7 @@
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/origin.h"
 #include "url/url_constants.h"
 
@@ -671,8 +672,8 @@
       continue;
     ScopedJavaLocalRef<jstring> host = ConvertUTF8ToJavaString(env, i->host);
 
-    Java_WebsitePreferenceBridge_insertStorageInfoIntoList(env, list, host,
-                                                           i->type, i->usage);
+    Java_WebsitePreferenceBridge_insertStorageInfoIntoList(
+        env, list, host, static_cast<jint>(i->type), i->usage);
   }
 
   base::android::RunCallbackAndroid(java_callback, list);
@@ -800,7 +801,7 @@
 
   auto storage_info_fetcher = base::MakeRefCounted<StorageInfoFetcher>(profile);
   storage_info_fetcher->ClearStorage(
-      host, static_cast<storage::StorageType>(type),
+      host, static_cast<blink::StorageType>(type),
       base::Bind(&OnStorageInfoCleared,
                  ScopedJavaGlobalRef<jobject>(java_callback)));
 }
diff --git a/chrome/browser/apps/guest_view/web_view_browsertest.cc b/chrome/browser/apps/guest_view/web_view_browsertest.cc
index 106a6ea9..52508799 100644
--- a/chrome/browser/apps/guest_view/web_view_browsertest.cc
+++ b/chrome/browser/apps/guest_view/web_view_browsertest.cc
@@ -69,6 +69,7 @@
 #include "content/public/test/browser_test_utils.h"
 #include "content/public/test/download_test_observer.h"
 #include "content/public/test/fake_speech_recognition_manager.h"
+#include "content/public/test/test_file_error_injector.h"
 #include "content/public/test/test_navigation_observer.h"
 #include "content/public/test/test_renderer_host.h"
 #include "content/public/test/test_utils.h"
@@ -2795,12 +2796,11 @@
 const char kDownloadPathPrefix[] = "/download_cookie_isolation_test";
 
 // EmbeddedTestServer request handler for use with DownloadCookieIsolation test.
-// Responds with the next status code in |status_codes| if the 'Cookie' header
-// sent with the request matches the query() part of the URL. Otherwise, fails
-// the request with an HTTP 403. The body of the response is the value of the
-// Cookie header.
+// Responds with the next status code 200 if the 'Cookie' header sent with the
+// request matches the query() part of the URL. Otherwise, fails the request
+// with an HTTP 403. The body of the response is the value of the Cookie
+// header.
 std::unique_ptr<net::test_server::HttpResponse> HandleDownloadRequestWithCookie(
-    base::queue<net::HttpStatusCode>* status_codes,
     const net::test_server::HttpRequest& request) {
   if (!base::StartsWith(request.relative_url, kDownloadPathPrefix,
                         base::CompareCase::SENSITIVE)) {
@@ -2821,14 +2821,11 @@
     return std::move(response);
   }
 
-  DCHECK(!status_codes->empty());
-
   // We have a cookie. Send some content along with the next status code.
   response.reset(new net::test_server::BasicHttpResponse);
-  response->set_code(status_codes->front());
+  response->set_code(net::HTTP_OK);
   response->set_content_type("application/octet-stream");
   response->set_content(cookie_to_expect);
-  status_codes->pop();
   return std::move(response);
 }
 
@@ -2891,17 +2888,8 @@
 // respective cookie stores. In addition, if those downloads are resumed, they
 // should continue to use their respective cookie stores.
 IN_PROC_BROWSER_TEST_P(WebViewTest, DownloadCookieIsolation) {
-  // These are the status codes to be returned by
-  // HandleDownloadRequestWithCookie. The first two requests are going to result
-  // in interrupted downloads. The next two requests are going to succeed.
-  base::queue<net::HttpStatusCode> status_codes;
-  status_codes.push(net::HTTP_INTERNAL_SERVER_ERROR);
-  status_codes.push(net::HTTP_INTERNAL_SERVER_ERROR);
-  status_codes.push(net::HTTP_OK);
-  status_codes.push(net::HTTP_OK);
-
   embedded_test_server()->RegisterRequestHandler(
-      base::Bind(&HandleDownloadRequestWithCookie, &status_codes));
+      base::BindRepeating(&HandleDownloadRequestWithCookie));
   ASSERT_TRUE(StartEmbeddedTestServer());  // For serving guest pages.
   LoadAndLaunchPlatformApp("web_view/download_cookie_isolation",
                            "created-webviews");
@@ -2919,6 +2907,15 @@
       content::BrowserContext::GetDownloadManager(
           web_contents->GetBrowserContext());
 
+  scoped_refptr<content::TestFileErrorInjector> error_injector(
+      content::TestFileErrorInjector::Create(download_manager));
+
+  content::TestFileErrorInjector::FileErrorInfo error_info(
+      content::TestFileErrorInjector::FILE_OPERATION_STREAM_COMPLETE, 0,
+      content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED);
+  error_info.stream_offset = 0;
+  error_injector->InjectError(error_info);
+
   std::unique_ptr<content::DownloadTestObserver> interrupted_observer(
       new content::DownloadTestObserverInterrupted(
           download_manager, 2,
@@ -2936,11 +2933,12 @@
           "startDownload('second', '%s?cookie=second')",
           embedded_test_server()->GetURL(kDownloadPathPrefix).spec().c_str())));
 
-  // Both downloads should fail due to the HTTP_INTERNAL_SERVER_ERROR that was
-  // injected above to the request handler. This maps to
-  // DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED.
+  // Both downloads should fail due to the error that was injected above to the
+  // download manager. This maps to DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED.
   interrupted_observer->WaitForFinished();
 
+  error_injector->ClearError();
+
   content::DownloadManager::DownloadVector downloads;
   download_manager->GetAllDownloads(&downloads);
   ASSERT_EQ(2u, downloads.size());
@@ -2979,15 +2977,8 @@
 }
 
 IN_PROC_BROWSER_TEST_P(WebViewTest, PRE_DownloadCookieIsolation_CrossSession) {
-  // These are the status codes to be returned by
-  // HandleDownloadRequestWithCookie. The first two requests are going to result
-  // in interrupted downloads. The next two requests are going to succeed.
-  base::queue<net::HttpStatusCode> status_codes;
-  status_codes.push(net::HTTP_INTERNAL_SERVER_ERROR);
-  status_codes.push(net::HTTP_INTERNAL_SERVER_ERROR);
-
   embedded_test_server()->RegisterRequestHandler(
-      base::Bind(&HandleDownloadRequestWithCookie, &status_codes));
+      base::BindRepeating(&HandleDownloadRequestWithCookie));
   ASSERT_TRUE(StartEmbeddedTestServer());  // For serving guest pages.
   LoadAndLaunchPlatformApp("web_view/download_cookie_isolation",
                            "created-webviews");
@@ -3012,6 +3003,15 @@
           download_manager, 2,
           content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_FAIL));
 
+  scoped_refptr<content::TestFileErrorInjector> error_injector(
+      content::TestFileErrorInjector::Create(download_manager));
+
+  content::TestFileErrorInjector::FileErrorInfo error_info(
+      content::TestFileErrorInjector::FILE_OPERATION_STREAM_COMPLETE, 0,
+      content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED);
+  error_info.stream_offset = 0;
+  error_injector->InjectError(error_info);
+
   EXPECT_TRUE(content::ExecuteScript(
       web_contents,
       base::StringPrintf(
@@ -3025,9 +3025,8 @@
           "startDownload('second', '%s?cookie=second')",
           embedded_test_server()->GetURL(kDownloadPathPrefix).spec().c_str())));
 
-  // Both downloads should fail due to the HTTP_INTERNAL_SERVER_ERROR that was
-  // injected above to the request handler. This maps to
-  // DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED.
+  // Both downloads should fail due to the error that was injected above to the
+  // download manager. This maps to DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED.
   interrupted_observer->WaitForFinished();
 
   // Wait for both downloads to be stored.
@@ -3039,12 +3038,8 @@
 }
 
 IN_PROC_BROWSER_TEST_P(WebViewTest, DownloadCookieIsolation_CrossSession) {
-  base::queue<net::HttpStatusCode> status_codes;
-  status_codes.push(net::HTTP_OK);
-  status_codes.push(net::HTTP_OK);
-
   embedded_test_server()->RegisterRequestHandler(
-      base::Bind(&HandleDownloadRequestWithCookie, &status_codes));
+      base::BindRepeating(&HandleDownloadRequestWithCookie));
   ASSERT_TRUE(StartEmbeddedTestServer());  // For serving guest pages.
 
   content::BrowserContext* browser_context = profile();
diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper.h b/chrome/browser/browsing_data/browsing_data_quota_helper.h
index 614350f..cc91e5e 100644
--- a/chrome/browser/browsing_data/browsing_data_quota_helper.h
+++ b/chrome/browser/browsing_data/browsing_data_quota_helper.h
@@ -14,7 +14,6 @@
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
 #include "base/sequenced_task_runner_helpers.h"
-#include "storage/common/quota/quota_types.h"
 
 class BrowsingDataQuotaHelper;
 class Profile;
diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
index 929cda6a..94bca40 100644
--- a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
+++ b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.cc
@@ -20,6 +20,7 @@
 #include "content/public/browser/storage_partition.h"
 #include "storage/browser/quota/quota_manager.h"
 
+using blink::StorageType;
 using content::BrowserThread;
 using content::BrowserContext;
 
@@ -62,9 +63,9 @@
     const FetchResultCallback& callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
-  const storage::StorageType types[] = {storage::kStorageTypeTemporary,
-                                        storage::kStorageTypePersistent,
-                                        storage::kStorageTypeSyncable};
+  const StorageType types[] = {StorageType::kTemporary,
+                               StorageType::kPersistent,
+                               StorageType::kSyncable};
 
   // Query hosts for each storage types. When complete, process the collected
   // hosts.
@@ -75,7 +76,7 @@
                      weak_factory_.GetWeakPtr(), callback,
                      base::Owned(pending_hosts)));
 
-  for (const storage::StorageType& type : types) {
+  for (const StorageType& type : types) {
     quota_manager_->GetOriginsModifiedSince(
         type, base::Time(),
         base::Bind(&BrowsingDataQuotaHelperImpl::GotOrigins,
@@ -86,7 +87,7 @@
 void BrowsingDataQuotaHelperImpl::GotOrigins(PendingHosts* pending_hosts,
                                              const base::Closure& completion,
                                              const std::set<GURL>& origins,
-                                             storage::StorageType type) {
+                                             StorageType type) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   for (const GURL& url : origins) {
     if (!BrowsingDataHelper::HasWebScheme(url))
@@ -111,7 +112,7 @@
 
   for (const auto& itr : *pending_hosts) {
     const std::string& host = itr.first;
-    storage::StorageType type = itr.second;
+    StorageType type = itr.second;
     quota_manager_->GetHostUsage(
         host, type, base::Bind(&BrowsingDataQuotaHelperImpl::GotHostUsage,
                                weak_factory_.GetWeakPtr(), quota_info,
@@ -122,17 +123,17 @@
 void BrowsingDataQuotaHelperImpl::GotHostUsage(QuotaInfoMap* quota_info,
                                                const base::Closure& completion,
                                                const std::string& host,
-                                               storage::StorageType type,
+                                               StorageType type,
                                                int64_t usage) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   switch (type) {
-    case storage::kStorageTypeTemporary:
+    case StorageType::kTemporary:
       (*quota_info)[host].temporary_usage = usage;
       break;
-    case storage::kStorageTypePersistent:
+    case StorageType::kPersistent:
       (*quota_info)[host].persistent_usage = usage;
       break;
-    case storage::kStorageTypeSyncable:
+    case StorageType::kSyncable:
       (*quota_info)[host].syncable_usage = usage;
       break;
     default:
diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h
index 569ff61..3157b84c 100644
--- a/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h
+++ b/chrome/browser/browsing_data/browsing_data_quota_helper_impl.h
@@ -17,8 +17,8 @@
 #include "base/memory/ref_counted.h"
 #include "base/memory/weak_ptr.h"
 #include "chrome/browser/browsing_data/browsing_data_quota_helper.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 class GURL;
 
@@ -35,7 +35,7 @@
   void RevokeHostQuota(const std::string& host) override;
 
  private:
-  using PendingHosts = std::set<std::pair<std::string, storage::StorageType>>;
+  using PendingHosts = std::set<std::pair<std::string, blink::StorageType>>;
   using QuotaInfoMap = std::map<std::string, QuotaInfo>;
 
   explicit BrowsingDataQuotaHelperImpl(storage::QuotaManager* quota_manager);
@@ -48,7 +48,7 @@
   void GotOrigins(PendingHosts* pending_hosts,
                   const base::Closure& completion,
                   const std::set<GURL>& origins,
-                  storage::StorageType type);
+                  blink::StorageType type);
 
   // Calls QuotaManager::GetHostUsage for each (origin, type) pair.
   void OnGetOriginsComplete(const FetchResultCallback& callback,
@@ -58,7 +58,7 @@
   void GotHostUsage(QuotaInfoMap* quota_info,
                     const base::Closure& completion,
                     const std::string& host,
-                    storage::StorageType type,
+                    blink::StorageType type,
                     int64_t usage);
 
   // Called when all QuotaManager::GetHostUsage requests are complete.
diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc
index 8d88d37..5746534 100644
--- a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc
+++ b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc
@@ -19,6 +19,7 @@
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/browser/test/mock_storage_client.h"
 
+using blink::StorageType;
 using content::BrowserThread;
 using content::MockOriginData;
 using content::MockStorageClient;
@@ -130,11 +131,11 @@
 
 TEST_F(BrowsingDataQuotaHelperTest, FetchData) {
   const MockOriginData kOrigins[] = {
-      {"http://example.com/", storage::kStorageTypeTemporary, 1},
-      {"https://example.com/", storage::kStorageTypeTemporary, 10},
-      {"http://example.com/", storage::kStorageTypePersistent, 100},
-      {"https://example.com/", storage::kStorageTypeSyncable, 1},
-      {"http://example2.com/", storage::kStorageTypeTemporary, 1000},
+      {"http://example.com/", StorageType::kTemporary, 1},
+      {"https://example.com/", StorageType::kTemporary, 10},
+      {"http://example.com/", StorageType::kPersistent, 100},
+      {"https://example.com/", StorageType::kSyncable, 1},
+      {"http://example2.com/", StorageType::kTemporary, 1000},
   };
 
   RegisterClient(kOrigins, arraysize(kOrigins));
@@ -151,19 +152,19 @@
 
 TEST_F(BrowsingDataQuotaHelperTest, IgnoreExtensionsAndDevTools) {
   const MockOriginData kOrigins[] = {
-      {"http://example.com/", storage::kStorageTypeTemporary, 1},
-      {"https://example.com/", storage::kStorageTypeTemporary, 10},
-      {"http://example.com/", storage::kStorageTypePersistent, 100},
-      {"https://example.com/", storage::kStorageTypeSyncable, 1},
-      {"http://example2.com/", storage::kStorageTypeTemporary, 1000},
+      {"http://example.com/", StorageType::kTemporary, 1},
+      {"https://example.com/", StorageType::kTemporary, 10},
+      {"http://example.com/", StorageType::kPersistent, 100},
+      {"https://example.com/", StorageType::kSyncable, 1},
+      {"http://example2.com/", StorageType::kTemporary, 1000},
       {"chrome-extension://abcdefghijklmnopqrstuvwxyz/",
-       storage::kStorageTypeTemporary, 10000},
+       StorageType::kTemporary, 10000},
       {"chrome-extension://abcdefghijklmnopqrstuvwxyz/",
-       storage::kStorageTypePersistent, 100000},
+       StorageType::kPersistent, 100000},
+      {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/", StorageType::kTemporary,
+       10000},
       {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/",
-       storage::kStorageTypeTemporary, 10000},
-      {"chrome-devtools://abcdefghijklmnopqrstuvwxyz/",
-       storage::kStorageTypePersistent, 100000},
+       StorageType::kPersistent, 100000},
   };
 
   RegisterClient(kOrigins, arraysize(kOrigins));
diff --git a/chrome/browser/browsing_data/site_data_counting_helper.cc b/chrome/browser/browsing_data/site_data_counting_helper.cc
index 003efb0..8e753646 100644
--- a/chrome/browser/browsing_data/site_data_counting_helper.cc
+++ b/chrome/browser/browsing_data/site_data_counting_helper.cc
@@ -59,9 +59,9 @@
     storage::GetOriginsCallback origins_callback =
         base::Bind(&SiteDataCountingHelper::GetQuotaOriginsCallback,
                    base::Unretained(this));
-    const storage::StorageType types[] = {storage::kStorageTypeTemporary,
-                                          storage::kStorageTypePersistent,
-                                          storage::kStorageTypeSyncable};
+    const blink::StorageType types[] = {blink::StorageType::kTemporary,
+                                        blink::StorageType::kPersistent,
+                                        blink::StorageType::kSyncable};
     for (auto type : types) {
       tasks_ += 1;
       BrowserThread::PostTask(
@@ -160,7 +160,7 @@
 
 void SiteDataCountingHelper::GetQuotaOriginsCallback(
     const std::set<GURL>& origin_set,
-    storage::StorageType type) {
+    blink::StorageType type) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   std::vector<GURL> origins(origin_set.begin(), origin_set.end());
   BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
diff --git a/chrome/browser/browsing_data/site_data_counting_helper.h b/chrome/browser/browsing_data/site_data_counting_helper.h
index 2d83dd3..89a8271 100644
--- a/chrome/browser/browsing_data/site_data_counting_helper.h
+++ b/chrome/browser/browsing_data/site_data_counting_helper.h
@@ -9,7 +9,7 @@
 #include "components/content_settings/core/common/content_settings_types.h"
 #include "net/cookies/canonical_cookie.h"
 #include "net/ssl/channel_id_store.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 class Profile;
 class BrowsingDataFlashLSOHelper;
@@ -55,7 +55,7 @@
           special_storage_policy,
       const std::vector<content::LocalStorageUsageInfo>& infos);
   void GetQuotaOriginsCallback(const std::set<GURL>& origin_set,
-                               storage::StorageType type);
+                               blink::StorageType type);
   void SitesWithFlashDataCallback(const std::vector<std::string>& sites);
   void GetChannelIDsOnIOThread(
       const scoped_refptr<net::URLRequestContextGetter>& rq_context);
diff --git a/chrome/browser/chrome_quota_permission_context.cc b/chrome/browser/chrome_quota_permission_context.cc
index 6e24790..66c9e29 100644
--- a/chrome/browser/chrome_quota_permission_context.cc
+++ b/chrome/browser/chrome_quota_permission_context.cc
@@ -22,7 +22,7 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/navigation_details.h"
 #include "content/public/browser/web_contents.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "url/gurl.h"
 
@@ -158,7 +158,7 @@
     const content::StorageQuotaParams& params,
     int render_process_id,
     const PermissionCallback& callback) {
-  if (params.storage_type != storage::kStorageTypePersistent) {
+  if (params.storage_type != blink::StorageType::kPersistent) {
     // For now we only support requesting quota with this interface
     // for Persistent storage type.
     callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
diff --git a/chrome/browser/chrome_quota_permission_context.h b/chrome/browser/chrome_quota_permission_context.h
index fc558776..6290df15 100644
--- a/chrome/browser/chrome_quota_permission_context.h
+++ b/chrome/browser/chrome_quota_permission_context.h
@@ -7,7 +7,6 @@
 
 #include "base/compiler_specific.h"
 #include "content/public/browser/quota_permission_context.h"
-#include "storage/common/quota/quota_types.h"
 
 class ChromeQuotaPermissionContext : public content::QuotaPermissionContext {
  public:
diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc
index ee8526bdd..08c1274f 100644
--- a/chrome/browser/download/download_browsertest.cc
+++ b/chrome/browser/download/download_browsertest.cc
@@ -2633,19 +2633,19 @@
        // should appear on the shelf and the error should be indicated.
        "download-anchor-attrib-name-not-resolved.html",
        "http://doesnotexist/shouldnotberesolved", DOWNLOAD_NAVIGATE,
-       content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, true, false},
+       content::DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED, false, false},
       {// Simulates clicking on <a href="http://..." download=""> where the URL
        // leads to a 404 response. This is different from the previous test case
        // in that the ResourceLoader issues a OnResponseStarted() callback since
        // the headers are successfully received.
        "download-anchor-attrib-404.html", "there_IS_no_spoon.zip",
        DOWNLOAD_NAVIGATE, content::DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT,
-       true, false},
+       false, false},
       {// Similar to the above, but the resulting response contains a status
        // code of 400.
        "download-anchor-attrib-400.html", "zip_file_not_found.zip",
        DOWNLOAD_NAVIGATE, content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED,
-       true, false},
+       false, false},
       {// Direct download of a URL where the hostname doesn't resolve.
        "http://doesnotexist/shouldnotdownloadsuccessfully",
        "http://doesnotexist/shouldnotdownloadsuccessfully", DOWNLOAD_DIRECT,
diff --git a/chrome/browser/engagement/important_sites_usage_counter_unittest.cc b/chrome/browser/engagement/important_sites_usage_counter_unittest.cc
index d4870c0..ac43cc2 100644
--- a/chrome/browser/engagement/important_sites_usage_counter_unittest.cc
+++ b/chrome/browser/engagement/important_sites_usage_counter_unittest.cc
@@ -99,10 +99,10 @@
   important_sites.push_back(i2);
 
   const std::vector<content::MockOriginData> origins = {
-      {"http://example.com/", storage::kStorageTypeTemporary, 1},
-      {"https://example.com/", storage::kStorageTypeTemporary, 2},
-      {"https://maps.example.com/", storage::kStorageTypeTemporary, 4},
-      {"http://google.com/", storage::kStorageTypePersistent, 8},
+      {"http://example.com/", blink::StorageType::kTemporary, 1},
+      {"https://example.com/", blink::StorageType::kTemporary, 2},
+      {"https://maps.example.com/", blink::StorageType::kTemporary, 4},
+      {"http://google.com/", blink::StorageType::kPersistent, 8},
   };
 
   QuotaManager* quota_manager = CreateQuotaManager();
diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc
index 7582880..7a16ea87 100644
--- a/chrome/browser/extensions/api/identity/identity_apitest.cc
+++ b/chrome/browser/extensions/api/identity/identity_apitest.cc
@@ -820,13 +820,6 @@
       return;
     base::ResetAndReturn(&on_access_token_requested_).Run();
   }
-  void OnFetchAccessTokenComplete(const std::string& account_id,
-                                  const std::string& consumer_id,
-                                  const OAuth2TokenService::ScopeSet& scopes,
-                                  GoogleServiceAuthError error,
-                                  base::Time expiration_time) override {}
-  void OnTokenRemoved(const std::string& account_id,
-                      const OAuth2TokenService::ScopeSet& scopes) override {}
 
   std::string extension_id_;
   std::set<std::string> oauth_scopes_;
diff --git a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
index 57e7010..5bf2cb9d 100644
--- a/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
+++ b/chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc
@@ -404,20 +404,9 @@
 }
 
 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, Download) {
-  base::ScopedAllowBlockingForTesting allow_blocking;
-  base::ScopedTempDir download_directory;
-  ASSERT_TRUE(download_directory.CreateUniqueTempDir());
-  DownloadPrefs* download_prefs =
-      DownloadPrefs::FromBrowserContext(browser()->profile());
-  download_prefs->SetDownloadPath(download_directory.GetPath());
-
-  DownloadTestObserverNotInProgress download_observer(
-      content::BrowserContext::GetDownloadManager(profile()), 1);
-  download_observer.StartObserving();
   ASSERT_TRUE(StartEmbeddedTestServer());
   ASSERT_TRUE(RunExtensionTest("webnavigation/download"))
       << message_;
-  download_observer.WaitForFinished();
 }
 
 IN_PROC_BROWSER_TEST_F(WebNavigationApiTest, ServerRedirectSingleProcess) {
diff --git a/chrome/browser/extensions/extension_special_storage_policy.cc b/chrome/browser/extensions/extension_special_storage_policy.cc
index 52e51c3..21fcb37d 100644
--- a/chrome/browser/extensions/extension_special_storage_policy.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy.cc
@@ -32,8 +32,8 @@
 #include "extensions/common/manifest_handlers/content_capabilities_handler.h"
 #include "extensions/common/permissions/permissions_data.h"
 #include "storage/browser/quota/quota_manager.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 using content::BrowserThread;
 using extensions::APIPermission;
@@ -72,7 +72,7 @@
         FROM_HERE, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
         base::BindOnce(&storage::QuotaManager::GetUsageAndQuotaForWebApps,
                        partition->GetQuotaManager(), launch_url,
-                       storage::kStorageTypePersistent,
+                       blink::StorageType::kPersistent,
                        base::Bind(&ReportQuotaUsage)));
   }
 }
diff --git a/chrome/browser/extensions/extension_storage_monitor.cc b/chrome/browser/extensions/extension_storage_monitor.cc
index 64ec7d9ee..081c710 100644
--- a/chrome/browser/extensions/extension_storage_monitor.cc
+++ b/chrome/browser/extensions/extension_storage_monitor.cc
@@ -36,6 +36,7 @@
 #include "extensions/common/permissions/permissions_data.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "storage/browser/quota/storage_observer.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/message_center/notification.h"
 #include "ui/message_center/notifier_id.h"
@@ -123,11 +124,11 @@
         should_uma_(should_uma) {
     // We always observe persistent storage usage.
     storage::StorageObserver::MonitorParams params(
-        storage::kStorageTypePersistent, origin, rate, false);
+        blink::StorageType::kPersistent, origin, rate, false);
     quota_manager_->AddStorageObserver(this, params);
     if (should_uma) {
       // And if this is for uma, we also observe temporary storage usage.
-      MonitorParams temporary_params(storage::kStorageTypeTemporary, origin,
+      MonitorParams temporary_params(blink::StorageType::kTemporary, origin,
                                      rate, false);
       quota_manager_->AddStorageObserver(this, temporary_params);
     }
@@ -246,7 +247,7 @@
 
 void SingleExtensionStorageObserver::OnStorageEvent(const Event& event) {
   if (should_uma_) {
-    if (event.filter.storage_type == storage::kStorageTypePersistent) {
+    if (event.filter.storage_type == blink::StorageType::kPersistent) {
       UMA_HISTOGRAM_MEMORY_KB(
           "Extensions.HostedAppUnlimitedStoragePersistentStorageUsage",
           event.usage);
diff --git a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
index ef934a8..6c39c86 100644
--- a/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_navigation_observer_browsertest.cc
@@ -81,6 +81,7 @@
 const char kPageBeforeLandingReferrerURL[] =
     "/safe_browsing/download_protection/navigation_observer/"
     "page_before_landing_referrer.html";
+const char kTestExeURL[] = "/temporary/test.exe";
 
 class DownloadItemCreatedObserver : public DownloadManager::Observer {
  public:
@@ -281,10 +282,7 @@
     }
   }
 
-  void TriggerDownloadViaHtml5FileApi(bool has_user_gesture) {
-    if (has_user_gesture)
-      SimulateUserGesture();
-
+  void TriggerDownloadViaHtml5FileApi() {
     std::vector<DownloadItem*> items;
     content::DownloadManager* manager =
         content::BrowserContext::GetDownloadManager(browser()->profile());
@@ -293,9 +291,7 @@
     ASSERT_TRUE(
         content::ExecuteScript(current_web_contents, "downloadViaFileApi()"));
     manager->GetAllDownloads(&items);
-    if (items.size() == 0U) {
-      DownloadItemCreatedObserver(manager).WaitForDownloadItem(&items);
-    }
+    ASSERT_EQ(0U, items.size());
   }
 
   void VerifyNavigationEvent(const GURL& expected_source_url,
@@ -2098,15 +2094,16 @@
   EXPECT_NE(yesterday, ip_map->at(test_server_host).front().timestamp);
 }
 
-// Download via html5 file API with user gesture.
+// Download via html5 file API.
 IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest,
-                       DownloadViaHTML5FileApiWithUserGesture) {
+                       DownloadViaHTML5FileApi) {
   ui_test_utils::NavigateToURL(
       browser(), embedded_test_server()->GetURL(kSingleFrameTestURL));
   GURL hosting_url = embedded_test_server()->GetURL(kSingleFrameTestURL);
-  // Trigger download by user gesture.
-  TriggerDownloadViaHtml5FileApi(true /* has_user_gesture */);
+  TriggerDownloadViaHtml5FileApi();
   std::string test_server_ip(embedded_test_server()->host_port_pair().host());
+  GURL filesystem_url(std::string(url::kFileSystemScheme) + ":" +
+                      embedded_test_server()->GetURL(kTestExeURL).spec());
   auto* nav_list = navigation_event_list();
   ASSERT_TRUE(nav_list);
   ASSERT_EQ(1U, nav_list->Size());
@@ -2121,44 +2118,19 @@
   VerifyHostToIpMap();
   ReferrerChain referrer_chain;
   IdentifyReferrerChainForDownload(GetDownload(), &referrer_chain);
-  ASSERT_EQ(1, referrer_chain.size());
+  ASSERT_EQ(2, referrer_chain.size());
 
-  VerifyReferrerChainEntry(hosting_url,                       // url
-                           GURL(),                            // main_frame_url
-                           ReferrerChainEntry::LANDING_PAGE,  // type
-                           test_server_ip,                    // ip_address
-                           GURL(),                            // referrer_url
-                           GURL(),               // referrer_main_frame_url
-                           false,                // is_retargeting
-                           std::vector<GURL>(),  // server redirects
-                           ReferrerChainEntry::BROWSER_INITIATED,
-                           referrer_chain.Get(0));
-}
-
-// Download via html5 file API without user gesture.
-IN_PROC_BROWSER_TEST_F(SBNavigationObserverBrowserTest,
-                       DownloadViaHTML5FileApiWithoutUserGesture) {
-  ui_test_utils::NavigateToURL(
-      browser(), embedded_test_server()->GetURL(kSingleFrameTestURL));
-  GURL hosting_url = embedded_test_server()->GetURL(kSingleFrameTestURL);
-  // Trigger download without user gesture.
-  TriggerDownloadViaHtml5FileApi(false /* has_user_gesture */);
-  std::string test_server_ip(embedded_test_server()->host_port_pair().host());
-  auto* nav_list = navigation_event_list();
-  ASSERT_TRUE(nav_list);
-  ASSERT_EQ(1U, nav_list->Size());
-  VerifyNavigationEvent(GURL(),       // source_url
-                        GURL(),       // source_main_frame_url
-                        hosting_url,  // original_request_url
-                        hosting_url,  // destination_url
-                        true,         // is_user_initiated,
-                        true,         // has_committed
-                        false,        // has_server_redirect
-                        nav_list->Get(0));
-  VerifyHostToIpMap();
-  ReferrerChain referrer_chain;
-  IdentifyReferrerChainForDownload(GetDownload(), &referrer_chain);
-  ASSERT_EQ(1, referrer_chain.size());
+  VerifyReferrerChainEntry(
+      filesystem_url,                 // url
+      GURL(),                         // main_frame_url
+      ReferrerChainEntry::EVENT_URL,  // type
+      std::string(),                  // ip_address
+      hosting_url,                    // referrer_url
+      GURL(),                         // referrer_main_frame_url
+      false,                          // is_retargeting
+      std::vector<GURL>(),            // server redirects
+      ReferrerChainEntry::RENDERER_INITIATED_WITHOUT_USER_GESTURE,
+      referrer_chain.Get(0));
 
   VerifyReferrerChainEntry(hosting_url,  // url
                            GURL(),       // main_frame_url
@@ -2169,7 +2141,7 @@
                            false,                // is_retargeting
                            std::vector<GURL>(),  // server redirects
                            ReferrerChainEntry::BROWSER_INITIATED,
-                           referrer_chain.Get(0));
+                           referrer_chain.Get(1));
 }
 
 // Verify referrer chain when there are URL fragments.
diff --git a/chrome/browser/storage/storage_info_fetcher.cc b/chrome/browser/storage/storage_info_fetcher.cc
index 28e841ae..5a7ea16 100644
--- a/chrome/browser/storage/storage_info_fetcher.cc
+++ b/chrome/browser/storage/storage_info_fetcher.cc
@@ -35,10 +35,9 @@
           base::Bind(&StorageInfoFetcher::OnGetUsageInfoInternal, this)));
 }
 
-void StorageInfoFetcher::ClearStorage(
-    const std::string& host,
-    storage::StorageType type,
-    const ClearCallback& clear_callback) {
+void StorageInfoFetcher::ClearStorage(const std::string& host,
+                                      blink::StorageType type,
+                                      const ClearCallback& clear_callback) {
   // Balanced in OnUsageCleared.
   AddRef();
 
diff --git a/chrome/browser/storage/storage_info_fetcher.h b/chrome/browser/storage/storage_info_fetcher.h
index 6b111f9e..3a738b1 100644
--- a/chrome/browser/storage/storage_info_fetcher.h
+++ b/chrome/browser/storage/storage_info_fetcher.h
@@ -7,6 +7,7 @@
 
 #include "base/memory/ref_counted.h"
 #include "storage/browser/quota/quota_callbacks.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace storage {
 class QuotaManager;
@@ -28,10 +29,9 @@
   void FetchStorageInfo(const FetchCallback& fetch_callback);
 
   // Asynchronously clears storage for the given host.
-  void ClearStorage(
-      const std::string& host,
-      storage::StorageType type,
-      const ClearCallback& clear_callback);
+  void ClearStorage(const std::string& host,
+                    blink::StorageType type,
+                    const ClearCallback& clear_callback);
 
  private:
   virtual ~StorageInfoFetcher();
@@ -60,7 +60,7 @@
   storage::UsageInfoEntries entries_;
 
   // The storage type to delete.
-  storage::StorageType type_to_delete_;
+  blink::StorageType type_to_delete_;
 
   // The callback to use when fetching is complete.
   FetchCallback fetch_callback_;
diff --git a/chrome/browser/sync_file_system/local/canned_syncable_file_system.h b/chrome/browser/sync_file_system/local/canned_syncable_file_system.h
index f531d197a..cd3eea5 100644
--- a/chrome/browser/sync_file_system/local/canned_syncable_file_system.h
+++ b/chrome/browser/sync_file_system/local/canned_syncable_file_system.h
@@ -24,8 +24,8 @@
 #include "storage/browser/quota/quota_callbacks.h"
 #include "storage/common/fileapi/file_system_types.h"
 #include "storage/common/fileapi/file_system_util.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace base {
 class SingleThreadTaskRunner;
@@ -110,7 +110,7 @@
   storage::QuotaManager* quota_manager() { return quota_manager_.get(); }
   GURL origin() const { return origin_; }
   storage::FileSystemType type() const { return type_; }
-  storage::StorageType storage_type() const {
+  blink::StorageType storage_type() const {
     return FileSystemTypeToQuotaStorageType(type_);
   }
 
diff --git a/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc b/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc
index 1839bd5..420e039 100644
--- a/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc
+++ b/chrome/browser/sync_file_system/local/syncable_file_system_unittest.cc
@@ -20,7 +20,6 @@
 #include "storage/browser/test/async_file_test_helper.h"
 #include "storage/browser/test/sandbox_file_system_test_helper.h"
 #include "storage/common/fileapi/file_system_types.h"
-#include "storage/common/quota/quota_types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/leveldatabase/leveldb_chrome.h"
 
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h b/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h
index b3a7eb7..515002f0 100644
--- a/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h
+++ b/chrome/browser/ui/webui/quota_internals/quota_internals_handler.h
@@ -14,7 +14,6 @@
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
 #include "content/public/browser/web_ui_message_handler.h"
-#include "storage/common/quota/quota_types.h"
 
 namespace base {
 class Value;
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc
index 923f99d..bf3dd34 100644
--- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc
+++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc
@@ -13,6 +13,7 @@
 #include "chrome/browser/ui/webui/quota_internals/quota_internals_types.h"
 #include "net/base/url_util.h"
 
+using blink::StorageType;
 using content::BrowserThread;
 
 namespace quota_internals {
@@ -40,22 +41,19 @@
       &QuotaInternalsProxy::DidGetCapacity, weak_factory_.GetWeakPtr()));
 
   quota_manager_->GetGlobalUsage(
-      storage::kStorageTypeTemporary,
+      StorageType::kTemporary,
       base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage,
-                 weak_factory_.GetWeakPtr(),
-                 storage::kStorageTypeTemporary));
+                 weak_factory_.GetWeakPtr(), StorageType::kTemporary));
 
   quota_manager_->GetGlobalUsage(
-      storage::kStorageTypePersistent,
+      StorageType::kPersistent,
       base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage,
-                 weak_factory_.GetWeakPtr(),
-                 storage::kStorageTypePersistent));
+                 weak_factory_.GetWeakPtr(), StorageType::kPersistent));
 
   quota_manager_->GetGlobalUsage(
-      storage::kStorageTypeSyncable,
+      StorageType::kSyncable,
       base::Bind(&QuotaInternalsProxy::DidGetGlobalUsage,
-                 weak_factory_.GetWeakPtr(),
-                 storage::kStorageTypeSyncable));
+                 weak_factory_.GetWeakPtr(), StorageType::kSyncable));
 
   quota_manager_->DumpQuotaTable(
       base::Bind(&QuotaInternalsProxy::DidDumpQuotaTable,
@@ -97,7 +95,7 @@
 void QuotaInternalsProxy::DidGetSettings(
     const storage::QuotaSettings& settings) {
   // TODO(michaeln): also report the other config fields
-  GlobalStorageInfo info(storage::kStorageTypeTemporary);
+  GlobalStorageInfo info(StorageType::kTemporary);
   info.set_quota(settings.pool_size);
   ReportGlobalInfo(info);
 }
@@ -108,7 +106,7 @@
   ReportAvailableSpace(available_space);
 }
 
-void QuotaInternalsProxy::DidGetGlobalUsage(storage::StorageType type,
+void QuotaInternalsProxy::DidGetGlobalUsage(StorageType type,
                                             int64_t usage,
                                             int64_t unlimited_usage) {
   GlobalStorageInfo info(type);
@@ -152,11 +150,10 @@
 }
 
 void QuotaInternalsProxy::DidGetHostUsage(const std::string& host,
-                                          storage::StorageType type,
+                                          StorageType type,
                                           int64_t usage) {
-  DCHECK(type == storage::kStorageTypeTemporary ||
-         type == storage::kStorageTypePersistent ||
-         type == storage::kStorageTypeSyncable);
+  DCHECK(type == StorageType::kTemporary || type == StorageType::kPersistent ||
+         type == StorageType::kSyncable);
 
   PerHostStorageInfo info(host, type);
   info.set_usage(usage);
@@ -173,7 +170,7 @@
                  hosts_pending_.begin()->second);
 }
 
-void QuotaInternalsProxy::RequestPerOriginInfo(storage::StorageType type) {
+void QuotaInternalsProxy::RequestPerOriginInfo(StorageType type) {
   DCHECK(quota_manager_.get());
 
   std::set<GURL> origins;
@@ -202,8 +199,7 @@
   ReportPerHostInfo(host_info);
 }
 
-void QuotaInternalsProxy::VisitHost(const std::string& host,
-                                    storage::StorageType type) {
+void QuotaInternalsProxy::VisitHost(const std::string& host, StorageType type) {
   if (hosts_visited_.insert(std::make_pair(host, type)).second) {
     hosts_pending_.insert(std::make_pair(host, type));
     if (hosts_pending_.size() == 1) {
@@ -213,7 +209,7 @@
 }
 
 void QuotaInternalsProxy::GetHostUsage(const std::string& host,
-                                       storage::StorageType type) {
+                                       StorageType type) {
   DCHECK(quota_manager_.get());
   quota_manager_->GetHostUsage(host,
                                type,
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h
index c8e750f..139f0c9 100644
--- a/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h
+++ b/chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h
@@ -18,7 +18,7 @@
 #include "base/sequenced_task_runner_helpers.h"
 #include "content/public/browser/browser_thread.h"
 #include "storage/browser/quota/quota_manager.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace quota_internals {
 
@@ -60,26 +60,26 @@
   // Called on IO Thread by QuotaManager as callback.
   void DidGetSettings(const storage::QuotaSettings& settings);
   void DidGetCapacity(int64_t total_space, int64_t available_space);
-  void DidGetGlobalUsage(storage::StorageType type,
+  void DidGetGlobalUsage(blink::StorageType type,
                          int64_t usage,
                          int64_t unlimited_usage);
   void DidDumpQuotaTable(const QuotaTableEntries& entries);
   void DidDumpOriginInfoTable(const OriginInfoTableEntries& entries);
   void DidGetHostUsage(const std::string& host,
-                       storage::StorageType type,
+                       blink::StorageType type,
                        int64_t usage);
 
   // Helper. Called on IO Thread.
-  void RequestPerOriginInfo(storage::StorageType type);
-  void VisitHost(const std::string& host, storage::StorageType type);
-  void GetHostUsage(const std::string& host, storage::StorageType type);
+  void RequestPerOriginInfo(blink::StorageType type);
+  void VisitHost(const std::string& host, blink::StorageType type);
+  void GetHostUsage(const std::string& host, blink::StorageType type);
 
   // Used on UI Thread.
   QuotaInternalsHandler* handler_;
 
   // Used on IO Thread.
   scoped_refptr<storage::QuotaManager> quota_manager_;
-  std::set<std::pair<std::string, storage::StorageType> > hosts_visited_,
+  std::set<std::pair<std::string, blink::StorageType>> hosts_visited_,
       hosts_pending_;
   std::vector<PerHostStorageInfo> report_pending_;
   base::WeakPtrFactory<QuotaInternalsProxy> weak_factory_;
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc b/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc
index d481c56c3..04f4a3a 100644
--- a/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc
+++ b/chrome/browser/ui/webui/quota_internals/quota_internals_types.cc
@@ -12,17 +12,17 @@
 
 namespace {
 
-std::string StorageTypeToString(storage::StorageType type) {
+std::string StorageTypeToString(blink::StorageType type) {
   switch (type) {
-    case storage::kStorageTypeTemporary:
+    case blink::StorageType::kTemporary:
       return "temporary";
-    case storage::kStorageTypePersistent:
+    case blink::StorageType::kPersistent:
       return "persistent";
-    case storage::kStorageTypeSyncable:
+    case blink::StorageType::kSyncable:
       return "syncable";
-    case storage::kStorageTypeQuotaNotManaged:
+    case blink::StorageType::kQuotaNotManaged:
       return "quota not managed";
-    case storage::kStorageTypeUnknown:
+    case blink::StorageType::kUnknown:
       return "unknown";
   }
   return "unknown";
@@ -32,9 +32,8 @@
 
 namespace quota_internals {
 
-GlobalStorageInfo::GlobalStorageInfo(storage::StorageType type)
-    : type_(type), usage_(-1), unlimited_usage_(-1), quota_(-1) {
-}
+GlobalStorageInfo::GlobalStorageInfo(blink::StorageType type)
+    : type_(type), usage_(-1), unlimited_usage_(-1), quota_(-1) {}
 
 GlobalStorageInfo::~GlobalStorageInfo() {}
 
@@ -53,9 +52,8 @@
 }
 
 PerHostStorageInfo::PerHostStorageInfo(const std::string& host,
-                                       storage::StorageType type)
-    : host_(host), type_(type), usage_(-1), quota_(-1) {
-}
+                                       blink::StorageType type)
+    : host_(host), type_(type), usage_(-1), quota_(-1) {}
 
 PerHostStorageInfo::~PerHostStorageInfo() {}
 
@@ -72,13 +70,12 @@
 }
 
 PerOriginStorageInfo::PerOriginStorageInfo(const GURL& origin,
-                                           storage::StorageType type)
+                                           blink::StorageType type)
     : origin_(origin),
       type_(type),
       host_(net::GetHostOrSpecFromURL(origin)),
       in_use_(-1),
-      used_count_(-1) {
-}
+      used_count_(-1) {}
 
 PerOriginStorageInfo::PerOriginStorageInfo(const PerOriginStorageInfo& other) =
     default;
diff --git a/chrome/browser/ui/webui/quota_internals/quota_internals_types.h b/chrome/browser/ui/webui/quota_internals/quota_internals_types.h
index 94a877e5..0b18c0b 100644
--- a/chrome/browser/ui/webui/quota_internals/quota_internals_types.h
+++ b/chrome/browser/ui/webui/quota_internals/quota_internals_types.h
@@ -12,7 +12,7 @@
 #include <string>
 
 #include "base/time/time.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace base {
@@ -24,7 +24,7 @@
 // Represends global usage and quota information for specific type of storage.
 class GlobalStorageInfo {
  public:
-  explicit GlobalStorageInfo(storage::StorageType type);
+  explicit GlobalStorageInfo(blink::StorageType type);
   ~GlobalStorageInfo();
 
   void set_usage(int64_t usage) { usage_ = usage; }
@@ -39,7 +39,7 @@
   std::unique_ptr<base::Value> NewValue() const;
 
  private:
-  storage::StorageType type_;
+  blink::StorageType type_;
 
   int64_t usage_;
   int64_t unlimited_usage_;
@@ -49,7 +49,7 @@
 // Represents per host usage and quota information for the storage.
 class PerHostStorageInfo {
  public:
-  PerHostStorageInfo(const std::string& host, storage::StorageType type);
+  PerHostStorageInfo(const std::string& host, blink::StorageType type);
   ~PerHostStorageInfo();
 
   void set_usage(int64_t usage) { usage_ = usage; }
@@ -61,7 +61,7 @@
 
  private:
   std::string host_;
-  storage::StorageType type_;
+  blink::StorageType type_;
 
   int64_t usage_;
   int64_t quota_;
@@ -70,7 +70,7 @@
 // Represendts per origin usage and access time information.
 class PerOriginStorageInfo {
  public:
-  PerOriginStorageInfo(const GURL& origin, storage::StorageType type);
+  PerOriginStorageInfo(const GURL& origin, blink::StorageType type);
   PerOriginStorageInfo(const PerOriginStorageInfo& other);
   ~PerOriginStorageInfo();
 
@@ -95,7 +95,7 @@
 
  private:
   GURL origin_;
-  storage::StorageType type_;
+  blink::StorageType type_;
   std::string host_;
 
   int in_use_;
diff --git a/chrome/browser/ui/webui/settings/site_settings_handler.cc b/chrome/browser/ui/webui/settings/site_settings_handler.cc
index db2bba1..4fb215a4 100644
--- a/chrome/browser/ui/webui/settings/site_settings_handler.cc
+++ b/chrome/browser/ui/webui/settings/site_settings_handler.cc
@@ -45,6 +45,7 @@
 #include "extensions/common/permissions/api_permission.h"
 #include "extensions/common/permissions/permissions_data.h"
 #include "storage/browser/quota/quota_manager.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/text/bytes_formatting.h"
 
@@ -241,7 +242,7 @@
       CallJavascriptFunction("settings.WebsiteUsagePrivateApi.returnUsageTotal",
                              base::Value(entry.host),
                              base::Value(ui::FormatBytes(entry.usage)),
-                             base::Value(entry.type));
+                             base::Value(static_cast<int>(entry.type)));
       return;
     }
   }
@@ -358,9 +359,9 @@
         = new StorageInfoFetcher(profile_);
     storage_info_fetcher->ClearStorage(
         url.host(),
-        static_cast<storage::StorageType>(static_cast<int>(storage_type)),
+        static_cast<blink::StorageType>(static_cast<int>(storage_type)),
         base::Bind(&SiteSettingsHandler::OnUsageInfoCleared,
-            base::Unretained(this)));
+                   base::Unretained(this)));
 
     // Also clear the *local* storage data.
     scoped_refptr<BrowsingDataLocalStorageHelper> local_storage_helper =
diff --git a/chrome/browser/ui/webui/signin/login_ui_test_utils.cc b/chrome/browser/ui/webui/signin/login_ui_test_utils.cc
index dc36720..6a0d125 100644
--- a/chrome/browser/ui/webui/signin/login_ui_test_utils.cc
+++ b/chrome/browser/ui/webui/signin/login_ui_test_utils.cc
@@ -158,32 +158,19 @@
   ASSERT_EQ("ready", message);
 }
 
-void WaitUntilElementExistsInSigninFrame(Browser* browser,
-                                         const std::string& element_id) {
-  std::string message;
-  std::string js =
-      "function WaitForElementById(elementId) {"
-      "  var retries = 10; /* 10 seconds. */"
-      "  function CheckelementExists() {"
-      "    if (document.getElementById(elementId) != null) {"
-      "      window.domAutomationController.send('found');"
-      "    } else if (retries > 0) { "
-      "      retries--;"
-      "      window.setTimeout(CheckelementExists, 1000);"
-      "    } else {"
-      "      window.domAutomationController.send('failed');"
-      "    }"
-      "  }"
-      "  CheckelementExists();"
-      "}"
-      "WaitForElementById('" + element_id + "');";
-  content::WebContents* web_contents =
-      browser->tab_strip_model()->GetActiveWebContents();
-  ASSERT_TRUE(content::ExecuteScriptAndExtractString(
-      signin::GetAuthFrame(web_contents, "signin-frame"), js, &message));
+void WaitUntilElementExistsInSigninFrame(
+    Browser* browser,
+    const std::vector<std::string>& element_ids) {
+  for (int attempt = 0; attempt < 10; ++attempt) {
+    for (const std::string& element_id : element_ids) {
+      if (ElementExistsInSigninFrame(browser, element_id)) {
+        return;
+      }
+    }
+    RunLoopFor(base::TimeDelta::FromMilliseconds(1000));
+  }
 
-  ASSERT_EQ("found", message) <<
-      "Failed to find element with id " << element_id;
+  FAIL();
 }
 
 bool ElementExistsInSigninFrame(Browser* browser,
@@ -203,18 +190,18 @@
 void SigninInNewGaiaFlow(Browser* browser,
                          const std::string& email,
                          const std::string& password) {
-  std::string js = "document.getElementById('Email').value = '" + email + "';"
-                   "document.getElementById('next').click();";
-
   content::WebContents* web_contents =
       browser->tab_strip_model()->GetActiveWebContents();
+
+  WaitUntilElementExistsInSigninFrame(browser, {"identifierId"});
+  std::string js = "document.getElementById('identifierId').value = '" + email +
+                   "'; document.getElementById('identifierNext').click();";
   ASSERT_TRUE(content::ExecuteScript(
       signin::GetAuthFrame(web_contents, "signin-frame"), js));
 
-  WaitUntilElementExistsInSigninFrame(browser, "Passwd");
-  js = "document.getElementById('Passwd').value = '" + password + "';"
-       "document.getElementById('signIn').click();";
-
+  WaitUntilElementExistsInSigninFrame(browser, {"password"});
+  js = "document.getElementById('password').value = '" + password + "';" +
+       "document.getElementById('passwordNext').click();";
   ASSERT_TRUE(content::ExecuteScript(
       signin::GetAuthFrame(web_contents, "signin-frame"), js));
 }
@@ -222,13 +209,18 @@
 void SigninInOldGaiaFlow(Browser* browser,
                          const std::string& email,
                          const std::string& password) {
-  std::string js =
-      "document.getElementById('Email').value = '" + email + "';"
-      "document.getElementById('Passwd').value = '" + password + "';"
-      "document.getElementById('signIn').click();";
-
   content::WebContents* web_contents =
       browser->tab_strip_model()->GetActiveWebContents();
+
+  WaitUntilElementExistsInSigninFrame(browser, {"Email"});
+  std::string js = "document.getElementById('Email').value = '" + email + ";" +
+                   "document.getElementById('next').click();";
+  ASSERT_TRUE(content::ExecuteScript(
+      signin::GetAuthFrame(web_contents, "signin-frame"), js));
+
+  WaitUntilElementExistsInSigninFrame(browser, {"Passwd"});
+  js = "document.getElementById('Passwd').value = '" + password + "';" +
+       "document.getElementById('signIn').click();";
   ASSERT_TRUE(content::ExecuteScript(
       signin::GetAuthFrame(web_contents, "signin-frame"), js));
 }
@@ -236,8 +228,8 @@
 void ExecuteJsToSigninInSigninFrame(Browser* browser,
                                     const std::string& email,
                                     const std::string& password) {
-  WaitUntilElementExistsInSigninFrame(browser, "Email");
-  if (ElementExistsInSigninFrame(browser, "next"))
+  WaitUntilElementExistsInSigninFrame(browser, {"identifierNext", "next"});
+  if (ElementExistsInSigninFrame(browser, "identifierNext"))
     SigninInNewGaiaFlow(browser, email, password);
   else
     SigninInOldGaiaFlow(browser, email, password);
diff --git a/chrome/browser/ui/webui/signin/login_ui_test_utils.h b/chrome/browser/ui/webui/signin/login_ui_test_utils.h
index 71c21725..8f9c5bb8 100644
--- a/chrome/browser/ui/webui/signin/login_ui_test_utils.h
+++ b/chrome/browser/ui/webui/signin/login_ui_test_utils.h
@@ -6,6 +6,7 @@
 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_LOGIN_UI_TEST_UTILS_H_
 
 #include <string>
+#include <vector>
 
 #include "base/time/time.h"
 #include "components/signin/core/browser/signin_metrics.h"
@@ -17,9 +18,11 @@
 // Blocks until the login UI is available and ready for authorization.
 void WaitUntilUIReady(Browser* browser);
 
-// Blocks until an element with id |element_id| exists in the signin page.
-void WaitUntilElementExistsInSigninFrame(Browser* browser,
-                                         const std::string& element_id);
+// Blocks until an element with an id from |element_ids| exists in the signin
+// page.
+void WaitUntilElementExistsInSigninFrame(
+    Browser* browser,
+    const std::vector<std::string>& element_ids);
 
 // Returns whether an element with id |element_id| exists in the signin page.
 bool ElementExistsInSigninFrame(Browser* browser,
diff --git a/chrome/browser/vr/databinding/binding.h b/chrome/browser/vr/databinding/binding.h
index ecaa9ee..1904a979 100644
--- a/chrome/browser/vr/databinding/binding.h
+++ b/chrome/browser/vr/databinding/binding.h
@@ -8,6 +8,7 @@
 #include "base/bind.h"
 #include "base/macros.h"
 #include "base/optional.h"
+#include "base/strings/stringprintf.h"
 #include "chrome/browser/vr/databinding/binding_base.h"
 
 namespace vr {
@@ -23,9 +24,18 @@
 template <typename T>
 class Binding : public BindingBase {
  public:
-  Binding(const base::Callback<T()>& getter,
-          const base::Callback<void(const T&)>& setter)
+  Binding(const base::RepeatingCallback<T()>& getter,
+          const base::RepeatingCallback<void(const T&)>& setter)
       : getter_(getter), setter_(setter) {}
+
+  Binding(const base::RepeatingCallback<T()>& getter,
+          const std::string& getter_text,
+          const base::RepeatingCallback<void(const T&)>& setter,
+          const std::string& setter_text)
+      : getter_(getter),
+        setter_(setter),
+        getter_text_(getter_text),
+        setter_text_(setter_text) {}
   ~Binding() override = default;
 
   // This function will check if the getter is producing a different value than
@@ -40,11 +50,22 @@
     return true;
   }
 
+  std::string ToString() override {
+    if (getter_text_.empty() && setter_text_.empty())
+      return "";
+
+    return base::StringPrintf("%s => %s", getter_text_.c_str(),
+                              setter_text_.c_str());
+  }
+
  private:
-  base::Callback<T()> getter_;
-  base::Callback<void(const T&)> setter_;
+  base::RepeatingCallback<T()> getter_;
+  base::RepeatingCallback<void(const T&)> setter_;
   base::Optional<T> last_value_;
 
+  std::string getter_text_;
+  std::string setter_text_;
+
   DISALLOW_COPY_AND_ASSIGN(Binding);
 };
 
@@ -82,11 +103,23 @@
 // auto binding =
 //     VR_BIND_FUNC(int, MyModel, &m, source, MyView, &v, SetAwesomeness);
 //
-#define VR_BIND(T, M, m, Get, V, v, Set)                                    \
-  base::MakeUnique<Binding<T>>(                                             \
-      base::Bind([](M* model) { return model->Get; }, base::Unretained(m)), \
-      base::Bind([](V* view, const T& value) { view->Set; },                \
-                 base::Unretained(v)))
+#ifndef NDEBUG
+#define VR_BIND(T, M, m, Get, V, v, Set)                              \
+  base::MakeUnique<Binding<T>>(                                       \
+      base::BindRepeating([](M* model) { return model->Get; },        \
+                          base::Unretained(m)),                       \
+      #Get,                                                           \
+      base::BindRepeating([](V* view, const T& value) { view->Set; }, \
+                          base::Unretained(v)),                       \
+      #Set)
+#else
+#define VR_BIND(T, M, m, Get, V, v, Set)                              \
+  base::MakeUnique<Binding<T>>(                                       \
+      base::BindRepeating([](M* model) { return model->Get; },        \
+                          base::Unretained(m)),                       \
+      base::BindRepeating([](V* view, const T& value) { view->Set; }, \
+                          base::Unretained(v)))
+#endif
 
 #define VR_BIND_FUNC(T, M, m, Get, V, v, f) \
   VR_BIND(T, M, m, Get, V, v, f(value))
@@ -94,6 +127,8 @@
 #define VR_BIND_FIELD(T, M, m, Get, V, v, f) \
   VR_BIND(T, M, m, Get, V, v, f = value)
 
+#define VR_BIND_LAMBDA(...) base::BindRepeating(__VA_ARGS__), #__VA_ARGS__
+
 }  // namespace vr
 
 #endif  // CHROME_BROWSER_VR_DATABINDING_BINDING_H_
diff --git a/chrome/browser/vr/databinding/binding_base.h b/chrome/browser/vr/databinding/binding_base.h
index 5887fbc..3d0448b 100644
--- a/chrome/browser/vr/databinding/binding_base.h
+++ b/chrome/browser/vr/databinding/binding_base.h
@@ -5,6 +5,8 @@
 #ifndef CHROME_BROWSER_VR_DATABINDING_BINDING_BASE_H_
 #define CHROME_BROWSER_VR_DATABINDING_BINDING_BASE_H_
 
+#include <string>
+
 namespace vr {
 
 // Bindings are used to tie models to views. You may, for example, want to bind
@@ -20,6 +22,8 @@
   // Returns true if the binding was updated.
   virtual bool Update() = 0;
 
+  virtual std::string ToString() = 0;
+
  private:
   DISALLOW_COPY_AND_ASSIGN(BindingBase);
 };
diff --git a/chrome/browser/vr/databinding/vector_binding.h b/chrome/browser/vr/databinding/vector_binding.h
index 8ec11c51..b51aed2 100644
--- a/chrome/browser/vr/databinding/vector_binding.h
+++ b/chrome/browser/vr/databinding/vector_binding.h
@@ -5,6 +5,7 @@
 #ifndef CHROME_BROWSER_VR_DATABINDING_VECTOR_BINDING_H_
 #define CHROME_BROWSER_VR_DATABINDING_VECTOR_BINDING_H_
 
+#include <sstream>
 #include <vector>
 
 #include "base/bind.h"
@@ -61,6 +62,15 @@
     return updated;
   }
 
+  std::string ToString() override {
+    std::ostringstream os;
+    for (size_t i = 0; i < bindings_.size(); ++i) {
+      auto& binding = bindings_[i];
+      os << i << ": " << binding->ToString() << std::endl;
+    }
+    return os.str();
+  }
+
  private:
   std::vector<M>* models_ = nullptr;
   std::vector<std::unique_ptr<ElementBinding>> bindings_;
diff --git a/chrome/browser/vr/databinding/vector_element_binding.h b/chrome/browser/vr/databinding/vector_element_binding.h
index ab2ddada7..b4c07d61 100644
--- a/chrome/browser/vr/databinding/vector_element_binding.h
+++ b/chrome/browser/vr/databinding/vector_element_binding.h
@@ -5,6 +5,7 @@
 #ifndef CHROME_BROWSER_VR_DATABINDING_VECTOR_ELEMENT_BINDING_H_
 #define CHROME_BROWSER_VR_DATABINDING_VECTOR_ELEMENT_BINDING_H_
 
+#include <sstream>
 #include <vector>
 
 #include "base/bind.h"
@@ -41,6 +42,14 @@
 
   std::vector<std::unique_ptr<BindingBase>>& bindings() { return bindings_; }
 
+  std::string ToString() override {
+    std::ostringstream os;
+    for (auto& binding : bindings_) {
+      os << std::endl << "  " << binding->ToString();
+    }
+    return os.str();
+  }
+
  private:
   std::vector<M>* models_ = nullptr;
   size_t index_ = 0;
diff --git a/chrome/browser/vr/elements/ui_element.cc b/chrome/browser/vr/elements/ui_element.cc
index 22006f1..4b1f0978 100644
--- a/chrome/browser/vr/elements/ui_element.cc
+++ b/chrome/browser/vr/elements/ui_element.cc
@@ -9,6 +9,7 @@
 #include "base/logging.h"
 #include "base/numerics/ranges.h"
 #include "base/stl_util.h"
+#include "base/strings/string_split.h"
 #include "base/strings/stringprintf.h"
 #include "base/time/time.h"
 #include "chrome/browser/vr/model/camera_model.h"
@@ -390,8 +391,26 @@
       type() == kTypeNone ? "" : UiElementTypeToString(type()).c_str());
 }
 
+void DumpLines(const std::vector<size_t>& counts,
+               const std::vector<const UiElement*>& ancestors,
+               std::ostringstream* os) {
+  for (size_t i = 0; i < counts.size(); ++i) {
+    size_t current_count = counts[i];
+    if (i + 1 < counts.size()) {
+      current_count++;
+    }
+    if (ancestors[ancestors.size() - i - 1]->children().size() >
+        current_count) {
+      *os << "| ";
+    } else {
+      *os << "  ";
+    }
+  }
+}
+
 void UiElement::DumpHierarchy(std::vector<size_t> counts,
-                              std::ostringstream* os) const {
+                              std::ostringstream* os,
+                              bool include_bindings) const {
   // Put our ancestors in a vector for easy reverse traversal.
   std::vector<const UiElement*> ancestors;
   for (const UiElement* ancestor = parent(); ancestor;
@@ -427,11 +446,35 @@
 
   *os << kGreen;
   DumpGeometry(os);
-  *os << kReset << std::endl;
 
   counts.push_back(0u);
+
+  if (include_bindings) {
+    std::ostringstream binding_stream;
+    for (auto& binding : bindings_) {
+      std::string binding_text = binding->ToString();
+      if (binding_text.empty())
+        continue;
+      binding_stream << binding->ToString() << std::endl;
+    }
+
+    auto split_bindings =
+        base::SplitString(binding_stream.str(), "\n", base::TRIM_WHITESPACE,
+                          base::SPLIT_WANT_NONEMPTY);
+    if (!split_bindings.empty()) {
+      ancestors.insert(ancestors.begin(), this);
+    }
+    for (const auto& split : split_bindings) {
+      *os << std::endl << kBlue;
+      DumpLines(counts, ancestors, os);
+      *os << kGreen << split;
+    }
+  }
+
+  *os << kReset << std::endl;
+
   for (auto& child : children_) {
-    child->DumpHierarchy(counts, os);
+    child->DumpHierarchy(counts, os, include_bindings);
     counts.back()++;
   }
 }
diff --git a/chrome/browser/vr/elements/ui_element.h b/chrome/browser/vr/elements/ui_element.h
index 16176f7..a0c104a0 100644
--- a/chrome/browser/vr/elements/ui_element.h
+++ b/chrome/browser/vr/elements/ui_element.h
@@ -423,7 +423,11 @@
   // situated in its parent's list of children. This is used to determine
   // whether each ancestor is the last child (which affects the lines we draw in
   // the tree).
-  void DumpHierarchy(std::vector<size_t> counts, std::ostringstream* os) const;
+  // TODO(vollick): generalize the configuration of the dump to selectively turn
+  // off or on a variety of features.
+  void DumpHierarchy(std::vector<size_t> counts,
+                     std::ostringstream* os,
+                     bool include_bindings) const;
   virtual void DumpGeometry(std::ostringstream* os) const;
 
  protected:
diff --git a/chrome/browser/vr/testapp/vr_test_context.cc b/chrome/browser/vr/testapp/vr_test_context.cc
index f2fea0b..f4a7006 100644
--- a/chrome/browser/vr/testapp/vr_test_context.cc
+++ b/chrome/browser/vr/testapp/vr_test_context.cc
@@ -153,8 +153,10 @@
         ui_->SetIncognito(incognito_);
         break;
       case ui::DomCode::US_D:
-        ui_->Dump();
+        ui_->Dump(false);
         break;
+      case ui::DomCode::US_B:
+        ui_->Dump(true);
       case ui::DomCode::US_V:
         CreateFakeVoiceSearchResult();
         break;
diff --git a/chrome/browser/vr/ui.cc b/chrome/browser/vr/ui.cc
index 3fff3b0a..2ba06da 100644
--- a/chrome/browser/vr/ui.cc
+++ b/chrome/browser/vr/ui.cc
@@ -304,11 +304,12 @@
   return model_->skips_redraw_when_not_dirty;
 }
 
-void Ui::Dump() {
+void Ui::Dump(bool include_bindings) {
   std::ostringstream os;
   os << std::setprecision(3);
   os << std::endl;
-  scene_->root_element().DumpHierarchy(std::vector<size_t>(), &os);
+  scene_->root_element().DumpHierarchy(std::vector<size_t>(), &os,
+                                       include_bindings);
   LOG(ERROR) << os.str();
 }
 
diff --git a/chrome/browser/vr/ui.h b/chrome/browser/vr/ui.h
index 4cd4015..3bbd4a4 100644
--- a/chrome/browser/vr/ui.h
+++ b/chrome/browser/vr/ui.h
@@ -114,7 +114,7 @@
 
   void ReinitializeForTest(const UiInitialState& ui_initial_state);
 
-  void Dump();
+  void Dump(bool include_bindings);
 
   void SetBackgroundImage(std::unique_ptr<SkBitmap> bitmap);
 
diff --git a/chrome/browser/vr/ui_scene_creator.cc b/chrome/browser/vr/ui_scene_creator.cc
index 3e96757..398125d 100644
--- a/chrome/browser/vr/ui_scene_creator.cc
+++ b/chrome/browser/vr/ui_scene_creator.cc
@@ -60,23 +60,51 @@
 namespace {
 
 template <typename V, typename C, typename S>
-void BindColor(Model* model, V* view, C color, S setter) {
+void BindColor(Model* model,
+               V* view,
+               C color,
+               const std::string& color_string,
+               S setter,
+               const std::string& setter_string) {
   view->AddBinding(base::MakeUnique<Binding<SkColor>>(
-      base::Bind([](Model* m, C c) { return (m->color_scheme()).*c; },
-                 base::Unretained(model), color),
-      base::Bind([](V* v, S s, const SkColor& value) { (v->*s)(value); },
-                 base::Unretained(view), setter)));
+      base::BindRepeating([](Model* m, C c) { return (m->color_scheme()).*c; },
+                          base::Unretained(model), color),
+      color_string,
+      base::BindRepeating(
+          [](V* v, S s, const SkColor& value) { (v->*s)(value); },
+          base::Unretained(view), setter),
+      setter_string));
 }
 
+#ifndef NDEBUG
+#define VR_BIND_COLOR(m, v, c, s) BindColor(m, v, c, #c, s, #s)
+#else
+#define VR_BIND_COLOR(m, v, c, s) BindColor(m, v, c, "", s, "")
+#endif
+
 template <typename V, typename C, typename S>
-void BindButtonColors(Model* model, V* view, C colors, S setter) {
+void BindButtonColors(Model* model,
+                      V* view,
+                      C colors,
+                      const std::string& colors_string,
+                      S setter,
+                      const std::string& setter_string) {
   view->AddBinding(base::MakeUnique<Binding<ButtonColors>>(
-      base::Bind([](Model* m, C c) { return (m->color_scheme()).*c; },
-                 base::Unretained(model), colors),
-      base::Bind([](V* v, S s, const ButtonColors& value) { (v->*s)(value); },
-                 base::Unretained(view), setter)));
+      base::BindRepeating([](Model* m, C c) { return (m->color_scheme()).*c; },
+                          base::Unretained(model), colors),
+      colors_string,
+      base::BindRepeating(
+          [](V* v, S s, const ButtonColors& value) { (v->*s)(value); },
+          base::Unretained(view), setter),
+      setter_string));
 }
 
+#ifndef NDEBUG
+#define VR_BIND_BUTTON_COLORS(m, v, c, s) BindButtonColors(m, v, c, #c, s, #s)
+#else
+#define VR_BIND_BUTTON_COLORS(m, v, c, s) BindButtonColors(m, v, c, "", s, "")
+#endif
+
 template <typename T, typename... Args>
 std::unique_ptr<T> Create(UiElementName name, DrawPhase phase, Args&&... args) {
   auto element = base::MakeUnique<T>(std::forward<Args>(args)...);
@@ -98,8 +126,8 @@
   icon->SetType(kTypeOmniboxSuggestionIcon);
   icon->set_hit_testable(false);
   icon->SetSize(kSuggestionIconSizeDMM, kSuggestionIconSizeDMM);
-  BindColor(model, icon.get(), &ColorScheme::omnibox_icon,
-            &VectorIcon::SetColor);
+  VR_BIND_COLOR(model, icon.get(), &ColorScheme::omnibox_icon,
+                &VectorIcon::SetColor);
   VectorIcon* p_icon = icon.get();
 
   auto icon_box = base::MakeUnique<UiElement>();
@@ -115,8 +143,8 @@
   content_text->SetTextLayoutMode(TextLayoutMode::kSingleLineFixedWidth);
   content_text->SetSize(kSuggestionTextFieldWidthDMM, 0);
   content_text->SetTextAlignment(UiTexture::kTextAlignmentLeft);
-  BindColor(model, content_text.get(), &ColorScheme::omnibox_suggestion_content,
-            &Text::SetColor);
+  VR_BIND_COLOR(model, content_text.get(),
+                &ColorScheme::omnibox_suggestion_content, &Text::SetColor);
   Text* p_content_text = content_text.get();
 
   auto description_text =
@@ -127,8 +155,8 @@
   description_text->SetTextLayoutMode(TextLayoutMode::kSingleLineFixedWidth);
   description_text->SetSize(kSuggestionTextFieldWidthDMM, 0);
   description_text->SetTextAlignment(UiTexture::kTextAlignmentLeft);
-  BindColor(model, description_text.get(),
-            &ColorScheme::omnibox_suggestion_description, &Text::SetColor);
+  VR_BIND_COLOR(model, description_text.get(),
+                &ColorScheme::omnibox_suggestion_description, &Text::SetColor);
   Text* p_description_text = description_text.get();
 
   auto text_layout = base::MakeUnique<LinearLayout>(LinearLayout::kDown);
@@ -164,9 +192,9 @@
   background->set_bubble_events(true);
   background->set_bounds_contain_children(true);
   background->set_hover_offset(0.0);
-  BindButtonColors(model, background.get(),
-                   &ColorScheme::suggestion_button_colors,
-                   &Button::SetButtonColors);
+  VR_BIND_BUTTON_COLORS(model, background.get(),
+                        &ColorScheme::suggestion_button_colors,
+                        &Button::SetButtonColors);
   background->AddChild(std::move(suggestion_layout));
 
   element_binding->bindings().push_back(
@@ -174,10 +202,10 @@
                    model()->content, Text, p_content_text, SetText));
   element_binding->bindings().push_back(
       base::MakeUnique<Binding<base::string16>>(
-          base::BindRepeating(
+          VR_BIND_LAMBDA(
               [](SuggestionBinding* m) { return m->model()->description; },
               base::Unretained(element_binding)),
-          base::BindRepeating(
+          VR_BIND_LAMBDA(
               [](Text* v, const base::string16& text) {
                 v->SetVisibleImmediately(!text.empty());
                 v->set_requires_layout(!text.empty());
@@ -220,17 +248,16 @@
   spacer->SetType(kTypeOmniboxSuggestionSpacer);
   spacer->SetSize(kOmniboxWidthDMM, kSuggestionVerticalPaddingDMM);
   spacer->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
-          [](Model* m) { return !m->omnibox_suggestions.empty(); },
-          base::Unretained(model)),
-      base::BindRepeating(
+      VR_BIND_LAMBDA([](Model* m) { return !m->omnibox_suggestions.empty(); },
+                     base::Unretained(model)),
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& v) {
             e->SetVisible(v);
             e->set_requires_layout(v);
           },
           base::Unretained(spacer.get()))));
-  BindColor(model, spacer.get(), &ColorScheme::omnibox_background,
-            &Rect::SetColor);
+  VR_BIND_COLOR(model, spacer.get(), &ColorScheme::omnibox_background,
+                &Rect::SetColor);
   return spacer;
 }
 
@@ -278,15 +305,15 @@
   auto element = Create<UiElement>(k2dBrowsingRoot, kPhaseNone);
   element->set_hit_testable(false);
   element->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* m) {
             bool ready = !m->background_available ||
                          (m->background_available && m->background_loaded);
             return m->browsing_enabled() && ready;
           },
           base::Unretained(model_)),
-      base::BindRepeating([](UiElement* e, const bool& v) { e->SetVisible(v); },
-                          base::Unretained(element.get()))));
+      VR_BIND_LAMBDA([](UiElement* e, const bool& v) { e->SetVisible(v); },
+                     base::Unretained(element.get()))));
 
   scene_->AddUiElement(kRoot, std::move(element));
 
@@ -308,9 +335,9 @@
                    default_browsing_enabled() || model->fullscreen_enabled(),
                    UiElement, element.get(), SetVisible));
   element->AddBinding(base::MakeUnique<Binding<ModalPromptType>>(
-      base::Bind([](Model* m) { return m->active_modal_prompt_type; },
-                 base::Unretained(model_)),
-      base::Bind(
+      VR_BIND_LAMBDA([](Model* m) { return m->active_modal_prompt_type; },
+                     base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](UiElement* e, const ModalPromptType& t) {
             if (t == kModalPromptTypeExitVRForSiteInfo) {
               e->SetVisibleImmediately(false);
@@ -370,8 +397,8 @@
   exit_warning_text->SetSize(kExitWarningTextWidthDMM, 0);
   exit_warning_text->SetVisible(true);
   exit_warning_text->set_hit_testable(false);
-  BindColor(model_, exit_warning_text.get(),
-            &ColorScheme::exit_warning_foreground, &Text::SetColor);
+  VR_BIND_COLOR(model_, exit_warning_text.get(),
+                &ColorScheme::exit_warning_foreground, &Text::SetColor);
 
   auto exit_warning_bg = base::MakeUnique<Rect>();
   exit_warning_bg->SetName(kExitWarningBackground);
@@ -385,8 +412,8 @@
   exit_warning_bg->AddBinding(VR_BIND_FUNC(bool, Model, model_, exiting_vr,
                                            UiElement, exit_warning_bg.get(),
                                            SetVisible));
-  BindColor(model_, exit_warning_bg.get(),
-            &ColorScheme::exit_warning_background, &Rect::SetColor);
+  VR_BIND_COLOR(model_, exit_warning_bg.get(),
+                &ColorScheme::exit_warning_background, &Rect::SetColor);
   scaler->AddChild(std::move(exit_warning_bg));
   scene_->AddUiElement(k2dBrowsingViewportAwareRoot, std::move(scaler));
 }
@@ -440,17 +467,19 @@
                        TextLayoutMode::kSingleLineFixedHeight);
     }
 
-    BindColor(model_, element.get(), &ColorScheme::system_indicator_background,
-              &Toast::SetBackgroundColor);
-    BindColor(model_, element.get(), &ColorScheme::system_indicator_foreground,
-              &Toast::SetForegroundColor);
+    VR_BIND_COLOR(model_, element.get(),
+                  &ColorScheme::system_indicator_background,
+                  &Toast::SetBackgroundColor);
+    VR_BIND_COLOR(model_, element.get(),
+                  &ColorScheme::system_indicator_foreground,
+                  &Toast::SetForegroundColor);
     element->AddBinding(base::MakeUnique<Binding<bool>>(
-        base::Bind(
+        VR_BIND_LAMBDA(
             [](Model* m, bool PermissionsModel::*permission) {
               return m->permissions.*permission;
             },
             base::Unretained(model_), indicator.signal),
-        base::Bind(
+        VR_BIND_LAMBDA(
             [](UiElement* e, const bool& v) {
               e->SetVisible(v);
               e->set_requires_layout(v);
@@ -473,8 +502,8 @@
 
   auto main_content = base::MakeUnique<ContentElement>(
       content_input_delegate_,
-      base::Bind(&UiBrowserInterface::OnContentScreenBoundsChanged,
-                 base::Unretained(browser_)));
+      base::BindRepeating(&UiBrowserInterface::OnContentScreenBoundsChanged,
+                          base::Unretained(browser_)));
   main_content->SetName(kContentQuad);
   main_content->SetDrawPhase(kPhaseForeground);
   main_content->SetSize(kContentWidth, kContentHeight);
@@ -528,7 +557,7 @@
   auto transient_parent = base::MakeUnique<ShowUntilSignalTransientElement>(
       base::TimeDelta::FromSeconds(kSplashScreenMinDurationSeconds),
       base::TimeDelta::Max(),
-      base::Bind(
+      base::BindRepeating(
           [](Model* model, UiBrowserInterface* browser,
              TransientElementHideReason reason) {
             if (reason == TransientElementHideReason::kTimeout) {
@@ -553,8 +582,8 @@
   auto text_scaler =
       base::MakeUnique<ScaledDepthAdjuster>(kSplashScreenTextDistance);
   auto text = base::MakeUnique<Text>(kSplashScreenTextFontHeightDMM);
-  BindColor(model_, text.get(), &ColorScheme::splash_screen_text_color,
-            &Text::SetColor);
+  VR_BIND_COLOR(model_, text.get(), &ColorScheme::splash_screen_text_color,
+                &Text::SetColor);
   text->SetText(l10n_util::GetStringUTF16(IDS_VR_RUNNING_IN_CHROME_MESSAGE));
   text->SetName(kSplashScreenText);
   text->SetDrawPhase(kPhaseForeground);
@@ -569,7 +598,7 @@
   auto scaler = base::MakeUnique<ScaledDepthAdjuster>(kTimeoutScreenDisatance);
   scaler->SetName(kWebVrTimeoutRoot);
   scaler->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* model, UiElement* splash_screen) {
             // The timeout UI should only be visible when the splash screen is
             // not visible.
@@ -580,7 +609,7 @@
           base::Unretained(model_),
           base::Unretained(
               scene_->GetUiElementByName(kSplashScreenTransientParent))),
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& value) { e->SetVisible(value); },
           base::Unretained(scaler.get()))));
 
@@ -633,10 +662,11 @@
   auto button_scaler =
       base::MakeUnique<ScaledDepthAdjuster>(kTimeoutButtonDepthOffset);
 
-  auto button = Create<DiscButton>(
-      kWebVrTimeoutMessageButton, kPhaseForeground,
-      base::Bind(&UiBrowserInterface::ExitPresent, base::Unretained(browser_)),
-      vector_icons::kClose16Icon);
+  auto button =
+      Create<DiscButton>(kWebVrTimeoutMessageButton, kPhaseForeground,
+                         base::BindRepeating(&UiBrowserInterface::ExitPresent,
+                                             base::Unretained(browser_)),
+                         vector_icons::kClose16Icon);
   button->SetVisible(false);
   button->SetTranslate(0, -kTimeoutMessageTextWidthDMM, 0);
   button->SetRotate(1, 0, 0, kTimeoutButtonRotationRad);
@@ -646,8 +676,8 @@
   button->AddBinding(VR_BIND_FUNC(bool, Model, model_,
                                   web_vr.state == kWebVrTimedOut, DiscButton,
                                   button.get(), SetVisible));
-  BindButtonColors(model_, button.get(), &ColorScheme::button_colors,
-                   &DiscButton::SetButtonColors);
+  VR_BIND_BUTTON_COLORS(model_, button.get(), &ColorScheme::button_colors,
+                        &DiscButton::SetButtonColors);
 
   auto timeout_button_text =
       Create<Text>(kWebVrTimeoutMessageButtonText, kPhaseForeground,
@@ -675,8 +705,8 @@
 
 void UiSceneCreator::CreateUnderDevelopmentNotice() {
   auto text = base::MakeUnique<Text>(kUnderDevelopmentNoticeFontHeightDMM);
-  BindColor(model_, text.get(), &ColorScheme::world_background_text,
-            &Text::SetColor);
+  VR_BIND_COLOR(model_, text.get(), &ColorScheme::world_background_text,
+                &Text::SetColor);
   text->SetText(l10n_util::GetStringUTF16(IDS_VR_UNDER_DEVELOPMENT_NOTICE));
   text->SetName(kUnderDevelopmentNotice);
   text->SetDrawPhase(kPhaseForeground);
@@ -695,22 +725,20 @@
       Create<Background>(k2dBrowsingTexturedBackground, kPhaseBackground);
   background->SetVisible(false);
   background->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* m) {
             return m->background_available && m->background_loaded;
           },
           base::Unretained(model_)),
-      base::BindRepeating([](UiElement* e, const bool& v) { e->SetVisible(v); },
-                          base::Unretained(background.get()))));
+      VR_BIND_LAMBDA([](UiElement* e, const bool& v) { e->SetVisible(v); },
+                     base::Unretained(background.get()))));
   scene_->AddUiElement(k2dBrowsingBackground, std::move(background));
 
   auto element = Create<UiElement>(k2dBrowsingDefaultBackground, kPhaseNone);
   element->set_hit_testable(false);
-  element->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating([](Model* m) { return !m->background_available; },
-                          base::Unretained(model_)),
-      base::BindRepeating([](UiElement* e, const bool& v) { e->SetVisible(v); },
-                          base::Unretained(element.get()))));
+  element->AddBinding(VR_BIND_FUNC(bool, Model, model_,
+                                   background_available == false, UiElement,
+                                   element.get(), SetVisible));
   scene_->AddUiElement(k2dBrowsingBackground, std::move(element));
 
   // Background solid-color panels.
@@ -740,8 +768,8 @@
     panel_element->SetRotate(panel.x_rotation, panel.y_rotation, 0,
                              base::kPiFloat / 2 * panel.angle);
     panel_element->set_hit_testable(false);
-    BindColor(model_, panel_element.get(), &ColorScheme::world_background,
-              &Rect::SetColor);
+    VR_BIND_COLOR(model_, panel_element.get(), &ColorScheme::world_background,
+                  &Rect::SetColor);
     panel_element->AddBinding(VR_BIND_FUNC(bool, Model, model_,
                                            browsing_enabled(), UiElement,
                                            panel_element.get(), SetVisible));
@@ -756,10 +784,12 @@
   floor->SetRotate(1, 0, 0, -base::kPiFloat / 2);
   floor->set_gridline_count(kFloorGridlineCount);
   floor->set_focusable(false);
-  BindColor(model_, floor.get(), &ColorScheme::floor, &Grid::SetCenterColor);
-  BindColor(model_, floor.get(), &ColorScheme::world_background,
-            &Grid::SetEdgeColor);
-  BindColor(model_, floor.get(), &ColorScheme::floor_grid, &Grid::SetGridColor);
+  VR_BIND_COLOR(model_, floor.get(), &ColorScheme::floor,
+                &Grid::SetCenterColor);
+  VR_BIND_COLOR(model_, floor.get(), &ColorScheme::world_background,
+                &Grid::SetEdgeColor);
+  VR_BIND_COLOR(model_, floor.get(), &ColorScheme::floor_grid,
+                &Grid::SetGridColor);
   scene_->AddUiElement(k2dBrowsingDefaultBackground, std::move(floor));
 
   // Ceiling.
@@ -768,10 +798,10 @@
   ceiling->SetSize(kSceneSize, kSceneSize);
   ceiling->SetTranslate(0.0, kSceneHeight / 2, 0.0);
   ceiling->SetRotate(1, 0, 0, base::kPiFloat / 2);
-  BindColor(model_, ceiling.get(), &ColorScheme::ceiling,
-            &Rect::SetCenterColor);
-  BindColor(model_, ceiling.get(), &ColorScheme::world_background,
-            &Rect::SetEdgeColor);
+  VR_BIND_COLOR(model_, ceiling.get(), &ColorScheme::ceiling,
+                &Rect::SetCenterColor);
+  VR_BIND_COLOR(model_, ceiling.get(), &ColorScheme::world_background,
+                &Rect::SetEdgeColor);
   scene_->AddUiElement(k2dBrowsingDefaultBackground, std::move(ceiling));
 }
 
@@ -799,17 +829,13 @@
   voice_search_button->SetTranslate(0.f, -kVoiceSearchButtonYOffsetDMM, 0.f);
   voice_search_button->set_y_anchoring(BOTTOM);
   voice_search_button->set_y_centering(TOP);
-  voice_search_button->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::Bind(
-          [](Model* m) {
-            return !m->incognito &&
-                   m->speech.has_or_can_request_audio_permission;
-          },
-          base::Unretained(model_)),
-      base::Bind([](UiElement* e, const bool& v) { e->SetVisible(v); },
-                 voice_search_button.get())));
-  BindButtonColors(model_, voice_search_button.get(),
-                   &ColorScheme::button_colors, &DiscButton::SetButtonColors);
+  voice_search_button->AddBinding(VR_BIND_FUNC(
+      bool, Model, model_,
+      speech.has_or_can_request_audio_permission && !model->incognito,
+      UiElement, voice_search_button.get(), SetVisible));
+  VR_BIND_BUTTON_COLORS(model_, voice_search_button.get(),
+                        &ColorScheme::button_colors,
+                        &DiscButton::SetButtonColors);
   scene_->AddUiElement(kUrlBar, std::move(voice_search_button));
 
   auto speech_recognition_root = base::MakeUnique<UiElement>();
@@ -830,9 +856,9 @@
   inner_circle->SetSize(kCloseButtonWidth * 2, kCloseButtonHeight * 2);
   inner_circle->set_corner_radius(kCloseButtonWidth);
   inner_circle->set_hit_testable(false);
-  BindColor(model_, inner_circle.get(),
-            &ColorScheme::speech_recognition_circle_background,
-            &Rect::SetColor);
+  VR_BIND_COLOR(model_, inner_circle.get(),
+                &ColorScheme::speech_recognition_circle_background,
+                &Rect::SetColor);
   scene_->AddUiElement(kSpeechRecognitionRoot, std::move(inner_circle));
 
   auto microphone_icon = base::MakeUnique<VectorIcon>(512);
@@ -856,9 +882,10 @@
   speech_result_parent->SetTransitionDuration(base::TimeDelta::FromMilliseconds(
       kSpeechRecognitionOpacityAnimationDurationMs));
   speech_result_parent->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::Bind([](Model* m) { return m->speech.recognition_result.empty(); },
-                 base::Unretained(model_)),
-      base::Bind(
+      VR_BIND_LAMBDA(
+          [](Model* m) { return m->speech.recognition_result.empty(); },
+          base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& v) {
             if (v) {
               e->SetVisible(false);
@@ -875,8 +902,8 @@
   speech_result->set_hit_testable(false);
   speech_result->SetSize(kVoiceSearchRecognitionResultTextWidth, 0);
   speech_result->SetTextAlignment(UiTexture::kTextAlignmentCenter);
-  BindColor(model_, speech_result.get(), &ColorScheme::prompt_foreground,
-            &Text::SetColor);
+  VR_BIND_COLOR(model_, speech_result.get(), &ColorScheme::prompt_foreground,
+                &Text::SetColor);
   speech_result->AddBinding(VR_BIND_FUNC(base::string16, Model, model_,
                                          speech.recognition_result, Text,
                                          speech_result.get(), SetText));
@@ -901,14 +928,14 @@
           kSpeechRecognitionOpacityAnimationDurationMs));
   speech_recognition_listening->AddBinding(
       base::MakeUnique<Binding<std::pair<bool, float>>>(
-          base::BindRepeating(
+          VR_BIND_LAMBDA(
               [](Model* m, UiElement* result_parent) {
                 return std::pair<bool, float>(
                     m->voice_search_enabled(),
                     result_parent->GetTargetOpacity());
               },
               base::Unretained(model_), base::Unretained(speech_result_parent)),
-          base::BindRepeating(
+          VR_BIND_LAMBDA(
               [](UiElement* listening, const std::pair<bool, float>& value) {
                 if (!value.first && value.second != 0.f) {
                   listening->SetVisibleImmediately(false);
@@ -926,9 +953,9 @@
   growing_circle->SetSize(kCloseButtonWidth * 2, kCloseButtonHeight * 2);
   growing_circle->set_corner_radius(kCloseButtonWidth);
   growing_circle->set_hit_testable(false);
-  BindColor(model_, growing_circle.get(),
-            &ColorScheme::speech_recognition_circle_background,
-            &Rect::SetColor);
+  VR_BIND_COLOR(model_, growing_circle.get(),
+                &ColorScheme::speech_recognition_circle_background,
+                &Rect::SetColor);
   growing_circle->AddBinding(VR_BIND(
       int, Model, model_, speech.speech_recognition_state, Throbber,
       growing_circle.get(),
@@ -946,13 +973,13 @@
                         kVoiceSearchCloseButtonHeight);
   close_button->set_hover_offset(kButtonZOffsetHoverDMM * kContentDistance);
   close_button->SetTranslate(0.0, -kVoiceSearchCloseButtonYOffset, 0.f);
-  BindButtonColors(model_, close_button.get(), &ColorScheme::button_colors,
-                   &DiscButton::SetButtonColors);
+  VR_BIND_BUTTON_COLORS(model_, close_button.get(), &ColorScheme::button_colors,
+                        &DiscButton::SetButtonColors);
   scene_->AddUiElement(kSpeechRecognitionListening, std::move(close_button));
 
   auto* root = scene_->GetUiElementByName(kSpeechRecognitionRoot);
   root->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* model, UiElement* speech_listening,
              UiElement* speech_result_parent) {
             // The speech recognition root should be visible ad long as the
@@ -966,13 +993,13 @@
               scene_->GetUiElementByName(kSpeechRecognitionListening)),
           base::Unretained(
               scene_->GetUiElementByName(kSpeechRecognitionResult))),
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& value) { e->SetVisible(value); },
           base::Unretained(root))));
   auto* browser_control =
       scene_->GetUiElementByName(k2dBrowsingVisibiltyControlForVoice);
   browser_control->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* model, UiElement* voice_search_root) {
             // The browser foreground should be hidden until the voice search UI
             // goes away.
@@ -980,7 +1007,7 @@
                    voice_search_root->GetTargetOpacity() == 0.f;
           },
           base::Unretained(model_), base::Unretained(root)),
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& value) { e->SetVisible(value); },
           base::Unretained(browser_control))));
 }
@@ -1000,12 +1027,12 @@
   group->set_hit_testable(false);
   group->SetTransitionedProperties({OPACITY});
   group->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::Bind(
+      VR_BIND_LAMBDA(
           [](Model* m) {
             return !m->controller.quiescent || !m->skips_redraw_when_not_dirty;
           },
           base::Unretained(model_)),
-      base::Bind(
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& visible) {
             e->SetTransitionDuration(base::TimeDelta::FromMilliseconds(
                 visible ? kControllerFadeInMs : kControllerFadeOutMs));
@@ -1064,13 +1091,11 @@
   text_input->set_hit_testable(false);
   text_input->SetTextInputDelegate(text_input_delegate);
   text_input->AddBinding(base::MakeUnique<Binding<TextInputInfo>>(
-      base::BindRepeating([](TextInputInfo* info) { return *info; },
-                          base::Unretained(text_input_model)),
-      base::BindRepeating(
-          [](TextInput* e, const TextInputInfo& value) {
-            e->UpdateInput(value);
-          },
-          base::Unretained(text_input.get()))));
+      VR_BIND_LAMBDA([](TextInputInfo* info) { return *info; },
+                     base::Unretained(text_input_model)),
+      VR_BIND_LAMBDA([](TextInput* e,
+                        const TextInputInfo& value) { e->UpdateInput(value); },
+                     base::Unretained(text_input.get()))));
   return text_input;
 }
 
@@ -1125,8 +1150,8 @@
   url_bar->AddBinding(VR_BIND_FUNC(bool, Model, model_, can_navigate_back,
                                    UrlBar, url_bar.get(),
                                    SetHistoryButtonsEnabled));
-  BindColor(model_, url_bar.get(), &ColorScheme::element_background,
-            &TexturedElement::SetBackgroundColor);
+  VR_BIND_COLOR(model_, url_bar.get(), &ColorScheme::element_background,
+                &TexturedElement::SetBackgroundColor);
   scene_->AddUiElement(kUrlBarDmmRoot, std::move(url_bar));
 
   auto indicator_bg = base::MakeUnique<Rect>();
@@ -1139,8 +1164,8 @@
   indicator_bg->set_corner_radius(kLoadingIndicatorHeightDMM * 0.5f);
   indicator_bg->AddBinding(VR_BIND_FUNC(bool, Model, model_, loading, Rect,
                                         indicator_bg.get(), SetVisible));
-  BindColor(model_, indicator_bg.get(),
-            &ColorScheme::loading_indicator_background, &Rect::SetColor);
+  VR_BIND_COLOR(model_, indicator_bg.get(),
+                &ColorScheme::loading_indicator_background, &Rect::SetColor);
 
   scene_->AddUiElement(kUrlBar, std::move(indicator_bg));
 
@@ -1150,12 +1175,12 @@
   indicator_fg->set_x_anchoring(LEFT);
   indicator_fg->set_corner_radius(kLoadingIndicatorHeightDMM * 0.5f);
   indicator_fg->set_hit_testable(false);
-  BindColor(model_, indicator_fg.get(),
-            &ColorScheme::loading_indicator_foreground, &Rect::SetColor);
+  VR_BIND_COLOR(model_, indicator_fg.get(),
+                &ColorScheme::loading_indicator_foreground, &Rect::SetColor);
   indicator_fg->AddBinding(base::MakeUnique<Binding<float>>(
-      base::Bind([](Model* m) { return m->load_progress; },
-                 base::Unretained(model_)),
-      base::Bind(
+      VR_BIND_LAMBDA([](Model* m) { return m->load_progress; },
+                     base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](Rect* r, const float& value) {
             r->SetSize(kLoadingIndicatorWidthDMM * value,
                        kLoadingIndicatorHeightDMM);
@@ -1196,9 +1221,9 @@
       0, kUrlBarVerticalOffsetDMM - 0.5 * kOmniboxHeightDMM,
       kOmniboxShadowOffset);
   omnibox_outer_layout->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating([](Model* m) { return m->omnibox_editing_enabled(); },
-                          base::Unretained(model_)),
-      base::BindRepeating(
+      VR_BIND_LAMBDA([](Model* m) { return m->omnibox_editing_enabled(); },
+                     base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& v) {
             float y_offset =
                 v ? kOmniboxVerticalOffsetDMM : kUrlBarVerticalOffsetDMM;
@@ -1216,10 +1241,9 @@
       base::TimeDelta::FromMilliseconds(kOmniboxTransitionMs));
   omnibox_container->set_focusable(false);
   omnibox_container->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
-          [](Model* m) { return m->omnibox_suggestions.empty(); },
-          base::Unretained(model_)),
-      base::BindRepeating(
+      VR_BIND_LAMBDA([](Model* m) { return m->omnibox_suggestions.empty(); },
+                     base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](Rect* r, const bool& v) {
             if (v) {
               r->SetCornerRadii(
@@ -1231,8 +1255,8 @@
             }
           },
           omnibox_container.get())));
-  BindColor(model_, omnibox_container.get(), &ColorScheme::omnibox_background,
-            &Rect::SetColor);
+  VR_BIND_COLOR(model_, omnibox_container.get(),
+                &ColorScheme::omnibox_background, &Rect::SetColor);
 
   float width = kOmniboxWidthDMM - 2 * kOmniboxTextMarginDMM;
   auto omnibox_text_field =
@@ -1259,9 +1283,9 @@
   omnibox_text_field->set_x_centering(LEFT);
   omnibox_text_field->SetTranslate(kOmniboxTextMarginDMM, 0, 0);
   omnibox_text_field->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating([](Model* m) { return m->omnibox_editing_enabled(); },
-                          base::Unretained(model_)),
-      base::BindRepeating(
+      VR_BIND_LAMBDA([](Model* m) { return m->omnibox_editing_enabled(); },
+                     base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](TextInput* e, Model* m, const bool& v) {
             m->omnibox_text_field_info = TextInputInfo();
             if (v) {
@@ -1273,7 +1297,7 @@
           base::Unretained(omnibox_text_field.get()),
           base::Unretained(model_))));
   omnibox_text_field->AddBinding(base::MakeUnique<Binding<AutocompleteStatus>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* m) {
             AutocompleteStatus state;
             state.active = m->omnibox_editing_enabled();
@@ -1281,7 +1305,7 @@
             return state;
           },
           base::Unretained(model_)),
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](UiBrowserInterface* browser, const AutocompleteStatus& r) {
             if (r.active) {
               browser->StartAutocomplete(r.input);
@@ -1290,20 +1314,20 @@
             }
           },
           base::Unretained(browser_))));
-  BindColor(model_, omnibox_text_field.get(), &ColorScheme::omnibox_text,
-            &TextInput::SetTextColor);
-  BindColor(model_, omnibox_text_field.get(), &ColorScheme::cursor,
-            &TextInput::SetCursorColor);
-  BindColor(model_, omnibox_text_field.get(), &ColorScheme::omnibox_hint,
-            &TextInput::SetHintColor);
+  VR_BIND_COLOR(model_, omnibox_text_field.get(), &ColorScheme::omnibox_text,
+                &TextInput::SetTextColor);
+  VR_BIND_COLOR(model_, omnibox_text_field.get(), &ColorScheme::cursor,
+                &TextInput::SetCursorColor);
+  VR_BIND_COLOR(model_, omnibox_text_field.get(), &ColorScheme::omnibox_hint,
+                &TextInput::SetHintColor);
 
   // Set up the vector binding to manage suggestions dynamically.
   SuggestionSetBinding::ModelAddedCallback added_callback =
-      base::Bind(&OnSuggestionModelAdded, base::Unretained(scene_),
-                 base::Unretained(browser_), base::Unretained(ui_),
-                 base::Unretained(model_));
+      base::BindRepeating(&OnSuggestionModelAdded, base::Unretained(scene_),
+                          base::Unretained(browser_), base::Unretained(ui_),
+                          base::Unretained(model_));
   SuggestionSetBinding::ModelRemovedCallback removed_callback =
-      base::Bind(&OnSuggestionModelRemoved, base::Unretained(scene_));
+      base::BindRepeating(&OnSuggestionModelRemoved, base::Unretained(scene_));
 
   auto suggestions_outer_layout =
       base::MakeUnique<LinearLayout>(LinearLayout::kDown);
@@ -1330,8 +1354,8 @@
   close_button->SetTranslate(0, kOmniboxCloseButtonVerticalOffsetDMM, 0);
   close_button->SetRotate(1, 0, 0, atan(kOmniboxCloseButtonVerticalOffsetDMM));
   close_button->set_hover_offset(kButtonZOffsetHoverDMM);
-  BindButtonColors(model_, close_button.get(), &ColorScheme::button_colors,
-                   &DiscButton::SetButtonColors);
+  VR_BIND_BUTTON_COLORS(model_, close_button.get(), &ColorScheme::button_colors,
+                        &DiscButton::SetButtonColors);
 
   auto spacer = CreateOmniboxSpacer(model_);
   spacer->SetCornerRadii(
@@ -1358,7 +1382,7 @@
 }
 
 void UiSceneCreator::CreateCloseButton() {
-  base::Callback<void()> click_handler = base::Bind(
+  base::RepeatingCallback<void()> click_handler = base::BindRepeating(
       [](Model* model, UiBrowserInterface* browser) {
         if (model->fullscreen_enabled()) {
           browser->ExitFullscreen();
@@ -1374,8 +1398,8 @@
   element->SetSize(kCloseButtonWidth, kCloseButtonHeight);
   element->set_hover_offset(kButtonZOffsetHoverDMM * kCloseButtonDistance);
   element->SetTranslate(0, kCloseButtonVerticalOffset, -kCloseButtonDistance);
-  BindButtonColors(model_, element.get(), &ColorScheme::button_colors,
-                   &DiscButton::SetButtonColors);
+  VR_BIND_BUTTON_COLORS(model_, element.get(), &ColorScheme::button_colors,
+                        &DiscButton::SetButtonColors);
 
   // Close button is a special control element that needs to be hidden when
   // in WebVR, but it needs to be visible when in cct or fullscreen.
@@ -1410,7 +1434,7 @@
                           kContentVerticalOffset + kExitPromptVerticalOffset,
                           -kContentDistance);
   EventHandlers event_handlers;
-  event_handlers.button_up = base::Bind(
+  event_handlers.button_up = base::BindRepeating(
       [](UiBrowserInterface* browser, Model* m) {
         browser->OnExitVrPromptResult(
             ExitVrPromptChoice::CHOICE_NONE,
@@ -1426,25 +1450,27 @@
 
   std::unique_ptr<ExitPrompt> exit_prompt = base::MakeUnique<ExitPrompt>(
       512,
-      base::Bind(&UiBrowserInterface::OnExitVrPromptResult,
-                 base::Unretained(browser_), ExitVrPromptChoice::CHOICE_STAY),
-      base::Bind(&UiBrowserInterface::OnExitVrPromptResult,
-                 base::Unretained(browser_), ExitVrPromptChoice::CHOICE_EXIT));
+      base::BindRepeating(&UiBrowserInterface::OnExitVrPromptResult,
+                          base::Unretained(browser_),
+                          ExitVrPromptChoice::CHOICE_STAY),
+      base::BindRepeating(&UiBrowserInterface::OnExitVrPromptResult,
+                          base::Unretained(browser_),
+                          ExitVrPromptChoice::CHOICE_EXIT));
   exit_prompt->SetName(kExitPrompt);
   exit_prompt->SetDrawPhase(kPhaseForeground);
   exit_prompt->SetSize(kExitPromptWidth, kExitPromptHeight);
-  BindColor(model_, exit_prompt.get(), &ColorScheme::prompt_foreground,
-            &TexturedElement::SetForegroundColor);
-  BindButtonColors(model_, exit_prompt.get(),
-                   &ColorScheme::prompt_primary_button_colors,
-                   &ExitPrompt::SetPrimaryButtonColors);
-  BindButtonColors(model_, exit_prompt.get(),
-                   &ColorScheme::prompt_secondary_button_colors,
-                   &ExitPrompt::SetSecondaryButtonColors);
+  VR_BIND_COLOR(model_, exit_prompt.get(), &ColorScheme::prompt_foreground,
+                &TexturedElement::SetForegroundColor);
+  VR_BIND_BUTTON_COLORS(model_, exit_prompt.get(),
+                        &ColorScheme::prompt_primary_button_colors,
+                        &ExitPrompt::SetPrimaryButtonColors);
+  VR_BIND_BUTTON_COLORS(model_, exit_prompt.get(),
+                        &ColorScheme::prompt_secondary_button_colors,
+                        &ExitPrompt::SetSecondaryButtonColors);
   exit_prompt->AddBinding(base::MakeUnique<Binding<ModalPromptType>>(
-      base::Bind([](Model* m) { return m->active_modal_prompt_type; },
-                 base::Unretained(model_)),
-      base::Bind(
+      VR_BIND_LAMBDA([](Model* m) { return m->active_modal_prompt_type; },
+                     base::Unretained(model_)),
+      VR_BIND_LAMBDA(
           [](ExitPrompt* e, const ModalPromptType& p) {
             e->set_reason(GetReasonForPrompt(p));
             switch (p) {
@@ -1472,7 +1498,7 @@
   backplane->SetSize(kPromptBackplaneSize, kPromptBackplaneSize);
   backplane->SetTranslate(0.0, kContentVerticalOffset, -kOverlayPlaneDistance);
   EventHandlers event_handlers;
-  event_handlers.button_up = base::Bind(
+  event_handlers.button_up = base::BindRepeating(
       [](UiBrowserInterface* browser, Model* m) {
         browser->OnExitVrPromptResult(
             ExitVrPromptChoice::CHOICE_NONE,
@@ -1495,11 +1521,11 @@
   std::unique_ptr<AudioPermissionPrompt> prompt =
       base::MakeUnique<AudioPermissionPrompt>(
           1024,
-          base::Bind(
+          base::BindRepeating(
               &UiBrowserInterface::OnExitVrPromptResult,
               base::Unretained(browser_), ExitVrPromptChoice::CHOICE_EXIT,
               UiUnsupportedMode::kVoiceSearchNeedsRecordAudioOsPermission),
-          base::Bind(
+          base::BindRepeating(
               &UiBrowserInterface::OnExitVrPromptResult,
               base::Unretained(browser_), ExitVrPromptChoice::CHOICE_STAY,
               UiUnsupportedMode::kVoiceSearchNeedsRecordAudioOsPermission));
@@ -1507,21 +1533,22 @@
   prompt->SetDrawPhase(kPhaseForeground);
   prompt->SetSize(kAudioPermissionPromptWidth, kAudioPermissionPromptHeight);
   prompt->SetTranslate(0.0, 0.0f, kAudionPermisionPromptDepth);
-  BindButtonColors(model_, prompt.get(),
-                   &ColorScheme::audio_permission_prompt_primary_button_colors,
-                   &AudioPermissionPrompt::SetPrimaryButtonColors);
-  BindButtonColors(
+  VR_BIND_BUTTON_COLORS(
+      model_, prompt.get(),
+      &ColorScheme::audio_permission_prompt_primary_button_colors,
+      &AudioPermissionPrompt::SetPrimaryButtonColors);
+  VR_BIND_BUTTON_COLORS(
       model_, prompt.get(),
       &ColorScheme::audio_permission_prompt_secondary_button_colors,
       &AudioPermissionPrompt::SetSecondaryButtonColors);
-  BindColor(model_, prompt.get(),
-            &ColorScheme::audio_permission_prompt_icon_foreground,
-            &AudioPermissionPrompt::SetIconColor);
-  BindColor(model_, prompt.get(),
-            &ColorScheme::audio_permission_prompt_background,
-            &TexturedElement::SetBackgroundColor);
-  BindColor(model_, prompt.get(), &ColorScheme::element_foreground,
-            &TexturedElement::SetForegroundColor);
+  VR_BIND_COLOR(model_, prompt.get(),
+                &ColorScheme::audio_permission_prompt_icon_foreground,
+                &AudioPermissionPrompt::SetIconColor);
+  VR_BIND_COLOR(model_, prompt.get(),
+                &ColorScheme::audio_permission_prompt_background,
+                &TexturedElement::SetBackgroundColor);
+  VR_BIND_COLOR(model_, prompt.get(), &ColorScheme::element_foreground,
+                &TexturedElement::SetForegroundColor);
   shadow->AddChild(std::move(prompt));
   backplane->AddChild(std::move(shadow));
   scene_->AddUiElement(k2dBrowsingRoot, std::move(backplane));
@@ -1533,7 +1560,7 @@
       AddTransientParent(kWebVrUrlToastTransientParent, kWebVrViewportAwareRoot,
                          kWebVrUrlToastTimeoutSeconds, true, scene_);
   parent->AddBinding(base::MakeUnique<Binding<bool>>(
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](Model* model, UiElement* splash_screen) {
             // The url toast should only be visible when the splash screen is
             // not visible.
@@ -1544,7 +1571,7 @@
           base::Unretained(model_),
           base::Unretained(
               scene_->GetUiElementByName(kSplashScreenTransientParent))),
-      base::BindRepeating(
+      VR_BIND_LAMBDA(
           [](UiElement* e, const bool& value) { e->SetVisible(value); },
           base::Unretained(parent))));
 
@@ -1560,12 +1587,12 @@
       -kWebVrToastDistance * cos(kWebVrUrlToastRotationRad));
   url_toast->SetRotate(1, 0, 0, kWebVrUrlToastRotationRad);
   url_toast->SetSize(kWebVrUrlToastWidth, kWebVrUrlToastHeight);
-  BindColor(model_, url_toast.get(),
-            &ColorScheme::web_vr_transient_toast_background,
-            &TexturedElement::SetBackgroundColor);
-  BindColor(model_, url_toast.get(),
-            &ColorScheme::web_vr_transient_toast_foreground,
-            &TexturedElement::SetForegroundColor);
+  VR_BIND_COLOR(model_, url_toast.get(),
+                &ColorScheme::web_vr_transient_toast_background,
+                &TexturedElement::SetBackgroundColor);
+  VR_BIND_COLOR(model_, url_toast.get(),
+                &ColorScheme::web_vr_transient_toast_foreground,
+                &TexturedElement::SetForegroundColor);
   url_toast->AddBinding(VR_BIND_FUNC(ToolbarState, Model, model_, toolbar_state,
                                      WebVrUrlToast, url_toast.get(),
                                      SetToolbarState));
@@ -1599,12 +1626,12 @@
                       kExclusiveScreenToastTextFontHeightDMM,
                       TextLayoutMode::kSingleLineFixedHeight);
 
-  BindColor(model_, exit_toast.get(),
-            &ColorScheme::exclusive_screen_toast_background,
-            &Toast::SetBackgroundColor);
-  BindColor(model_, exit_toast.get(),
-            &ColorScheme::exclusive_screen_toast_foreground,
-            &Toast::SetForegroundColor);
+  VR_BIND_COLOR(model_, exit_toast.get(),
+                &ColorScheme::exclusive_screen_toast_background,
+                &Toast::SetBackgroundColor);
+  VR_BIND_COLOR(model_, exit_toast.get(),
+                &ColorScheme::exclusive_screen_toast_foreground,
+                &Toast::SetForegroundColor);
 
   scaler->AddChild(std::move(exit_toast));
   scene_->AddUiElement(kExclusiveScreenToastViewportAwareTransientParent,
@@ -1632,12 +1659,12 @@
                    kExclusiveScreenToastTextFontHeightDMM,
                    TextLayoutMode::kSingleLineFixedHeight);
 
-  BindColor(model_, element.get(),
-            &ColorScheme::exclusive_screen_toast_background,
-            &Toast::SetBackgroundColor);
-  BindColor(model_, element.get(),
-            &ColorScheme::exclusive_screen_toast_foreground,
-            &Toast::SetForegroundColor);
+  VR_BIND_COLOR(model_, element.get(),
+                &ColorScheme::exclusive_screen_toast_background,
+                &Toast::SetBackgroundColor);
+  VR_BIND_COLOR(model_, element.get(),
+                &ColorScheme::exclusive_screen_toast_foreground,
+                &Toast::SetForegroundColor);
 
   scaler->AddChild(std::move(element));
   scene_->AddUiElement(kExclusiveScreenToastTransientParent, std::move(scaler));
diff --git a/chrome/installer/zucchini/BUILD.gn b/chrome/installer/zucchini/BUILD.gn
index 3c13e07d..47eef3a 100644
--- a/chrome/installer/zucchini/BUILD.gn
+++ b/chrome/installer/zucchini/BUILD.gn
@@ -50,6 +50,8 @@
     "patch_utils.h",
     "patch_writer.cc",
     "patch_writer.h",
+    "reference_set.cc",
+    "reference_set.h",
     "rel32_finder.cc",
     "rel32_finder.h",
     "rel32_utils.cc",
@@ -57,6 +59,8 @@
     "reloc_utils.cc",
     "reloc_utils.h",
     "suffix_array.h",
+    "target_pool.cc",
+    "target_pool.h",
     "targets_affinity.cc",
     "targets_affinity.h",
     "type_win_pe.h",
@@ -148,10 +152,12 @@
     "mapped_file_unittest.cc",
     "patch_read_write_unittest.cc",
     "patch_utils_unittest.cc",
+    "reference_set_unittest.cc",
     "rel32_finder_unittest.cc",
     "rel32_utils_unittest.cc",
     "reloc_utils_unittest.cc",
     "suffix_array_unittest.cc",
+    "target_pool_unittest.cc",
     "targets_affinity_unittest.cc",
     "test_disassembler.cc",
     "test_disassembler.h",
diff --git a/chrome/installer/zucchini/algorithm.h b/chrome/installer/zucchini/algorithm.h
index 18ba9003..10a60e8 100644
--- a/chrome/installer/zucchini/algorithm.h
+++ b/chrome/installer/zucchini/algorithm.h
@@ -7,7 +7,9 @@
 
 #include <stddef.h>
 
+#include <algorithm>
 #include <type_traits>
+#include <vector>
 
 #include "base/logging.h"
 
@@ -51,6 +53,15 @@
   return T((x + m - 1) / m) * m;
 }
 
+// Sorts values in |container| and removes duplicates.
+template <class T>
+void SortAndUniquify(std::vector<T>* container) {
+  std::sort(container->begin(), container->end());
+  container->erase(std::unique(container->begin(), container->end()),
+                   container->end());
+  container->shrink_to_fit();
+}
+
 }  // namespace zucchini
 
 #endif  // CHROME_INSTALLER_ZUCCHINI_ALGORITHM_H_
diff --git a/chrome/installer/zucchini/encoded_view.cc b/chrome/installer/zucchini/encoded_view.cc
index acc8397..5c2ea224 100644
--- a/chrome/installer/zucchini/encoded_view.cc
+++ b/chrome/installer/zucchini/encoded_view.cc
@@ -12,6 +12,7 @@
 
 EncodedView::EncodedView(const ImageIndex& image_index)
     : image_index_(image_index) {}
+EncodedView::~EncodedView() = default;
 
 EncodedView::value_type EncodedView::Projection(offset_t location) const {
   DCHECK_LT(location, image_index_.size());
@@ -26,9 +27,10 @@
   }
 
   // |location| points into a Reference.
-  Reference ref = image_index_.FindReference(type, location);
+  const ReferenceSet& ref_set = image_index_.refs(type);
+  IndirectReference ref = ref_set.at(location);
   DCHECK_GE(location, ref.location);
-  DCHECK_LT(location, ref.location + image_index_.GetTraits(type).width);
+  DCHECK_LT(location, ref.location + ref_set.width());
 
   // |location| is not the first byte of the reference.
   if (location != ref.location) {
@@ -36,15 +38,16 @@
     return kReferencePaddingProjection;
   }
 
+  const TargetPool& target_pool = ref_set.target_pool();
+
   // Targets with an associated Label will use its Label index in projection.
   // Otherwise, LabelBound() is used for all targets with no Label.
+  offset_t offset = target_pool.OffsetForKey(ref.target_key);
   value_type target =
-      IsMarked(ref.target)
-          ? UnmarkIndex(ref.target)
-          : image_index_.LabelBound(image_index_.GetPoolTag(type));
+      IsMarked(offset) ? UnmarkIndex(offset) : target_pool.label_bound();
 
-  // Projection is done on (|target|, |type|), shifted by a constant value to
-  // avoid collisions with raw content.
+  // Projection is done on (|target|, |type|), shifted by
+  // kBaseReferenceProjection to avoid collisions with raw content.
   value_type projection = target;
   projection *= image_index_.TypeCount();
   projection += type.value();
@@ -53,9 +56,10 @@
 
 size_t EncodedView::Cardinality() const {
   size_t max_width = 0;
-  for (uint8_t pool = 0; pool < image_index_.PoolCount(); ++pool) {
-    // LabelBound() + 1 for the extra case of references with no Label.
-    max_width = std::max(image_index_.LabelBound(PoolTag(pool)) + 1, max_width);
+  for (const auto& target_pool : image_index_.target_pools()) {
+    // TODO(etiennep): Remove "+ 1" after refactoring.
+    // label_bound() + 1 for the extra case of references with no Label.
+    max_width = std::max(target_pool.second.label_bound() + 1, max_width);
   }
   return max_width * image_index_.TypeCount() + kBaseReferenceProjection;
 }
diff --git a/chrome/installer/zucchini/encoded_view.h b/chrome/installer/zucchini/encoded_view.h
index e63dede..25726469 100644
--- a/chrome/installer/zucchini/encoded_view.h
+++ b/chrome/installer/zucchini/encoded_view.h
@@ -10,18 +10,32 @@
 
 #include <iterator>
 
+#include "base/macros.h"
 #include "chrome/installer/zucchini/image_index.h"
 #include "chrome/installer/zucchini/image_utils.h"
 
 namespace zucchini {
 
+// Zucchini-gen performs semantics-aware matching:
+// - Same-typed reference target in "old" and "new" can be associated.
+//   Associated targets are assigned an identifier called "label" (and for
+//   unassociated targets, label = 0).
+// - EncodedView maps each offset in "old" and "new" images to a "projected
+//   value", which can be:
+//   - Raw byte value (0-255) for non-references.
+//   - Reference "projected value" (> 256) that depends on target {type, label}
+//     at each reference's location (byte 0).
+//   - Reference padding value (256) at the body of each reference (bytes 1+).
+// - The projected values for "old" and "new" are used to build the equivalence
+//   map.
+
 constexpr size_t kReferencePaddingProjection = 256;
 constexpr size_t kBaseReferenceProjection = 257;
 
-// A Range (providing a begin and end iterator) that adapts ImageIndex to make
+// A Range (providing begin and end iterators) that adapts ImageIndex to make
 // image data appear as an Encoded Image, that is encoded data under a higher
 // level of abstraction than raw bytes. In particular:
-// - First byte of each reference becomes a projection of its type and Label.
+// - First byte of each reference become a projection of its type and label.
 // - Subsequent bytes of each reference becomes |kReferencePaddingProjection|.
 // - Non-reference raw bytes remain as raw bytes.
 class EncodedView {
@@ -117,11 +131,16 @@
   // |image_index| is the annotated image being adapted, and is required to
   // remain valid for the lifetime of the object.
   explicit EncodedView(const ImageIndex& image_index);
+  ~EncodedView();
 
   // Projects |location| to a scalar value that describes the content at a
   // higher level of abstraction.
   value_type Projection(offset_t location) const;
 
+  bool IsToken(offset_t location) const {
+    return image_index_.IsToken(location);
+  }
+
   // Returns the cardinality of the projection, i.e., the upper bound on
   // values returned by Projection().
   value_type Cardinality() const;
@@ -139,6 +158,8 @@
 
  private:
   const ImageIndex& image_index_;
+
+  DISALLOW_COPY_AND_ASSIGN(EncodedView);
 };
 
 }  // namespace zucchini
diff --git a/chrome/installer/zucchini/encoded_view_unittest.cc b/chrome/installer/zucchini/encoded_view_unittest.cc
index 78ba15c..4717010 100644
--- a/chrome/installer/zucchini/encoded_view_unittest.cc
+++ b/chrome/installer/zucchini/encoded_view_unittest.cc
@@ -5,6 +5,7 @@
 #include "chrome/installer/zucchini/encoded_view.h"
 
 #include <iterator>
+#include <numeric>
 #include <vector>
 
 #include "chrome/installer/zucchini/image_index.h"
@@ -114,9 +115,7 @@
   EncodedViewTest()
       : buffer_(20),
         image_index_(ConstBufferView(buffer_.data(), buffer_.size())) {
-    for (uint8_t i = 0; i < buffer_.size(); ++i) {
-      buffer_[i] = i;
-    }
+    std::iota(buffer_.begin(), buffer_.end(), 0);
     TestDisassembler disasm({2, TypeTag(0), PoolTag(0)},
                             {{1, 0}, {8, 1}, {10, 2}},
                             {4, TypeTag(1), PoolTag(0)}, {{3, 3}},
diff --git a/chrome/installer/zucchini/equivalence_map.cc b/chrome/installer/zucchini/equivalence_map.cc
index 6f029895..fb9ad26 100644
--- a/chrome/installer/zucchini/equivalence_map.cc
+++ b/chrome/installer/zucchini/equivalence_map.cc
@@ -14,50 +14,56 @@
 
 /******** Utility Functions ********/
 
-double GetTokenSimilarity(const ImageIndex& old_image,
-                          const ImageIndex& new_image,
+double GetTokenSimilarity(const ImageIndex& old_image_index,
+                          const ImageIndex& new_image_index,
                           offset_t src,
                           offset_t dst) {
-  DCHECK(old_image.IsToken(src));
-  DCHECK(new_image.IsToken(dst));
+  DCHECK(old_image_index.IsToken(src));
+  DCHECK(new_image_index.IsToken(dst));
 
-  TypeTag old_type = old_image.LookupType(src);
-  TypeTag new_type = new_image.LookupType(dst);
+  TypeTag old_type = old_image_index.LookupType(src);
+  TypeTag new_type = new_image_index.LookupType(dst);
   if (old_type != new_type)
     return kMismatchFatal;
 
   // Raw comparison.
-  if (!old_image.IsReference(src) && !new_image.IsReference(dst)) {
-    return old_image.GetRawValue(src) == new_image.GetRawValue(dst) ? 1.0
-                                                                    : -1.5;
+  if (!old_image_index.IsReference(src) && !new_image_index.IsReference(dst)) {
+    return old_image_index.GetRawValue(src) == new_image_index.GetRawValue(dst)
+               ? 1.0
+               : -1.5;
   }
 
-  Reference old_reference = old_image.FindReference(old_type, src);
-  Reference new_reference = new_image.FindReference(new_type, dst);
+  const ReferenceSet& old_ref_set = old_image_index.refs(old_type);
+  const ReferenceSet& new_ref_set = new_image_index.refs(new_type);
+  IndirectReference old_reference = old_ref_set.at(src);
+  IndirectReference new_reference = new_ref_set.at(dst);
+
+  offset_t old_target =
+      old_ref_set.target_pool().OffsetForKey(old_reference.target_key);
+  offset_t new_target =
+      new_ref_set.target_pool().OffsetForKey(new_reference.target_key);
 
   // Both targets are not associated, which implies a weak match.
-  if (!IsMarked(old_reference.target) && !IsMarked(new_reference.target))
-    return 0.5 * old_image.GetTraits(old_type).width;
+  if (!IsMarked(old_target) && !IsMarked(new_target))
+    return 0.5 * old_ref_set.width();
 
   // At least one target is associated, so values are compared.
-  return old_reference.target == new_reference.target
-             ? old_image.GetTraits(old_type).width
-             : -2.0;
+  return old_target == new_target ? old_ref_set.width() : -2.0;
 }
 
-double GetEquivalenceSimilarity(const ImageIndex& old_image,
-                                const ImageIndex& new_image,
+double GetEquivalenceSimilarity(const ImageIndex& old_image_index,
+                                const ImageIndex& new_image_index,
                                 const Equivalence& equivalence) {
   double similarity = 0.0;
   for (offset_t k = 0; k < equivalence.length; ++k) {
     // Non-tokens are joined with the nearest previous token: skip until we
     // cover the unit.
-    if (!new_image.IsToken(equivalence.dst_offset + k))
+    if (!new_image_index.IsToken(equivalence.dst_offset + k))
       continue;
 
-    similarity +=
-        GetTokenSimilarity(old_image, new_image, equivalence.src_offset + k,
-                           equivalence.dst_offset + k);
+    similarity += GetTokenSimilarity(old_image_index, new_image_index,
+                                     equivalence.src_offset + k,
+                                     equivalence.dst_offset + k);
     if (similarity == kMismatchFatal)
       return kMismatchFatal;
   }
@@ -65,8 +71,8 @@
 }
 
 EquivalenceCandidate ExtendEquivalenceForward(
-    const ImageIndex& old_image,
-    const ImageIndex& new_image,
+    const ImageIndex& old_image_index,
+    const ImageIndex& new_image_index,
     const EquivalenceCandidate& candidate,
     double min_similarity) {
   Equivalence equivalence = candidate.eq;
@@ -74,16 +80,17 @@
   double current_similarity = candidate.similarity;
   double best_similarity = current_similarity;
   double current_penalty = min_similarity;
-  for (offset_t k = best_k; equivalence.src_offset + k < old_image.size() &&
-                            equivalence.dst_offset + k < new_image.size();
+  for (offset_t k = best_k;
+       equivalence.src_offset + k < old_image_index.size() &&
+       equivalence.dst_offset + k < new_image_index.size();
        ++k) {
     // Mismatch in type, |candidate| cannot be extended further.
-    if (old_image.LookupType(equivalence.src_offset + k) !=
-        new_image.LookupType(equivalence.dst_offset + k)) {
+    if (old_image_index.LookupType(equivalence.src_offset + k) !=
+        new_image_index.LookupType(equivalence.dst_offset + k)) {
       break;
     }
 
-    if (!new_image.IsToken(equivalence.dst_offset + k)) {
+    if (!new_image_index.IsToken(equivalence.dst_offset + k)) {
       // Non-tokens are joined with the nearest previous token: skip until we
       // cover the unit, and extend |best_k| if applicable.
       if (best_k == k)
@@ -91,9 +98,9 @@
       continue;
     }
 
-    double similarity =
-        GetTokenSimilarity(old_image, new_image, equivalence.src_offset + k,
-                           equivalence.dst_offset + k);
+    double similarity = GetTokenSimilarity(old_image_index, new_image_index,
+                                           equivalence.src_offset + k,
+                                           equivalence.dst_offset + k);
     current_similarity += similarity;
     current_penalty = std::max(0.0, current_penalty) - similarity;
 
@@ -109,8 +116,8 @@
 }
 
 EquivalenceCandidate ExtendEquivalenceBackward(
-    const ImageIndex& old_image,
-    const ImageIndex& new_image,
+    const ImageIndex& old_image_index,
+    const ImageIndex& new_image_index,
     const EquivalenceCandidate& candidate,
     double min_similarity) {
   Equivalence equivalence = candidate.eq;
@@ -121,22 +128,22 @@
   for (offset_t k = 1;
        k <= equivalence.dst_offset && k <= equivalence.src_offset; ++k) {
     // Mismatch in type, |candidate| cannot be extended further.
-    if (old_image.LookupType(equivalence.src_offset - k) !=
-        new_image.LookupType(equivalence.dst_offset - k)) {
+    if (old_image_index.LookupType(equivalence.src_offset - k) !=
+        new_image_index.LookupType(equivalence.dst_offset - k)) {
       break;
     }
 
     // Non-tokens are joined with the nearest previous token: skip until we
     // reach the next token.
-    if (!new_image.IsToken(equivalence.dst_offset - k))
+    if (!new_image_index.IsToken(equivalence.dst_offset - k))
       continue;
 
-    DCHECK_EQ(
-        old_image.LookupType(equivalence.src_offset - k),
-        new_image.LookupType(equivalence.dst_offset - k));  // Sanity check.
-    double similarity =
-        GetTokenSimilarity(old_image, new_image, equivalence.src_offset - k,
-                           equivalence.dst_offset - k);
+    DCHECK_EQ(old_image_index.LookupType(equivalence.src_offset - k),
+              new_image_index.LookupType(equivalence.dst_offset -
+                                         k));  // Sanity check.
+    double similarity = GetTokenSimilarity(old_image_index, new_image_index,
+                                           equivalence.src_offset - k,
+                                           equivalence.dst_offset - k);
     current_similarity += similarity;
     current_penalty = std::max(0.0, current_penalty) - similarity;
 
@@ -154,17 +161,17 @@
   return {equivalence, best_similarity};
 }
 
-EquivalenceCandidate VisitEquivalenceSeed(const ImageIndex& old_image,
-                                          const ImageIndex& new_image,
+EquivalenceCandidate VisitEquivalenceSeed(const ImageIndex& old_image_index,
+                                          const ImageIndex& new_image_index,
                                           offset_t src,
                                           offset_t dst,
                                           double min_similarity) {
   EquivalenceCandidate candidate{{src, dst, 0}, 0.0};  // Empty.
-  candidate =
-      ExtendEquivalenceForward(old_image, new_image, candidate, min_similarity);
+  candidate = ExtendEquivalenceForward(old_image_index, new_image_index,
+                                       candidate, min_similarity);
   if (candidate.similarity < min_similarity)
     return candidate;  // Not worth exploring any more.
-  return ExtendEquivalenceBackward(old_image, new_image, candidate,
+  return ExtendEquivalenceBackward(old_image_index, new_image_index, candidate,
                                    min_similarity);
 }
 
@@ -183,14 +190,14 @@
 EquivalenceMap::~EquivalenceMap() = default;
 
 void EquivalenceMap::Build(const std::vector<offset_t>& old_sa,
-                           const ImageIndex& old_image,
-                           const ImageIndex& new_image,
+                           const EncodedView& old_view,
+                           const EncodedView& new_view,
                            double min_similarity) {
-  DCHECK_EQ(old_sa.size(), old_image.size());
+  DCHECK_EQ(old_sa.size(), old_view.size());
 
-  CreateCandidates(old_sa, old_image, new_image, min_similarity);
+  CreateCandidates(old_sa, old_view, new_view, min_similarity);
   SortByDestination();
-  Prune(old_image, new_image, min_similarity);
+  Prune(old_view, new_view, min_similarity);
 
   offset_t coverage = 0;
   offset_t current_offset = 0;
@@ -201,7 +208,7 @@
   }
   LOG(INFO) << "Equivalence Count: " << size();
   LOG(INFO) << "Coverage / Extra / Total: " << coverage << " / "
-            << new_image.size() - coverage << " / " << new_image.size();
+            << new_view.size() - coverage << " / " << new_view.size();
 }
 
 std::vector<Equivalence> EquivalenceMap::MakeForwardEquivalences() const {
@@ -216,19 +223,17 @@
 }
 
 void EquivalenceMap::CreateCandidates(const std::vector<offset_t>& old_sa,
-                                      const ImageIndex& old_image,
-                                      const ImageIndex& new_image,
+                                      const EncodedView& old_view,
+                                      const EncodedView& new_view,
                                       double min_similarity) {
   candidates_.clear();
 
   // This is an heuristic to find 'good' equivalences on encoded views.
   // Equivalences are found in ascending order of |new_image|.
-  EncodedView old_view(old_image);
-  EncodedView new_view(new_image);
   offset_t dst_offset = 0;
 
-  while (dst_offset < new_image.size()) {
-    if (!new_image.IsToken(dst_offset)) {
+  while (dst_offset < new_view.size()) {
+    if (!new_view.IsToken(dst_offset)) {
       ++dst_offset;
       continue;
     }
@@ -241,9 +246,9 @@
     double best_similarity = min_similarity;
     EquivalenceCandidate best_candidate = {{0, 0, 0}, 0.0};
     for (auto it = match; it != old_sa.end(); ++it) {
-      EquivalenceCandidate candidate =
-          VisitEquivalenceSeed(old_image, new_image, static_cast<offset_t>(*it),
-                               dst_offset, min_similarity);
+      EquivalenceCandidate candidate = VisitEquivalenceSeed(
+          old_view.image_index(), new_view.image_index(),
+          static_cast<offset_t>(*it), dst_offset, min_similarity);
       if (candidate.similarity > best_similarity) {
         best_candidate = candidate;
         best_similarity = candidate.similarity;
@@ -254,8 +259,8 @@
     }
     for (auto it = match; it != old_sa.begin(); --it) {
       EquivalenceCandidate candidate = VisitEquivalenceSeed(
-          old_image, new_image, static_cast<offset_t>(it[-1]), dst_offset,
-          min_similarity);
+          old_view.image_index(), new_view.image_index(),
+          static_cast<offset_t>(it[-1]), dst_offset, min_similarity);
       if (candidate.similarity > best_similarity) {
         best_candidate = candidate;
         best_similarity = candidate.similarity;
@@ -279,8 +284,8 @@
             });
 }
 
-void EquivalenceMap::Prune(const ImageIndex& old_image,
-                           const ImageIndex& new_image,
+void EquivalenceMap::Prune(const EncodedView& old_view,
+                           const EncodedView& new_view,
                            double min_similarity) {
   for (auto current = candidates_.begin(); current != candidates_.end();
        ++current) {
@@ -298,8 +303,8 @@
       // |next| is better, so |current| shrinks.
       if (current->similarity < next->similarity) {
         current->eq.length -= delta;
-        current->similarity =
-            GetEquivalenceSimilarity(old_image, new_image, current->eq);
+        current->similarity = GetEquivalenceSimilarity(
+            old_view.image_index(), new_view.image_index(), current->eq);
         break;
       }
     }
@@ -313,8 +318,8 @@
       next->eq.length = next->eq.length > delta ? next->eq.length - delta : 0;
       next->eq.src_offset += delta;
       next->eq.dst_offset += delta;
-      next->similarity =
-          GetEquivalenceSimilarity(old_image, new_image, next->eq);
+      next->similarity = GetEquivalenceSimilarity(
+          old_view.image_index(), new_view.image_index(), next->eq);
       DCHECK_EQ(next->eq.dst_offset, current->eq.dst_end());
     }
   }
diff --git a/chrome/installer/zucchini/equivalence_map.h b/chrome/installer/zucchini/equivalence_map.h
index f8d1342e..cec21e5 100644
--- a/chrome/installer/zucchini/equivalence_map.h
+++ b/chrome/installer/zucchini/equivalence_map.h
@@ -17,49 +17,51 @@
 
 constexpr double kMismatchFatal = -std::numeric_limits<double>::infinity();
 
-// Returns a similarity score between content in |old_view| and |new_view| at
-// offsets |src| and |dst|, respectively. Both |src| and |dst| must refer to
-// tokens in |old_image| and |new_image|.
-double GetTokenSimilarity(const ImageIndex& old_image,
-                          const ImageIndex& new_image,
+class EncodedView;
+
+// Returns a similarity score between content in |old_image_index| and
+// |new_image_index| at offsets |src| and |dst|, respectively. Both |src| and
+// |dst| must refer to tokens in |old_image_index| and |new_image_index|.
+double GetTokenSimilarity(const ImageIndex& old_image_index,
+                          const ImageIndex& new_image_index,
                           offset_t src,
                           offset_t dst);
 
-// Returns a similarity score between content in |old_view| and |new_view| at
-// regions described by |equivalence|.
-double GetEquivalenceSimilarity(const ImageIndex& old_image,
-                                const ImageIndex& new_image,
+// Returns a similarity score between content in |old_image_index| and
+// |new_image_index| at regions described by |equivalence|.
+double GetEquivalenceSimilarity(const ImageIndex& old_image_index,
+                                const ImageIndex& new_image_index,
                                 const Equivalence& equivalence);
 
 // Extends |equivalence| forward and returns the result. This is related to
 // VisitEquivalenceSeed().
 EquivalenceCandidate ExtendEquivalenceForward(
-    const ImageIndex& old_image,
-    const ImageIndex& new_image,
+    const ImageIndex& old_image_index,
+    const ImageIndex& new_image_index,
     const EquivalenceCandidate& equivalence,
     double min_similarity);
 
 // Extends |equivalence| backward and returns the result. This is related to
 // VisitEquivalenceSeed().
 EquivalenceCandidate ExtendEquivalenceBackward(
-    const ImageIndex& old_image,
-    const ImageIndex& new_image,
+    const ImageIndex& old_image_index,
+    const ImageIndex& new_image_index,
     const EquivalenceCandidate& equivalence,
     double min_similarity);
 
 // Creates an equivalence, starting with |src| and |dst| as offset hint, and
 // extends it both forward and backward, trying to maximise similarity between
-// |old_image| and |new_image|, and returns the result. |min_similarity|
-// describes the minimum acceptable similarity score and is used as threshold to
-// discard bad equivalences.
-EquivalenceCandidate VisitEquivalenceSeed(const ImageIndex& old_image,
-                                          const ImageIndex& new_image,
+// |old_image_index| and |new_image_index|, and returns the result.
+// |min_similarity| describes the minimum acceptable similarity score and is
+// used as threshold to discard bad equivalences.
+EquivalenceCandidate VisitEquivalenceSeed(const ImageIndex& old_image_index,
+                                          const ImageIndex& new_image_index,
                                           offset_t src,
                                           offset_t dst,
                                           double min_similarity);
 
-// Container of equivalences between |old_image| and |new_image|, sorted by
-// |Equivalence::dst_offset|, only used during patch generation.
+// Container of equivalences between |old_image_index| and |new_image_index|,
+// sorted by |Equivalence::dst_offset|, only used during patch generation.
 class EquivalenceMap {
  public:
   using const_iterator = std::vector<EquivalenceCandidate>::const_iterator;
@@ -72,15 +74,15 @@
   EquivalenceMap(const EquivalenceMap&) = delete;
   ~EquivalenceMap();
 
-  // Finds relevant equivalences between |old_image| and |new_image|, using
-  // suffix array |old_sa| computed from |old_image|. This function is not
-  // symmetric. Equivalences might overlap in |old_image|, but not in
-  // |new_image|. It tries to maximize accumulated similarity within each
-  // equivalence, while maximizing |new_image| coverage. The minimum similarity
-  // of an equivalence is given by |min_similarity|.
+  // Finds relevant equivalences between |old_view| and |new_view|, using suffix
+  // array |old_sa| computed from |old_view|. This function is not symmetric.
+  // Equivalences might overlap in |old_view|, but not in |new_view|. It tries
+  // to maximize accumulated similarity within each equivalence, while
+  // maximizing |new_view| coverage. The minimum similarity of an equivalence is
+  // given by |min_similarity|.
   void Build(const std::vector<offset_t>& old_sa,
-             const ImageIndex& old_image,
-             const ImageIndex& new_image,
+             const EncodedView& old_view,
+             const EncodedView& new_view,
              double min_similarity);
 
   size_t size() const { return candidates_.size(); }
@@ -92,20 +94,20 @@
   std::vector<Equivalence> MakeForwardEquivalences() const;
 
  private:
-  // Discovers equivalence candidates between |old_image| and |new_image| and
+  // Discovers equivalence candidates between |old_view| and |new_view| and
   // stores them in the object. Note that resulting candidates are not sorted
   // and might be overlapping in new image.
   void CreateCandidates(const std::vector<offset_t>& old_sa,
-                        const ImageIndex& old_image,
-                        const ImageIndex& new_image,
+                        const EncodedView& old_view,
+                        const EncodedView& new_view,
                         double min_similarity);
   // Sorts candidates by their offset in new image.
   void SortByDestination();
   // Visits |candidates_| (sorted by |dst_offset|) and remove all destination
   // overlaps. Candidates with low similarity scores are more likely to be
   // shrunken. Unfit candidates may be removed.
-  void Prune(const ImageIndex& old_image,
-             const ImageIndex& new_image,
+  void Prune(const EncodedView& old_view,
+             const EncodedView& new_view,
              double min_similarity);
 
   std::vector<EquivalenceCandidate> candidates_;
diff --git a/chrome/installer/zucchini/equivalence_map_unittest.cc b/chrome/installer/zucchini/equivalence_map_unittest.cc
index 306bbe6..2a84a03 100644
--- a/chrome/installer/zucchini/equivalence_map_unittest.cc
+++ b/chrome/installer/zucchini/equivalence_map_unittest.cc
@@ -215,11 +215,13 @@
                                    const ImageIndex new_index,
                                    double minimum_similarity) {
     EncodedView old_view(old_index);
+    EncodedView new_view(new_index);
+
     std::vector<offset_t> old_sa =
         MakeSuffixArray<InducedSuffixSort>(old_view, old_view.Cardinality());
 
     EquivalenceMap equivalence_map;
-    equivalence_map.Build(old_sa, old_index, new_index, minimum_similarity);
+    equivalence_map.Build(old_sa, old_view, new_view, minimum_similarity);
 
     offset_t current_dst_offset = 0;
     offset_t coverage = 0;
diff --git a/chrome/installer/zucchini/image_index.cc b/chrome/installer/zucchini/image_index.cc
index c4f6d3d..cb3c4c86 100644
--- a/chrome/installer/zucchini/image_index.cc
+++ b/chrome/installer/zucchini/image_index.cc
@@ -7,6 +7,7 @@
 #include <algorithm>
 #include <utility>
 
+#include "chrome/installer/zucchini/algorithm.h"
 #include "chrome/installer/zucchini/disassembler.h"
 
 namespace zucchini {
@@ -20,53 +21,24 @@
 
 bool ImageIndex::Initialize(Disassembler* disasm) {
   std::vector<ReferenceGroup> ref_groups = disasm->MakeReferenceGroups();
-
   for (const auto& group : ref_groups) {
-    // Store TypeInfo for current type (of |group|).
-    DCHECK_NE(kNoTypeTag, group.type_tag());
-    auto result = types_.emplace(group.type_tag(), group.traits());
-    DCHECK(result.second);
-
-    // Find and store all references for current type, returns false on finding
+    // Build pool-to-type mapping.
+    DCHECK_NE(kNoPoolTag, group.pool_tag());
+    TargetPool& target_pool = target_pools_[group.pool_tag()];
+    target_pool.AddType(group.type_tag());
+    target_pool.InsertTargets(std::move(*group.GetReader(disasm)));
+  }
+  for (const auto& group : ref_groups) {
+    // Find and store all references for each type, returns false on finding
     // any overlap, to signal error.
-    if (!InsertReferences(group.type_tag(),
+    if (!InsertReferences(group.traits(),
                           std::move(*group.GetReader(disasm)))) {
       return false;
     }
-
-    // Build pool-to-type mapping.
-    DCHECK_NE(kNoPoolTag, group.pool_tag());
-    pools_[group.pool_tag()].types.push_back(group.type_tag());
   }
   return true;
 }
 
-Reference ImageIndex::FindReference(TypeTag type, offset_t location) const {
-  DCHECK_LE(location, size());
-  DCHECK_LT(type.value(), types_.size());
-  const TypeInfo& type_info = types_.at(type);
-  auto pos = std::upper_bound(
-      type_info.references.begin(), type_info.references.end(), location,
-      [](offset_t a, const Reference& ref) { return a < ref.location; });
-
-  DCHECK(pos != type_info.references.begin());
-  --pos;
-  DCHECK_LT(location, pos->location + GetTraits(type).width);
-  return *pos;
-}
-
-std::vector<offset_t> ImageIndex::GetTargets(PoolTag pool) const {
-  size_t target_count = 0;
-  for (TypeTag type : GetTypeTags(pool))
-    target_count += GetReferences(type).size();
-  std::vector<offset_t> targets;
-  targets.reserve(target_count);
-  for (TypeTag type : GetTypeTags(pool))
-    for (const auto& ref : GetReferences(type))
-      targets.push_back(ref.target);
-  return targets;
-}
-
 bool ImageIndex::IsToken(offset_t location) const {
   TypeTag type = LookupType(location);
 
@@ -75,55 +47,23 @@
     return true;
 
   // |location| points into a Reference.
-  Reference reference = FindReference(type, location);
+  IndirectReference reference = refs(type).at(location);
   // Only the first byte of a reference is a token.
   return location == reference.location;
 }
 
-void ImageIndex::LabelTargets(PoolTag pool,
-                              const BaseLabelManager& label_manager) {
-  for (const TypeTag& type : pools_.at(pool).types)
-    for (auto& ref : types_.at(type).references)
-      ref.target = label_manager.MarkedIndexFromOffset(ref.target);
-  pools_.at(pool).label_bound = label_manager.size();
-}
+bool ImageIndex::InsertReferences(const ReferenceTypeTraits& traits,
+                                  ReferenceReader&& ref_reader) {
+  // Store ReferenceSet for current type (of |group|).
+  DCHECK_NE(kNoTypeTag, traits.type_tag);
+  auto result = reference_sets_.emplace(
+      traits.type_tag, ReferenceSet(traits, pool(traits.pool_tag)));
+  DCHECK(result.second);
 
-void ImageIndex::UnlabelTargets(PoolTag pool,
-                                const BaseLabelManager& label_manager) {
-  for (const TypeTag& type : pools_.at(pool).types)
-    for (auto& ref : types_.at(type).references) {
-      ref.target = label_manager.OffsetFromMarkedIndex(ref.target);
-      DCHECK(!IsMarked(ref.target));  // Expected to be represented as offset.
-    }
-  pools_.at(pool).label_bound = 0;
-}
-
-void ImageIndex::LabelAssociatedTargets(
-    PoolTag pool,
-    const BaseLabelManager& label_manager,
-    const BaseLabelManager& reference_label_manager) {
-  // Convert to marked indexes.
-  for (const auto& type : pools_.at(pool).types) {
-    for (auto& ref : types_.at(type).references) {
-      // Represent Label as marked index iff the index is also in
-      // |reference_label_manager|.
-      DCHECK(!IsMarked(ref.target));  // Expected to be represented as offset.
-      offset_t index = label_manager.IndexOfOffset(ref.target);
-      DCHECK_NE(kUnusedIndex, index);  // Target is expected to have a label.
-      if (reference_label_manager.IsIndexStored(index))
-        ref.target = MarkIndex(index);
-    }
-  }
-  pools_.at(pool).label_bound = label_manager.size();
-}
-
-bool ImageIndex::InsertReferences(TypeTag type, ReferenceReader&& ref_reader) {
-  const ReferenceTypeTraits& traits = GetTraits(type);
-  TypeInfo& type_info = types_.at(traits.type_tag);
-  for (base::Optional<Reference> ref = ref_reader.GetNext(); ref.has_value();
-       ref = ref_reader.GetNext()) {
-    DCHECK_LE(ref->location + traits.width, size());
-    auto cur_type_tag = type_tags_.begin() + ref->location;
+  result.first->second.InitReferences(std::move(ref_reader));
+  for (auto ref : reference_sets_.at(traits.type_tag)) {
+    DCHECK(RangeIsBounded(ref.location, traits.width, size()));
+    auto cur_type_tag = type_tags_.begin() + ref.location;
 
     // Check for overlap with existing reference. If found, then invalidate.
     if (std::any_of(cur_type_tag, cur_type_tag + traits.width,
@@ -131,23 +71,8 @@
       return false;
     }
     std::fill(cur_type_tag, cur_type_tag + traits.width, traits.type_tag);
-    type_info.references.push_back(*ref);
   }
-  DCHECK(std::is_sorted(type_info.references.begin(),
-                        type_info.references.end(),
-                        [](const Reference& a, const Reference& b) {
-                          return a.location < b.location;
-                        }));
   return true;
 }
 
-ImageIndex::TypeInfo::TypeInfo(ReferenceTypeTraits traits_in)
-    : traits(traits_in) {}
-ImageIndex::TypeInfo::TypeInfo(TypeInfo&&) = default;
-ImageIndex::TypeInfo::~TypeInfo() = default;
-
-ImageIndex::PoolInfo::PoolInfo() = default;
-ImageIndex::PoolInfo::PoolInfo(PoolInfo&&) = default;
-ImageIndex::PoolInfo::~PoolInfo() = default;
-
 }  // namespace zucchini
diff --git a/chrome/installer/zucchini/image_index.h b/chrome/installer/zucchini/image_index.h
index 68ff5f8..921390e 100644
--- a/chrome/installer/zucchini/image_index.h
+++ b/chrome/installer/zucchini/image_index.h
@@ -12,17 +12,18 @@
 #include <vector>
 
 #include "base/logging.h"
-#include "base/optional.h"
 #include "chrome/installer/zucchini/buffer_view.h"
 #include "chrome/installer/zucchini/image_utils.h"
 #include "chrome/installer/zucchini/label_manager.h"
+#include "chrome/installer/zucchini/reference_set.h"
+#include "chrome/installer/zucchini/target_pool.h"
 
 namespace zucchini {
 
 class Disassembler;
 
-// A class that holds annotations of an image, allowing quick access to its
-// raw and reference content. The memory overhead of storing all references is
+// A class that holds annotations of an image, allowing quick access to its raw
+// and reference content. The memory overhead of storing all references is
 // relatively high, so this is only used during patch generation.
 class ImageIndex {
  public:
@@ -33,30 +34,17 @@
 
   // Inserts all references read from |disasm|. This should be called exactly
   // once. If overlap between any two references of any type is encountered,
-  // returns false and leaves the object in an invalid state. Otherwise, returns
-  // true.
+  // returns false and leaves the object in an invalid state. Otherwise,
+  // returns true.
   // TODO(huangs): Refactor ReaderFactory and WriterFactory so
   // |const Disassembler&| can be used here.
   bool Initialize(Disassembler* disasm);
 
-  // Returns the number of reference type the index holds.
-  size_t TypeCount() const { return types_.size(); }
+  // Returns the number of reference types the index holds.
+  size_t TypeCount() const { return reference_sets_.size(); }
 
-  // Returns the number of target pool discovered.
-  size_t PoolCount() const { return pools_.size(); }
-
-  size_t LabelBound(PoolTag pool) const { return pools_.at(pool).label_bound; }
-
-  // Returns traits describing references of type |type|.
-  const ReferenceTypeTraits& GetTraits(TypeTag type) const {
-    return types_.at(type).traits;
-  }
-
-  PoolTag GetPoolTag(TypeTag type) const { return GetTraits(type).pool_tag; }
-
-  const std::vector<TypeTag>& GetTypeTags(PoolTag pool) const {
-    return pools_.at(pool).types;
-  }
+  // Returns the number of target pools discovered.
+  size_t PoolCount() const { return target_pools_.size(); }
 
   // Returns true if |image_[location]| is either:
   // - A raw value.
@@ -81,18 +69,19 @@
     return image_[location];
   }
 
-  // Assumes that a reference of given |type| covers |location|, and returns the
-  // reference.
-  Reference FindReference(TypeTag type, offset_t location) const;
-
-  // Returns a vector of references of type |type|, where references are sorted
-  // by their location.
-  const std::vector<Reference>& GetReferences(TypeTag type) const {
-    return types_.at(type).references;
+  const std::map<PoolTag, TargetPool>& target_pools() const {
+    return target_pools_;
+  }
+  const std::map<TypeTag, ReferenceSet>& reference_sets() const {
+    return reference_sets_;
   }
 
-  // Creates and returns a vector of all targets in |pool|.
-  std::vector<offset_t> GetTargets(PoolTag pool) const;
+  const TargetPool& pool(PoolTag pool_tag) const {
+    return target_pools_.at(pool_tag);
+  }
+  const ReferenceSet& refs(TypeTag type_tag) const {
+    return reference_sets_.at(type_tag);
+  }
 
   // Returns the size of the image.
   size_t size() const { return image_.size(); }
@@ -100,7 +89,9 @@
   // Replaces every target represented as offset whose Label is in
   // |label_manager| by the index of this Label, and updates the Label bound
   // associated with |pool|.
-  void LabelTargets(PoolTag pool, const BaseLabelManager& label_manager);
+  void LabelTargets(PoolTag pool, const BaseLabelManager& label_manager) {
+    target_pools_.at(pool).LabelTargets(label_manager);
+  }
 
   // Replaces every associated target represented as offset whose Label is in
   // |label_manager| by the index of this Label, and updates the Label bound
@@ -111,48 +102,34 @@
   // UnlabelTargets() (below) is called.
   void LabelAssociatedTargets(PoolTag pool,
                               const BaseLabelManager& label_manager,
-                              const BaseLabelManager& reference_label_manager);
+                              const BaseLabelManager& reference_label_manager) {
+    target_pools_.at(pool).LabelAssociatedTargets(label_manager,
+                                                  reference_label_manager);
+  }
 
   // Replaces every target represented as a Label index by its original offset,
   // assuming that |label_manager| still holds the same Labels referered to by
   // target indices. Resets Label bound associated with |pool| to 0.
-  void UnlabelTargets(PoolTag pool, const BaseLabelManager& label_manager);
+  void UnlabelTargets(PoolTag pool, const BaseLabelManager& label_manager) {
+    target_pools_.at(pool).UnlabelTargets(label_manager);
+  }
 
  private:
-  // Information stored for every reference type.
-  struct TypeInfo {
-    explicit TypeInfo(ReferenceTypeTraits traits_in);
-    TypeInfo(TypeInfo&&);
-    ~TypeInfo();
-
-    ReferenceTypeTraits traits;
-    // List of Reference instances sorted by location (file offset).
-    std::vector<Reference> references;
-  };
-  // Information stored for every reference pool.
-  struct PoolInfo {
-    PoolInfo();
-    PoolInfo(PoolInfo&&);
-    ~PoolInfo();
-
-    std::vector<TypeTag> types;  // Enumerates type_tag for this pool.
-    size_t label_bound = 0;      // Upper bound on Label indices for this pool.
-  };
-
-  // Inserts to |*this| index, all references of type |type_tag| read from
+  // Inserts to |*this| index, all references described by |traits| read from
   // |ref_reader|, which gets consumed. This should be called exactly once for
   // each reference type. If overlap between any two references of any type is
   // encountered, returns false and leaves the object in an invalid state.
   // Otherwise, returns true.
-  bool InsertReferences(TypeTag type_tag, ReferenceReader&& ref_reader);
+  bool InsertReferences(const ReferenceTypeTraits& traits,
+                        ReferenceReader&& ref_reader);
 
   const ConstBufferView image_;
 
   // Used for random access lookup of reference type, for each byte in |image_|.
   std::vector<TypeTag> type_tags_;
 
-  std::map<TypeTag, TypeInfo> types_;
-  std::map<PoolTag, PoolInfo> pools_;
+  std::map<PoolTag, TargetPool> target_pools_;
+  std::map<TypeTag, ReferenceSet> reference_sets_;
 };
 
 }  // namespace zucchini
diff --git a/chrome/installer/zucchini/image_index_unittest.cc b/chrome/installer/zucchini/image_index_unittest.cc
index 8823038..f1c9bc2 100644
--- a/chrome/installer/zucchini/image_index_unittest.cc
+++ b/chrome/installer/zucchini/image_index_unittest.cc
@@ -45,15 +45,16 @@
   EXPECT_EQ(3U, image_index_.TypeCount());
   EXPECT_EQ(2U, image_index_.PoolCount());
 
-  EXPECT_EQ(PoolTag(0), image_index_.GetPoolTag(TypeTag(0)));
-  EXPECT_EQ(PoolTag(0), image_index_.GetPoolTag(TypeTag(1)));
-  EXPECT_EQ(PoolTag(1), image_index_.GetPoolTag(TypeTag(2)));
+  EXPECT_EQ(TypeTag(0), image_index_.refs(TypeTag(0)).type_tag());
+  EXPECT_EQ(TypeTag(1), image_index_.refs(TypeTag(1)).type_tag());
+  EXPECT_EQ(TypeTag(2), image_index_.refs(TypeTag(2)).type_tag());
 
-  EXPECT_EQ(0U, image_index_.LabelBound(PoolTag(0)));
-  EXPECT_EQ(0U, image_index_.LabelBound(PoolTag(1)));
+  EXPECT_EQ(PoolTag(0), image_index_.refs(TypeTag(0)).pool_tag());
+  EXPECT_EQ(PoolTag(0), image_index_.refs(TypeTag(1)).pool_tag());
+  EXPECT_EQ(PoolTag(1), image_index_.refs(TypeTag(2)).pool_tag());
 }
 
-TEST_F(ImageIndexTest, InvalidInsertReferences1) {
+TEST_F(ImageIndexTest, InvalidInitialize1) {
   // Overlap within the same group.
   TestDisassembler disasm({2, TypeTag(0), PoolTag(0)}, {{1, 0}, {2, 0}},
                           {4, TypeTag(1), PoolTag(0)}, {},
@@ -61,13 +62,12 @@
   EXPECT_FALSE(image_index_.Initialize(&disasm));
 }
 
-TEST_F(ImageIndexTest, InvalidInsertReferences2) {
+TEST_F(ImageIndexTest, InvalidInitialize2) {
+  // Overlap across different readers.
   TestDisassembler disasm({2, TypeTag(0), PoolTag(0)},
                           {{1, 0}, {8, 1}, {10, 2}},
                           {4, TypeTag(1), PoolTag(0)}, {{3, 3}},
                           {3, TypeTag(2), PoolTag(1)}, {{11, 0}});
-
-  // Overlap across different readers.
   EXPECT_FALSE(image_index_.Initialize(&disasm));
 }
 
@@ -128,78 +128,4 @@
     EXPECT_EQ(expected[i], image_index_.IsReference(i));
 }
 
-TEST_F(ImageIndexTest, FindReference) {
-  InitializeWithDefaultTestData();
-
-  EXPECT_DCHECK_DEATH(image_index_.FindReference(TypeTag(0), 0));
-  EXPECT_EQ(Reference({1, 0}), image_index_.FindReference(TypeTag(0), 1));
-  EXPECT_EQ(Reference({1, 0}), image_index_.FindReference(TypeTag(0), 2));
-  EXPECT_DCHECK_DEATH(image_index_.FindReference(TypeTag(0), 3));
-  EXPECT_DCHECK_DEATH(image_index_.FindReference(TypeTag(1), 1));
-  EXPECT_DCHECK_DEATH(image_index_.FindReference(TypeTag(1), 2));
-  EXPECT_EQ(Reference({10, 2}), image_index_.FindReference(TypeTag(0), 10));
-  EXPECT_EQ(Reference({10, 2}), image_index_.FindReference(TypeTag(0), 11));
-  EXPECT_DCHECK_DEATH(image_index_.FindReference(TypeTag(0), 12));
-}
-
-TEST_F(ImageIndexTest, LabelTargets) {
-  InitializeWithDefaultTestData();
-
-  OrderedLabelManager label_manager0;
-  label_manager0.InsertOffsets({0, 2, 3, 4});
-  image_index_.LabelTargets(PoolTag(0), label_manager0);
-  EXPECT_EQ(4U, image_index_.LabelBound(PoolTag(0)));
-  EXPECT_EQ(0U, image_index_.LabelBound(PoolTag(1)));
-
-  EXPECT_EQ(
-      std::vector<Reference>({{1, MarkIndex(0)}, {8, 1}, {10, MarkIndex(1)}}),
-      image_index_.GetReferences(TypeTag(0)));
-  EXPECT_EQ(std::vector<Reference>({{3, MarkIndex(2)}}),
-            image_index_.GetReferences(TypeTag(1)));
-  EXPECT_EQ(std::vector<Reference>({{12, 4}, {17, 5}}),
-            image_index_.GetReferences(TypeTag(2)));
-
-  OrderedLabelManager label_manager1;
-  label_manager1.InsertOffsets({5});
-  image_index_.LabelTargets(PoolTag(1), label_manager1);
-  EXPECT_EQ(4U, image_index_.LabelBound(PoolTag(0)));
-  EXPECT_EQ(1U, image_index_.LabelBound(PoolTag(1)));
-
-  EXPECT_EQ(std::vector<Reference>({{12, 4}, {17, MarkIndex(0)}}),
-            image_index_.GetReferences(TypeTag(2)));
-
-  image_index_.UnlabelTargets(PoolTag(0), label_manager0);
-  EXPECT_EQ(0U, image_index_.LabelBound(PoolTag(0)));
-  EXPECT_EQ(1U, image_index_.LabelBound(PoolTag(1)));
-
-  EXPECT_EQ(std::vector<Reference>({{1, 0}, {8, 1}, {10, 2}}),
-            image_index_.GetReferences(TypeTag(0)));
-  EXPECT_EQ(std::vector<Reference>({{3, 3}}),
-            image_index_.GetReferences(TypeTag(1)));
-  EXPECT_EQ(std::vector<Reference>({{12, 4}, {17, MarkIndex(0)}}),
-            image_index_.GetReferences(TypeTag(2)));
-}
-
-TEST_F(ImageIndexTest, LabelAssociatedTargets) {
-  InitializeWithDefaultTestData();
-
-  OrderedLabelManager label_manager;
-  label_manager.InsertOffsets({0, 1, 2, 3, 4});
-
-  UnorderedLabelManager reference_label_manager;
-  reference_label_manager.Init({0, kUnusedIndex, 2});
-
-  image_index_.LabelAssociatedTargets(PoolTag(0), label_manager,
-                                      reference_label_manager);
-  EXPECT_EQ(5U, image_index_.LabelBound(PoolTag(0)));
-  EXPECT_EQ(0U, image_index_.LabelBound(PoolTag(1)));
-  EXPECT_EQ(
-      std::vector<Reference>({{1, MarkIndex(0)}, {8, 1}, {10, MarkIndex(2)}}),
-      image_index_.GetReferences(TypeTag(0)));
-  EXPECT_EQ(std::vector<Reference>({{3, 3}}),
-            image_index_.GetReferences(TypeTag(1)));
-  EXPECT_EQ(std::vector<Reference>({{12, 4}, {17, 5}}),
-            image_index_.GetReferences(TypeTag(2)));
-}
-
 }  // namespace zucchini
diff --git a/chrome/installer/zucchini/image_utils.h b/chrome/installer/zucchini/image_utils.h
index c298589..c6dd4e8 100644
--- a/chrome/installer/zucchini/image_utils.h
+++ b/chrome/installer/zucchini/image_utils.h
@@ -53,7 +53,6 @@
 
 // Specification of references in an image file.
 struct ReferenceTypeTraits {
-  constexpr ReferenceTypeTraits() = default;
   constexpr ReferenceTypeTraits(offset_t width_in,
                                 TypeTag type_tag_in,
                                 PoolTag pool_tag_in)
@@ -61,11 +60,11 @@
 
   // |width| specifies number of bytes covered by the reference's binary
   // encoding.
-  offset_t width = 0;
+  const offset_t width;
   // |type_tag| identifies the reference type being described.
-  TypeTag type_tag = kNoTypeTag;
+  const TypeTag type_tag;
   // |pool_tag| identifies the pool this type belongs to.
-  PoolTag pool_tag = kNoPoolTag;
+  const PoolTag pool_tag;
 };
 
 // There is no need to store |type| because references of the same type are
@@ -80,6 +79,15 @@
   return a.location == b.location && a.target == b.target;
 }
 
+struct IndirectReference {
+  offset_t location;
+  key_t target_key;  // Key within a pool of references with same semantics.
+};
+
+inline bool operator==(const IndirectReference& a, const IndirectReference& b) {
+  return a.location == b.location && a.target_key == b.target_key;
+}
+
 // Interface for extracting References through member function GetNext().
 // This is used by Disassemblers to extract references from an image file.
 // Typically, a Reader lazily extracts values and does not hold any storage.
diff --git a/chrome/installer/zucchini/label_manager.cc b/chrome/installer/zucchini/label_manager.cc
index abbdc0a..db73954 100644
--- a/chrome/installer/zucchini/label_manager.cc
+++ b/chrome/installer/zucchini/label_manager.cc
@@ -8,19 +8,10 @@
 #include <utility>
 
 #include "base/logging.h"
+#include "chrome/installer/zucchini/algorithm.h"
 
 namespace zucchini {
 
-namespace {
-
-void SortAndUniquify(std::vector<offset_t>* offsets) {
-  std::sort(offsets->begin(), offsets->end());
-  offsets->erase(std::unique(offsets->begin(), offsets->end()), offsets->end());
-  offsets->shrink_to_fit();
-}
-
-}  // namespace
-
 /******** BaseLabelManager ********/
 
 BaseLabelManager::BaseLabelManager() = default;
diff --git a/chrome/installer/zucchini/reference_set.cc b/chrome/installer/zucchini/reference_set.cc
new file mode 100644
index 0000000..d369a57
--- /dev/null
+++ b/chrome/installer/zucchini/reference_set.cc
@@ -0,0 +1,68 @@
+// 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 "chrome/installer/zucchini/reference_set.h"
+
+#include <algorithm>
+#include <iterator>
+
+#include "base/logging.h"
+#include "base/macros.h"
+#include "chrome/installer/zucchini/target_pool.h"
+
+namespace zucchini {
+
+namespace {
+
+// Returns true if |refs| is sorted by location.
+bool IsReferenceListSorted(const std::vector<IndirectReference>& refs) {
+  return std::is_sorted(
+      refs.begin(), refs.end(),
+      [](const IndirectReference& a, const IndirectReference& b) {
+        return a.location < b.location;
+      });
+}
+
+}  // namespace
+
+ReferenceSet::ReferenceSet(const ReferenceTypeTraits& traits,
+                           const TargetPool& target_pool)
+    : traits_(traits), target_pool_(target_pool) {}
+ReferenceSet::ReferenceSet(ReferenceSet&&) = default;
+ReferenceSet::~ReferenceSet() = default;
+
+void ReferenceSet::InitReferences(ReferenceReader&& ref_reader) {
+  DCHECK(references_.empty());
+  for (auto ref = ref_reader.GetNext(); ref.has_value();
+       ref = ref_reader.GetNext()) {
+    references_.push_back(
+        {ref->location, target_pool_.KeyForOffset(ref->target)});
+  }
+  DCHECK(IsReferenceListSorted(references_));
+}
+
+void ReferenceSet::InitReferences(const std::vector<Reference>& refs) {
+  DCHECK(references_.empty());
+  references_.reserve(refs.size());
+  std::transform(refs.begin(), refs.end(), std::back_inserter(references_),
+                 [&](const Reference& ref) -> IndirectReference {
+                   return {ref.location, target_pool_.KeyForOffset(ref.target)};
+                 });
+  DCHECK(IsReferenceListSorted(references_));
+}
+
+IndirectReference ReferenceSet::at(offset_t offset) const {
+  auto pos =
+      std::upper_bound(references_.begin(), references_.end(), offset,
+                       [](offset_t offset, const IndirectReference& ref) {
+                         return offset < ref.location;
+                       });
+
+  DCHECK(pos != references_.begin());  // Iterators.
+  --pos;
+  DCHECK_LT(offset, pos->location + width());
+  return *pos;
+}
+
+}  // namespace zucchini
diff --git a/chrome/installer/zucchini/reference_set.h b/chrome/installer/zucchini/reference_set.h
new file mode 100644
index 0000000..dcc2cc0
--- /dev/null
+++ b/chrome/installer/zucchini/reference_set.h
@@ -0,0 +1,66 @@
+// 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 CHROME_INSTALLER_ZUCCHINI_REFERENCE_SET_H_
+#define CHROME_INSTALLER_ZUCCHINI_REFERENCE_SET_H_
+
+#include <stddef.h>
+
+#include <vector>
+
+#include "chrome/installer/zucchini/image_utils.h"
+
+namespace zucchini {
+
+class TargetPool;
+
+// Container of distinct indirect references of one type, along with traits,
+// only used during patch generation.
+class ReferenceSet {
+ public:
+  using const_iterator = std::vector<IndirectReference>::const_iterator;
+
+  // |traits| specifies the reference represented. |target_pool| specifies
+  // common targets shared by all reference represented, and mediates target
+  // translation between offsets and indexes.
+  ReferenceSet(const ReferenceTypeTraits& traits,
+               const TargetPool& target_pool);
+  ReferenceSet(const ReferenceSet&) = delete;
+  ReferenceSet(ReferenceSet&&);
+  ~ReferenceSet();
+
+  // Either one of the initializers below should be called exactly once. These
+  // insert all references from |ref_reader/refs| into this class. The targets
+  // of these references must be in |target_pool_|.
+  void InitReferences(ReferenceReader&& ref_reader);
+  void InitReferences(const std::vector<Reference>& refs);
+
+  const std::vector<IndirectReference>& references() const {
+    return references_;
+  }
+  const ReferenceTypeTraits& traits() const { return traits_; }
+  const TargetPool& target_pool() const { return target_pool_; }
+  TypeTag type_tag() const { return traits_.type_tag; }
+  PoolTag pool_tag() const { return traits_.pool_tag; }
+  offset_t width() const { return traits_.width; }
+
+  // Looks up the IndirectReference by an |offset| that it spans. |offset| is
+  // assumed to be valid, i.e., |offset| must be spanned by some
+  // IndirectReference in |references_|.
+  IndirectReference at(offset_t offset) const;
+
+  size_t size() const { return references_.size(); }
+  const_iterator begin() const { return references_.begin(); }
+  const_iterator end() const { return references_.end(); }
+
+ private:
+  ReferenceTypeTraits traits_;
+  const TargetPool& target_pool_;
+  // List of distinct IndirectReference instances sorted by location.
+  std::vector<IndirectReference> references_;
+};
+
+}  // namespace zucchini
+
+#endif  // CHROME_INSTALLER_ZUCCHINI_REFERENCE_SET_H_
diff --git a/chrome/installer/zucchini/reference_set_unittest.cc b/chrome/installer/zucchini/reference_set_unittest.cc
new file mode 100644
index 0000000..c2f345a
--- /dev/null
+++ b/chrome/installer/zucchini/reference_set_unittest.cc
@@ -0,0 +1,51 @@
+// 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 "chrome/installer/zucchini/reference_set.h"
+
+#include <vector>
+
+#include "chrome/installer/zucchini/image_utils.h"
+#include "chrome/installer/zucchini/target_pool.h"
+#include "chrome/installer/zucchini/test_reference_reader.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace zucchini {
+
+namespace {
+
+constexpr offset_t kWidth = 2U;
+
+}  // namespace
+
+class ReferenceSetTest : public testing::Test {
+ protected:
+  // For simplicity, |target_pool_| has no type info (not needed here).
+  TargetPool target_pool_ = TargetPool{{0, 2, 3, 5}};
+  ReferenceSet reference_set_ =
+      ReferenceSet{{kWidth, TypeTag(0), PoolTag(0)}, target_pool_};
+};
+
+TEST_F(ReferenceSetTest, InitReferencesFromReader) {
+  EXPECT_EQ(std::vector<IndirectReference>(), reference_set_.references());
+  EXPECT_EQ(0U, reference_set_.size());
+  std::vector<Reference> references = {{10, 0}, {12, 2}, {14, 5}};
+  reference_set_.InitReferences(TestReferenceReader(references));
+  EXPECT_EQ(std::vector<IndirectReference>({{10, 0}, {12, 1}, {14, 3}}),
+            reference_set_.references());
+  EXPECT_EQ(3U, reference_set_.size());
+}
+
+TEST_F(ReferenceSetTest, At) {
+  reference_set_.InitReferences({{10, 0}, {12, 2}, {15, 5}});
+  // Each references has kWidth = 2, so check all bytes covered.
+  EXPECT_EQ(IndirectReference({10, 0}), reference_set_.at(10));
+  EXPECT_EQ(IndirectReference({10, 0}), reference_set_.at(11));
+  EXPECT_EQ(IndirectReference({12, 1}), reference_set_.at(12));
+  EXPECT_EQ(IndirectReference({12, 1}), reference_set_.at(13));
+  EXPECT_EQ(IndirectReference({15, 3}), reference_set_.at(15));
+  EXPECT_EQ(IndirectReference({15, 3}), reference_set_.at(16));
+}
+
+}  // namespace zucchini
diff --git a/chrome/installer/zucchini/target_pool.cc b/chrome/installer/zucchini/target_pool.cc
new file mode 100644
index 0000000..3ed9f41
--- /dev/null
+++ b/chrome/installer/zucchini/target_pool.cc
@@ -0,0 +1,81 @@
+// 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 "chrome/installer/zucchini/target_pool.h"
+
+#include <algorithm>
+#include <iterator>
+#include <utility>
+
+#include "base/logging.h"
+#include "chrome/installer/zucchini/algorithm.h"
+#include "chrome/installer/zucchini/label_manager.h"
+
+namespace zucchini {
+
+TargetPool::TargetPool() = default;
+
+TargetPool::TargetPool(std::vector<offset_t>&& targets) {
+  DCHECK(targets_.empty());
+  DCHECK(std::is_sorted(targets.begin(), targets.end()));
+  targets_ = std::move(targets);
+}
+
+TargetPool::TargetPool(TargetPool&&) = default;
+TargetPool::~TargetPool() = default;
+
+void TargetPool::InsertTargets(const std::vector<Reference>& references) {
+  // This can be called many times, so it's better to let std::back_inserter()
+  // manage |targets_| resize, instead of manually reserving space.
+  std::transform(references.begin(), references.end(),
+                 std::back_inserter(targets_),
+                 [](const Reference& ref) { return ref.target; });
+  SortAndUniquify(&targets_);
+}
+
+void TargetPool::InsertTargets(ReferenceReader&& references) {
+  for (auto ref = references.GetNext(); ref.has_value();
+       ref = references.GetNext()) {
+    targets_.push_back(ref->target);
+  }
+  SortAndUniquify(&targets_);
+}
+
+offset_t TargetPool::KeyForOffset(offset_t offset) const {
+  auto pos = std::lower_bound(targets_.begin(), targets_.end(), offset);
+  DCHECK(pos != targets_.end() && *pos == offset);
+  return static_cast<offset_t>(pos - targets_.begin());
+}
+
+void TargetPool::LabelTargets(const BaseLabelManager& label_manager) {
+  for (auto& target : targets_)
+    target = label_manager.MarkedIndexFromOffset(target);
+  label_bound_ = label_manager.size();
+}
+
+void TargetPool::UnlabelTargets(const BaseLabelManager& label_manager) {
+  for (auto& target : targets_) {
+    target = label_manager.OffsetFromMarkedIndex(target);
+    DCHECK(!IsMarked(target));  // Expected to be represented as offset.
+  }
+  label_bound_ = 0;
+}
+
+void TargetPool::LabelAssociatedTargets(
+    const BaseLabelManager& label_manager,
+    const BaseLabelManager& reference_label_manager) {
+  // Convert to marked indexes.
+  for (auto& target : targets_) {
+    // Represent Label as marked index iff the index is also in
+    // |reference_label_manager|.
+    DCHECK(!IsMarked(target));  // Expected to be represented as offset.
+    offset_t index = label_manager.IndexOfOffset(target);
+    DCHECK_NE(kUnusedIndex, index);  // Target is expected to have a label.
+    if (reference_label_manager.IsIndexStored(index))
+      target = MarkIndex(index);
+  }
+  label_bound_ = label_manager.size();
+}
+
+}  // namespace zucchini
diff --git a/chrome/installer/zucchini/target_pool.h b/chrome/installer/zucchini/target_pool.h
new file mode 100644
index 0000000..ebc87ad
--- /dev/null
+++ b/chrome/installer/zucchini/target_pool.h
@@ -0,0 +1,88 @@
+// 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 CHROME_INSTALLER_ZUCCHINI_TARGET_POOL_H_
+#define CHROME_INSTALLER_ZUCCHINI_TARGET_POOL_H_
+
+#include <stddef.h>
+
+#include <vector>
+
+#include "chrome/installer/zucchini/image_utils.h"
+
+namespace zucchini {
+
+class BaseLabelManager;
+
+// Ordered container of distinct targets that have the same semantics, along
+// with a list of associated reference types, only used during patch generation.
+class TargetPool {
+ public:
+  using const_iterator = std::vector<offset_t>::const_iterator;
+
+  TargetPool();
+  // Initializes the object with given sorted and unique |targets|.
+  explicit TargetPool(std::vector<offset_t>&& targets);
+  TargetPool(const TargetPool&) = delete;
+  TargetPool(TargetPool&&);
+  ~TargetPool();
+
+  // The following functions insert each new target from |references|. This
+  // invalidates all previous key lookups.
+  void InsertTargets(const std::vector<Reference>& references);
+  void InsertTargets(ReferenceReader&& references);
+
+  // Adds |type| as a reference type associated with the pool of targets.
+  void AddType(TypeTag type) { types_.push_back(type); }
+
+  // Returns a canonical key associated with |offset|.
+  key_t KeyForOffset(offset_t offset) const;
+
+  // Returns the target for a |key|, which is assumed to be valid and held by
+  // this class.
+  offset_t OffsetForKey(key_t key) const { return targets_[key]; }
+
+  size_t label_bound() const { return label_bound_; }
+
+  // Accessors for testing.
+  const std::vector<offset_t>& targets() const { return targets_; }
+  const std::vector<TypeTag>& types() const { return types_; }
+
+  // Returns the number of targets.
+  size_t size() const { return targets_.size(); }
+  const_iterator begin() const;
+  const_iterator end() const;
+
+  // The three functions below are transition hacks that mark targets, which
+  // will disappear.
+
+  // Replaces every target represented as offset whose Label is in
+  // |label_manager| by the index of this Label, and updates the Label bound
+  // associated with |pool|.
+  void LabelTargets(const BaseLabelManager& label_manager);
+
+  // Replaces every associated target represented as offset whose Label is in
+  // |label_manager| by the index of this Label, and updates the Label bound
+  // associated with |pool|. A target is associated iff its Label index is also
+  // used in |reference_label_manager|. All targets must have a Label in
+  // |label_manager|, and must be represented as offset when calling this
+  // function, implying it can only be called once for each |pool|, until
+  // UnlabelTargets() (below) is called.
+  void LabelAssociatedTargets(const BaseLabelManager& label_manager,
+                              const BaseLabelManager& reference_label_manager);
+
+  // Replaces every target represented as a Label index by its original offset,
+  // assuming that |label_manager| still holds the same Labels referered to by
+  // target indices. Resets Label bound associated with |pool| to 0.
+  void UnlabelTargets(const BaseLabelManager& label_manager);
+
+ private:
+  std::vector<TypeTag> types_;     // Enumerates type_tag for this pool.
+  std::vector<offset_t> targets_;  // Targets for pool in ascending order.
+  size_t label_bound_ = 0;
+};
+
+}  // namespace zucchini
+
+#endif  // CHROME_INSTALLER_ZUCCHINI_TARGET_POOL_H_
diff --git a/chrome/installer/zucchini/target_pool_unittest.cc b/chrome/installer/zucchini/target_pool_unittest.cc
new file mode 100644
index 0000000..0b8f626
--- /dev/null
+++ b/chrome/installer/zucchini/target_pool_unittest.cc
@@ -0,0 +1,90 @@
+// 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 "chrome/installer/zucchini/target_pool.h"
+
+#include <utility>
+#include <vector>
+
+#include "chrome/installer/zucchini/image_utils.h"
+#include "chrome/installer/zucchini/label_manager.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace zucchini {
+
+namespace {
+
+using OffsetVector = std::vector<offset_t>;
+
+}  // namespace
+
+TEST(TargetPoolTest, InsertTargetsFromReferences) {
+  auto test_insert = [](std::vector<Reference>&& references) -> OffsetVector {
+    TargetPool target_pool;
+    target_pool.InsertTargets(references);
+    // Return copy since |target_pool| goes out of scope.
+    return target_pool.targets();
+  };
+
+  EXPECT_EQ(OffsetVector(), test_insert({}));
+  EXPECT_EQ(OffsetVector({0, 1}), test_insert({{0, 0}, {10, 1}}));
+  EXPECT_EQ(OffsetVector({0, 1}), test_insert({{0, 1}, {10, 0}}));
+  EXPECT_EQ(OffsetVector({0, 1, 2}), test_insert({{0, 1}, {10, 0}, {20, 2}}));
+  EXPECT_EQ(OffsetVector({0}), test_insert({{0, 0}, {10, 0}}));
+  EXPECT_EQ(OffsetVector({0, 1}), test_insert({{0, 0}, {10, 0}, {20, 1}}));
+}
+
+TEST(TargetPoolTest, KeyOffset) {
+  auto test_key_offset = [](OffsetVector&& targets) {
+    TargetPool target_pool(std::move(targets));
+    for (offset_t offset : target_pool.targets()) {
+      offset_t key = target_pool.KeyForOffset(offset);
+      EXPECT_LT(key, target_pool.size());
+      EXPECT_EQ(offset, target_pool.OffsetForKey(key));
+    }
+  };
+  test_key_offset({0});
+  test_key_offset({1});
+  test_key_offset({0, 1});
+  test_key_offset({0, 2});
+  test_key_offset({1, 2});
+  test_key_offset({1, 3});
+  test_key_offset({1, 3, 7, 9, 13});
+}
+
+TEST(TargetPoolTest, LabelTargets) {
+  TargetPool target_pool;
+  target_pool.InsertTargets({{1, 0}, {8, 1}, {10, 2}});
+
+  OrderedLabelManager label_manager;
+  label_manager.InsertOffsets({0, 2, 3, 4});
+  target_pool.LabelTargets(label_manager);
+  EXPECT_EQ(4U, target_pool.label_bound());
+
+  EXPECT_EQ(std::vector<offset_t>({MarkIndex(0), 1, MarkIndex(1)}),
+            target_pool.targets());
+
+  target_pool.UnlabelTargets(label_manager);
+  EXPECT_EQ(0U, target_pool.label_bound());
+
+  EXPECT_EQ(std::vector<offset_t>({0, 1, 2}), target_pool.targets());
+}
+
+TEST(TargetPoolTest, LabelAssociatedTargets) {
+  TargetPool target_pool;
+  target_pool.InsertTargets({{1, 0}, {8, 1}, {10, 2}});
+
+  OrderedLabelManager label_manager;
+  label_manager.InsertOffsets({0, 1, 2, 3, 4});
+
+  UnorderedLabelManager reference_label_manager;
+  reference_label_manager.Init({0, kUnusedIndex, 2});
+
+  target_pool.LabelAssociatedTargets(label_manager, reference_label_manager);
+  EXPECT_EQ(5U, target_pool.label_bound());
+  EXPECT_EQ(std::vector<offset_t>({MarkIndex(0), 1, MarkIndex(2)}),
+            target_pool.targets());
+}
+
+}  // namespace zucchini
diff --git a/chrome/installer/zucchini/zucchini_gen.cc b/chrome/installer/zucchini/zucchini_gen.cc
index abcdf99..8e97e4b 100644
--- a/chrome/installer/zucchini/zucchini_gen.cc
+++ b/chrome/installer/zucchini/zucchini_gen.cc
@@ -17,6 +17,7 @@
 #include "chrome/installer/zucchini/encoded_view.h"
 #include "chrome/installer/zucchini/equivalence_map.h"
 #include "chrome/installer/zucchini/image_index.h"
+#include "chrome/installer/zucchini/label_manager.h"
 #include "chrome/installer/zucchini/patch_writer.h"
 #include "chrome/installer/zucchini/suffix_array.h"
 
@@ -89,20 +90,21 @@
   return new_targets;
 }
 
-std::vector<offset_t> FindExtraTargets(
-    const std::vector<Reference>& new_references,
-    const EquivalenceMap& equivalence_map) {
+std::vector<offset_t> FindExtraTargets(const ReferenceSet& new_references,
+                                       const EquivalenceMap& equivalence_map) {
   auto equivalence = equivalence_map.begin();
   std::vector<offset_t> targets;
-  for (const Reference& ref : new_references) {
+  for (const IndirectReference& ref : new_references) {
     while (equivalence != equivalence_map.end() &&
-           equivalence->eq.dst_end() <= ref.location)
+           equivalence->eq.dst_end() <= ref.location) {
       ++equivalence;
-
+    }
     if (equivalence == equivalence_map.end())
       break;
-    if (ref.location >= equivalence->eq.dst_offset && !IsMarked(ref.target))
-      targets.push_back(ref.target);
+    offset_t target_offset =
+        new_references.target_pool().OffsetForKey(ref.target_key);
+    if (ref.location >= equivalence->eq.dst_offset && !IsMarked(target_offset))
+      targets.push_back(target_offset);
   }
   return targets;
 }
@@ -122,7 +124,8 @@
   // Build coarse equivalence map, where references with same types are
   // considered equivalent.
   equivalence_map.Build(MakeSuffixArrayFromImageIndex(*old_image_index),
-                        *old_image_index, *new_image_index,
+                        EncodedView(*old_image_index),
+                        EncodedView(*new_image_index),
                         kLargeEquivalenceSimilarity);
 
   // Associate targets from "old" to "new" image based on coarse
@@ -150,7 +153,8 @@
   // on) are considered equivalent. Note that a different |min_similarity| is
   // used.
   equivalence_map.Build(MakeSuffixArrayFromImageIndex(*old_image_index),
-                        *old_image_index, *new_image_index,
+                        EncodedView(*old_image_index),
+                        EncodedView(*new_image_index),
                         kMinEquivalenceSimilarity);
 
   // Restore |old_image_index| and |new_image_index| to offsets.
@@ -225,10 +229,12 @@
   // TODO(huangs): Investigate whether mixing all types is worthwhile.
   for (uint8_t type = 0; type < old_index.TypeCount(); ++type) {
     TypeTag type_tag(type);
-    size_t ref_width = old_index.GetTraits(type_tag).width;
 
-    const std::vector<Reference>& src_refs = old_index.GetReferences(type_tag);
-    const std::vector<Reference>& dst_refs = new_index.GetReferences(type_tag);
+    const ReferenceSet& src_refs = old_index.refs(type_tag);
+    const ReferenceSet& dst_refs = new_index.refs(type_tag);
+    const TargetPool& src_target_pool = old_index.pool(src_refs.pool_tag());
+    const TargetPool& dst_target_pool = new_index.pool(dst_refs.pool_tag());
+    offset_t ref_width = src_refs.width();
     auto dst_ref = dst_refs.begin();
 
     // For each equivalence, for each covered |dst_ref| and the matching
@@ -250,19 +256,23 @@
 
       offset_t src_loc =
           equiv.src_offset + (dst_ref->location - equiv.dst_offset);
-      auto src_ref = std::lower_bound(
-          src_refs.begin(), src_refs.end(), src_loc,
-          [](const Reference& a, offset_t b) { return a.location < b; });
+      auto src_ref =
+          std::lower_bound(src_refs.begin(), src_refs.end(), src_loc,
+                           [](const IndirectReference& a, offset_t b) {
+                             return a.location < b;
+                           });
       for (; dst_ref != dst_refs.end() &&
              dst_ref->location + ref_width <= equiv.dst_end();
            ++dst_ref, ++src_ref) {
         // Local offset of |src_ref| should match that of |dst_ref|.
         DCHECK_EQ(src_ref->location - equiv.src_offset,
                   dst_ref->location - equiv.dst_offset);
-        DCHECK(IsMarked(dst_ref->target));
-        DCHECK(IsMarked(src_ref->target));
+        offset_t src_target = src_target_pool.OffsetForKey(src_ref->target_key);
+        offset_t dst_target = dst_target_pool.OffsetForKey(dst_ref->target_key);
+        DCHECK(IsMarked(dst_target));
+        DCHECK(IsMarked(src_target));
         reference_delta_sink->PutNext(static_cast<int32_t>(
-            UnmarkIndex(dst_ref->target) - UnmarkIndex(src_ref->target)));
+            UnmarkIndex(dst_target) - UnmarkIndex(src_target)));
       }
       if (dst_ref == dst_refs.end())
         break;  // Done.
@@ -291,8 +301,8 @@
   ImageIndex new_image_index(new_image);
 
   EquivalenceMap equivalences;
-  equivalences.Build(old_sa, old_image_index, new_image_index,
-                     kMinEquivalenceSimilarity);
+  equivalences.Build(old_sa, EncodedView(old_image_index),
+                     EncodedView(new_image_index), kMinEquivalenceSimilarity);
 
   patch_writer->SetReferenceDeltaSink({});
   return GenerateEquivalencesAndExtraData(new_image, equivalences,
@@ -330,7 +340,7 @@
   std::vector<OrderedLabelManager> old_label_managers(pool_count);
   for (uint8_t pool = 0; pool < old_image_index->PoolCount(); ++pool) {
     old_label_managers[pool].InsertOffsets(
-        old_image_index->GetTargets(PoolTag(pool)));
+        old_image_index->pool(PoolTag(pool)).targets());
   }
 
   EquivalenceMap equivalences = CreateEquivalenceMap(
@@ -352,9 +362,9 @@
     // Find extra targets in |new_image_index|, emit into patch, merge them to
     // |new_labelsl_manager|, and update new references.
     OrderedLabelManager extra_label_manager;
-    for (TypeTag type : new_image_index->GetTypeTags(PoolTag(pool))) {
+    for (TypeTag type : new_image_index->pool(PoolTag(pool)).types()) {
       extra_label_manager.InsertOffsets(
-          FindExtraTargets(new_image_index->GetReferences(type), equivalences));
+          FindExtraTargets(new_image_index->refs(type), equivalences));
     }
     if (!GenerateExtraTargets(extra_label_manager.Labels(), PoolTag(pool),
                               patch_writer))
diff --git a/chrome/installer/zucchini/zucchini_gen.h b/chrome/installer/zucchini/zucchini_gen.h
index d5f1803..9e1790cb 100644
--- a/chrome/installer/zucchini/zucchini_gen.h
+++ b/chrome/installer/zucchini/zucchini_gen.h
@@ -19,6 +19,8 @@
 class ImageIndex;
 class OrderedLabelManager;
 class PatchElementWriter;
+class ReferenceDeltaSink;
+class ReferenceSet;
 
 // Creates an ImageIndex and initializes it with references from |disasm|.
 // Returns nullopt on error.
@@ -36,9 +38,8 @@
 // Extracts all unmarked targets of references in |new_references| whose
 // location is found in an equivalence of |equivalences|, and returns these
 // targets in a new vector. |new_references| must be sorted in ascending order.
-std::vector<offset_t> FindExtraTargets(
-    const std::vector<Reference>& new_references,
-    const EquivalenceMap& equivalences);
+std::vector<offset_t> FindExtraTargets(const ReferenceSet& new_references,
+                                       const EquivalenceMap& equivalences);
 
 // Creates an EquivalenceMap from "old" image to "new" image and returns the
 // result. The params |*_image_index|:
diff --git a/chrome/installer/zucchini/zucchini_gen_unittest.cc b/chrome/installer/zucchini/zucchini_gen_unittest.cc
index 02e496f..c59d038 100644
--- a/chrome/installer/zucchini/zucchini_gen_unittest.cc
+++ b/chrome/installer/zucchini/zucchini_gen_unittest.cc
@@ -67,6 +67,17 @@
   return delta_vec;
 }
 
+// Helper function wrapping FindExtraTargets().
+std::vector<offset_t> FindExtraTargetsTest(
+    std::vector<Reference>&& new_references,
+    EquivalenceMap&& equivalence_map) {
+  TargetPool new_targets;
+  new_targets.InsertTargets(new_references);
+  ReferenceSet reference_set({1, TypeTag(0), PoolTag(0)}, new_targets);
+  reference_set.InitReferences(new_references);
+  return FindExtraTargets(reference_set, equivalence_map);
+}
+
 }  // namespace
 
 TEST(ZucchiniGenTest, MakeNewTargetsFromEquivalenceMap) {
@@ -109,31 +120,33 @@
   // Note that |new_offsets| provided are sorted, and |equivalences| provided
   // are sorted by |dst_offset|.
 
-  EXPECT_EQ(OffsetVector(), FindExtraTargets({}, {}));
-  EXPECT_EQ(OffsetVector(), FindExtraTargets({{0, 0}}, {}));
-  EXPECT_EQ(OffsetVector(), FindExtraTargets({{0, IsMarked(0)}}, {}));
+  EXPECT_EQ(OffsetVector(), FindExtraTargetsTest({}, {}));
+  EXPECT_EQ(OffsetVector(), FindExtraTargetsTest({{0, 0}}, {}));
+  EXPECT_EQ(OffsetVector(), FindExtraTargetsTest({{0, IsMarked(0)}}, {}));
 
-  EXPECT_EQ(OffsetVector({0}),
-            FindExtraTargets({{0, 0}}, EquivalenceMap({{{0, 0, 2}, 0.0}})));
+  EXPECT_EQ(
+      OffsetVector({0}),
+      FindExtraTargetsTest({{10, 0}}, EquivalenceMap({{{10, 10, 2}, 0.0}})));
   EXPECT_EQ(OffsetVector(),
-            FindExtraTargets({{0, MarkIndex(0)}},
-                             EquivalenceMap({{{0, 0, 2}, 0.0}})));
+            FindExtraTargetsTest({{10, MarkIndex(0)}},
+                                 EquivalenceMap({{{10, 10, 2}, 0.0}})));
 
   EXPECT_EQ(OffsetVector({1, 2}),
-            FindExtraTargets({{0, 0}, {1, 1}, {2, 2}, {3, 3}},
-                             EquivalenceMap({{{0, 1, 2}, 0.0}})));
-  EXPECT_EQ(OffsetVector({2}),
-            FindExtraTargets({{0, 0}, {1, MarkIndex(1)}, {2, 2}, {3, 3}},
-                             EquivalenceMap({{{0, 1, 2}, 0.0}})));
+            FindExtraTargetsTest({{10, 0}, {11, 1}, {12, 2}, {13, 3}},
+                                 EquivalenceMap({{{10, 11, 2}, 0.0}})));
+  EXPECT_EQ(
+      OffsetVector({2}),
+      FindExtraTargetsTest({{10, 0}, {11, MarkIndex(1)}, {12, 2}, {13, 3}},
+                           EquivalenceMap({{{10, 11, 2}, 0.0}})));
 
-  EXPECT_EQ(
-      OffsetVector({1, 2, 4, 5}),
-      FindExtraTargets({{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}},
-                       EquivalenceMap({{{0, 1, 2}, 0.0}, {{0, 4, 2}, 0.0}})));
-  EXPECT_EQ(
-      OffsetVector({4, 5}),
-      FindExtraTargets({{3, 3}, {4, 4}, {5, 5}, {6, 6}},
-                       EquivalenceMap({{{0, 1, 2}, 0.0}, {{0, 4, 2}, 0.0}})));
+  EXPECT_EQ(OffsetVector({1, 2, 4, 5}),
+            FindExtraTargetsTest(
+                {{10, 0}, {11, 1}, {12, 2}, {13, 3}, {14, 4}, {15, 5}, {16, 6}},
+                EquivalenceMap({{{10, 11, 2}, 0.0}, {{10, 14, 2}, 0.0}})));
+  EXPECT_EQ(OffsetVector({4, 5}),
+            FindExtraTargetsTest(
+                {{13, 3}, {14, 4}, {15, 5}, {16, 6}},
+                EquivalenceMap({{{10, 11, 2}, 0.0}, {{10, 14, 2}, 0.0}})));
 }
 
 TEST(ZucchiniGenTest, GenerateReferencesDelta) {
diff --git a/chrome/test/chromedriver/window_commands.cc b/chrome/test/chromedriver/window_commands.cc
index 22a5f97a..aa45715 100644
--- a/chrome/test/chromedriver/window_commands.cc
+++ b/chrome/test/chromedriver/window_commands.cc
@@ -1211,8 +1211,9 @@
                              Timeout* timeout) {
   const char script[] =
       "var keys = [];"
-      "for (var key in %s) {"
-      "  keys.push(key);"
+      "var storage = %s;"
+      "for (var i = 0; i < storage.length; i++) {"
+      "  keys.push(storage.key(i));"
       "}"
       "keys";
   return web_view->EvaluateScript(
diff --git a/chrome/test/data/extensions/api_test/webnavigation/download/test_download.js b/chrome/test/data/extensions/api_test/webnavigation/download/test_download.js
index e71ea08..8f49ab4b 100644
--- a/chrome/test/data/extensions/api_test/webnavigation/download/test_download.js
+++ b/chrome/test/data/extensions/api_test/webnavigation/download/test_download.js
@@ -4,9 +4,16 @@
 
 onload = function() {
   var getURL = chrome.extension.getURL;
+  var URL_LOAD_REDIRECT = "http://127.0.0.1:PORT/server-redirect";
+  var URL_NOT_FOUND = "http://127.0.0.1:PORT/not-found";
   chrome.tabs.create({"url": "about:blank"}, function(tab) {
     var tabId = tab.id;
     chrome.test.getConfig(function(config) {
+      var fixPort = function(url) {
+        return url.replace(/PORT/g, config.testServer.port);
+      };
+      URL_LOAD_REDIRECT = fixPort(URL_LOAD_REDIRECT);
+      URL_NOT_FOUND = fixPort(URL_NOT_FOUND);
       chrome.test.runTests([
         // Navigates to a page that redirects (on the server side) to a.html.
         function serverRedirect() {
@@ -41,8 +48,71 @@
                          processId: 0,
                          tabId: 0,
                          timeStamp: 0,
-                         url: getURL('a.html') }}],
-          [ navigationOrder("a-") ]);
+                         url: getURL('a.html') }},
+            { label: "b-onBeforeNavigate",
+              event: "onBeforeNavigate",
+              details: { frameId: 0,
+                         parentFrameId: -1,
+                         processId: -1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_LOAD_REDIRECT }},
+            { label: "b-onCommitted",
+              event: "onCommitted",
+              details: { frameId: 0,
+                         processId: 1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         transitionQualifiers: ["server_redirect"],
+                         transitionType: "link",
+                         url: URL_NOT_FOUND }},
+            { label: "b-onDOMContentLoaded",
+              event: "onDOMContentLoaded",
+              details: { frameId: 0,
+                         processId: 1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_NOT_FOUND }},
+            { label: "b-onCompleted",
+              event: "onCompleted",
+              details: { frameId: 0,
+                         processId: 1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_NOT_FOUND }},
+            { label: "c-onBeforeNavigate",
+              event: "onBeforeNavigate",
+              details: { frameId: 0,
+                         parentFrameId: -1,
+                         processId: -1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_NOT_FOUND }},
+            { label: "c-onErrorOccurred",
+              event: "onErrorOccurred",
+              details: { error: "net::ERR_ABORTED",
+                         frameId: 0,
+                         processId: -1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_NOT_FOUND }},
+            { label: "d-onBeforeNavigate",
+              event: "onBeforeNavigate",
+              details: { frameId: 0,
+                         parentFrameId: -1,
+                         processId: -1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_NOT_FOUND }},
+            { label: "d-onErrorOccurred",
+              event: "onErrorOccurred",
+              details: { error: "net::ERR_ABORTED",
+                         frameId: 0,
+                         processId: -1,
+                         tabId: 0,
+                         timeStamp: 0,
+                         url: URL_NOT_FOUND }}],
+          [ navigationOrder("a-"), navigationOrder("b-") ]);
           chrome.tabs.update(
               tabId, { url: getURL('a.html?' + config.testServer.port) });
         },
diff --git a/chrome/test/data/extensions/platform_apps/web_view/download/expect-allow.zip b/chrome/test/data/extensions/platform_apps/web_view/download/expect-allow.zip
new file mode 100644
index 0000000..15cb0ec
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/web_view/download/expect-allow.zip
Binary files differ
diff --git a/chrome/test/data/extensions/platform_apps/web_view/download/expect-deny.zip b/chrome/test/data/extensions/platform_apps/web_view/download/expect-deny.zip
new file mode 100644
index 0000000..15cb0ec
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/web_view/download/expect-deny.zip
Binary files differ
diff --git a/chrome/test/data/extensions/platform_apps/web_view/download/expect-ignore.zip b/chrome/test/data/extensions/platform_apps/web_view/download/expect-ignore.zip
new file mode 100644
index 0000000..15cb0ec
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/web_view/download/expect-ignore.zip
Binary files differ
diff --git a/components/policy/core/browser/android/policy_converter.cc b/components/policy/core/browser/android/policy_converter.cc
index 9f886fb..9b1549c 100644
--- a/components/policy/core/browser/android/policy_converter.cc
+++ b/components/policy/core/browser/android/policy_converter.cc
@@ -12,7 +12,6 @@
 #include "base/android/jni_string.h"
 #include "base/json/json_reader.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
@@ -57,7 +56,7 @@
                                        const JavaRef<jstring>& policyKey,
                                        jboolean value) {
   SetPolicyValue(ConvertJavaStringToUTF8(env, policyKey),
-                 base::MakeUnique<base::Value>(static_cast<bool>(value)));
+                 std::make_unique<base::Value>(static_cast<bool>(value)));
 }
 
 void PolicyConverter::SetPolicyInteger(JNIEnv* env,
@@ -65,7 +64,7 @@
                                        const JavaRef<jstring>& policyKey,
                                        jint value) {
   SetPolicyValue(ConvertJavaStringToUTF8(env, policyKey),
-                 base::MakeUnique<base::Value>(static_cast<int>(value)));
+                 std::make_unique<base::Value>(static_cast<int>(value)));
 }
 
 void PolicyConverter::SetPolicyString(JNIEnv* env,
@@ -74,7 +73,7 @@
                                       const JavaRef<jstring>& value) {
   SetPolicyValue(
       ConvertJavaStringToUTF8(env, policyKey),
-      base::MakeUnique<base::Value>(ConvertJavaStringToUTF8(env, value)));
+      std::make_unique<base::Value>(ConvertJavaStringToUTF8(env, value)));
 }
 
 void PolicyConverter::SetPolicyStringArray(JNIEnv* env,
@@ -113,22 +112,22 @@
 
   switch (schema.type()) {
     case base::Value::Type::NONE:
-      return base::MakeUnique<base::Value>();
+      return std::make_unique<base::Value>();
 
     case base::Value::Type::BOOLEAN: {
       std::string string_value;
       if (value->GetAsString(&string_value)) {
         if (string_value.compare("true") == 0)
-          return base::MakeUnique<base::Value>(true);
+          return std::make_unique<base::Value>(true);
 
         if (string_value.compare("false") == 0)
-          return base::MakeUnique<base::Value>(false);
+          return std::make_unique<base::Value>(false);
 
         return value;
       }
       int int_value = 0;
       if (value->GetAsInteger(&int_value))
-        return base::MakeUnique<base::Value>(int_value != 0);
+        return std::make_unique<base::Value>(int_value != 0);
 
       return value;
     }
@@ -138,7 +137,7 @@
       if (value->GetAsString(&string_value)) {
         int int_value = 0;
         if (base::StringToInt(string_value, &int_value))
-          return base::MakeUnique<base::Value>(int_value);
+          return std::make_unique<base::Value>(int_value);
       }
       return value;
     }
@@ -148,7 +147,7 @@
       if (value->GetAsString(&string_value)) {
         double double_value = 0;
         if (base::StringToDouble(string_value, &double_value))
-          return base::MakeUnique<base::Value>(double_value);
+          return std::make_unique<base::Value>(double_value);
       }
       return value;
     }
diff --git a/components/policy/core/browser/configuration_policy_handler.cc b/components/policy/core/browser/configuration_policy_handler.cc
index 8ca7635..4b0a7771 100644
--- a/components/policy/core/browser/configuration_policy_handler.cc
+++ b/components/policy/core/browser/configuration_policy_handler.cc
@@ -13,7 +13,6 @@
 #include "base/files/file_path.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string16.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
@@ -115,7 +114,7 @@
   // Filter the list, rejecting any invalid strings.
   const base::Value::ListStorage& list = value->GetList();
   if (filtered_list)
-    *filtered_list = base::MakeUnique<base::ListValue>();
+    *filtered_list = std::make_unique<base::ListValue>();
   for (size_t list_index = 0; list_index < list.size(); ++list_index) {
     const base::Value& entry = list[list_index];
     if (entry.type() != list_entry_type_) {
diff --git a/components/policy/core/browser/configuration_policy_handler_unittest.cc b/components/policy/core/browser/configuration_policy_handler_unittest.cc
index 6d6ec2d82..4787231 100644
--- a/components/policy/core/browser/configuration_policy_handler_unittest.cc
+++ b/components/policy/core/browser/configuration_policy_handler_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/bind.h"
 #include "base/callback.h"
 #include "base/json/json_reader.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/policy/core/browser/policy_error_map.h"
 #include "components/policy/core/common/policy_map.h"
@@ -26,10 +25,10 @@
     std::vector<std::unique_ptr<StringMappingListPolicyHandler::MappingEntry>>*
         result) {
   result->push_back(
-      base::MakeUnique<StringMappingListPolicyHandler::MappingEntry>(
+      std::make_unique<StringMappingListPolicyHandler::MappingEntry>(
           "one", std::unique_ptr<base::Value>(new base::Value(1))));
   result->push_back(
-      base::MakeUnique<StringMappingListPolicyHandler::MappingEntry>(
+      std::make_unique<StringMappingListPolicyHandler::MappingEntry>(
           "two", std::unique_ptr<base::Value>(new base::Value(2))));
 }
 
@@ -186,7 +185,7 @@
   EXPECT_FALSE(errors.GetErrors(kTestPolicy).empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("no list"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("no list"),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -237,21 +236,21 @@
 
   // Check that values lying in the accepted range are not rejected.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
@@ -260,14 +259,14 @@
   // Check that values lying outside the accepted range are not rejected
   // (because clamping is enabled) but do yield a warning message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(-5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(-5),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_FALSE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(15),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(15),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
@@ -276,7 +275,7 @@
   // Check that an entirely invalid value is rejected and yields an error
   // message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("invalid"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("invalid"),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -293,21 +292,21 @@
 
   // Check that values lying in the accepted range are not rejected.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
@@ -316,14 +315,14 @@
   // Check that values lying outside the accepted range are rejected and yield
   // an error message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(-5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(-5),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_FALSE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(15),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(15),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -332,7 +331,7 @@
   // Check that an entirely invalid value is rejected and yields an error
   // message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("invalid"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("invalid"),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -351,7 +350,7 @@
 
   // Check that values lying in the accepted range are written to the pref.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -360,7 +359,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -369,7 +368,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -380,7 +379,7 @@
   // Check that values lying outside the accepted range are clamped and written
   // to the pref.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(-5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(-5),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -389,7 +388,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(15),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(15),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -410,7 +409,7 @@
 
   // Check that values lying in the accepted range are written to the pref.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -419,7 +418,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -428,7 +427,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -448,21 +447,21 @@
 
   // Check that values lying in the accepted range are not rejected.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
@@ -471,14 +470,14 @@
   // Check that values lying outside the accepted range are not rejected
   // (because clamping is enabled) but do yield a warning message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(-5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(-5),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_FALSE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(15),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(15),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
@@ -487,7 +486,7 @@
   // Check that an entirely invalid value is rejected and yields an error
   // message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("invalid"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("invalid"),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -505,21 +504,21 @@
 
   // Check that values lying in the accepted range are not rejected.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_TRUE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   errors.Clear();
   EXPECT_TRUE(handler.CheckPolicySettings(policy_map, &errors));
@@ -528,14 +527,14 @@
   // Check that values lying outside the accepted range are rejected and yield
   // an error message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(-5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(-5),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
   EXPECT_FALSE(errors.empty());
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(15),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(15),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -544,7 +543,7 @@
   // Check that an entirely invalid value is rejected and yields an error
   // message.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("invalid"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("invalid"),
                  nullptr);
   errors.Clear();
   EXPECT_FALSE(handler.CheckPolicySettings(policy_map, &errors));
@@ -564,7 +563,7 @@
 
   // Check that values lying in the accepted range are written to the pref.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -573,7 +572,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -582,7 +581,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -593,7 +592,7 @@
   // Check that values lying outside the accepted range are clamped and written
   // to the pref.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(-5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(-5),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -602,7 +601,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(15),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(15),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -624,7 +623,7 @@
 
   // Check that values lying in the accepted range are written to the pref.
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -633,7 +632,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(5),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(5),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
@@ -642,7 +641,7 @@
   EXPECT_EQ(*expected, *value);
 
   policy_map.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(10),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(10),
                  nullptr);
   prefs.Clear();
   handler.ApplyPolicySettings(policy_map, &prefs);
diff --git a/components/policy/core/browser/configuration_policy_pref_store.cc b/components/policy/core/browser/configuration_policy_pref_store.cc
index 15274f24..56e7ef0 100644
--- a/components/policy/core/browser/configuration_policy_pref_store.cc
+++ b/components/policy/core/browser/configuration_policy_pref_store.cc
@@ -10,7 +10,6 @@
 #include "base/bind.h"
 #include "base/location.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/strings/string16.h"
 #include "base/strings/utf_string_conversions.h"
@@ -83,7 +82,7 @@
 std::unique_ptr<base::DictionaryValue> ConfigurationPolicyPrefStore::GetValues()
     const {
   if (!prefs_)
-    return base::MakeUnique<base::DictionaryValue>();
+    return std::make_unique<base::DictionaryValue>();
   return prefs_->AsDictionaryValue();
 }
 
diff --git a/components/policy/core/browser/configuration_policy_pref_store_unittest.cc b/components/policy/core/browser/configuration_policy_pref_store_unittest.cc
index e3fb6cb6..1fe864bf 100644
--- a/components/policy/core/browser/configuration_policy_pref_store_unittest.cc
+++ b/components/policy/core/browser/configuration_policy_pref_store_unittest.cc
@@ -87,7 +87,7 @@
   PolicyMap policy;
   policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://chromium.org"), nullptr);
+             std::make_unique<base::Value>("http://chromium.org"), nullptr);
   UpdateProviderPolicy(policy);
   const base::Value* value = nullptr;
   EXPECT_TRUE(store_->GetValue(kTestPref, &value));
@@ -112,7 +112,7 @@
 TEST_F(ConfigurationPolicyPrefStoreBooleanTest, SetValue) {
   PolicyMap policy;
   policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false),
              nullptr);
   UpdateProviderPolicy(policy);
   const base::Value* value = nullptr;
@@ -124,7 +124,7 @@
   EXPECT_FALSE(boolean_value);
 
   policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   UpdateProviderPolicy(policy);
   value = nullptr;
   EXPECT_TRUE(store_->GetValue(kTestPref, &value));
@@ -151,7 +151,7 @@
 TEST_F(ConfigurationPolicyPrefStoreIntegerTest, SetValue) {
   PolicyMap policy;
   policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(2), nullptr);
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(2), nullptr);
   UpdateProviderPolicy(policy);
   const base::Value* value = nullptr;
   EXPECT_TRUE(store_->GetValue(kTestPref, &value));
@@ -185,7 +185,7 @@
   PolicyMap policy;
   policy.Set(kTestPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://www.chromium.org"), nullptr);
+             std::make_unique<base::Value>("http://www.chromium.org"), nullptr);
   UpdateProviderPolicy(policy);
   observer_.VerifyAndResetChangedKey(kTestPref);
   EXPECT_TRUE(store_->GetValue(kTestPref, &value));
diff --git a/components/policy/core/browser/policy_error_map.cc b/components/policy/core/browser/policy_error_map.cc
index fc178da..0dadd94 100644
--- a/components/policy/core/browser/policy_error_map.cc
+++ b/components/policy/core/browser/policy_error_map.cc
@@ -7,7 +7,6 @@
 #include <utility>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_piece.h"
 #include "base/strings/string_util.h"
@@ -142,20 +141,20 @@
 
 void PolicyErrorMap::AddError(const std::string& policy, int message_id) {
   AddError(
-      base::MakeUnique<SimplePendingError>(policy, message_id, std::string()));
+      std::make_unique<SimplePendingError>(policy, message_id, std::string()));
 }
 
 void PolicyErrorMap::AddError(const std::string& policy,
                               const std::string& subkey,
                               int message_id) {
-  AddError(base::MakeUnique<DictSubkeyPendingError>(policy, subkey, message_id,
+  AddError(std::make_unique<DictSubkeyPendingError>(policy, subkey, message_id,
                                                     std::string()));
 }
 
 void PolicyErrorMap::AddError(const std::string& policy,
                               int index,
                               int message_id) {
-  AddError(base::MakeUnique<ListItemPendingError>(policy, index, message_id,
+  AddError(std::make_unique<ListItemPendingError>(policy, index, message_id,
                                                   std::string()));
 }
 
@@ -163,14 +162,14 @@
                               int message_id,
                               const std::string& replacement) {
   AddError(
-      base::MakeUnique<SimplePendingError>(policy, message_id, replacement));
+      std::make_unique<SimplePendingError>(policy, message_id, replacement));
 }
 
 void PolicyErrorMap::AddError(const std::string& policy,
                               const std::string& subkey,
                               int message_id,
                               const std::string& replacement) {
-  AddError(base::MakeUnique<DictSubkeyPendingError>(policy, subkey, message_id,
+  AddError(std::make_unique<DictSubkeyPendingError>(policy, subkey, message_id,
                                                     replacement));
 }
 
@@ -178,14 +177,14 @@
                               int index,
                               int message_id,
                               const std::string& replacement) {
-  AddError(base::MakeUnique<ListItemPendingError>(policy, index, message_id,
+  AddError(std::make_unique<ListItemPendingError>(policy, index, message_id,
                                                   replacement));
 }
 
 void PolicyErrorMap::AddError(const std::string& policy,
                               const std::string& error_path,
                               const std::string& message) {
-  AddError(base::MakeUnique<SchemaValidatingPendingError>(policy, error_path,
+  AddError(std::make_unique<SchemaValidatingPendingError>(policy, error_path,
                                                           message));
 }
 
diff --git a/components/policy/core/browser/proxy_policy_handler_unittest.cc b/components/policy/core/browser/proxy_policy_handler_unittest.cc
index 96c65870..c77184d 100644
--- a/components/policy/core/browser/proxy_policy_handler_unittest.cc
+++ b/components/policy/core/browser/proxy_policy_handler_unittest.cc
@@ -78,15 +78,15 @@
   PolicyMap policy;
   policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://chromium.org/override"),
+             std::make_unique<base::Value>("http://chromium.org/override"),
              nullptr);
   policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("chromium.org"),
              nullptr);
   policy.Set(
       key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(
+      std::make_unique<base::Value>(
           ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
       nullptr);
   UpdateProviderPolicy(policy);
@@ -102,15 +102,15 @@
   policy.Set(
       key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(
+      std::make_unique<base::Value>(
           ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
       nullptr);
   policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://chromium.org/override"),
+             std::make_unique<base::Value>("http://chromium.org/override"),
              nullptr);
   policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("chromium.org"),
              nullptr);
   UpdateProviderPolicy(policy);
 
@@ -125,7 +125,7 @@
   policy.Set(
       key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(
+      std::make_unique<base::Value>(
           ProxyPolicyHandler::PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE),
       nullptr);
   UpdateProviderPolicy(policy);
@@ -139,7 +139,7 @@
   policy.Set(
       key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(ProxyPolicyHandler::PROXY_SERVER_MODE),
+      std::make_unique<base::Value>(ProxyPolicyHandler::PROXY_SERVER_MODE),
       nullptr);
   UpdateProviderPolicy(policy);
   VerifyProxyPrefs(
@@ -150,7 +150,7 @@
   PolicyMap policy;
   policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>(ProxyPrefs::kDirectProxyModeName),
+             std::make_unique<base::Value>(ProxyPrefs::kDirectProxyModeName),
              nullptr);
   UpdateProviderPolicy(policy);
   VerifyProxyPrefs(
@@ -161,7 +161,7 @@
   PolicyMap policy;
   policy.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>(
+             std::make_unique<base::Value>(
                  ProxyPolicyHandler::PROXY_AUTO_DETECT_PROXY_SERVER_MODE),
              nullptr);
   UpdateProviderPolicy(policy);
@@ -176,7 +176,7 @@
   policy.Set(
       key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(ProxyPrefs::kAutoDetectProxyModeName),
+      std::make_unique<base::Value>(ProxyPrefs::kAutoDetectProxyModeName),
       nullptr);
   UpdateProviderPolicy(policy);
   VerifyProxyPrefs(std::string(),
@@ -189,11 +189,11 @@
   PolicyMap policy;
   policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://short.org/proxy.pac"),
+             std::make_unique<base::Value>("http://short.org/proxy.pac"),
              nullptr);
   policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>(ProxyPrefs::kPacScriptProxyModeName),
+             std::make_unique<base::Value>(ProxyPrefs::kPacScriptProxyModeName),
              nullptr);
   UpdateProviderPolicy(policy);
   VerifyProxyPrefs(std::string(),
@@ -206,7 +206,7 @@
   PolicyMap policy;
   policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>(ProxyPrefs::kPacScriptProxyModeName),
+             std::make_unique<base::Value>(ProxyPrefs::kPacScriptProxyModeName),
              nullptr);
   UpdateProviderPolicy(policy);
   const base::Value* value = nullptr;
@@ -240,7 +240,7 @@
   PolicyMap policy;
   policy.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>(
+             std::make_unique<base::Value>(
                  ProxyPolicyHandler::PROXY_USE_SYSTEM_PROXY_SERVER_MODE),
              nullptr);
   UpdateProviderPolicy(policy);
@@ -252,7 +252,7 @@
   PolicyMap policy;
   policy.Set(key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>(ProxyPrefs::kSystemProxyModeName),
+             std::make_unique<base::Value>(ProxyPrefs::kSystemProxyModeName),
              nullptr);
   UpdateProviderPolicy(policy);
   VerifyProxyPrefs(
@@ -265,12 +265,12 @@
   policy.Set(
       key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(ProxyPolicyHandler::PROXY_SERVER_MODE),
+      std::make_unique<base::Value>(ProxyPolicyHandler::PROXY_SERVER_MODE),
       nullptr);
   policy.Set(
       key::kProxyMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
       POLICY_SOURCE_CLOUD,
-      base::MakeUnique<base::Value>(ProxyPrefs::kAutoDetectProxyModeName),
+      std::make_unique<base::Value>(ProxyPrefs::kAutoDetectProxyModeName),
       nullptr);
   UpdateProviderPolicy(policy);
   VerifyProxyPrefs(std::string(),
@@ -284,18 +284,18 @@
   PolicyMap policy;
   policy.Set(key::kProxyPacUrl, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://short.org/proxy.pac"),
+             std::make_unique<base::Value>("http://short.org/proxy.pac"),
              nullptr);
   policy.Set(key::kProxyBypassList, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD,
-             base::MakeUnique<base::Value>("http://chromium.org/override"),
+             std::make_unique<base::Value>("http://chromium.org/override"),
              nullptr);
   policy.Set(key::kProxyServer, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("chromium.org"),
              nullptr);
   for (int i = 0; i < ProxyPolicyHandler::MODE_COUNT; ++i) {
     policy.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(i), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(i), nullptr);
     UpdateProviderPolicy(policy);
     const base::Value* value = nullptr;
     EXPECT_FALSE(store_->GetValue(proxy_config::prefs::kProxy, &value));
diff --git a/components/policy/core/browser/url_blacklist_manager_unittest.cc b/components/policy/core/browser/url_blacklist_manager_unittest.cc
index c1cfbb33..a15f9c8 100644
--- a/components/policy/core/browser/url_blacklist_manager_unittest.cc
+++ b/components/policy/core/browser/url_blacklist_manager_unittest.cc
@@ -212,10 +212,10 @@
 }
 
 TEST_F(URLBlacklistManagerTest, LoadBlacklistOnCreate) {
-  auto list = base::MakeUnique<base::ListValue>();
+  auto list = std::make_unique<base::ListValue>();
   list->AppendString("example.com");
   pref_service_.SetManagedPref(policy_prefs::kUrlBlacklist, std::move(list));
-  auto manager = base::MakeUnique<URLBlacklistManager>(
+  auto manager = std::make_unique<URLBlacklistManager>(
       &pref_service_, URLBlacklistManager::OverrideBlacklistCallback());
   scoped_task_environment_.RunUntilIdle();
   EXPECT_EQ(URLBlacklist::URL_IN_BLACKLIST,
@@ -223,10 +223,10 @@
 }
 
 TEST_F(URLBlacklistManagerTest, LoadWhitelistOnCreate) {
-  auto list = base::MakeUnique<base::ListValue>();
+  auto list = std::make_unique<base::ListValue>();
   list->AppendString("example.com");
   pref_service_.SetManagedPref(policy_prefs::kUrlWhitelist, std::move(list));
-  auto manager = base::MakeUnique<URLBlacklistManager>(
+  auto manager = std::make_unique<URLBlacklistManager>(
       &pref_service_, URLBlacklistManager::OverrideBlacklistCallback());
   scoped_task_environment_.RunUntilIdle();
   EXPECT_EQ(URLBlacklist::URL_IN_WHITELIST,
@@ -234,9 +234,9 @@
 }
 
 TEST_F(URLBlacklistManagerTest, SingleUpdateForTwoPrefChanges) {
-  auto blacklist = base::MakeUnique<base::ListValue>();
+  auto blacklist = std::make_unique<base::ListValue>();
   blacklist->AppendString("*.google.com");
-  auto whitelist = base::MakeUnique<base::ListValue>();
+  auto whitelist = std::make_unique<base::ListValue>();
   whitelist->AppendString("mail.google.com");
   pref_service_.SetManagedPref(policy_prefs::kUrlBlacklist,
                                std::move(blacklist));
diff --git a/components/policy/core/browser/url_blacklist_policy_handler_unittest.cc b/components/policy/core/browser/url_blacklist_policy_handler_unittest.cc
index 964dc20..a2764fa 100644
--- a/components/policy/core/browser/url_blacklist_policy_handler_unittest.cc
+++ b/components/policy/core/browser/url_blacklist_policy_handler_unittest.cc
@@ -69,7 +69,7 @@
        CheckPolicySettings_DisabledSchemesWrongType) {
   // The policy expects a list. Give it a boolean.
   EXPECT_TRUE(
-      CheckPolicy(key::kDisabledSchemes, base::MakeUnique<base::Value>(false)));
+      CheckPolicy(key::kDisabledSchemes, std::make_unique<base::Value>(false)));
   EXPECT_EQ(1U, errors_.size());
   const std::string expected = key::kDisabledSchemes;
   const std::string actual = errors_.begin()->first;
@@ -80,7 +80,7 @@
        CheckPolicySettings_URLBlacklistWrongType) {
   // The policy expects a list. Give it a boolean.
   EXPECT_TRUE(
-      CheckPolicy(key::kURLBlacklist, base::MakeUnique<base::Value>(false)));
+      CheckPolicy(key::kURLBlacklist, std::make_unique<base::Value>(false)));
   EXPECT_EQ(1U, errors_.size());
   const std::string expected = key::kURLBlacklist;
   const std::string actual = errors_.begin()->first;
@@ -95,7 +95,7 @@
 TEST_F(URLBlacklistPolicyHandlerTest,
        ApplyPolicySettings_DisabledSchemesWrongType) {
   // The policy expects a list. Give it a boolean.
-  SetPolicy(key::kDisabledSchemes, base::MakeUnique<base::Value>(false));
+  SetPolicy(key::kDisabledSchemes, std::make_unique<base::Value>(false));
   ApplyPolicies();
   EXPECT_FALSE(prefs_.GetValue(policy_prefs::kUrlBlacklist, nullptr));
 }
@@ -103,7 +103,7 @@
 TEST_F(URLBlacklistPolicyHandlerTest,
        ApplyPolicySettings_URLBlacklistWrongType) {
   // The policy expects a list. Give it a boolean.
-  SetPolicy(key::kURLBlacklist, base::MakeUnique<base::Value>(false));
+  SetPolicy(key::kURLBlacklist, std::make_unique<base::Value>(false));
   ApplyPolicies();
   EXPECT_FALSE(prefs_.GetValue(policy_prefs::kUrlBlacklist, nullptr));
 }
diff --git a/components/policy/core/common/async_policy_provider_unittest.cc b/components/policy/core/common/async_policy_provider_unittest.cc
index 5365465..61286c6 100644
--- a/components/policy/core/common/async_policy_provider_unittest.cc
+++ b/components/policy/core/common/async_policy_provider_unittest.cc
@@ -6,7 +6,6 @@
 
 #include "base/callback.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
@@ -34,7 +33,7 @@
                const std::string& value) {
   bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set(name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>(value),
+           POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(value),
            nullptr);
 }
 
diff --git a/components/policy/core/common/cloud/cloud_policy_client.cc b/components/policy/core/common/cloud/cloud_policy_client.cc
index 46674d8..e4917473 100644
--- a/components/policy/core/common/cloud/cloud_policy_client.cc
+++ b/components/policy/core/common/cloud/cloud_policy_client.cc
@@ -10,7 +10,6 @@
 #include "base/bind_helpers.h"
 #include "base/guid.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/stl_util.h"
 #include "components/policy/core/common/cloud/device_management_service.h"
 #include "components/policy/core/common/cloud/signing_service.h"
@@ -676,7 +675,7 @@
             << type << ", entity: " << entity_id << ", ignoring";
         continue;
       }
-      responses_[key] = base::MakeUnique<em::PolicyFetchResponse>(response);
+      responses_[key] = std::make_unique<em::PolicyFetchResponse>(response);
     }
     state_keys_to_upload_.clear();
     NotifyPolicyFetched();
diff --git a/components/policy/core/common/cloud/cloud_policy_client_unittest.cc b/components/policy/core/common/cloud/cloud_policy_client_unittest.cc
index 2105a5c..ff6c109 100644
--- a/components/policy/core/common/cloud/cloud_policy_client_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_client_unittest.cc
@@ -15,7 +15,6 @@
 #include "base/bind_helpers.h"
 #include "base/compiler_specific.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/message_loop/message_loop.h"
 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
@@ -226,7 +225,7 @@
 
     request_context_ =
         new net::TestURLRequestContextGetter(loop_.task_runner());
-    client_ = base::MakeUnique<CloudPolicyClient>(kMachineID, kMachineModel,
+    client_ = std::make_unique<CloudPolicyClient>(kMachineID, kMachineModel,
                                                   &service_, request_context_,
                                                   &fake_signing_service_);
     client_->AddPolicyTypeToFetch(policy_type_, std::string());
@@ -998,7 +997,7 @@
   const std::vector<em::RemoteCommandResult> command_results(
       1, remote_command_request_.remote_command_request().command_results(0));
   client_->FetchRemoteCommands(
-      base::MakeUnique<RemoteCommandJob::UniqueIDType>(kLastCommandId),
+      std::make_unique<RemoteCommandJob::UniqueIDType>(kLastCommandId),
       command_results, callback);
 
   EXPECT_EQ(DM_STATUS_SUCCESS, client_->status());
diff --git a/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
index dcfb565..fd8a2040 100644
--- a/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
@@ -9,7 +9,6 @@
 #include "base/callback.h"
 #include "base/compiler_specific.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/test/scoped_task_environment.h"
 #include "components/policy/core/common/cloud/cloud_policy_constants.h"
@@ -92,21 +91,21 @@
                                       const std::string& policy_value) {
   store_.policy_map_.Set(policy_name, policy_level(), policy_scope(),
                          POLICY_SOURCE_CLOUD,
-                         base::MakeUnique<base::Value>(policy_value), nullptr);
+                         std::make_unique<base::Value>(policy_value), nullptr);
 }
 
 void TestHarness::InstallIntegerPolicy(const std::string& policy_name,
                                        int policy_value) {
   store_.policy_map_.Set(policy_name, policy_level(), policy_scope(),
                          POLICY_SOURCE_CLOUD,
-                         base::MakeUnique<base::Value>(policy_value), nullptr);
+                         std::make_unique<base::Value>(policy_value), nullptr);
 }
 
 void TestHarness::InstallBooleanPolicy(const std::string& policy_name,
                                        bool policy_value) {
   store_.policy_map_.Set(policy_name, policy_level(), policy_scope(),
                          POLICY_SOURCE_CLOUD,
-                         base::MakeUnique<base::Value>(policy_value), nullptr);
+                         std::make_unique<base::Value>(policy_value), nullptr);
 }
 
 void TestHarness::InstallStringListPolicy(const std::string& policy_name,
@@ -175,7 +174,7 @@
   void SetUp() override {
     // Set up a policy map for testing.
     policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                    POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"),
+                    POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"),
                     nullptr);
     expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
         .CopyFrom(policy_map_);
diff --git a/components/policy/core/common/cloud/cloud_policy_validator.h b/components/policy/core/common/cloud/cloud_policy_validator.h
index a245e6f5..360d98b 100644
--- a/components/policy/core/common/cloud/cloud_policy_validator.h
+++ b/components/policy/core/common/cloud/cloud_policy_validator.h
@@ -352,7 +352,7 @@
           policy_response,
       scoped_refptr<base::SequencedTaskRunner> background_task_runner) {
     return base::WrapUnique<CloudPolicyValidator>(new CloudPolicyValidator(
-        std::move(policy_response), base::MakeUnique<PayloadProto>(),
+        std::move(policy_response), std::make_unique<PayloadProto>(),
         background_task_runner));
   }
 
diff --git a/components/policy/core/common/cloud/component_cloud_policy_service.cc b/components/policy/core/common/cloud/component_cloud_policy_service.cc
index ce3a5a43..3f2fd3a 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_service.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_service.cc
@@ -15,7 +15,6 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
@@ -199,7 +198,7 @@
   updater_.reset(new ComponentCloudPolicyUpdater(
       task_runner_, std::move(external_policy_data_fetcher_), &store_));
 
-  std::unique_ptr<PolicyBundle> bundle(base::MakeUnique<PolicyBundle>());
+  std::unique_ptr<PolicyBundle> bundle(std::make_unique<PolicyBundle>());
   bundle->CopyFrom(store_.policy());
   service_task_runner_->PostTask(
       FROM_HERE, base::Bind(&ComponentCloudPolicyService::SetPolicy, service_,
@@ -230,7 +229,7 @@
   }
   DVLOG(2) << "Installing updated policy from the component policy store";
 
-  std::unique_ptr<PolicyBundle> bundle(base::MakeUnique<PolicyBundle>());
+  std::unique_ptr<PolicyBundle> bundle(std::make_unique<PolicyBundle>());
   bundle->CopyFrom(store_.policy());
   service_task_runner_->PostTask(
       FROM_HERE, base::Bind(&ComponentCloudPolicyService::SetPolicy, service_,
@@ -261,7 +260,7 @@
   for (auto it = last_fetched_policy_->begin();
        it != last_fetched_policy_->end(); ++it) {
     updater_->UpdateExternalPolicy(
-        it->first, base::MakeUnique<em::PolicyFetchResponse>(*it->second));
+        it->first, std::make_unique<em::PolicyFetchResponse>(*it->second));
   }
 }
 
@@ -451,7 +450,7 @@
   DVLOG(2) << "Obtaining fetched policies from the policy client";
 
   std::unique_ptr<ScopedResponseMap> valid_responses =
-      base::MakeUnique<ScopedResponseMap>();
+      std::make_unique<ScopedResponseMap>();
   for (const auto& response : core_->client()->responses()) {
     PolicyNamespace ns;
     if (!ToPolicyNamespace(response.first, &ns)) {
@@ -459,7 +458,7 @@
       continue;
     }
     (*valid_responses)[ns] =
-        base::MakeUnique<em::PolicyFetchResponse>(*response.second);
+        std::make_unique<em::PolicyFetchResponse>(*response.second);
   }
 
   backend_task_runner_->PostTask(
diff --git a/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
index 78b3a59..ec913542 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_service_unittest.cc
@@ -12,7 +12,6 @@
 
 #include "base/callback.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
@@ -131,10 +130,10 @@
 
     expected_policy_.Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                          POLICY_SOURCE_CLOUD,
-                         base::MakeUnique<base::Value>("disabled"), nullptr);
+                         std::make_unique<base::Value>("disabled"), nullptr);
     expected_policy_.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
                          POLICY_SOURCE_CLOUD,
-                         base::MakeUnique<base::Value>("maybe"), nullptr);
+                         std::make_unique<base::Value>("maybe"), nullptr);
   }
 
   void SetUp() override {
@@ -212,7 +211,7 @@
 
   std::unique_ptr<em::PolicyFetchResponse> CreateResponse() {
     builder_.Build();
-    return base::MakeUnique<em::PolicyFetchResponse>(builder_.policy());
+    return std::make_unique<em::PolicyFetchResponse>(builder_.policy());
   }
 
   std::string CreateSerializedResponse() {
@@ -597,7 +596,7 @@
   PolicyBundle expected_bundle;
   expected_bundle.Get(kTestExtensionNS)
       .Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("published"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("published"),
            nullptr);
   EXPECT_TRUE(service_->policy().Equals(expected_bundle));
 }
diff --git a/components/policy/core/common/cloud/component_cloud_policy_store.cc b/components/policy/core/common/cloud/component_cloud_policy_store.cc
index 2ad7917b..ab2c2f2d 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_store.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store.cc
@@ -13,7 +13,6 @@
 #include "base/json/json_reader.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/string_util.h"
 #include "base/values.h"
@@ -150,7 +149,7 @@
       const PolicyNamespace ns(constants.domain, id);
 
       // Validate the protobuf.
-      auto proto = base::MakeUnique<em::PolicyFetchResponse>();
+      auto proto = std::make_unique<em::PolicyFetchResponse>();
       if (!proto->ParseFromString(it->second)) {
         LOG(ERROR) << "Failed to parse the cached policy fetch response.";
         Delete(ns);
diff --git a/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
index 1e750a8..392af1a5 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_store_unittest.cc
@@ -13,7 +13,6 @@
 #include "base/bind.h"
 #include "base/callback.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/time/time.h"
@@ -88,10 +87,10 @@
 
     PolicyMap& policy = expected_bundle_.Get(kTestPolicyNS);
     policy.Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("disabled"),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("disabled"),
                nullptr);
     policy.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("maybe"),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("maybe"),
                nullptr);
   }
 
@@ -110,12 +109,12 @@
 
   std::unique_ptr<em::PolicyFetchResponse> CreateResponse() {
     builder_.Build();
-    return base::MakeUnique<em::PolicyFetchResponse>(builder_.policy());
+    return std::make_unique<em::PolicyFetchResponse>(builder_.policy());
   }
 
   std::unique_ptr<em::PolicyData> CreatePolicyData() {
     builder_.Build();
-    return base::MakeUnique<em::PolicyData>(builder_.policy_data());
+    return std::make_unique<em::PolicyData>(builder_.policy_data());
   }
 
   std::string CreateSerializedResponse() {
diff --git a/components/policy/core/common/cloud/component_cloud_policy_updater.cc b/components/policy/core/common/cloud/component_cloud_policy_updater.cc
index 15eb63f1..8b0ee06 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_updater.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_updater.cc
@@ -14,7 +14,6 @@
 #include "base/bind.h"
 #include "base/bind_helpers.h"
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/string_number_conversions.h"
 #include "components/policy/core/common/cloud/component_cloud_policy_store.h"
@@ -75,7 +74,7 @@
   }
 
   // Validate the policy before doing anything else.
-  auto policy_data = base::MakeUnique<em::PolicyData>();
+  auto policy_data = std::make_unique<em::PolicyData>();
   em::ExternalPolicyData data;
   if (!store_->ValidatePolicy(ns, std::move(response), policy_data.get(),
                               &data)) {
diff --git a/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc b/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc
index a1b01ce..9e7b578 100644
--- a/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc
+++ b/components/policy/core/common/cloud/component_cloud_policy_updater_unittest.cc
@@ -11,7 +11,6 @@
 #include "base/callback.h"
 #include "base/compiler_specific.h"
 #include "base/files/scoped_temp_dir.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/test/test_mock_time_task_runner.h"
 #include "base/time/time.h"
@@ -108,10 +107,10 @@
 
   PolicyMap& policy = expected_bundle_.Get(kTestPolicyNS);
   policy.Set("Name", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("disabled"),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("disabled"),
              nullptr);
   policy.Set("Second", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("maybe"),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("maybe"),
              nullptr);
 }
 
@@ -144,7 +143,7 @@
 std::unique_ptr<em::PolicyFetchResponse>
 ComponentCloudPolicyUpdaterTest::CreateResponse() {
   builder_.Build();
-  return base::MakeUnique<em::PolicyFetchResponse>(builder_.policy());
+  return std::make_unique<em::PolicyFetchResponse>(builder_.policy());
 }
 
 TEST_F(ComponentCloudPolicyUpdaterTest, FetchAndCache) {
diff --git a/components/policy/core/common/cloud/external_policy_data_fetcher.cc b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
index fb2d91f..d0a1e7bf 100644
--- a/components/policy/core/common/cloud/external_policy_data_fetcher.cc
+++ b/components/policy/core/common/cloud/external_policy_data_fetcher.cc
@@ -11,7 +11,6 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/stl_util.h"
 #include "components/data_use_measurement/core/data_use_user_data.h"
@@ -171,7 +170,7 @@
 std::unique_ptr<ExternalPolicyDataFetcher>
 ExternalPolicyDataFetcherBackend::CreateFrontend(
     scoped_refptr<base::SequencedTaskRunner> task_runner) {
-  return base::MakeUnique<ExternalPolicyDataFetcher>(
+  return std::make_unique<ExternalPolicyDataFetcher>(
       task_runner, io_task_runner_, weak_factory_.GetWeakPtr());
 }
 
diff --git a/components/policy/core/common/cloud/mock_cloud_external_data_manager.cc b/components/policy/core/common/cloud/mock_cloud_external_data_manager.cc
index 8b6b774..09a27928 100644
--- a/components/policy/core/common/cloud/mock_cloud_external_data_manager.cc
+++ b/components/policy/core/common/cloud/mock_cloud_external_data_manager.cc
@@ -5,7 +5,6 @@
 #include "components/policy/core/common/cloud/mock_cloud_external_data_manager.h"
 
 #include "base/callback.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/weak_ptr.h"
 #include "components/policy/core/common/external_data_fetcher.h"
 #include "net/url_request/url_request_context_getter.h"
@@ -21,7 +20,7 @@
 std::unique_ptr<ExternalDataFetcher>
 MockCloudExternalDataManager::CreateExternalDataFetcher(
     const std::string& policy) {
-  return base::MakeUnique<ExternalDataFetcher>(weak_factory_.GetWeakPtr(),
+  return std::make_unique<ExternalDataFetcher>(weak_factory_.GetWeakPtr(),
                                                policy);
 }
 
diff --git a/components/policy/core/common/cloud/mock_cloud_policy_client.cc b/components/policy/core/common/cloud/mock_cloud_policy_client.cc
index e58c1915..11682a4 100644
--- a/components/policy/core/common/cloud/mock_cloud_policy_client.cc
+++ b/components/policy/core/common/cloud/mock_cloud_policy_client.cc
@@ -2,9 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include <memory>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
 #include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
 #include "components/policy/proto/device_management_backend.pb.h"
 #include "net/url_request/url_request_context_getter.h"
@@ -30,7 +30,7 @@
                                       const std::string& settings_entity_id,
                                       const em::PolicyFetchResponse& policy) {
   responses_[std::make_pair(policy_type, settings_entity_id)] =
-      base::MakeUnique<enterprise_management::PolicyFetchResponse>(policy);
+      std::make_unique<enterprise_management::PolicyFetchResponse>(policy);
 }
 
 void MockCloudPolicyClient::SetFetchedInvalidationVersion(
diff --git a/components/policy/core/common/cloud/policy_builder.cc b/components/policy/core/common/cloud/policy_builder.cc
index 8237baee..eb96d61d 100644
--- a/components/policy/core/common/cloud/policy_builder.cc
+++ b/components/policy/core/common/cloud/policy_builder.cc
@@ -281,7 +281,7 @@
 }
 
 std::unique_ptr<em::PolicyFetchResponse> PolicyBuilder::GetCopy() const {
-  return base::MakeUnique<em::PolicyFetchResponse>(policy_);
+  return std::make_unique<em::PolicyFetchResponse>(policy_);
 }
 
 // static
diff --git a/components/policy/core/common/cloud/policy_builder.h b/components/policy/core/common/cloud/policy_builder.h
index 3b5f09a..7612dcd6 100644
--- a/components/policy/core/common/cloud/policy_builder.h
+++ b/components/policy/core/common/cloud/policy_builder.h
@@ -14,7 +14,6 @@
 #include "base/compiler_specific.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "build/build_config.h"
 #include "components/policy/proto/cloud_policy.pb.h"
 #include "components/policy/proto/device_management_backend.pb.h"
@@ -57,7 +56,7 @@
   }
   void clear_policy_data() { policy_data_.reset(); }
   void CreatePolicyData() {
-    policy_data_ = base::MakeUnique<enterprise_management::PolicyData>();
+    policy_data_ = std::make_unique<enterprise_management::PolicyData>();
   }
 
   // Returns a reference to the policy protobuf being built. Note that the
@@ -155,7 +154,7 @@
   PayloadProto& payload() { return *payload_; }
   const PayloadProto& payload() const { return *payload_; }
   void clear_payload() { payload_.reset(); }
-  void CreatePayload() { payload_ = base::MakeUnique<PayloadProto>(); }
+  void CreatePayload() { payload_ = std::make_unique<PayloadProto>(); }
 
   // PolicyBuilder:
   void Build() override {
diff --git a/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc b/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
index 6ca4c9c8..8b1d297 100644
--- a/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
+++ b/components/policy/core/common/cloud/policy_header_io_helper_unittest.cc
@@ -6,7 +6,6 @@
 
 #include <memory>
 
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/test/test_simple_task_runner.h"
 #include "net/http/http_request_headers.h"
@@ -30,7 +29,7 @@
   ~PolicyHeaderIOHelperTest() override {}
 
   void SetUp() override {
-    helper_ = base::MakeUnique<PolicyHeaderIOHelper>(
+    helper_ = std::make_unique<PolicyHeaderIOHelper>(
         kDMServerURL, kInitialPolicyHeader, task_runner_);
     task_runner_->RunUntilIdle();
   }
diff --git a/components/policy/core/common/cloud/policy_header_service.cc b/components/policy/core/common/cloud/policy_header_service.cc
index 638d303..2bc90bb3 100644
--- a/components/policy/core/common/cloud/policy_header_service.cc
+++ b/components/policy/core/common/cloud/policy_header_service.cc
@@ -6,7 +6,6 @@
 
 #include "base/base64.h"
 #include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/values.h"
 #include "components/policy/core/common/cloud/cloud_policy_store.h"
@@ -39,7 +38,7 @@
     scoped_refptr<base::SequencedTaskRunner> task_runner) {
   std::string initial_header_value = CreateHeaderValue();
   std::unique_ptr<PolicyHeaderIOHelper> helper =
-      base::MakeUnique<PolicyHeaderIOHelper>(server_url_, initial_header_value,
+      std::make_unique<PolicyHeaderIOHelper>(server_url_, initial_header_value,
                                              task_runner);
   helpers_.push_back(helper.get());
   return helper;
diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager.cc b/components/policy/core/common/cloud/user_cloud_policy_manager.cc
index 0c643c0..4ccb7ee 100644
--- a/components/policy/core/common/cloud/user_cloud_policy_manager.cc
+++ b/components/policy/core/common/cloud/user_cloud_policy_manager.cc
@@ -8,7 +8,6 @@
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "components/crash/core/common/crash_key.h"
 #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
@@ -83,7 +82,7 @@
 UserCloudPolicyManager::CreateCloudPolicyClient(
     DeviceManagementService* device_management_service,
     scoped_refptr<net::URLRequestContextGetter> request_context) {
-  return base::MakeUnique<CloudPolicyClient>(
+  return std::make_unique<CloudPolicyClient>(
       std::string() /* machine_id */, std::string() /* machine_model */,
       device_management_service, request_context,
       nullptr /* signing_service */);
@@ -121,7 +120,7 @@
       !policy_map->Get(key::kNTPContentSuggestionsEnabled)) {
     policy_map->Set(key::kNTPContentSuggestionsEnabled, POLICY_LEVEL_MANDATORY,
                     POLICY_SCOPE_USER, POLICY_SOURCE_ENTERPRISE_DEFAULT,
-                    base::MakeUnique<base::Value>(false),
+                    std::make_unique<base::Value>(false),
                     nullptr /* external_data_fetcher */);
   }
 }
diff --git a/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc b/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc
index 747b358..b452c39 100644
--- a/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc
+++ b/components/policy/core/common/cloud/user_cloud_policy_manager_unittest.cc
@@ -6,7 +6,6 @@
 
 #include "base/callback.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/test/scoped_task_environment.h"
 #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
@@ -36,7 +35,7 @@
   void SetUp() override {
     // Set up a policy map for testing.
     policy_map_.Set("key", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                    POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"),
+                    POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"),
                     nullptr);
     expected_bundle_.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
         .CopyFrom(policy_map_);
diff --git a/components/policy/core/common/config_dir_policy_loader_unittest.cc b/components/policy/core/common/config_dir_policy_loader_unittest.cc
index 569fe2d2..b17add7 100644
--- a/components/policy/core/common/config_dir_policy_loader_unittest.cc
+++ b/components/policy/core/common/config_dir_policy_loader_unittest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "components/policy/core/common/config_dir_policy_loader.h"
+#include <memory>
 
 #include <utility>
 
@@ -11,7 +12,6 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/json/json_string_value_serializer.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/string_number_conversions.h"
@@ -122,7 +122,7 @@
 void TestHarness::InstallStringListPolicy(const std::string& policy_name,
                                           const base::ListValue* policy_value) {
   base::DictionaryValue dict;
-  dict.Set(policy_name, base::MakeUnique<base::Value>(policy_value->Clone()));
+  dict.Set(policy_name, std::make_unique<base::Value>(policy_value->Clone()));
   WriteConfigFile(dict, NextConfigFileName());
 }
 
@@ -130,7 +130,7 @@
     const std::string& policy_name,
     const base::DictionaryValue* policy_value) {
   base::DictionaryValue dict;
-  dict.Set(policy_name, base::MakeUnique<base::Value>(policy_value->Clone()));
+  dict.Set(policy_name, std::make_unique<base::Value>(policy_value->Clone()));
   WriteConfigFile(dict, NextConfigFileName());
 }
 
diff --git a/components/policy/core/common/configuration_policy_provider_test.cc b/components/policy/core/common/configuration_policy_provider_test.cc
index 554825af..4f9beea 100644
--- a/components/policy/core/common/configuration_policy_provider_test.cc
+++ b/components/policy/core/common/configuration_policy_provider_test.cc
@@ -8,7 +8,6 @@
 
 #include "base/bind.h"
 #include "base/callback.h"
-#include "base/memory/ptr_util.h"
 #include "base/task_scheduler/post_task.h"
 #include "base/task_scheduler/task_traits.h"
 #include "base/values.h"
@@ -298,19 +297,19 @@
   expected_value.SetInteger("int", 123);
   expected_value.SetString("string", "omg");
 
-  auto list = base::MakeUnique<base::ListValue>();
+  auto list = std::make_unique<base::ListValue>();
   list->AppendString("first");
   list->AppendString("second");
   expected_value.Set("array", std::move(list));
 
-  auto dict = base::MakeUnique<base::DictionaryValue>();
+  auto dict = std::make_unique<base::DictionaryValue>();
   dict->SetString("sub", "value");
-  list = base::MakeUnique<base::ListValue>();
-  auto sub = base::MakeUnique<base::DictionaryValue>();
+  list = std::make_unique<base::ListValue>();
+  auto sub = std::make_unique<base::DictionaryValue>();
   sub->SetInteger("aaa", 111);
   sub->SetInteger("bbb", 222);
   list->Append(std::move(sub));
-  sub = base::MakeUnique<base::DictionaryValue>();
+  sub = std::make_unique<base::DictionaryValue>();
   sub->SetString("ccc", "333");
   sub->SetString("ddd", "444");
   list->Append(std::move(sub));
@@ -349,7 +348,7 @@
   bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set(test_keys::kKeyString, test_harness_->policy_level(),
            test_harness_->policy_scope(), test_harness_->policy_source(),
-           base::MakeUnique<base::Value>("value"), nullptr);
+           std::make_unique<base::Value>("value"), nullptr);
   EXPECT_TRUE(provider_->policies().Equals(bundle));
   provider_->RemoveObserver(&observer);
 }
@@ -367,9 +366,9 @@
   policy_dict.SetInteger("int", 789);
   policy_dict.SetString("string", "string value");
 
-  auto list = base::MakeUnique<base::ListValue>();
+  auto list = std::make_unique<base::ListValue>();
   for (int i = 0; i < 2; ++i) {
-    auto dict = base::MakeUnique<base::DictionaryValue>();
+    auto dict = std::make_unique<base::DictionaryValue>();
     dict->SetInteger("subdictindex", i);
     dict->SetKey("subdict", policy_dict.Clone());
     list->Append(std::move(dict));
diff --git a/components/policy/core/common/generate_policy_source_unittest.cc b/components/policy/core/common/generate_policy_source_unittest.cc
index 1e9fa94..78d5cad 100644
--- a/components/policy/core/common/generate_policy_source_unittest.cc
+++ b/components/policy/core/common/generate_policy_source_unittest.cc
@@ -6,7 +6,6 @@
 #include <memory>
 #include <string>
 
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "build/build_config.h"
 #include "components/policy/core/common/policy_details.h"
@@ -216,7 +215,7 @@
   // If policy already configured, it's not changed to enterprise defaults.
   policy_map.Set(key::kChromeOsMultiProfileUserBehavior, POLICY_LEVEL_MANDATORY,
                  POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
-                 base::MakeUnique<base::Value>("test_value"), nullptr);
+                 std::make_unique<base::Value>("test_value"), nullptr);
   SetEnterpriseUsersDefaults(&policy_map);
   multiprof_behavior =
       policy_map.GetValue(key::kChromeOsMultiProfileUserBehavior);
diff --git a/components/policy/core/common/mac_util.cc b/components/policy/core/common/mac_util.cc
index e213d08..134f7a7 100644
--- a/components/policy/core/common/mac_util.cc
+++ b/components/policy/core/common/mac_util.cc
@@ -8,7 +8,6 @@
 #include <utility>
 
 #include "base/mac/foundation_util.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/sys_string_conversions.h"
 #include "base/values.h"
 
@@ -47,7 +46,7 @@
 
 std::unique_ptr<base::Value> PropertyToValue(CFPropertyListRef property) {
   if (CFCast<CFNullRef>(property))
-    return base::MakeUnique<base::Value>();
+    return std::make_unique<base::Value>();
 
   if (CFBooleanRef boolean = CFCast<CFBooleanRef>(property)) {
     return std::unique_ptr<base::Value>(
diff --git a/components/policy/core/common/mac_util_unittest.cc b/components/policy/core/common/mac_util_unittest.cc
index 974761a..554d7240 100644
--- a/components/policy/core/common/mac_util_unittest.cc
+++ b/components/policy/core/common/mac_util_unittest.cc
@@ -9,7 +9,6 @@
 #include <memory>
 
 #include "base/mac/scoped_cftyperef.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/policy/core/common/policy_test_utils.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -20,7 +19,7 @@
   base::DictionaryValue root;
 
   // base::Value::Type::NONE
-  root.Set("null", base::MakeUnique<base::Value>());
+  root.Set("null", std::make_unique<base::Value>());
 
   // base::Value::Type::BOOLEAN
   root.SetBoolean("false", false);
@@ -39,17 +38,17 @@
   root.SetString("empty", "");
 
   // base::Value::Type::LIST
-  root.Set("emptyl", base::MakeUnique<base::Value>(base::Value::Type::LIST));
+  root.Set("emptyl", std::make_unique<base::Value>(base::Value::Type::LIST));
   base::ListValue list;
   for (base::DictionaryValue::Iterator it(root); !it.IsAtEnd(); it.Advance())
-    list.Append(base::MakeUnique<base::Value>(it.value().Clone()));
+    list.Append(std::make_unique<base::Value>(it.value().Clone()));
   EXPECT_EQ(root.size(), list.GetSize());
-  list.Append(base::MakeUnique<base::Value>(root.Clone()));
+  list.Append(std::make_unique<base::Value>(root.Clone()));
   root.SetKey("list", list.Clone());
 
   // base::Value::Type::DICTIONARY
   root.Set("emptyd",
-           base::MakeUnique<base::Value>(base::Value::Type::DICTIONARY));
+           std::make_unique<base::Value>(base::Value::Type::DICTIONARY));
   // Very meta.
   root.SetKey("dict", root.Clone());
 
diff --git a/components/policy/core/common/policy_bundle.cc b/components/policy/core/common/policy_bundle.cc
index fdcbb2a..8d369ad 100644
--- a/components/policy/core/common/policy_bundle.cc
+++ b/components/policy/core/common/policy_bundle.cc
@@ -5,7 +5,6 @@
 #include "components/policy/core/common/policy_bundle.h"
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 
 namespace policy {
 
@@ -19,7 +18,7 @@
   DCHECK(ns.domain != POLICY_DOMAIN_CHROME || ns.component_id.empty());
   std::unique_ptr<PolicyMap>& policy = policy_bundle_[ns];
   if (!policy)
-    policy = base::MakeUnique<PolicyMap>();
+    policy = std::make_unique<PolicyMap>();
   return *policy;
 }
 
diff --git a/components/policy/core/common/policy_bundle_unittest.cc b/components/policy/core/common/policy_bundle_unittest.cc
index 91938437..7ac3bd1 100644
--- a/components/policy/core/common/policy_bundle_unittest.cc
+++ b/components/policy/core/common/policy_bundle_unittest.cc
@@ -8,7 +8,6 @@
 #include <utility>
 
 #include "base/callback.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/policy/core/common/external_data_fetcher.h"
 #include "components/policy/core/common/policy_map.h"
@@ -32,12 +31,12 @@
 // Adds test policies to |policy|.
 void AddTestPolicies(PolicyMap* policy) {
   policy->Set("mandatory-user", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-              POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123), nullptr);
+              POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123), nullptr);
   policy->Set("mandatory-machine", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-              POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("omg"),
+              POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("omg"),
               nullptr);
   policy->Set("recommended-user", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-              POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true),
+              POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true),
               nullptr);
   std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
   dict->SetBoolean("false", false);
@@ -58,12 +57,12 @@
                                PolicyLevel level,
                                PolicyScope scope) {
   policy->Set(kPolicyClashing0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-              POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(value),
+              POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(value),
               nullptr);
   policy->Set(kPolicyClashing1, level, scope, POLICY_SOURCE_CLOUD,
-              base::MakeUnique<base::Value>(value), nullptr);
+              std::make_unique<base::Value>(value), nullptr);
   policy->Set(name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-              POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(value),
+              POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(value),
               nullptr);
 }
 
@@ -192,15 +191,15 @@
   // - kPolicyN are merged from each bundle.
   PolicyMap expected;
   expected.Set(kPolicyClashing0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr);
   expected.Set(kPolicyClashing1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr);
   expected.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr);
   expected.Set(kPolicy1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr);
   expected.Set(kPolicy2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(2), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(2), nullptr);
   EXPECT_TRUE(merged.Get(PolicyNamespace(POLICY_DOMAIN_CHROME,
                                          std::string())).Equals(expected));
   EXPECT_TRUE(merged.Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS,
@@ -240,13 +239,13 @@
   other.CopyFrom(bundle);
   bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123), nullptr);
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123), nullptr);
   EXPECT_FALSE(bundle.Equals(other));
   other.CopyFrom(bundle);
   EXPECT_TRUE(bundle.Equals(other));
   bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123), nullptr);
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123), nullptr);
   EXPECT_FALSE(bundle.Equals(other));
 
   // Test non-const Get().
@@ -256,7 +255,7 @@
       bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
   EXPECT_TRUE(bundle.Equals(other));
   policy_map.Set(kPolicy0, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123),
                  nullptr);
   EXPECT_FALSE(bundle.Equals(other));
 }
diff --git a/components/policy/core/common/policy_loader_ios_unittest.mm b/components/policy/core/common/policy_loader_ios_unittest.mm
index c4ead91..09187b1 100644
--- a/components/policy/core/common/policy_loader_ios_unittest.mm
+++ b/components/policy/core/common/policy_loader_ios_unittest.mm
@@ -6,10 +6,11 @@
 
 #import <UIKit/UIKit.h>
 
+#include <memory>
+
 #include "base/callback.h"
 #include "base/files/file_path.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/sequenced_task_runner.h"
 #include "base/strings/sys_string_conversions.h"
 #include "base/test/test_simple_task_runner.h"
@@ -91,7 +92,7 @@
     scoped_refptr<base::SequencedTaskRunner> task_runner) {
   std::unique_ptr<AsyncPolicyLoader> loader();
   return new AsyncPolicyProvider(
-      registry, base::MakeUnique<PolicyLoaderIOS>(task_runner));
+      registry, std::make_unique<PolicyLoaderIOS>(task_runner));
 }
 
 void TestHarness::InstallEmptyPolicy() {
diff --git a/components/policy/core/common/policy_loader_mac_unittest.cc b/components/policy/core/common/policy_loader_mac_unittest.cc
index 0e1cbe6..cc69ffec 100644
--- a/components/policy/core/common/policy_loader_mac_unittest.cc
+++ b/components/policy/core/common/policy_loader_mac_unittest.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include "components/policy/core/common/policy_loader_mac.h"
+#include <memory>
 
 #include <CoreFoundation/CoreFoundation.h>
 
@@ -12,7 +13,6 @@
 #include "base/files/file_path.h"
 #include "base/mac/scoped_cftyperef.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/sequenced_task_runner.h"
@@ -200,7 +200,7 @@
   expected_bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set(test_keys::kKeyString, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
            POLICY_SOURCE_PLATFORM,
-           base::MakeUnique<base::Value>("string value"), nullptr);
+           std::make_unique<base::Value>("string value"), nullptr);
   EXPECT_TRUE(provider_->policies().Equals(expected_bundle));
 }
 
diff --git a/components/policy/core/common/policy_loader_win_unittest.cc b/components/policy/core/common/policy_loader_win_unittest.cc
index dd00f30c..ad17382 100644
--- a/components/policy/core/common/policy_loader_win_unittest.cc
+++ b/components/policy/core/common/policy_loader_win_unittest.cc
@@ -19,7 +19,6 @@
 #include "base/callback.h"
 #include "base/json/json_writer.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/path_service.h"
 #include "base/process/process_handle.h"
 #include "base/sequenced_task_runner.h"
@@ -447,7 +446,7 @@
   PolicyBundle expected;
   expected.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set(test_keys::kKeyString, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-           POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>("hklm"),
+           POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>("hklm"),
            nullptr);
   EXPECT_TRUE(Matches(expected));
 }
@@ -500,17 +499,17 @@
   PolicyMap& expected_policy = expected.Get(ns);
   expected_policy.Set(
       "a", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, POLICY_SOURCE_PLATFORM,
-      base::MakeUnique<base::Value>(kMachineMandatory), nullptr);
+      std::make_unique<base::Value>(kMachineMandatory), nullptr);
   expected_policy.Set("b", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                       POLICY_SOURCE_PLATFORM,
-                      base::MakeUnique<base::Value>(kUserMandatory), nullptr);
+                      std::make_unique<base::Value>(kUserMandatory), nullptr);
   expected_policy.Set("c", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE,
                       POLICY_SOURCE_PLATFORM,
-                      base::MakeUnique<base::Value>(kMachineRecommended),
+                      std::make_unique<base::Value>(kMachineRecommended),
                       nullptr);
   expected_policy.Set("d", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
                       POLICY_SOURCE_PLATFORM,
-                      base::MakeUnique<base::Value>(kUserRecommended), nullptr);
+                      std::make_unique<base::Value>(kUserRecommended), nullptr);
   EXPECT_TRUE(Matches(expected));
 }
 
@@ -537,13 +536,13 @@
       "}"));
 
   base::DictionaryValue policy;
-  policy.Set("null", base::MakeUnique<base::Value>());
+  policy.Set("null", std::make_unique<base::Value>());
   policy.SetBoolean("bool", true);
   policy.SetInteger("int", -123);
   policy.SetDouble("double", 456.78e9);
   base::ListValue list;
-  list.Append(base::MakeUnique<base::Value>(policy.Clone()));
-  list.Append(base::MakeUnique<base::Value>(policy.Clone()));
+  list.Append(std::make_unique<base::Value>(policy.Clone()));
+  list.Append(std::make_unique<base::Value>(policy.Clone()));
   policy.SetKey("list", list.Clone());
   // Encode |policy| before adding the "dict" entry.
   std::string encoded_dict;
diff --git a/components/policy/core/common/policy_map_unittest.cc b/components/policy/core/common/policy_map_unittest.cc
index 5c49dfdc..4320faa 100644
--- a/components/policy/core/common/policy_map_unittest.cc
+++ b/components/policy/core/common/policy_map_unittest.cc
@@ -8,7 +8,6 @@
 
 #include "base/bind.h"
 #include "base/callback.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/weak_ptr.h"
 #include "components/policy/core/common/external_data_manager.h"
 #include "components/policy/core/common/policy_types.h"
@@ -53,16 +52,16 @@
 
 std::unique_ptr<ExternalDataFetcher> PolicyMapTest::CreateExternalDataFetcher(
     const std::string& policy) const {
-  return base::MakeUnique<ExternalDataFetcher>(
+  return std::make_unique<ExternalDataFetcher>(
       base::WeakPtr<ExternalDataManager>(), policy);
 }
 
 TEST_F(PolicyMapTest, SetAndGet) {
   PolicyMap map;
-  SetPolicy(&map, kTestPolicyName1, base::MakeUnique<base::Value>("aaa"));
+  SetPolicy(&map, kTestPolicyName1, std::make_unique<base::Value>("aaa"));
   base::Value expected("aaa");
   EXPECT_TRUE(expected.Equals(map.GetValue(kTestPolicyName1)));
-  SetPolicy(&map, kTestPolicyName1, base::MakeUnique<base::Value>("bbb"));
+  SetPolicy(&map, kTestPolicyName1, std::make_unique<base::Value>("bbb"));
   base::Value expected_b("bbb");
   EXPECT_TRUE(expected_b.Equals(map.GetValue(kTestPolicyName1)));
   SetPolicy(&map, kTestPolicyName1, CreateExternalDataFetcher("dummy"));
@@ -88,14 +87,14 @@
 
 TEST_F(PolicyMapTest, Equals) {
   PolicyMap a;
-  SetPolicy(&a, kTestPolicyName1, base::MakeUnique<base::Value>("aaa"));
+  SetPolicy(&a, kTestPolicyName1, std::make_unique<base::Value>("aaa"));
   PolicyMap a2;
-  SetPolicy(&a2, kTestPolicyName1, base::MakeUnique<base::Value>("aaa"));
+  SetPolicy(&a2, kTestPolicyName1, std::make_unique<base::Value>("aaa"));
   PolicyMap b;
-  SetPolicy(&b, kTestPolicyName1, base::MakeUnique<base::Value>("bbb"));
+  SetPolicy(&b, kTestPolicyName1, std::make_unique<base::Value>("bbb"));
   PolicyMap c;
-  SetPolicy(&c, kTestPolicyName1, base::MakeUnique<base::Value>("aaa"));
-  SetPolicy(&c, kTestPolicyName2, base::MakeUnique<base::Value>(true));
+  SetPolicy(&c, kTestPolicyName1, std::make_unique<base::Value>("aaa"));
+  SetPolicy(&c, kTestPolicyName2, std::make_unique<base::Value>(true));
   PolicyMap d;
   SetPolicy(&d, kTestPolicyName1, CreateExternalDataFetcher("ddd"));
   PolicyMap d2;
@@ -136,11 +135,11 @@
 
 TEST_F(PolicyMapTest, Swap) {
   PolicyMap a;
-  SetPolicy(&a, kTestPolicyName1, base::MakeUnique<base::Value>("aaa"));
+  SetPolicy(&a, kTestPolicyName1, std::make_unique<base::Value>("aaa"));
   SetPolicy(&a, kTestPolicyName2, CreateExternalDataFetcher("dummy"));
   PolicyMap b;
-  SetPolicy(&b, kTestPolicyName1, base::MakeUnique<base::Value>("bbb"));
-  SetPolicy(&b, kTestPolicyName3, base::MakeUnique<base::Value>(true));
+  SetPolicy(&b, kTestPolicyName1, std::make_unique<base::Value>("bbb"));
+  SetPolicy(&b, kTestPolicyName3, std::make_unique<base::Value>(true));
 
   a.Swap(&b);
   base::Value expected("bbb");
@@ -169,41 +168,41 @@
 TEST_F(PolicyMapTest, MergeFrom) {
   PolicyMap a;
   a.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com"),
         nullptr);
   a.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   a.Set(kTestPolicyName3, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_ENTERPRISE_DEFAULT, nullptr,
         CreateExternalDataFetcher("a"));
   a.Set(kTestPolicyName4, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false), nullptr);
   a.Set(kTestPolicyName5, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com/q={x}"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com/q={x}"),
         nullptr);
   a.Set(kTestPolicyName7, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_ENTERPRISE_DEFAULT, base::MakeUnique<base::Value>(false),
+        POLICY_SOURCE_ENTERPRISE_DEFAULT, std::make_unique<base::Value>(false),
         nullptr);
 
   PolicyMap b;
   b.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("chromium.org"),
         nullptr);
   b.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false), nullptr);
   b.Set(kTestPolicyName3, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_ENTERPRISE_DEFAULT, nullptr,
         CreateExternalDataFetcher("b"));
   b.Set(kTestPolicyName4, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE,
-        base::MakeUnique<base::Value>(true), nullptr);
+        std::make_unique<base::Value>(true), nullptr);
   b.Set(kTestPolicyName5, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>(std::string()),
+        POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(std::string()),
         nullptr);
   b.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   b.Set(kTestPolicyName7, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_ACTIVE_DIRECTORY, base::MakeUnique<base::Value>(true),
+        POLICY_SOURCE_ACTIVE_DIRECTORY, std::make_unique<base::Value>(true),
         nullptr);
 
   a.MergeFrom(b);
@@ -211,28 +210,28 @@
   PolicyMap c;
   // POLICY_SCOPE_MACHINE over POLICY_SCOPE_USER.
   c.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("chromium.org"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("chromium.org"),
         nullptr);
   // |a| has precedence over |b|.
   c.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   c.Set(kTestPolicyName3, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_ENTERPRISE_DEFAULT, nullptr,
         CreateExternalDataFetcher("a"));
   // POLICY_SCOPE_MACHINE over POLICY_SCOPE_USER for POLICY_LEVEL_RECOMMENDED.
   c.Set(kTestPolicyName4, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE,
-        base::MakeUnique<base::Value>(true), nullptr);
+        std::make_unique<base::Value>(true), nullptr);
   // POLICY_LEVEL_MANDATORY over POLICY_LEVEL_RECOMMENDED.
   c.Set(kTestPolicyName5, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>(std::string()),
+        POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(std::string()),
         nullptr);
   // Merge new ones.
   c.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   // POLICY_SOURCE_ACTIVE_DIRECTORY over POLICY_SOURCE_ENTERPRISE_DEFAULT.
   c.Set(kTestPolicyName7, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_ACTIVE_DIRECTORY, base::MakeUnique<base::Value>(true),
+        POLICY_SOURCE_ACTIVE_DIRECTORY, std::make_unique<base::Value>(true),
         nullptr);
 
   EXPECT_TRUE(a.Equals(c));
@@ -241,39 +240,39 @@
 TEST_F(PolicyMapTest, GetDifferingKeys) {
   PolicyMap a;
   a.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com"),
         nullptr);
   a.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_CLOUD, nullptr, CreateExternalDataFetcher("dummy"));
   a.Set(kTestPolicyName3, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   a.Set(kTestPolicyName4, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_CLOUD, nullptr, CreateExternalDataFetcher("a"));
   a.Set(kTestPolicyName5, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false), nullptr);
   a.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com/q={x}"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com/q={x}"),
         nullptr);
   a.Set(kTestPolicyName7, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
 
   PolicyMap b;
   b.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com"),
         nullptr);
   b.Set(kTestPolicyName2, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_CLOUD, nullptr, CreateExternalDataFetcher("dummy"));
   b.Set(kTestPolicyName3, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false), nullptr);
   b.Set(kTestPolicyName4, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
         POLICY_SOURCE_CLOUD, nullptr, CreateExternalDataFetcher("b"));
   b.Set(kTestPolicyName5, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false), nullptr);
   b.Set(kTestPolicyName6, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com/q={x}"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com/q={x}"),
         nullptr);
   b.Set(kTestPolicyName8, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
 
   std::set<std::string> diff;
   std::set<std::string> diff2;
@@ -315,12 +314,12 @@
   PolicyMap expected;
   expected.Set("TestPolicy1", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                POLICY_SOURCE_PLATFORM,
-               base::MakeUnique<base::Value>("google.com"), nullptr);
+               std::make_unique<base::Value>("google.com"), nullptr);
   expected.Set("TestPolicy2", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>(true),
+               POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(true),
                nullptr);
   expected.Set("TestPolicy3", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>(-12321),
+               POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>(-12321),
                nullptr);
   EXPECT_TRUE(loaded.Equals(expected));
 }
@@ -332,16 +331,16 @@
 TEST_F(PolicyMapTest, EraseNonmatching) {
   PolicyMap a;
   a.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com"),
         nullptr);
   a.Set(kTestPolicyName2, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_MACHINE,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
 
   a.EraseNonmatching(base::Bind(&IsMandatory));
 
   PolicyMap b;
   b.Set(kTestPolicyName1, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-        POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("google.com"),
+        POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("google.com"),
         nullptr);
   EXPECT_TRUE(a.Equals(b));
 }
diff --git a/components/policy/core/common/policy_scheduler.cc b/components/policy/core/common/policy_scheduler.cc
index b4c4bd1..4c8d67d 100644
--- a/components/policy/core/common/policy_scheduler.cc
+++ b/components/policy/core/common/policy_scheduler.cc
@@ -4,7 +4,6 @@
 
 #include "components/policy/core/common/policy_scheduler.h"
 
-#include "base/memory/ptr_util.h"
 #include "base/threading/thread_task_runner_handle.h"
 
 namespace policy {
@@ -31,7 +30,7 @@
   if (job_) {
     job_->Cancel();
   }
-  job_ = base::MakeUnique<base::CancelableClosure>(base::Bind(
+  job_ = std::make_unique<base::CancelableClosure>(base::Bind(
       &PolicyScheduler::RunScheduledTask, weak_ptr_factory_.GetWeakPtr()));
   base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(FROM_HERE,
                                                        job_->callback(), delay);
diff --git a/components/policy/core/common/policy_scheduler_unittest.cc b/components/policy/core/common/policy_scheduler_unittest.cc
index cb5758c..2950f3f1 100644
--- a/components/policy/core/common/policy_scheduler_unittest.cc
+++ b/components/policy/core/common/policy_scheduler_unittest.cc
@@ -7,7 +7,6 @@
 #include <memory>
 
 #include "base/bind.h"
-#include "base/memory/ptr_util.h"
 #include "base/run_loop.h"
 #include "base/test/scoped_task_environment.h"
 #include "base/threading/thread_task_runner_handle.h"
@@ -59,7 +58,7 @@
 };
 
 TEST_F(PolicySchedulerTest, Run) {
-  scheduler_ = base::MakeUnique<PolicyScheduler>(
+  scheduler_ = std::make_unique<PolicyScheduler>(
       base::BindRepeating(&PolicySchedulerTest::DoTask, base::Unretained(this)),
       base::BindRepeating(&PolicySchedulerTest::OnTaskDone,
                           base::Unretained(this)),
@@ -70,7 +69,7 @@
 }
 
 TEST_F(PolicySchedulerTest, Loop) {
-  scheduler_ = base::MakeUnique<PolicyScheduler>(
+  scheduler_ = std::make_unique<PolicyScheduler>(
       base::BindRepeating(&PolicySchedulerTest::DoTask, base::Unretained(this)),
       base::BindRepeating(&PolicySchedulerTest::OnTaskDone,
                           base::Unretained(this)),
@@ -81,7 +80,7 @@
 }
 
 TEST_F(PolicySchedulerTest, Reschedule) {
-  scheduler_ = base::MakeUnique<PolicyScheduler>(
+  scheduler_ = std::make_unique<PolicyScheduler>(
       base::BindRepeating(&PolicySchedulerTest::DoTask, base::Unretained(this)),
       base::BindRepeating(&PolicySchedulerTest::OnTaskDone,
                           base::Unretained(this)),
@@ -101,7 +100,7 @@
 }
 
 TEST_F(PolicySchedulerTest, OverlappingTasks) {
-  scheduler_ = base::MakeUnique<PolicyScheduler>(
+  scheduler_ = std::make_unique<PolicyScheduler>(
       base::BindRepeating(&PolicySchedulerTest::CaptureCallbackForSlowTask,
                           base::Unretained(this)),
       base::BindRepeating(&PolicySchedulerTest::OnTaskDone,
@@ -131,4 +130,4 @@
   EXPECT_EQ(2, done_counter_);
 }
 
-}  // namespace policy
\ No newline at end of file
+}  // namespace policy
diff --git a/components/policy/core/common/policy_service_impl.cc b/components/policy/core/common/policy_service_impl.cc
index 53cdc09..29c09af3 100644
--- a/components/policy/core/common/policy_service_impl.cc
+++ b/components/policy/core/common/policy_service_impl.cc
@@ -12,7 +12,6 @@
 #include "base/bind.h"
 #include "base/location.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/values.h"
@@ -101,7 +100,7 @@
   DCHECK(thread_checker_.CalledOnValidThread());
   std::unique_ptr<Observers>& list = observers_[domain];
   if (!list)
-    list = base::MakeUnique<Observers>();
+    list = std::make_unique<Observers>();
   list->AddObserver(observer);
 }
 
diff --git a/components/policy/core/common/policy_service_impl_unittest.cc b/components/policy/core/common/policy_service_impl_unittest.cc
index 4b0bbb9..dd2d2da 100644
--- a/components/policy/core/common/policy_service_impl_unittest.cc
+++ b/components/policy/core/common/policy_service_impl_unittest.cc
@@ -11,7 +11,6 @@
 #include "base/bind_helpers.h"
 #include "base/callback.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/message_loop/message_loop.h"
 #include "base/run_loop.h"
 #include "base/values.h"
@@ -57,16 +56,16 @@
       &bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()));
   policy_map->Set(kSameLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                   POLICY_SOURCE_ENTERPRISE_DEFAULT,
-                  base::MakeUnique<base::Value>(value), nullptr);
+                  std::make_unique<base::Value>(value), nullptr);
   policy_map->Set(kDiffLevelPolicy, level, scope, POLICY_SOURCE_PLATFORM,
-                  base::MakeUnique<base::Value>(value), nullptr);
+                  std::make_unique<base::Value>(value), nullptr);
   policy_map =
       &bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kExtension));
   policy_map->Set(kSameLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                   POLICY_SOURCE_ENTERPRISE_DEFAULT,
-                  base::MakeUnique<base::Value>(value), nullptr);
+                  std::make_unique<base::Value>(value), nullptr);
   policy_map->Set(kDiffLevelPolicy, level, scope, POLICY_SOURCE_PLATFORM,
-                  base::MakeUnique<base::Value>(value), nullptr);
+                  std::make_unique<base::Value>(value), nullptr);
 }
 
 // Observer class that changes the policy in the passed provider when the
@@ -82,7 +81,7 @@
                        const PolicyMap& current) override {
     PolicyMap new_policy;
     new_policy.Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                   POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(14),
+                   POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(14),
                    nullptr);
     provider_->UpdateChromePolicy(new_policy);
     observer_invoked_ = true;
@@ -114,7 +113,7 @@
 
     policy0_.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                  POLICY_SOURCE_ENTERPRISE_DEFAULT,
-                 base::MakeUnique<base::Value>(13), nullptr);
+                 std::make_unique<base::Value>(13), nullptr);
     provider0_.UpdateChromePolicy(policy0_);
 
     PolicyServiceImpl::Providers providers;
@@ -164,7 +163,7 @@
   PolicyMap expected;
   expected.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                POLICY_SOURCE_ENTERPRISE_DEFAULT,
-               base::MakeUnique<base::Value>(13), nullptr);
+               std::make_unique<base::Value>(13), nullptr);
   EXPECT_TRUE(VerifyPolicies(
       PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()), expected));
 }
@@ -176,15 +175,15 @@
   PolicyMap expectedPrevious;
   expectedPrevious.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                        POLICY_SOURCE_ENTERPRISE_DEFAULT,
-                       base::MakeUnique<base::Value>(13), nullptr);
+                       std::make_unique<base::Value>(13), nullptr);
 
   PolicyMap expectedCurrent;
   expectedCurrent.CopyFrom(expectedPrevious);
   expectedCurrent.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                      POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123),
+                      POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123),
                       nullptr);
   policy0_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123),
                nullptr);
   EXPECT_CALL(observer, OnPolicyUpdated(PolicyNamespace(POLICY_DOMAIN_CHROME,
                                                         std::string()),
@@ -203,10 +202,10 @@
   // New policy.
   expectedPrevious.CopyFrom(expectedCurrent);
   expectedCurrent.Set("bbb", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                      POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(456),
+                      POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(456),
                       nullptr);
   policy0_.Set("bbb", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(456),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(456),
                nullptr);
   EXPECT_CALL(observer, OnPolicyUpdated(PolicyNamespace(POLICY_DOMAIN_CHROME,
                                                         std::string()),
@@ -229,10 +228,10 @@
   // Changed policy.
   expectedPrevious.CopyFrom(expectedCurrent);
   expectedCurrent.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                      POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(789),
+                      POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(789),
                       nullptr);
   policy0_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(789),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(789),
                nullptr);
 
   EXPECT_CALL(observer, OnPolicyUpdated(PolicyNamespace(POLICY_DOMAIN_CHROME,
@@ -264,11 +263,11 @@
   PolicyMap previous_policy_map;
   previous_policy_map.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                           POLICY_SOURCE_ENTERPRISE_DEFAULT,
-                          base::MakeUnique<base::Value>(13), nullptr);
+                          std::make_unique<base::Value>(13), nullptr);
   PolicyMap policy_map;
   policy_map.CopyFrom(previous_policy_map);
   policy_map.Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"),
                  nullptr);
 
   std::unique_ptr<PolicyBundle> bundle(new PolicyBundle());
@@ -309,7 +308,7 @@
       .CopyFrom(policy_map);
   policy_map.Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                  POLICY_SOURCE_CLOUD,
-                 base::MakeUnique<base::Value>("another value"), nullptr);
+                 std::make_unique<base::Value>("another value"), nullptr);
   bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kExtension1))
       .CopyFrom(policy_map);
   bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, kExtension2))
@@ -345,10 +344,10 @@
   ChangePolicyObserver observer(&provider0_);
   policy_service_->AddObserver(POLICY_DOMAIN_CHROME, &observer);
   policy0_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(123),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(123),
                nullptr);
   policy0_.Set("bbb", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1234),
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1234),
                nullptr);
   // Should not crash.
   provider0_.UpdateChromePolicy(policy0_);
@@ -360,15 +359,15 @@
   PolicyMap expected;
   expected.Set("pre", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                POLICY_SOURCE_ENTERPRISE_DEFAULT,
-               base::MakeUnique<base::Value>(13), nullptr);
+               std::make_unique<base::Value>(13), nullptr);
   expected.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr);
   policy0_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr);
   policy1_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr);
   policy2_.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(2), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(2), nullptr);
   provider0_.UpdateChromePolicy(policy0_);
   provider1_.UpdateChromePolicy(policy1_);
   provider2_.UpdateChromePolicy(policy2_);
@@ -376,16 +375,16 @@
       PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()), expected));
 
   expected.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr);
   policy0_.Erase("aaa");
   provider0_.UpdateChromePolicy(policy0_);
   EXPECT_TRUE(VerifyPolicies(
       PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()), expected));
 
   expected.Set("aaa", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(2), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(2), nullptr);
   policy1_.Set("aaa", POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
-               POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
+               POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr);
   provider1_.UpdateChromePolicy(policy1_);
   EXPECT_TRUE(VerifyPolicies(
       PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()), expected));
@@ -537,11 +536,11 @@
   // precedence, on every namespace.
   expected.Set(kSameLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                POLICY_SOURCE_ENTERPRISE_DEFAULT,
-               base::MakeUnique<base::Value>("bundle0"), nullptr);
+               std::make_unique<base::Value>("bundle0"), nullptr);
   // For policies with different levels and scopes, the highest priority
   // level/scope combination takes precedence, on every namespace.
   expected.Set(kDiffLevelPolicy, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE,
-               POLICY_SOURCE_PLATFORM, base::MakeUnique<base::Value>("bundle2"),
+               POLICY_SOURCE_PLATFORM, std::make_unique<base::Value>("bundle2"),
                nullptr);
   EXPECT_TRUE(policy_service_->GetPolicies(
       PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())).Equals(expected));
@@ -665,22 +664,22 @@
   // into a dictionary.
   policy_map.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY,
                  POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
-                 base::MakeUnique<base::Value>(3), nullptr);
+                 std::make_unique<base::Value>(3), nullptr);
 
   // Both these policies should be ignored, since there's a higher priority
   // policy available.
   policy_map.Set(key::kProxyMode, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
                  POLICY_SOURCE_CLOUD,
-                 base::MakeUnique<base::Value>("pac_script"), nullptr);
+                 std::make_unique<base::Value>("pac_script"), nullptr);
   policy_map.Set(key::kProxyPacUrl, POLICY_LEVEL_RECOMMENDED, POLICY_SCOPE_USER,
                  POLICY_SOURCE_CLOUD,
-                 base::MakeUnique<base::Value>("http://example.com/wpad.dat"),
+                 std::make_unique<base::Value>("http://example.com/wpad.dat"),
                  nullptr);
 
   // Add a value to a non-Chrome namespace.
   policy_bundle->Get(extension_namespace)
       .Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(3), nullptr);
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(3), nullptr);
 
   // The resulting Chrome namespace map should have the collected policy.
   PolicyMap expected_chrome;
@@ -695,7 +694,7 @@
   PolicyMap expected_extension;
   expected_extension.Set(key::kProxyServerMode, POLICY_LEVEL_MANDATORY,
                          POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
-                         base::MakeUnique<base::Value>(3), nullptr);
+                         std::make_unique<base::Value>(3), nullptr);
 
   provider0_.UpdatePolicy(std::move(policy_bundle));
   RunUntilIdle();
diff --git a/components/policy/core/common/policy_statistics_collector_unittest.cc b/components/policy/core/common/policy_statistics_collector_unittest.cc
index 649058cd..05438dfd 100644
--- a/components/policy/core/common/policy_statistics_collector_unittest.cc
+++ b/components/policy/core/common/policy_statistics_collector_unittest.cc
@@ -10,7 +10,6 @@
 
 #include "base/callback.h"
 #include "base/compiler_specific.h"
-#include "base/memory/ptr_util.h"
 #include "base/test/test_simple_task_runner.h"
 #include "base/values.h"
 #include "components/policy/core/common/external_data_fetcher.h"
@@ -109,7 +108,7 @@
 
   void SetPolicy(const std::string& name) {
     policy_map_.Set(name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                    POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true),
+                    POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true),
                     nullptr);
   }
 
diff --git a/components/policy/core/common/preg_parser_unittest.cc b/components/policy/core/common/preg_parser_unittest.cc
index c28cd32..1b7c349 100644
--- a/components/policy/core/common/preg_parser_unittest.cc
+++ b/components/policy/core/common/preg_parser_unittest.cc
@@ -104,7 +104,7 @@
   RegistryDict dict;
   SetInteger(&dict, "DeleteValuesTest1", 1);
   SetString(&dict, "DeleteValuesTest2", "2");
-  dict.SetKey("DeleteKeysTest1", base::MakeUnique<RegistryDict>());
+  dict.SetKey("DeleteKeysTest1", std::make_unique<RegistryDict>());
   std::unique_ptr<RegistryDict> delete_keys_test(new RegistryDict());
   SetInteger(delete_keys_test.get(), "DeleteKeysTest2Entry", 1);
   dict.SetKey("DeleteKeysTest2", std::move(delete_keys_test));
@@ -112,7 +112,7 @@
   std::unique_ptr<RegistryDict> subdict(new RegistryDict());
   SetInteger(subdict.get(), "DelValsTest1", 1);
   SetString(subdict.get(), "DelValsTest2", "2");
-  subdict->SetKey("DelValsTest3", base::MakeUnique<RegistryDict>());
+  subdict->SetKey("DelValsTest3", std::make_unique<RegistryDict>());
   dict.SetKey("DelValsTest", std::move(subdict));
 
   // Run the parser.
@@ -124,7 +124,7 @@
   // Build the expected output dictionary.
   RegistryDict expected;
   std::unique_ptr<RegistryDict> del_vals_dict(new RegistryDict());
-  del_vals_dict->SetKey("DelValsTest3", base::MakeUnique<RegistryDict>());
+  del_vals_dict->SetKey("DelValsTest3", std::make_unique<RegistryDict>());
   expected.SetKey("DelValsTest", std::move(del_vals_dict));
   SetInteger(&expected, "HomepageIsNewTabPage", 1);
   SetString(&expected, "HomepageLocation", "http://www.example.com");
diff --git a/components/policy/core/common/proxy_policy_provider_unittest.cc b/components/policy/core/common/proxy_policy_provider_unittest.cc
index 1b57eb5..fcd9317 100644
--- a/components/policy/core/common/proxy_policy_provider_unittest.cc
+++ b/components/policy/core/common/proxy_policy_provider_unittest.cc
@@ -2,13 +2,13 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "components/policy/core/common/proxy_policy_provider.h"
+#include <memory>
 #include "base/callback.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "components/policy/core/common/external_data_fetcher.h"
 #include "components/policy/core/common/mock_configuration_policy_provider.h"
 #include "components/policy/core/common/policy_types.h"
-#include "components/policy/core/common/proxy_policy_provider.h"
 #include "components/policy/core/common/schema_registry.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -55,7 +55,7 @@
   PolicyBundle bundle;
   bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"),
            nullptr);
   mock_provider_.UpdatePolicy(CopyBundle(bundle));
 
@@ -67,7 +67,7 @@
   EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_));
   bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
       .Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("new value"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("new value"),
            nullptr);
   mock_provider_.UpdatePolicy(CopyBundle(bundle));
   Mock::VerifyAndClearExpectations(&observer_);
diff --git a/components/policy/core/common/registry_dict.cc b/components/policy/core/common/registry_dict.cc
index d2b1d6c9..6bff6e4 100644
--- a/components/policy/core/common/registry_dict.cc
+++ b/components/policy/core/common/registry_dict.cc
@@ -7,7 +7,6 @@
 #include <utility>
 
 #include "base/json/json_reader.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
@@ -76,7 +75,7 @@
   int int_value = 0;
   switch (schema.type()) {
     case base::Value::Type::NONE: {
-      return base::MakeUnique<base::Value>();
+      return std::make_unique<base::Value>();
     }
     case base::Value::Type::BOOLEAN: {
       // Accept booleans encoded as either string or integer.
@@ -234,7 +233,7 @@
        entry != other.keys_.end(); ++entry) {
     std::unique_ptr<RegistryDict>& subdict = keys_[entry->first];
     if (!subdict)
-      subdict = base::MakeUnique<RegistryDict>();
+      subdict = std::make_unique<RegistryDict>();
     subdict->Merge(*entry->second);
   }
 
diff --git a/components/policy/core/common/registry_dict_unittest.cc b/components/policy/core/common/registry_dict_unittest.cc
index 4a54444e..1a18bb6c 100644
--- a/components/policy/core/common/registry_dict_unittest.cc
+++ b/components/policy/core/common/registry_dict_unittest.cc
@@ -7,7 +7,6 @@
 #include <string>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/policy/core/common/schema.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -102,7 +101,7 @@
 
   base::Value int_value(42);
 
-  test_dict.SetKey("One", base::MakeUnique<RegistryDict>());
+  test_dict.SetKey("One", std::make_unique<RegistryDict>());
   EXPECT_EQ(1u, test_dict.keys().size());
   RegistryDict* actual_subdict = test_dict.GetKey("One");
   ASSERT_TRUE(actual_subdict);
@@ -166,7 +165,7 @@
   base::Value string_value("fortytwo");
 
   dict_a.SetValue("one", int_value.CreateDeepCopy());
-  dict_a.SetKey("two", base::MakeUnique<RegistryDict>());
+  dict_a.SetKey("two", std::make_unique<RegistryDict>());
   dict_b.SetValue("three", string_value.CreateDeepCopy());
 
   dict_a.Swap(&dict_b);
@@ -227,20 +226,20 @@
 
   base::DictionaryValue expected;
   expected.SetKey("one", int_value.Clone());
-  auto expected_subdict = base::MakeUnique<base::DictionaryValue>();
+  auto expected_subdict = std::make_unique<base::DictionaryValue>();
   expected_subdict->SetKey("two", string_value.Clone());
   expected.Set("three", std::move(expected_subdict));
-  auto expected_list = base::MakeUnique<base::ListValue>();
-  expected_list->Append(base::MakeUnique<base::Value>(string_value.Clone()));
+  auto expected_list = std::make_unique<base::ListValue>();
+  expected_list->Append(std::make_unique<base::Value>(string_value.Clone()));
   expected.Set("dict-to-list", std::move(expected_list));
   expected.SetBoolean("int-to-bool", true);
   expected.SetDouble("int-to-double", 42.0);
   expected.SetBoolean("string-to-bool", false);
   expected.SetDouble("string-to-double", 0.0);
   expected.SetInteger("string-to-int", static_cast<int>(0));
-  expected_list = base::MakeUnique<base::ListValue>();
-  expected_list->Append(base::MakeUnique<base::Value>("value"));
-  expected_subdict = base::MakeUnique<base::DictionaryValue>();
+  expected_list = std::make_unique<base::ListValue>();
+  expected_list->Append(std::make_unique<base::Value>("value"));
+  expected_subdict = std::make_unique<base::DictionaryValue>();
   expected_subdict->Set("key", std::move(expected_list));
   expected.Set("string-to-dict", std::move(expected_subdict));
 
diff --git a/components/policy/core/common/remote_commands/test_remote_command_job.cc b/components/policy/core/common/remote_commands/test_remote_command_job.cc
index 6b35cde3..6677007d 100644
--- a/components/policy/core/common/remote_commands/test_remote_command_job.cc
+++ b/components/policy/core/common/remote_commands/test_remote_command_job.cc
@@ -11,7 +11,6 @@
 #include "base/location.h"
 #include "base/logging.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 
@@ -39,7 +38,7 @@
 };
 
 std::unique_ptr<std::string> TestRemoteCommandJob::EchoPayload::Serialize() {
-  return base::MakeUnique<std::string>(payload_);
+  return std::make_unique<std::string>(payload_);
 }
 
 TestRemoteCommandJob::TestRemoteCommandJob(bool succeed,
diff --git a/components/policy/core/common/schema_map_unittest.cc b/components/policy/core/common/schema_map_unittest.cc
index b99bc8a..96916e5 100644
--- a/components/policy/core/common/schema_map_unittest.cc
+++ b/components/policy/core/common/schema_map_unittest.cc
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include "components/policy/core/common/schema_map.h"
+#include <memory>
 
-#include "base/memory/ptr_util.h"
 #include "base/memory/weak_ptr.h"
 #include "base/values.h"
 #include "components/policy/core/common/external_data_fetcher.h"
@@ -142,14 +142,14 @@
   PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, "");
   expected_bundle.Get(chrome_ns).Set(
       "ChromePolicy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-      POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"), nullptr);
+      POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"), nullptr);
   bundle.CopyFrom(expected_bundle);
 
   // Unknown components are filtered out.
   PolicyNamespace another_extension_ns(POLICY_DOMAIN_EXTENSIONS, "xyz");
   bundle.Get(another_extension_ns)
       .Set("AnotherExtensionPolicy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"),
            nullptr);
   schema_map->FilterBundle(&bundle);
   EXPECT_TRUE(bundle.Equals(expected_bundle));
@@ -162,25 +162,25 @@
   map.Set("list", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
           POLICY_SOURCE_CLOUD, list.CreateDeepCopy(), nullptr);
   map.Set("boolean", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-          POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(true), nullptr);
+          POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(true), nullptr);
   map.Set("integer", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-          POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1), nullptr);
+          POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1), nullptr);
   map.Set("null", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-          POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(), nullptr);
+          POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(), nullptr);
   map.Set("double", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-          POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(1.2), nullptr);
+          POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(1.2), nullptr);
   base::DictionaryValue dict;
   dict.SetString("a", "b");
   dict.SetInteger("b", 2);
   map.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
           POLICY_SOURCE_CLOUD, dict.CreateDeepCopy(), nullptr);
   map.Set("string", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-          POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value"), nullptr);
+          POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value"), nullptr);
 
   bundle.MergeFrom(expected_bundle);
   bundle.Get(extension_ns)
       .Set("Unexpected", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("to-be-removed"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("to-be-removed"),
            nullptr);
 
   schema_map->FilterBundle(&bundle);
@@ -190,25 +190,25 @@
   bundle.Clear();
   PolicyMap& badmap = bundle.Get(extension_ns);
   badmap.Set("list", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false),
              nullptr);
   badmap.Set("boolean", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(0), nullptr);
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(0), nullptr);
   badmap.Set("integer", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false),
              nullptr);
   badmap.Set("null", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false),
              nullptr);
   badmap.Set("double", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false),
              nullptr);
   badmap.Set("object", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-             POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>(false),
+             POLICY_SOURCE_CLOUD, std::make_unique<base::Value>(false),
              nullptr);
   badmap.Set("string", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
              POLICY_SOURCE_CLOUD, nullptr,
-             base::MakeUnique<ExternalDataFetcher>(nullptr, std::string()));
+             std::make_unique<ExternalDataFetcher>(nullptr, std::string()));
 
   schema_map->FilterBundle(&bundle);
   EXPECT_TRUE(bundle.Equals(empty_bundle));
@@ -237,14 +237,14 @@
   PolicyNamespace extension_ns(POLICY_DOMAIN_EXTENSIONS, "with-schema");
   bundle.Get(extension_ns)
       .Set("String", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 1"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value 1"),
            nullptr);
 
   // The Chrome namespace isn't filtered.
   PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, "");
   bundle.Get(chrome_ns).Set("ChromePolicy", POLICY_LEVEL_MANDATORY,
                             POLICY_SCOPE_USER, POLICY_SOURCE_CLOUD,
-                            base::MakeUnique<base::Value>("value 3"), nullptr);
+                            std::make_unique<base::Value>("value 3"), nullptr);
 
   PolicyBundle expected_bundle;
   expected_bundle.MergeFrom(bundle);
@@ -253,20 +253,20 @@
   PolicyNamespace without_schema_ns(POLICY_DOMAIN_EXTENSIONS, "without-schema");
   bundle.Get(without_schema_ns)
       .Set("Schemaless", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 2"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value 2"),
            nullptr);
 
   // Unknown policies of known components with a schema are removed.
   bundle.Get(extension_ns)
       .Set("Surprise", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 4"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value 4"),
            nullptr);
 
   // Unknown components are removed.
   PolicyNamespace unknown_ns(POLICY_DOMAIN_EXTENSIONS, "unknown");
   bundle.Get(unknown_ns)
       .Set("Surprise", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("value 5"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("value 5"),
            nullptr);
 
   schema_map->FilterBundle(&bundle);
diff --git a/components/policy/core/common/schema_registry_tracking_policy_provider_unittest.cc b/components/policy/core/common/schema_registry_tracking_policy_provider_unittest.cc
index fd6668d..5def498 100644
--- a/components/policy/core/common/schema_registry_tracking_policy_provider_unittest.cc
+++ b/components/policy/core/common/schema_registry_tracking_policy_provider_unittest.cc
@@ -8,7 +8,6 @@
 #include <string>
 #include <utility>
 
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/policy/core/common/mock_configuration_policy_provider.h"
 #include "components/policy/core/common/policy_bundle.h"
@@ -87,14 +86,14 @@
   const PolicyNamespace chrome_ns(POLICY_DOMAIN_CHROME, "");
   bundle.Get(chrome_ns).Set("policy", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                             POLICY_SOURCE_CLOUD,
-                            base::MakeUnique<base::Value>("visible"), nullptr);
+                            std::make_unique<base::Value>("visible"), nullptr);
 
   EXPECT_CALL(observer_, OnUpdatePolicy(&schema_registry_tracking_provider_));
   std::unique_ptr<PolicyBundle> delegate_bundle(new PolicyBundle);
   delegate_bundle->CopyFrom(bundle);
   delegate_bundle->Get(PolicyNamespace(POLICY_DOMAIN_EXTENSIONS, "xyz"))
       .Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-           POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("not visible"),
+           POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("not visible"),
            nullptr);
   mock_provider_.UpdatePolicy(std::move(delegate_bundle));
   Mock::VerifyAndClearExpectations(&observer_);
@@ -122,7 +121,7 @@
 TEST_F(SchemaRegistryTrackingPolicyProviderTest, SchemaReadyWithComponents) {
   PolicyMap policy_map;
   policy_map.Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("omg"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("omg"),
                  nullptr);
   std::unique_ptr<PolicyBundle> bundle(new PolicyBundle);
   bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")).CopyFrom(policy_map);
@@ -171,7 +170,7 @@
 
   PolicyMap policy_map;
   policy_map.Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
-                 POLICY_SOURCE_CLOUD, base::MakeUnique<base::Value>("omg"),
+                 POLICY_SOURCE_CLOUD, std::make_unique<base::Value>("omg"),
                  nullptr);
   // Chrome policy updates are visible even if the components aren't ready.
   EXPECT_CALL(observer_, OnUpdatePolicy(&schema_registry_tracking_provider_));
@@ -211,7 +210,7 @@
   PolicyBundle platform_policy;
   platform_policy.Get(ns).Set("foo", POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
                               POLICY_SOURCE_CLOUD,
-                              base::MakeUnique<base::Value>("omg"), nullptr);
+                              std::make_unique<base::Value>("omg"), nullptr);
   std::unique_ptr<PolicyBundle> copy(new PolicyBundle);
   copy->CopyFrom(platform_policy);
   EXPECT_CALL(observer_, OnUpdatePolicy(_));
diff --git a/components/policy/core/common/schema_unittest.cc b/components/policy/core/common/schema_unittest.cc
index 6829de9b..4b99223 100644
--- a/components/policy/core/common/schema_unittest.cc
+++ b/components/policy/core/common/schema_unittest.cc
@@ -10,7 +10,6 @@
 #include <utility>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/stringprintf.h"
 #include "base/values.h"
 #include "components/policy/core/common/schema_internal.h"
@@ -642,7 +641,7 @@
   bundle.Clear();
   bundle.SetBoolean("Boolean", true);
   bundle.SetInteger("Integer", 123);
-  bundle.Set("Null", base::MakeUnique<base::Value>());
+  bundle.Set("Null", std::make_unique<base::Value>());
   bundle.SetDouble("Number", 3.14);
   bundle.SetString("String", "omg");
 
@@ -805,7 +804,7 @@
     base::DictionaryValue root;
 
     base::ListValue* list_value =
-        root.SetList("List", base::MakeUnique<base::ListValue>());
+        root.SetList("List", std::make_unique<base::ListValue>());
 
     // Test that there are not errors here.
     list_value->AppendInteger(12345);
@@ -831,9 +830,9 @@
     ASSERT_TRUE(subschema.valid());
     base::ListValue root;
 
-    auto dict_value = base::MakeUnique<base::DictionaryValue>();
+    auto dict_value = std::make_unique<base::DictionaryValue>();
     base::ListValue* list_value =
-        dict_value->SetList("List", base::MakeUnique<base::ListValue>());
+        dict_value->SetList("List", std::make_unique<base::ListValue>());
     root.Append(std::move(dict_value));
 
     // Test that there are not errors here.
diff --git a/components/policy/tools/generate_policy_source.py b/components/policy/tools/generate_policy_source.py
index a92062f9..990391e 100755
--- a/components/policy/tools/generate_policy_source.py
+++ b/components/policy/tools/generate_policy_source.py
@@ -708,12 +708,12 @@
 
   |value|: The deserialized value to convert to base::Value."""
   if type(value) == bool or type(value) == int:
-    return [], 'base::MakeUnique<base::Value>(%s)' %\
+    return [], 'std::make_unique<base::Value>(%s)' %\
                     json.dumps(value)
   elif type(value) == str:
-    return [], 'base::MakeUnique<base::Value>("%s")' % value
+    return [], 'std::make_unique<base::Value>("%s")' % value
   elif type(value) == list:
-    setup = ['auto default_value = base::MakeUnique<base::ListValue>();']
+    setup = ['auto default_value = std::make_unique<base::ListValue>();']
     for entry in value:
       decl, fetch = _GenerateDefaultValue(entry)
       # Nested lists are not supported.
@@ -728,9 +728,9 @@
           '\n'
           '#include <algorithm>\n'
           '#include <climits>\n'
+          '#include <memory>\n'
           '\n'
           '#include "base/logging.h"\n'
-          '#include "base/memory/ptr_util.h"\n'
           '#include "components/policy/core/common/policy_types.h"\n'
           '#include "components/policy/core/common/schema_internal.h"\n'
           '#include "components/policy/risk_tag.h"\n'
diff --git a/components/policy/tools/generate_policy_source_test.py b/components/policy/tools/generate_policy_source_test.py
index 0a42616..4bb5df9 100755
--- a/components/policy/tools/generate_policy_source_test.py
+++ b/components/policy/tools/generate_policy_source_test.py
@@ -13,33 +13,33 @@
     # Bools
     stmts, expr = generate_policy_source._GenerateDefaultValue(True)
     self.assertListEqual([], stmts)
-    self.assertEqual('base::MakeUnique<base::Value>(true)', expr)
+    self.assertEqual('std::make_unique<base::Value>(true)', expr)
     stmts, expr = generate_policy_source._GenerateDefaultValue(False)
     self.assertListEqual([], stmts)
-    self.assertEqual('base::MakeUnique<base::Value>(false)', expr)
+    self.assertEqual('std::make_unique<base::Value>(false)', expr)
 
     # Ints
     stmts, expr = generate_policy_source._GenerateDefaultValue(33)
     self.assertListEqual([], stmts)
-    self.assertEqual('base::MakeUnique<base::Value>(33)', expr)
+    self.assertEqual('std::make_unique<base::Value>(33)', expr)
 
     # Strings
     stmts, expr = generate_policy_source._GenerateDefaultValue('foo')
     self.assertListEqual([], stmts)
-    self.assertEqual('base::MakeUnique<base::Value>("foo")', expr)
+    self.assertEqual('std::make_unique<base::Value>("foo")', expr)
 
     # Empty list
     stmts, expr = generate_policy_source._GenerateDefaultValue([])
     self.assertListEqual(
-        ['auto default_value = base::MakeUnique<base::ListValue>();'], stmts)
+        ['auto default_value = std::make_unique<base::ListValue>();'], stmts)
     self.assertEqual('std::move(default_value)', expr)
 
     # List with values
     stmts, expr = generate_policy_source._GenerateDefaultValue([1, '2'])
     self.assertListEqual([
-        'auto default_value = base::MakeUnique<base::ListValue>();',
-        'default_value->Append(base::MakeUnique<base::Value>(1));',
-        'default_value->Append(base::MakeUnique<base::Value>("2"));'
+        'auto default_value = std::make_unique<base::ListValue>();',
+        'default_value->Append(std::make_unique<base::Value>(1));',
+        'default_value->Append(std::make_unique<base::Value>("2"));'
       ], stmts)
     self.assertEqual('std::move(default_value)', expr)
 
diff --git a/components/prefs/command_line_pref_store.cc b/components/prefs/command_line_pref_store.cc
index ddaac31e..79fc10c 100644
--- a/components/prefs/command_line_pref_store.cc
+++ b/components/prefs/command_line_pref_store.cc
@@ -4,10 +4,10 @@
 
 #include "components/prefs/command_line_pref_store.h"
 
+#include <memory>
 #include <string>
 
 #include "base/files/file_path.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 
 CommandLinePrefStore::CommandLinePrefStore(
@@ -22,7 +22,7 @@
   for (size_t i = 0; i < size; ++i) {
     if (command_line_->HasSwitch(string_switch[i].switch_name)) {
       SetValue(string_switch[i].preference_path,
-               base::MakeUnique<base::Value>(command_line_->GetSwitchValueASCII(
+               std::make_unique<base::Value>(command_line_->GetSwitchValueASCII(
                    string_switch[i].switch_name)),
                WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
     }
@@ -35,7 +35,7 @@
   for (size_t i = 0; i < size; ++i) {
     if (command_line_->HasSwitch(path_switch[i].switch_name)) {
       SetValue(path_switch[i].preference_path,
-               base::MakeUnique<base::Value>(
+               std::make_unique<base::Value>(
                    command_line_->GetSwitchValuePath(path_switch[i].switch_name)
                        .value()),
                WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
@@ -58,7 +58,7 @@
         continue;
       }
       SetValue(integer_switch[i].preference_path,
-               base::MakeUnique<base::Value>(int_value),
+               std::make_unique<base::Value>(int_value),
                WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
     }
   }
@@ -70,7 +70,7 @@
   for (size_t i = 0; i < size; ++i) {
     if (command_line_->HasSwitch(boolean_switch_map[i].switch_name)) {
       SetValue(boolean_switch_map[i].preference_path,
-               base::MakeUnique<base::Value>(boolean_switch_map[i].set_value),
+               std::make_unique<base::Value>(boolean_switch_map[i].set_value),
                WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
     }
   }
diff --git a/components/prefs/in_memory_pref_store_unittest.cc b/components/prefs/in_memory_pref_store_unittest.cc
index 2bf1e7e..b2b6780 100644
--- a/components/prefs/in_memory_pref_store_unittest.cc
+++ b/components/prefs/in_memory_pref_store_unittest.cc
@@ -4,7 +4,8 @@
 
 #include "components/prefs/in_memory_pref_store.h"
 
-#include "base/memory/ptr_util.h"
+#include <memory>
+
 #include "base/test/scoped_task_environment.h"
 #include "base/values.h"
 #include "components/prefs/persistent_pref_store_unittest.h"
@@ -32,7 +33,7 @@
   EXPECT_FALSE(store_->GetValue(kTestPref, &value));
   EXPECT_FALSE(store_->GetMutableValue(kTestPref, &mutable_value));
 
-  store_->SetValue(kTestPref, base::MakeUnique<base::Value>(42),
+  store_->SetValue(kTestPref, std::make_unique<base::Value>(42),
                    WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(store_->GetValue(kTestPref, &value));
   EXPECT_TRUE(base::Value(42).Equals(value));
@@ -62,7 +63,7 @@
   store_->AddObserver(&observer_);
 
   // Triggers on SetValue.
-  store_->SetValue(kTestPref, base::MakeUnique<base::Value>(42),
+  store_->SetValue(kTestPref, std::make_unique<base::Value>(42),
                    WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   observer_.VerifyAndResetChangedKey(kTestPref);
 
@@ -71,7 +72,7 @@
   observer_.VerifyAndResetChangedKey(kTestPref);
 
   // But not SetValueSilently.
-  store_->SetValueSilently(kTestPref, base::MakeUnique<base::Value>(42),
+  store_->SetValueSilently(kTestPref, std::make_unique<base::Value>(42),
                            WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_EQ(0u, observer_.changed_keys.size());
 
@@ -83,7 +84,7 @@
 
   // Doesn't make call on removed observers.
   store_->RemoveObserver(&observer_);
-  store_->SetValue(kTestPref, base::MakeUnique<base::Value>(42),
+  store_->SetValue(kTestPref, std::make_unique<base::Value>(42),
                    WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   store_->RemoveValue(kTestPref, WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_EQ(0u, observer_.changed_keys.size());
diff --git a/components/prefs/json_pref_store_unittest.cc b/components/prefs/json_pref_store_unittest.cc
index fcb28f5..b0e2229 100644
--- a/components/prefs/json_pref_store_unittest.cc
+++ b/components/prefs/json_pref_store_unittest.cc
@@ -14,7 +14,6 @@
 #include "base/files/scoped_temp_dir.h"
 #include "base/location.h"
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/memory/ref_counted.h"
 #include "base/metrics/histogram_samples.h"
 #include "base/path_service.h"
@@ -231,7 +230,7 @@
   base::FilePath some_path(FILE_PATH_LITERAL("/usr/sbin/"));
 
   pref_store->SetValue(kSomeDirectory,
-                       base::MakeUnique<Value>(some_path.value()),
+                       std::make_unique<Value>(some_path.value()),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(pref_store->GetValue(kSomeDirectory, &actual));
   EXPECT_TRUE(actual->GetAsString(&path));
@@ -243,7 +242,7 @@
   EXPECT_TRUE(actual->GetAsBoolean(&boolean));
   EXPECT_TRUE(boolean);
 
-  pref_store->SetValue(kNewWindowsInTabs, base::MakeUnique<Value>(false),
+  pref_store->SetValue(kNewWindowsInTabs, std::make_unique<Value>(false),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(pref_store->GetValue(kNewWindowsInTabs, &actual));
   EXPECT_TRUE(actual->GetAsBoolean(&boolean));
@@ -253,7 +252,7 @@
   int integer = 0;
   EXPECT_TRUE(actual->GetAsInteger(&integer));
   EXPECT_EQ(20, integer);
-  pref_store->SetValue(kMaxTabs, base::MakeUnique<Value>(10),
+  pref_store->SetValue(kMaxTabs, std::make_unique<Value>(10),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(pref_store->GetValue(kMaxTabs, &actual));
   EXPECT_TRUE(actual->GetAsInteger(&integer));
@@ -261,7 +260,7 @@
 
   pref_store->SetValue(
       kLongIntPref,
-      base::MakeUnique<Value>(base::Int64ToString(214748364842LL)),
+      std::make_unique<Value>(base::Int64ToString(214748364842LL)),
       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(pref_store->GetValue(kLongIntPref, &actual));
   EXPECT_TRUE(actual->GetAsString(&string_value));
@@ -350,9 +349,9 @@
   auto pref_store = base::MakeRefCounted<JsonPrefStore>(pref_file);
 
   // Set some keys with empty values.
-  pref_store->SetValue("list", base::MakeUnique<base::ListValue>(),
+  pref_store->SetValue("list", std::make_unique<base::ListValue>(),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  pref_store->SetValue("dict", base::MakeUnique<base::DictionaryValue>(),
+  pref_store->SetValue("dict", std::make_unique<base::DictionaryValue>(),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   // Write to file.
@@ -714,7 +713,7 @@
 
   // Set a normal pref and check that it gets scheduled to be written.
   ASSERT_FALSE(file_writer->HasPendingWrite());
-  pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
+  pref_store->SetValue("normal", std::make_unique<base::Value>("normal"),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   ASSERT_TRUE(file_writer->HasPendingWrite());
   file_writer->DoScheduledWrite();
@@ -723,14 +722,14 @@
 
   // Set a lossy pref and check that it is not scheduled to be written.
   // SetValue/RemoveValue.
-  pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
+  pref_store->SetValue("lossy", std::make_unique<base::Value>("lossy"),
                        WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_FALSE(file_writer->HasPendingWrite());
   pref_store->RemoveValue("lossy", WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_FALSE(file_writer->HasPendingWrite());
 
   // SetValueSilently/RemoveValueSilently.
-  pref_store->SetValueSilently("lossy", base::MakeUnique<base::Value>("lossy"),
+  pref_store->SetValueSilently("lossy", std::make_unique<base::Value>("lossy"),
                                WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_FALSE(file_writer->HasPendingWrite());
   pref_store->RemoveValueSilently("lossy",
@@ -738,7 +737,7 @@
   ASSERT_FALSE(file_writer->HasPendingWrite());
 
   // ReportValueChanged.
-  pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
+  pref_store->SetValue("lossy", std::make_unique<base::Value>("lossy"),
                        WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_FALSE(file_writer->HasPendingWrite());
   pref_store->ReportValueChanged("lossy",
@@ -759,12 +758,12 @@
 
   // Set a lossy pref and check that it is not scheduled to be written.
   ASSERT_FALSE(file_writer->HasPendingWrite());
-  pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
+  pref_store->SetValue("lossy", std::make_unique<base::Value>("lossy"),
                        WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_FALSE(file_writer->HasPendingWrite());
 
   // Set a normal pref and check that it is scheduled to be written.
-  pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
+  pref_store->SetValue("normal", std::make_unique<base::Value>("normal"),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   ASSERT_TRUE(file_writer->HasPendingWrite());
 
@@ -781,12 +780,12 @@
 
   // Set a normal pref and check that it is scheduled to be written.
   ASSERT_FALSE(file_writer->HasPendingWrite());
-  pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
+  pref_store->SetValue("normal", std::make_unique<base::Value>("normal"),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   ASSERT_TRUE(file_writer->HasPendingWrite());
 
   // Set a lossy pref and check that the write is still scheduled.
-  pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
+  pref_store->SetValue("lossy", std::make_unique<base::Value>("lossy"),
                        WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_TRUE(file_writer->HasPendingWrite());
 
@@ -802,7 +801,7 @@
   ImportantFileWriter* file_writer = GetImportantFileWriter(pref_store.get());
 
   // Set a lossy pref and check that it is not scheduled to be written.
-  pref_store->SetValue("lossy", base::MakeUnique<base::Value>("lossy"),
+  pref_store->SetValue("lossy", std::make_unique<base::Value>("lossy"),
                        WriteablePrefStore::LOSSY_PREF_WRITE_FLAG);
   ASSERT_FALSE(file_writer->HasPendingWrite());
 
@@ -965,7 +964,7 @@
 
   EXPECT_EQ(NOT_CALLED,
             write_callback_observer_.GetAndResetPostWriteObservationState());
-  pref_store->SetValue("normal", base::MakeUnique<base::Value>("normal"),
+  pref_store->SetValue("normal", std::make_unique<base::Value>("normal"),
                        WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   file_writer->DoScheduledWrite();
 
@@ -989,7 +988,7 @@
   // RegisterOnNextSuccessfulWriteReply.
   successful_write_reply_observer_.ObserveNextWriteCallback(pref_store.get());
   write_callback_observer_.ObserveNextWriteCallback(pref_store.get());
-  file_writer->WriteNow(MakeUnique<std::string>("foo"));
+  file_writer->WriteNow(std::make_unique<std::string>("foo"));
   scoped_task_environment_.RunUntilIdle();
   EXPECT_TRUE(successful_write_reply_observer_.GetAndResetObservationState());
   EXPECT_TRUE(write_callback_observer_.GetAndResetPreWriteObservationState());
@@ -1000,7 +999,7 @@
   // RegisterOnNextWriteSynchronousCallbacks.
   successful_write_reply_observer_.ObserveNextWriteCallback(pref_store.get());
   write_callback_observer_.ObserveNextWriteCallback(pref_store.get());
-  file_writer->WriteNow(MakeUnique<std::string>("foo"));
+  file_writer->WriteNow(std::make_unique<std::string>("foo"));
   scoped_task_environment_.RunUntilIdle();
   EXPECT_TRUE(successful_write_reply_observer_.GetAndResetObservationState());
   EXPECT_TRUE(write_callback_observer_.GetAndResetPreWriteObservationState());
@@ -1009,7 +1008,7 @@
 
   // Test RegisterOnNextSuccessfulWriteReply only.
   successful_write_reply_observer_.ObserveNextWriteCallback(pref_store.get());
-  file_writer->WriteNow(MakeUnique<std::string>("foo"));
+  file_writer->WriteNow(std::make_unique<std::string>("foo"));
   scoped_task_environment_.RunUntilIdle();
   EXPECT_TRUE(successful_write_reply_observer_.GetAndResetObservationState());
   EXPECT_FALSE(write_callback_observer_.GetAndResetPreWriteObservationState());
@@ -1018,7 +1017,7 @@
 
   // Test RegisterOnNextWriteSynchronousCallbacks only.
   write_callback_observer_.ObserveNextWriteCallback(pref_store.get());
-  file_writer->WriteNow(MakeUnique<std::string>("foo"));
+  file_writer->WriteNow(std::make_unique<std::string>("foo"));
   scoped_task_environment_.RunUntilIdle();
   EXPECT_FALSE(successful_write_reply_observer_.GetAndResetObservationState());
   EXPECT_TRUE(write_callback_observer_.GetAndResetPreWriteObservationState());
@@ -1062,7 +1061,7 @@
   // Do a real write, and confirm that the successful observer was invoked after
   // being set by |PostWriteCallback| by the last TriggerFakeWriteCallback.
   ImportantFileWriter* file_writer = GetImportantFileWriter(pref_store.get());
-  file_writer->WriteNow(MakeUnique<std::string>("foo"));
+  file_writer->WriteNow(std::make_unique<std::string>("foo"));
   scoped_task_environment_.RunUntilIdle();
   EXPECT_TRUE(successful_write_reply_observer_.GetAndResetObservationState());
   EXPECT_EQ(NOT_CALLED,
@@ -1081,7 +1080,7 @@
         soon_out_of_scope_pref_store.get());
     write_callback_observer_.ObserveNextWriteCallback(
         soon_out_of_scope_pref_store.get());
-    file_writer->WriteNow(MakeUnique<std::string>("foo"));
+    file_writer->WriteNow(std::make_unique<std::string>("foo"));
   }
   scoped_task_environment_.RunUntilIdle();
   EXPECT_FALSE(successful_write_reply_observer_.GetAndResetObservationState());
diff --git a/components/prefs/overlay_user_pref_store.cc b/components/prefs/overlay_user_pref_store.cc
index cc34c7b0..618033a 100644
--- a/components/prefs/overlay_user_pref_store.cc
+++ b/components/prefs/overlay_user_pref_store.cc
@@ -39,9 +39,9 @@
 OverlayUserPrefStore::OverlayUserPrefStore(PersistentPrefStore* overlay,
                                            PersistentPrefStore* underlay)
     : overlay_observer_(
-          base::MakeUnique<OverlayUserPrefStore::ObserverAdapter>(true, this)),
+          std::make_unique<OverlayUserPrefStore::ObserverAdapter>(true, this)),
       underlay_observer_(
-          base::MakeUnique<OverlayUserPrefStore::ObserverAdapter>(false, this)),
+          std::make_unique<OverlayUserPrefStore::ObserverAdapter>(false, this)),
       overlay_(overlay),
       underlay_(underlay) {
   DCHECK(overlay->IsInitializationComplete());
diff --git a/components/prefs/overlay_user_pref_store_unittest.cc b/components/prefs/overlay_user_pref_store_unittest.cc
index b5813b40..528b9ab 100644
--- a/components/prefs/overlay_user_pref_store_unittest.cc
+++ b/components/prefs/overlay_user_pref_store_unittest.cc
@@ -3,8 +3,8 @@
 // found in the LICENSE file.
 
 #include "components/prefs/overlay_user_pref_store.h"
+#include <memory>
 
-#include "base/memory/ptr_util.h"
 #include "base/test/scoped_task_environment.h"
 #include "base/values.h"
 #include "components/prefs/persistent_pref_store_unittest.h"
@@ -50,22 +50,22 @@
   overlay_->AddObserver(&obs);
 
   // Check that underlay first value is reported.
-  underlay_->SetValue(overlay_key, base::MakeUnique<Value>(42),
+  underlay_->SetValue(overlay_key, std::make_unique<Value>(42),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   obs.VerifyAndResetChangedKey(overlay_key);
 
   // Check that underlay overwriting is reported.
-  underlay_->SetValue(overlay_key, base::MakeUnique<Value>(43),
+  underlay_->SetValue(overlay_key, std::make_unique<Value>(43),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   obs.VerifyAndResetChangedKey(overlay_key);
 
   // Check that overwriting change in overlay is reported.
-  overlay_->SetValue(overlay_key, base::MakeUnique<Value>(44),
+  overlay_->SetValue(overlay_key, std::make_unique<Value>(44),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   obs.VerifyAndResetChangedKey(overlay_key);
 
   // Check that hidden underlay change is not reported.
-  underlay_->SetValue(overlay_key, base::MakeUnique<Value>(45),
+  underlay_->SetValue(overlay_key, std::make_unique<Value>(45),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(obs.changed_keys.empty());
 
@@ -80,16 +80,16 @@
   obs.VerifyAndResetChangedKey(overlay_key);
 
   // Check respecting of silence.
-  overlay_->SetValueSilently(overlay_key, base::MakeUnique<Value>(46),
+  overlay_->SetValueSilently(overlay_key, std::make_unique<Value>(46),
                              WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(obs.changed_keys.empty());
 
   overlay_->RemoveObserver(&obs);
 
   // Check successful unsubscription.
-  underlay_->SetValue(overlay_key, base::MakeUnique<Value>(47),
+  underlay_->SetValue(overlay_key, std::make_unique<Value>(47),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  overlay_->SetValue(overlay_key, base::MakeUnique<Value>(48),
+  overlay_->SetValue(overlay_key, std::make_unique<Value>(48),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(obs.changed_keys.empty());
 }
@@ -99,7 +99,7 @@
   EXPECT_FALSE(overlay_->GetValue(overlay_key, &value));
   EXPECT_FALSE(underlay_->GetValue(overlay_key, &value));
 
-  underlay_->SetValue(overlay_key, base::MakeUnique<Value>(42),
+  underlay_->SetValue(overlay_key, std::make_unique<Value>(42),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   // Value shines through:
@@ -109,7 +109,7 @@
   EXPECT_TRUE(underlay_->GetValue(overlay_key, &value));
   EXPECT_TRUE(base::Value(42).Equals(value));
 
-  overlay_->SetValue(overlay_key, base::MakeUnique<Value>(43),
+  overlay_->SetValue(overlay_key, std::make_unique<Value>(43),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   EXPECT_TRUE(overlay_->GetValue(overlay_key, &value));
@@ -131,7 +131,7 @@
 
 // Check that GetMutableValue does not return the dictionary of the underlay.
 TEST_F(OverlayUserPrefStoreTest, ModifyDictionaries) {
-  underlay_->SetValue(overlay_key, base::MakeUnique<DictionaryValue>(),
+  underlay_->SetValue(overlay_key, std::make_unique<DictionaryValue>(),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   Value* modify = nullptr;
@@ -161,12 +161,12 @@
   const Value* value = nullptr;
 
   // Check that underlay first value is reported.
-  underlay_->SetValue(regular_key, base::MakeUnique<Value>(42),
+  underlay_->SetValue(regular_key, std::make_unique<Value>(42),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   obs.VerifyAndResetChangedKey(regular_key);
 
   // Check that underlay overwriting is reported.
-  underlay_->SetValue(regular_key, base::MakeUnique<Value>(43),
+  underlay_->SetValue(regular_key, std::make_unique<Value>(43),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   obs.VerifyAndResetChangedKey(regular_key);
 
@@ -175,7 +175,7 @@
   EXPECT_TRUE(base::Value(43).Equals(value));
 
   // Check that overwriting change in overlay is reported.
-  overlay_->SetValue(regular_key, base::MakeUnique<Value>(44),
+  overlay_->SetValue(regular_key, std::make_unique<Value>(44),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   obs.VerifyAndResetChangedKey(regular_key);
 
@@ -195,16 +195,16 @@
   EXPECT_FALSE(underlay_->GetValue(regular_key, &value));
 
   // Check respecting of silence.
-  overlay_->SetValueSilently(regular_key, base::MakeUnique<Value>(46),
+  overlay_->SetValueSilently(regular_key, std::make_unique<Value>(46),
                              WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(obs.changed_keys.empty());
 
   overlay_->RemoveObserver(&obs);
 
   // Check successful unsubscription.
-  underlay_->SetValue(regular_key, base::MakeUnique<Value>(47),
+  underlay_->SetValue(regular_key, std::make_unique<Value>(47),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  overlay_->SetValue(regular_key, base::MakeUnique<Value>(48),
+  overlay_->SetValue(regular_key, std::make_unique<Value>(48),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
   EXPECT_TRUE(obs.changed_keys.empty());
 }
@@ -212,9 +212,9 @@
 // Check that mutable values are removed correctly.
 TEST_F(OverlayUserPrefStoreTest, ClearMutableValues) {
   // Set in overlay and underlay the same preference.
-  underlay_->SetValue(overlay_key, base::MakeUnique<Value>(42),
+  underlay_->SetValue(overlay_key, std::make_unique<Value>(42),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  overlay_->SetValue(overlay_key, base::MakeUnique<Value>(43),
+  overlay_->SetValue(overlay_key, std::make_unique<Value>(43),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   const Value* value = nullptr;
@@ -231,9 +231,9 @@
 // Check that mutable values are removed correctly when using a silent set.
 TEST_F(OverlayUserPrefStoreTest, ClearMutableValues_Silently) {
   // Set in overlay and underlay the same preference.
-  underlay_->SetValueSilently(overlay_key, base::MakeUnique<Value>(42),
+  underlay_->SetValueSilently(overlay_key, std::make_unique<Value>(42),
                               WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  overlay_->SetValueSilently(overlay_key, base::MakeUnique<Value>(43),
+  overlay_->SetValueSilently(overlay_key, std::make_unique<Value>(43),
                              WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   const Value* value = nullptr;
@@ -250,13 +250,13 @@
 TEST_F(OverlayUserPrefStoreTest, GetValues) {
   // To check merge behavior, create underlay and overlay so each has a key the
   // other doesn't have and they have one key in common.
-  underlay_->SetValue(regular_key, base::MakeUnique<Value>(42),
+  underlay_->SetValue(regular_key, std::make_unique<Value>(42),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  overlay_->SetValue(overlay_key, base::MakeUnique<Value>(43),
+  overlay_->SetValue(overlay_key, std::make_unique<Value>(43),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  underlay_->SetValue(shared_key, base::MakeUnique<Value>(42),
+  underlay_->SetValue(shared_key, std::make_unique<Value>(42),
                       WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
-  overlay_->SetValue(shared_key, base::MakeUnique<Value>(43),
+  overlay_->SetValue(shared_key, std::make_unique<Value>(43),
                      WriteablePrefStore::DEFAULT_PREF_WRITE_FLAGS);
 
   auto values = overlay_->GetValues();
diff --git a/components/prefs/pref_change_registrar_unittest.cc b/components/prefs/pref_change_registrar_unittest.cc
index 15be02c8..4027618a 100644
--- a/components/prefs/pref_change_registrar_unittest.cc
+++ b/components/prefs/pref_change_registrar_unittest.cc
@@ -4,9 +4,10 @@
 
 #include "components/prefs/pref_change_registrar.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/bind_helpers.h"
-#include "base/memory/ptr_util.h"
 #include "components/prefs/pref_observer.h"
 #include "components/prefs/pref_registry_simple.h"
 #include "components/prefs/testing_pref_service.h"
@@ -160,10 +161,10 @@
   std::unique_ptr<PrefChangeRegistrar> pref_set(CreatePrefChangeRegistrar());
   EXPECT_FALSE(pref_set->IsManaged());
   pref_service_->SetManagedPref(kHomePage,
-                                base::MakeUnique<Value>("http://crbug.com"));
+                                std::make_unique<Value>("http://crbug.com"));
   EXPECT_TRUE(pref_set->IsManaged());
   pref_service_->SetManagedPref(kHomePageIsNewTabPage,
-                                base::MakeUnique<Value>(true));
+                                std::make_unique<Value>(true));
   EXPECT_TRUE(pref_set->IsManaged());
   pref_service_->RemoveManagedPref(kHomePage);
   EXPECT_TRUE(pref_set->IsManaged());
@@ -185,17 +186,17 @@
 
   EXPECT_CALL(*this, OnPreferenceChanged(kHomePage));
   pref_service_->SetUserPref(kHomePage,
-                             base::MakeUnique<Value>("http://crbug.com"));
+                             std::make_unique<Value>("http://crbug.com"));
   Mock::VerifyAndClearExpectations(this);
 
   EXPECT_CALL(*this, OnPreferenceChanged(kHomePageIsNewTabPage));
   pref_service_->SetUserPref(kHomePageIsNewTabPage,
-                             base::MakeUnique<Value>(true));
+                             std::make_unique<Value>(true));
   Mock::VerifyAndClearExpectations(this);
 
   EXPECT_CALL(*this, OnPreferenceChanged(_)).Times(0);
   pref_service_->SetUserPref(kApplicationLocale,
-                             base::MakeUnique<Value>("en_US.utf8"));
+                             std::make_unique<Value>("en_US.utf8"));
   Mock::VerifyAndClearExpectations(this);
 }
 
diff --git a/components/prefs/pref_member_unittest.cc b/components/prefs/pref_member_unittest.cc
index 7c684a5..6208698 100644
--- a/components/prefs/pref_member_unittest.cc
+++ b/components/prefs/pref_member_unittest.cc
@@ -4,9 +4,10 @@
 
 #include "components/prefs/pref_member.h"
 
+#include <memory>
+
 #include "base/bind.h"
 #include "base/location.h"
-#include "base/memory/ptr_util.h"
 #include "base/single_thread_task_runner.h"
 #include "base/synchronization/waitable_event.h"
 #include "base/test/scoped_task_environment.h"
@@ -29,7 +30,7 @@
   registry->RegisterDoublePref(kDoublePref, 0.0);
   registry->RegisterStringPref(kStringPref, "default");
   registry->RegisterListPref(kStringListPref,
-                             base::MakeUnique<base::ListValue>());
+                             std::make_unique<base::ListValue>());
 }
 
 class GetPrefValueHelper
diff --git a/components/prefs/pref_registry_simple.cc b/components/prefs/pref_registry_simple.cc
index c617f1dd..c19825e 100644
--- a/components/prefs/pref_registry_simple.cc
+++ b/components/prefs/pref_registry_simple.cc
@@ -7,7 +7,6 @@
 #include <utility>
 
 #include "base/files/file_path.h"
-#include "base/memory/ptr_util.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/values.h"
 
@@ -19,37 +18,37 @@
 
 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path,
                                              bool default_value) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value),
+  RegisterPreference(path, std::make_unique<base::Value>(default_value),
                      NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path,
                                              int default_value) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value),
+  RegisterPreference(path, std::make_unique<base::Value>(default_value),
                      NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterDoublePref(const std::string& path,
                                             double default_value) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value),
+  RegisterPreference(path, std::make_unique<base::Value>(default_value),
                      NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterStringPref(const std::string& path,
                                             const std::string& default_value) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value),
+  RegisterPreference(path, std::make_unique<base::Value>(default_value),
                      NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterFilePathPref(
     const std::string& path,
     const base::FilePath& default_value) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value.value()),
+  RegisterPreference(path, std::make_unique<base::Value>(default_value.value()),
                      NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterListPref(const std::string& path) {
-  RegisterPreference(path, base::MakeUnique<base::ListValue>(),
+  RegisterPreference(path, std::make_unique<base::ListValue>(),
                      NO_REGISTRATION_FLAGS);
 }
 
@@ -60,7 +59,7 @@
 }
 
 void PrefRegistrySimple::RegisterDictionaryPref(const std::string& path) {
-  RegisterPreference(path, base::MakeUnique<base::DictionaryValue>(),
+  RegisterPreference(path, std::make_unique<base::DictionaryValue>(),
                      NO_REGISTRATION_FLAGS);
 }
 
@@ -73,52 +72,52 @@
 void PrefRegistrySimple::RegisterInt64Pref(const std::string& path,
                                            int64_t default_value) {
   RegisterPreference(
-      path, base::MakeUnique<base::Value>(base::Int64ToString(default_value)),
+      path, std::make_unique<base::Value>(base::Int64ToString(default_value)),
       NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterUint64Pref(const std::string& path,
                                             uint64_t default_value) {
   RegisterPreference(
-      path, base::MakeUnique<base::Value>(base::NumberToString(default_value)),
+      path, std::make_unique<base::Value>(base::NumberToString(default_value)),
       NO_REGISTRATION_FLAGS);
 }
 
 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path,
                                              bool default_value,
                                              uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value), flags);
+  RegisterPreference(path, std::make_unique<base::Value>(default_value), flags);
 }
 
 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path,
                                              int default_value,
                                              uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value), flags);
+  RegisterPreference(path, std::make_unique<base::Value>(default_value), flags);
 }
 
 void PrefRegistrySimple::RegisterDoublePref(const std::string& path,
                                             double default_value,
                                             uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value), flags);
+  RegisterPreference(path, std::make_unique<base::Value>(default_value), flags);
 }
 
 void PrefRegistrySimple::RegisterStringPref(const std::string& path,
                                             const std::string& default_value,
                                             uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value), flags);
+  RegisterPreference(path, std::make_unique<base::Value>(default_value), flags);
 }
 
 void PrefRegistrySimple::RegisterFilePathPref(
     const std::string& path,
     const base::FilePath& default_value,
     uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::Value>(default_value.value()),
+  RegisterPreference(path, std::make_unique<base::Value>(default_value.value()),
                      flags);
 }
 
 void PrefRegistrySimple::RegisterListPref(const std::string& path,
                                           uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::ListValue>(), flags);
+  RegisterPreference(path, std::make_unique<base::ListValue>(), flags);
 }
 
 void PrefRegistrySimple::RegisterListPref(
@@ -130,7 +129,7 @@
 
 void PrefRegistrySimple::RegisterDictionaryPref(const std::string& path,
                                                 uint32_t flags) {
-  RegisterPreference(path, base::MakeUnique<base::DictionaryValue>(), flags);
+  RegisterPreference(path, std::make_unique<base::DictionaryValue>(), flags);
 }
 
 void PrefRegistrySimple::RegisterDictionaryPref(
@@ -144,7 +143,7 @@
                                            int64_t default_value,
                                            uint32_t flags) {
   RegisterPreference(
-      path, base::MakeUnique<base::Value>(base::Int64ToString(default_value)),
+      path, std::make_unique<base::Value>(base::Int64ToString(default_value)),
       flags);
 }
 
@@ -152,6 +151,6 @@
                                             uint64_t default_value,
                                             uint32_t flags) {
   RegisterPreference(
-      path, base::MakeUnique<base::Value>(base::NumberToString(default_value)),
+      path, std::make_unique<base::Value>(base::NumberToString(default_value)),
       flags);
 }
diff --git a/components/prefs/pref_service.cc b/components/prefs/pref_service.cc
index 1adbb77..c96a044a 100644
--- a/components/prefs/pref_service.cc
+++ b/components/prefs/pref_service.cc
@@ -405,19 +405,19 @@
 }
 
 void PrefService::SetBoolean(const std::string& path, bool value) {
-  SetUserPrefValue(path, base::MakeUnique<base::Value>(value));
+  SetUserPrefValue(path, std::make_unique<base::Value>(value));
 }
 
 void PrefService::SetInteger(const std::string& path, int value) {
-  SetUserPrefValue(path, base::MakeUnique<base::Value>(value));
+  SetUserPrefValue(path, std::make_unique<base::Value>(value));
 }
 
 void PrefService::SetDouble(const std::string& path, double value) {
-  SetUserPrefValue(path, base::MakeUnique<base::Value>(value));
+  SetUserPrefValue(path, std::make_unique<base::Value>(value));
 }
 
 void PrefService::SetString(const std::string& path, const std::string& value) {
-  SetUserPrefValue(path, base::MakeUnique<base::Value>(value));
+  SetUserPrefValue(path, std::make_unique<base::Value>(value));
 }
 
 void PrefService::SetFilePath(const std::string& path,
@@ -427,7 +427,7 @@
 
 void PrefService::SetInt64(const std::string& path, int64_t value) {
   SetUserPrefValue(path,
-                   base::MakeUnique<base::Value>(base::Int64ToString(value)));
+                   std::make_unique<base::Value>(base::Int64ToString(value)));
 }
 
 int64_t PrefService::GetInt64(const std::string& path) const {
@@ -449,7 +449,7 @@
 
 void PrefService::SetUint64(const std::string& path, uint64_t value) {
   SetUserPrefValue(path,
-                   base::MakeUnique<base::Value>(base::NumberToString(value)));
+                   std::make_unique<base::Value>(base::NumberToString(value)));
 }
 
 uint64_t PrefService::GetUint64(const std::string& path) const {
diff --git a/components/prefs/pref_service_unittest.cc b/components/prefs/pref_service_unittest.cc
index 2776fbf6..5df7851 100644
--- a/components/prefs/pref_service_unittest.cc
+++ b/components/prefs/pref_service_unittest.cc
@@ -8,7 +8,6 @@
 #include <string>
 
 #include "base/macros.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "components/prefs/json_pref_store.h"
 #include "components/prefs/mock_pref_change_callback.h"
@@ -85,7 +84,7 @@
 
   TestingPrefServiceSimple prefs;
   prefs.SetUserPref(pref_name,
-                    base::MakeUnique<base::Value>("http://www.cnn.com"));
+                    std::make_unique<base::Value>("http://www.cnn.com"));
   prefs.registry()->RegisterStringPref(pref_name, std::string());
 
   const char new_pref_value[] = "http://www.google.com/";
@@ -143,7 +142,7 @@
   prefs.registry()->RegisterIntegerPref(kPrefName, kTestValue);
 
   // Check falling back to a recommended value.
-  prefs.SetUserPref(kPrefName, base::MakeUnique<base::Value>("not an integer"));
+  prefs.SetUserPref(kPrefName, std::make_unique<base::Value>("not an integer"));
   const PrefService::Preference* pref = prefs.FindPreference(kPrefName);
   ASSERT_TRUE(pref);
   const base::Value* value = pref->GetValue();
@@ -178,7 +177,7 @@
   ASSERT_FALSE(value);
 
   // Set a user-set value.
-  prefs.SetUserPref(kPrefName, base::MakeUnique<base::Value>(kUserValue));
+  prefs.SetUserPref(kPrefName, std::make_unique<base::Value>(kUserValue));
 
   // Check that GetValue() returns the user-set value.
   value = pref->GetValue();
@@ -194,7 +193,7 @@
 
   // Set a recommended value.
   prefs.SetRecommendedPref(kPrefName,
-                           base::MakeUnique<base::Value>(kRecommendedValue));
+                           std::make_unique<base::Value>(kRecommendedValue));
 
   // Check that GetValue() returns the user-set value.
   value = pref->GetValue();
@@ -316,7 +315,7 @@
   for (size_t i = 0; i < arraysize(kRegistrationToWriteFlags); ++i) {
     RegistrationToWriteFlags entry = kRegistrationToWriteFlags[i];
     registry->RegisterDictionaryPref(entry.pref_name,
-                                     base::MakeUnique<base::DictionaryValue>(),
+                                     std::make_unique<base::DictionaryValue>(),
                                      entry.registration_flags);
 
     SCOPED_TRACE("Currently testing pref with name: " +
@@ -335,7 +334,7 @@
     EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
 
     prefs->SetUserPrefValue(entry.pref_name,
-                            base::MakeUnique<base::DictionaryValue>());
+                            std::make_unique<base::DictionaryValue>());
     EXPECT_TRUE(flag_checker->last_write_flags_set());
     EXPECT_EQ(entry.write_flags, flag_checker->GetLastFlagsAndClear());
   }
diff --git a/components/prefs/pref_value_map.cc b/components/prefs/pref_value_map.cc
index 1d120a8..3cd2d87 100644
--- a/components/prefs/pref_value_map.cc
+++ b/components/prefs/pref_value_map.cc
@@ -9,7 +9,6 @@
 #include <utility>
 
 #include "base/logging.h"
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 
 PrefValueMap::PrefValueMap() {}
@@ -92,7 +91,7 @@
 }
 
 void PrefValueMap::SetBoolean(const std::string& key, bool value) {
-  SetValue(key, base::MakeUnique<base::Value>(value));
+  SetValue(key, std::make_unique<base::Value>(value));
 }
 
 bool PrefValueMap::GetString(const std::string& key,
@@ -103,7 +102,7 @@
 
 void PrefValueMap::SetString(const std::string& key,
                              const std::string& value) {
-  SetValue(key, base::MakeUnique<base::Value>(value));
+  SetValue(key, std::make_unique<base::Value>(value));
 }
 
 bool PrefValueMap::GetInteger(const std::string& key, int* value) const {
@@ -112,11 +111,11 @@
 }
 
 void PrefValueMap::SetInteger(const std::string& key, const int value) {
-  SetValue(key, base::MakeUnique<base::Value>(value));
+  SetValue(key, std::make_unique<base::Value>(value));
 }
 
 void PrefValueMap::SetDouble(const std::string& key, const double value) {
-  SetValue(key, base::MakeUnique<base::Value>(value));
+  SetValue(key, std::make_unique<base::Value>(value));
 }
 
 void PrefValueMap::GetDifferingKeys(
@@ -159,7 +158,7 @@
 }
 
 std::unique_ptr<base::DictionaryValue> PrefValueMap::AsDictionaryValue() const {
-  auto dictionary = base::MakeUnique<base::DictionaryValue>();
+  auto dictionary = std::make_unique<base::DictionaryValue>();
   for (const auto& value : prefs_) {
     dictionary->Set(value.first, value.second->CreateDeepCopy());
   }
diff --git a/components/prefs/pref_value_map_unittest.cc b/components/prefs/pref_value_map_unittest.cc
index 0cc9d61..f3b05f7a 100644
--- a/components/prefs/pref_value_map_unittest.cc
+++ b/components/prefs/pref_value_map_unittest.cc
@@ -4,7 +4,6 @@
 
 #include "components/prefs/pref_value_map.h"
 
-#include "base/memory/ptr_util.h"
 #include "base/values.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -17,9 +16,9 @@
   EXPECT_FALSE(map.GetValue("key", &result));
   EXPECT_FALSE(result);
 
-  EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("test")));
-  EXPECT_FALSE(map.SetValue("key", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("hi mom!")));
+  EXPECT_TRUE(map.SetValue("key", std::make_unique<Value>("test")));
+  EXPECT_FALSE(map.SetValue("key", std::make_unique<Value>("test")));
+  EXPECT_TRUE(map.SetValue("key", std::make_unique<Value>("hi mom!")));
 
   EXPECT_TRUE(map.GetValue("key", &result));
   EXPECT_TRUE(Value("hi mom!").Equals(result));
@@ -27,7 +26,7 @@
 
 TEST(PrefValueMapTest, GetAndSetIntegerValue) {
   PrefValueMap map;
-  ASSERT_TRUE(map.SetValue("key", base::MakeUnique<Value>(5)));
+  ASSERT_TRUE(map.SetValue("key", std::make_unique<Value>(5)));
 
   int int_value = 0;
   EXPECT_TRUE(map.GetInteger("key", &int_value));
@@ -40,7 +39,7 @@
 
 TEST(PrefValueMapTest, SetDoubleValue) {
   PrefValueMap map;
-  ASSERT_TRUE(map.SetValue("key", base::MakeUnique<Value>(5.5)));
+  ASSERT_TRUE(map.SetValue("key", std::make_unique<Value>(5.5)));
 
   const Value* result = nullptr;
   ASSERT_TRUE(map.GetValue("key", &result));
@@ -53,7 +52,7 @@
   PrefValueMap map;
   EXPECT_FALSE(map.RemoveValue("key"));
 
-  EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("test")));
+  EXPECT_TRUE(map.SetValue("key", std::make_unique<Value>("test")));
   EXPECT_TRUE(map.GetValue("key", nullptr));
 
   EXPECT_TRUE(map.RemoveValue("key"));
@@ -64,7 +63,7 @@
 
 TEST(PrefValueMapTest, Clear) {
   PrefValueMap map;
-  EXPECT_TRUE(map.SetValue("key", base::MakeUnique<Value>("test")));
+  EXPECT_TRUE(map.SetValue("key", std::make_unique<Value>("test")));
   EXPECT_TRUE(map.GetValue("key", nullptr));
 
   map.Clear();
@@ -74,9 +73,9 @@
 
 TEST(PrefValueMapTest, GetDifferingKeys) {
   PrefValueMap reference;
-  EXPECT_TRUE(reference.SetValue("b", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(reference.SetValue("c", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(reference.SetValue("e", base::MakeUnique<Value>("test")));
+  EXPECT_TRUE(reference.SetValue("b", std::make_unique<Value>("test")));
+  EXPECT_TRUE(reference.SetValue("c", std::make_unique<Value>("test")));
+  EXPECT_TRUE(reference.SetValue("e", std::make_unique<Value>("test")));
 
   PrefValueMap check;
   std::vector<std::string> differing_paths;
@@ -88,9 +87,9 @@
   expected_differing_paths.push_back("e");
   EXPECT_EQ(expected_differing_paths, differing_paths);
 
-  EXPECT_TRUE(check.SetValue("a", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(check.SetValue("c", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(check.SetValue("d", base::MakeUnique<Value>("test")));
+  EXPECT_TRUE(check.SetValue("a", std::make_unique<Value>("test")));
+  EXPECT_TRUE(check.SetValue("c", std::make_unique<Value>("test")));
+  EXPECT_TRUE(check.SetValue("d", std::make_unique<Value>("test")));
 
   reference.GetDifferingKeys(&check, &differing_paths);
   expected_differing_paths.clear();
@@ -103,14 +102,14 @@
 
 TEST(PrefValueMapTest, SwapTwoMaps) {
   PrefValueMap first_map;
-  EXPECT_TRUE(first_map.SetValue("a", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(first_map.SetValue("b", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(first_map.SetValue("c", base::MakeUnique<Value>("test")));
+  EXPECT_TRUE(first_map.SetValue("a", std::make_unique<Value>("test")));
+  EXPECT_TRUE(first_map.SetValue("b", std::make_unique<Value>("test")));
+  EXPECT_TRUE(first_map.SetValue("c", std::make_unique<Value>("test")));
 
   PrefValueMap second_map;
-  EXPECT_TRUE(second_map.SetValue("d", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(second_map.SetValue("e", base::MakeUnique<Value>("test")));
-  EXPECT_TRUE(second_map.SetValue("f", base::MakeUnique<Value>("test")));
+  EXPECT_TRUE(second_map.SetValue("d", std::make_unique<Value>("test")));
+  EXPECT_TRUE(second_map.SetValue("e", std::make_unique<Value>("test")));
+  EXPECT_TRUE(second_map.SetValue("f", std::make_unique<Value>("test")));
 
   first_map.Swap(&second_map);
 
diff --git a/components/prefs/testing_pref_store.cc b/components/prefs/testing_pref_store.cc
index cccf6b4e0..5dbc56af 100644
--- a/components/prefs/testing_pref_store.cc
+++ b/components/prefs/testing_pref_store.cc
@@ -8,7 +8,6 @@
 #include <utility>
 
 #include "base/json/json_writer.h"
-#include "base/memory/ptr_util.h"
 #include "base/threading/sequenced_task_runner_handle.h"
 #include "base/values.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -136,15 +135,15 @@
 
 void TestingPrefStore::SetString(const std::string& key,
                                  const std::string& value) {
-  SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
+  SetValue(key, std::make_unique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
 }
 
 void TestingPrefStore::SetInteger(const std::string& key, int value) {
-  SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
+  SetValue(key, std::make_unique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
 }
 
 void TestingPrefStore::SetBoolean(const std::string& key, bool value) {
-  SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
+  SetValue(key, std::make_unique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
 }
 
 bool TestingPrefStore::GetString(const std::string& key,
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 5e5fad0..421bc58 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -2042,6 +2042,8 @@
       "android/java/java_type.h",
       "android/java/jni_helper.cc",
       "android/java/jni_helper.h",
+      "android/javascript_injector.cc",
+      "android/javascript_injector.h",
       "android/load_url_params.cc",
       "android/nfc_host.cc",
       "android/nfc_host.h",
diff --git a/content/browser/android/javascript_injector.cc b/content/browser/android/javascript_injector.cc
new file mode 100644
index 0000000..494b1bfe
--- /dev/null
+++ b/content/browser/android/javascript_injector.cc
@@ -0,0 +1,79 @@
+// 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/browser/android/javascript_injector.h"
+
+#include "base/android/jni_string.h"
+#include "content/browser/android/java/gin_java_bridge_dispatcher_host.h"
+#include "jni/JavascriptInjectorImpl_jni.h"
+
+using base::android::AttachCurrentThread;
+using base::android::ConvertJavaStringToUTF8;
+using base::android::JavaParamRef;
+using base::android::ScopedJavaLocalRef;
+
+namespace content {
+
+DEFINE_WEB_CONTENTS_USER_DATA_KEY(JavascriptInjector);
+
+JavascriptInjector::JavascriptInjector(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jobject>& obj,
+    const base::android::JavaParamRef<jobject>& retained_objects,
+    WebContents* web_contents)
+    : java_ref_(env, obj) {
+  java_bridge_dispatcher_host_ =
+      new GinJavaBridgeDispatcherHost(web_contents, retained_objects);
+}
+
+JavascriptInjector::~JavascriptInjector() {
+  JNIEnv* env = AttachCurrentThread();
+  ScopedJavaLocalRef<jobject> j_obj = java_ref_.get(env);
+  if (j_obj.is_null())
+    return;
+  Java_JavascriptInjectorImpl_onDestroy(env, j_obj);
+}
+
+void JavascriptInjector::SetAllowInspection(JNIEnv* env,
+                                            const JavaParamRef<jobject>& obj,
+                                            jboolean allow) {
+  DCHECK(java_bridge_dispatcher_host_);
+  java_bridge_dispatcher_host_->SetAllowObjectContentsInspection(allow);
+}
+
+void JavascriptInjector::AddInterface(
+    JNIEnv* env,
+    const JavaParamRef<jobject>& /* obj */,
+    const JavaParamRef<jobject>& object,
+    const JavaParamRef<jstring>& name,
+    const JavaParamRef<jclass>& safe_annotation_clazz) {
+  DCHECK(java_bridge_dispatcher_host_);
+  java_bridge_dispatcher_host_->AddNamedObject(
+      ConvertJavaStringToUTF8(env, name), object, safe_annotation_clazz);
+}
+
+void JavascriptInjector::RemoveInterface(JNIEnv* env,
+                                         const JavaParamRef<jobject>& /* obj */,
+                                         const JavaParamRef<jstring>& name) {
+  DCHECK(java_bridge_dispatcher_host_);
+  java_bridge_dispatcher_host_->RemoveNamedObject(
+      ConvertJavaStringToUTF8(env, name));
+}
+
+jlong JNI_JavascriptInjectorImpl_Init(
+    JNIEnv* env,
+    const JavaParamRef<jobject>& obj,
+    const JavaParamRef<jobject>& jweb_contents,
+    const JavaParamRef<jobject>& retained_objects) {
+  auto* web_contents = WebContents::FromJavaWebContents(jweb_contents);
+  CHECK(web_contents) << "Should be created with a valid WebContents.";
+  DCHECK(!JavascriptInjector::FromWebContents(web_contents));
+
+  // Owned by |web_contents|.
+  auto* injector =
+      new JavascriptInjector(env, obj, retained_objects, web_contents);
+  return reinterpret_cast<intptr_t>(injector);
+}
+
+}  // namespace content
diff --git a/content/browser/android/javascript_injector.h b/content/browser/android/javascript_injector.h
new file mode 100644
index 0000000..ebac010
--- /dev/null
+++ b/content/browser/android/javascript_injector.h
@@ -0,0 +1,54 @@
+// 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_BROWSER_ANDROID_JAVASCRIPT_INJECTOR_H_
+#define CONTENT_BROWSER_ANDROID_JAVASCRIPT_INJECTOR_H_
+
+#include "base/android/jni_android.h"
+#include "base/android/jni_weak_ref.h"
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+namespace content {
+
+class GinJavaBridgeDispatcherHost;
+
+class JavascriptInjector : public WebContentsUserData<JavascriptInjector> {
+ public:
+  JavascriptInjector(
+      JNIEnv* env,
+      const base::android::JavaParamRef<jobject>& obj,
+      const base::android::JavaParamRef<jobject>& retained_objects,
+      WebContents* web_contents);
+  ~JavascriptInjector() override;
+
+  void SetAllowInspection(JNIEnv* env,
+                          const base::android::JavaParamRef<jobject>& obj,
+                          jboolean allow);
+
+  void AddInterface(
+      JNIEnv* env,
+      const base::android::JavaParamRef<jobject>& /* obj */,
+      const base::android::JavaParamRef<jobject>& object,
+      const base::android::JavaParamRef<jstring>& name,
+      const base::android::JavaParamRef<jclass>& safe_annotation_clazz);
+
+  void RemoveInterface(JNIEnv* env,
+                       const base::android::JavaParamRef<jobject>& /* obj */,
+                       const base::android::JavaParamRef<jstring>& name);
+
+ private:
+  // A weak reference to the Java GestureListenerManager object.
+  JavaObjectWeakGlobalRef java_ref_;
+
+  // Manages injecting Java objects.
+  scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_;
+
+  DISALLOW_COPY_AND_ASSIGN(JavascriptInjector);
+};
+
+}  // namespace content
+
+#endif  // CONTENT_BROWSER_ANDROID_JAVASCRIPT_INJECTOR_H_
diff --git a/content/browser/appcache/appcache_host_unittest.cc b/content/browser/appcache/appcache_host_unittest.cc
index 2fd5c6a..b4cf5f5 100644
--- a/content/browser/appcache/appcache_host_unittest.cc
+++ b/content/browser/appcache/appcache_host_unittest.cc
@@ -95,18 +95,18 @@
     void RegisterClient(storage::QuotaClient* client) override {}
     void NotifyStorageAccessed(storage::QuotaClient::ID client_id,
                                const GURL& origin,
-                               storage::StorageType type) override {}
+                               blink::StorageType type) override {}
     void NotifyStorageModified(storage::QuotaClient::ID client_id,
                                const GURL& origin,
-                               storage::StorageType type,
+                               blink::StorageType type,
                                int64_t delta) override {}
     void SetUsageCacheEnabled(storage::QuotaClient::ID client_id,
                               const GURL& origin,
-                              storage::StorageType type,
+                              blink::StorageType type,
                               bool enabled) override {}
     void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner,
                           const GURL& origin,
-                          storage::StorageType type,
+                          blink::StorageType type,
                           const UsageAndQuotaCallback& callback) override {}
 
     void NotifyOriginInUse(const GURL& origin) override { inuse_[origin] += 1; }
diff --git a/content/browser/appcache/appcache_quota_client.cc b/content/browser/appcache/appcache_quota_client.cc
index 9c2c470..4bbf0a870 100644
--- a/content/browser/appcache/appcache_quota_client.cc
+++ b/content/browser/appcache/appcache_quota_client.cc
@@ -13,6 +13,7 @@
 #include "content/browser/appcache/appcache_service_impl.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
 
+using blink::StorageType;
 using storage::QuotaClient;
 
 namespace {
@@ -63,7 +64,7 @@
 }
 
 void AppCacheQuotaClient::GetOriginUsage(const GURL& origin,
-                                         storage::StorageType type,
+                                         StorageType type,
                                          const GetUsageCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(!quota_manager_is_destroyed_);
@@ -80,7 +81,7 @@
     return;
   }
 
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(0);
     return;
   }
@@ -95,13 +96,13 @@
 }
 
 void AppCacheQuotaClient::GetOriginsForType(
-    storage::StorageType type,
+    StorageType type,
     const GetOriginsCallback& callback) {
   GetOriginsHelper(type, std::string(), callback);
 }
 
 void AppCacheQuotaClient::GetOriginsForHost(
-    storage::StorageType type,
+    StorageType type,
     const std::string& host,
     const GetOriginsCallback& callback) {
   DCHECK(!callback.is_null());
@@ -113,7 +114,7 @@
 }
 
 void AppCacheQuotaClient::DeleteOriginData(const GURL& origin,
-                                           storage::StorageType type,
+                                           StorageType type,
                                            const DeletionCallback& callback) {
   DCHECK(!quota_manager_is_destroyed_);
 
@@ -130,7 +131,7 @@
   }
 
   current_delete_request_callback_ = callback;
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     DidDeleteAppCachesForOrigin(net::OK);
     return;
   }
@@ -139,8 +140,8 @@
       origin, GetServiceDeleteCallback()->callback());
 }
 
-bool AppCacheQuotaClient::DoesSupport(storage::StorageType type) const {
-  return type == storage::kStorageTypeTemporary;
+bool AppCacheQuotaClient::DoesSupport(StorageType type) const {
+  return type == StorageType::kTemporary;
 }
 
 void AppCacheQuotaClient::DidDeleteAppCachesForOrigin(int rv) {
@@ -158,7 +159,7 @@
   RunFront(&pending_serial_requests_);
 }
 
-void AppCacheQuotaClient::GetOriginsHelper(storage::StorageType type,
+void AppCacheQuotaClient::GetOriginsHelper(StorageType type,
                                            const std::string& opt_host,
                                            const GetOriginsCallback& callback) {
   DCHECK(!callback.is_null());
@@ -176,7 +177,7 @@
     return;
   }
 
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
diff --git a/content/browser/appcache/appcache_quota_client.h b/content/browser/appcache/appcache_quota_client.h
index acbaafba..776b0ea 100644
--- a/content/browser/appcache/appcache_quota_client.h
+++ b/content/browser/appcache/appcache_quota_client.h
@@ -17,7 +17,7 @@
 #include "net/base/completion_callback.h"
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/quota/quota_task.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 class AppCacheQuotaClientTest;
@@ -39,17 +39,17 @@
   ID id() const override;
   void OnQuotaManagerDestroyed() override;
   void GetOriginUsage(const GURL& origin,
-                      storage::StorageType type,
+                      blink::StorageType type,
                       const GetUsageCallback& callback) override;
-  void GetOriginsForType(storage::StorageType type,
+  void GetOriginsForType(blink::StorageType type,
                          const GetOriginsCallback& callback) override;
-  void GetOriginsForHost(storage::StorageType type,
+  void GetOriginsForHost(blink::StorageType type,
                          const std::string& host,
                          const GetOriginsCallback& callback) override;
   void DeleteOriginData(const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(blink::StorageType type) const override;
 
  private:
   friend class content::AppCacheQuotaClientTest;
@@ -60,7 +60,7 @@
       explicit AppCacheQuotaClient(AppCacheServiceImpl* service);
 
   void DidDeleteAppCachesForOrigin(int rv);
-  void GetOriginsHelper(storage::StorageType type,
+  void GetOriginsHelper(blink::StorageType type,
                         const std::string& opt_host,
                         const GetOriginsCallback& callback);
   void ProcessPendingRequests();
diff --git a/content/browser/appcache/appcache_quota_client_unittest.cc b/content/browser/appcache/appcache_quota_client_unittest.cc
index 53ef9e4..cc5ee29 100644
--- a/content/browser/appcache/appcache_quota_client_unittest.cc
+++ b/content/browser/appcache/appcache_quota_client_unittest.cc
@@ -17,9 +17,11 @@
 
 namespace content {
 
+using blink::StorageType;
+
 // Declared to shorten the line lengths.
-static const storage::StorageType kTemp = storage::kStorageTypeTemporary;
-static const storage::StorageType kPerm = storage::kStorageTypePersistent;
+static const StorageType kTemp = StorageType::kTemporary;
+static const StorageType kPerm = StorageType::kPersistent;
 
 // Base class for our test fixtures.
 class AppCacheQuotaClientTest : public testing::Test {
@@ -41,7 +43,7 @@
 
   int64_t GetOriginUsage(storage::QuotaClient* client,
                          const GURL& origin,
-                         storage::StorageType type) {
+                         StorageType type) {
     usage_ = -1;
     AsyncGetOriginUsage(client, origin, type);
     base::RunLoop().RunUntilIdle();
@@ -49,7 +51,7 @@
   }
 
   const std::set<GURL>& GetOriginsForType(storage::QuotaClient* client,
-                                          storage::StorageType type) {
+                                          StorageType type) {
     origins_.clear();
     AsyncGetOriginsForType(client, type);
     base::RunLoop().RunUntilIdle();
@@ -57,7 +59,7 @@
   }
 
   const std::set<GURL>& GetOriginsForHost(storage::QuotaClient* client,
-                                          storage::StorageType type,
+                                          StorageType type,
                                           const std::string& host) {
     origins_.clear();
     AsyncGetOriginsForHost(client, type, host);
@@ -66,7 +68,7 @@
   }
 
   blink::QuotaStatusCode DeleteOriginData(storage::QuotaClient* client,
-                                          storage::StorageType type,
+                                          StorageType type,
                                           const GURL& origin) {
     delete_status_ = blink::QuotaStatusCode::kUnknown;
     AsyncDeleteOriginData(client, type, origin);
@@ -76,15 +78,14 @@
 
   void AsyncGetOriginUsage(storage::QuotaClient* client,
                            const GURL& origin,
-                           storage::StorageType type) {
+                           StorageType type) {
     client->GetOriginUsage(
         origin, type,
         base::Bind(&AppCacheQuotaClientTest::OnGetOriginUsageComplete,
                    weak_factory_.GetWeakPtr()));
   }
 
-  void AsyncGetOriginsForType(storage::QuotaClient* client,
-                              storage::StorageType type) {
+  void AsyncGetOriginsForType(storage::QuotaClient* client, StorageType type) {
     client->GetOriginsForType(
         type,
         base::Bind(&AppCacheQuotaClientTest::OnGetOriginsComplete,
@@ -92,7 +93,7 @@
   }
 
   void AsyncGetOriginsForHost(storage::QuotaClient* client,
-                              storage::StorageType type,
+                              StorageType type,
                               const std::string& host) {
     client->GetOriginsForHost(
         type, host,
@@ -101,7 +102,7 @@
   }
 
   void AsyncDeleteOriginData(storage::QuotaClient* client,
-                             storage::StorageType type,
+                             StorageType type,
                              const GURL& origin) {
     client->DeleteOriginData(
         origin, type,
diff --git a/content/browser/appcache/appcache_storage.cc b/content/browser/appcache/appcache_storage.cc
index 666acd56..dae08109 100644
--- a/content/browser/appcache/appcache_storage.cc
+++ b/content/browser/appcache/appcache_storage.cc
@@ -11,6 +11,7 @@
 #include "content/browser/appcache/appcache_service_impl.h"
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 
@@ -110,9 +111,7 @@
     usage_map_.erase(origin);
   if (new_usage != old_usage && service()->quota_manager_proxy()) {
     service()->quota_manager_proxy()->NotifyStorageModified(
-        storage::QuotaClient::kAppcache,
-        origin,
-        storage::kStorageTypeTemporary,
+        storage::QuotaClient::kAppcache, origin, blink::StorageType::kTemporary,
         new_usage - old_usage);
   }
 }
@@ -122,10 +121,8 @@
     for (UsageMap::const_iterator iter = usage_map_.begin();
          iter != usage_map_.end(); ++iter) {
       service()->quota_manager_proxy()->NotifyStorageModified(
-          storage::QuotaClient::kAppcache,
-          iter->first,
-          storage::kStorageTypeTemporary,
-          -(iter->second));
+          storage::QuotaClient::kAppcache, iter->first,
+          blink::StorageType::kTemporary, -(iter->second));
     }
   }
   usage_map_.clear();
@@ -135,9 +132,8 @@
   if (service()->quota_manager_proxy() &&
       usage_map_.find(origin) != usage_map_.end())
     service()->quota_manager_proxy()->NotifyStorageAccessed(
-        storage::QuotaClient::kAppcache,
-        origin,
-        storage::kStorageTypeTemporary);
+        storage::QuotaClient::kAppcache, origin,
+        blink::StorageType::kTemporary);
 }
 
 }  // namespace content
diff --git a/content/browser/appcache/appcache_storage_impl.cc b/content/browser/appcache/appcache_storage_impl.cc
index be08ad05..ae53912 100644
--- a/content/browser/appcache/appcache_storage_impl.cc
+++ b/content/browser/appcache/appcache_storage_impl.cc
@@ -38,6 +38,7 @@
 #include "storage/browser/quota/quota_manager.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 
@@ -668,8 +669,7 @@
   // We have to ask the quota manager for the value.
   storage_->pending_quota_queries_.insert(this);
   quota_manager->GetUsageAndQuota(
-      group_record_.origin,
-      storage::kStorageTypeTemporary,
+      group_record_.origin, blink::StorageType::kTemporary,
       base::Bind(&StoreGroupAndCacheTask::OnQuotaCallback, this));
 }
 
diff --git a/content/browser/appcache/appcache_storage_impl_unittest.cc b/content/browser/appcache/appcache_storage_impl_unittest.cc
index b977de3..5d5662aa 100644
--- a/content/browser/appcache/appcache_storage_impl_unittest.cc
+++ b/content/browser/appcache/appcache_storage_impl_unittest.cc
@@ -47,6 +47,8 @@
 
 namespace content {
 
+using blink::StorageType;
+
 namespace {
 
 const base::Time kZeroTime;
@@ -285,9 +287,9 @@
           async_(false) {}
 
     void GetUsageAndQuota(const GURL& origin,
-                          storage::StorageType type,
+                          StorageType type,
                           const UsageAndQuotaCallback& callback) override {
-      EXPECT_EQ(storage::kStorageTypeTemporary, type);
+      EXPECT_EQ(StorageType::kTemporary, type);
       if (async_) {
         base::SequencedTaskRunnerHandle::Get()->PostTask(
             FROM_HERE, base::BindOnce(&MockQuotaManager::CallCallback,
@@ -320,19 +322,19 @@
 
     void NotifyStorageAccessed(storage::QuotaClient::ID client_id,
                                const GURL& origin,
-                               storage::StorageType type) override {
+                               StorageType type) override {
       EXPECT_EQ(storage::QuotaClient::kAppcache, client_id);
-      EXPECT_EQ(storage::kStorageTypeTemporary, type);
+      EXPECT_EQ(StorageType::kTemporary, type);
       ++notify_storage_accessed_count_;
       last_origin_ = origin;
     }
 
     void NotifyStorageModified(storage::QuotaClient::ID client_id,
                                const GURL& origin,
-                               storage::StorageType type,
+                               StorageType type,
                                int64_t delta) override {
       EXPECT_EQ(storage::QuotaClient::kAppcache, client_id);
-      EXPECT_EQ(storage::kStorageTypeTemporary, type);
+      EXPECT_EQ(StorageType::kTemporary, type);
       ++notify_storage_modified_count_;
       last_origin_ = origin;
       last_delta_ = delta;
@@ -344,11 +346,11 @@
     void NotifyOriginNoLongerInUse(const GURL& origin) override {}
     void SetUsageCacheEnabled(storage::QuotaClient::ID client_id,
                               const GURL& origin,
-                              storage::StorageType type,
+                              StorageType type,
                               bool enabled) override {}
     void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner,
                           const GURL& origin,
-                          storage::StorageType type,
+                          StorageType type,
                           const UsageAndQuotaCallback& callback) override {}
 
     int notify_storage_accessed_count_;
diff --git a/content/browser/appcache/appcache_storage_unittest.cc b/content/browser/appcache/appcache_storage_unittest.cc
index bbe3922..4cd055d 100644
--- a/content/browser/appcache/appcache_storage_unittest.cc
+++ b/content/browser/appcache/appcache_storage_unittest.cc
@@ -15,7 +15,7 @@
 namespace content {
 namespace appcache_storage_unittest {
 
-const storage::StorageType kTemp = storage::kStorageTypeTemporary;
+const blink::StorageType kTemp = blink::StorageType::kTemporary;
 
 class AppCacheStorageTest : public testing::Test {
  public:
diff --git a/content/browser/browser_side_navigation_browsertest.cc b/content/browser/browser_side_navigation_browsertest.cc
index 1e2eec3..702c5d91 100644
--- a/content/browser/browser_side_navigation_browsertest.cc
+++ b/content/browser/browser_side_navigation_browsertest.cc
@@ -471,7 +471,8 @@
           blink::WebMixedContentContextType::kBlockable,
           false /* is_form_submission */, GURL() /* searchable_form_url */,
           std::string() /* searchable_form_encoding */,
-          url::Origin::Create(data_url), GURL() /* client_side_redirect_url */);
+          url::Origin::Create(data_url), GURL() /* client_side_redirect_url */,
+          base::nullopt /* suggested_filename */);
 
   // Receiving the invalid IPC message should lead to renderer process
   // termination.
diff --git a/content/browser/browsing_data/browsing_data_remover_impl.h b/content/browser/browsing_data/browsing_data_remover_impl.h
index 0ff0300..f71bdc8a 100644
--- a/content/browser/browsing_data/browsing_data_remover_impl.h
+++ b/content/browser/browsing_data/browsing_data_remover_impl.h
@@ -20,7 +20,6 @@
 #include "build/build_config.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/browsing_data_remover.h"
-#include "storage/common/quota/quota_types.h"
 #include "url/gurl.h"
 
 namespace content {
diff --git a/content/browser/cache_storage/cache_storage.cc b/content/browser/cache_storage/cache_storage.cc
index 8bc9518..7acd661 100644
--- a/content/browser/cache_storage/cache_storage.cc
+++ b/content/browser/cache_storage/cache_storage.cc
@@ -40,9 +40,11 @@
 #include "net/url_request/url_request_context_getter.h"
 #include "storage/browser/blob/blob_storage_context.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 using base::LazyInstance;
 using blink::mojom::CacheStorageError;
+using blink::StorageType;
 using crypto::SymmetricKey;
 
 namespace content {
@@ -604,7 +606,7 @@
 
   quota_manager_proxy_->NotifyStorageAccessed(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary);
+      StorageType::kTemporary);
 
   scheduler_->ScheduleOperation(base::BindOnce(
       &CacheStorage::OpenCacheImpl, weak_factory_.GetWeakPtr(), cache_name,
@@ -620,7 +622,7 @@
 
   quota_manager_proxy_->NotifyStorageAccessed(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary);
+      StorageType::kTemporary);
 
   scheduler_->ScheduleOperation(base::BindOnce(
       &CacheStorage::HasCacheImpl, weak_factory_.GetWeakPtr(), cache_name,
@@ -636,7 +638,7 @@
 
   quota_manager_proxy_->NotifyStorageAccessed(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary);
+      StorageType::kTemporary);
 
   scheduler_->ScheduleOperation(base::BindOnce(
       &CacheStorage::DoomCacheImpl, weak_factory_.GetWeakPtr(), cache_name,
@@ -651,7 +653,7 @@
 
   quota_manager_proxy_->NotifyStorageAccessed(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary);
+      StorageType::kTemporary);
 
   scheduler_->ScheduleOperation(base::BindOnce(
       &CacheStorage::EnumerateCachesImpl, weak_factory_.GetWeakPtr(),
@@ -670,7 +672,7 @@
 
   quota_manager_proxy_->NotifyStorageAccessed(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary);
+      StorageType::kTemporary);
 
   scheduler_->ScheduleOperation(
       base::BindOnce(&CacheStorage::MatchCacheImpl, weak_factory_.GetWeakPtr(),
@@ -689,7 +691,7 @@
 
   quota_manager_proxy_->NotifyStorageAccessed(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary);
+      StorageType::kTemporary);
 
   scheduler_->ScheduleOperation(base::BindOnce(
       &CacheStorage::MatchAllCachesImpl, weak_factory_.GetWeakPtr(),
@@ -962,7 +964,7 @@
                                          int64_t cache_size) {
   quota_manager_proxy_->NotifyStorageModified(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary, -1 * cache_size);
+      StorageType::kTemporary, -1 * cache_size);
 
   cache_loader_->CleanUpDeletedCache(doomed_cache);
   auto doomed_caches_iter = doomed_caches_.find(doomed_cache);
diff --git a/content/browser/cache_storage/cache_storage_cache.cc b/content/browser/cache_storage/cache_storage_cache.cc
index 9254ab8..82aa69a 100644
--- a/content/browser/cache_storage/cache_storage_cache.cc
+++ b/content/browser/cache_storage/cache_storage_cache.cc
@@ -47,6 +47,7 @@
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/common/blob_storage/blob_handle.h"
 #include "storage/common/storage_histograms.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 using blink::mojom::CacheStorageError;
 
@@ -511,7 +512,7 @@
   // can call Size, another scheduled operation.
   quota_manager_proxy_->GetUsageAndQuota(
       base::ThreadTaskRunnerHandle::Get().get(), origin_,
-      storage::kStorageTypeTemporary,
+      blink::StorageType::kTemporary,
       base::AdaptCallbackForRepeating(
           base::BindOnce(&CacheStorageCache::WriteSideDataDidGetQuota,
                          weak_ptr_factory_.GetWeakPtr(), std::move(callback),
@@ -559,7 +560,7 @@
     // than it's supposed to be.
     quota_manager_proxy_->GetUsageAndQuota(
         base::ThreadTaskRunnerHandle::Get().get(), origin_,
-        storage::kStorageTypeTemporary,
+        blink::StorageType::kTemporary,
         base::AdaptCallbackForRepeating(base::BindOnce(
             &CacheStorageCache::BatchDidGetUsageAndQuota,
             weak_ptr_factory_.GetWeakPtr(), operations, std::move(callback),
@@ -1565,7 +1566,7 @@
 
   quota_manager_proxy_->NotifyStorageModified(
       storage::QuotaClient::kServiceWorkerCache, origin_,
-      storage::kStorageTypeTemporary, size_delta);
+      blink::StorageType::kTemporary, size_delta);
 
   if (cache_storage_)
     cache_storage_->NotifyCacheContentChanged(cache_name_);
diff --git a/content/browser/cache_storage/cache_storage_cache_unittest.cc b/content/browser/cache_storage/cache_storage_cache_unittest.cc
index 4f92723..03b63842 100644
--- a/content/browser/cache_storage/cache_storage_cache_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_cache_unittest.cc
@@ -377,7 +377,7 @@
     mock_quota_manager_ = new MockQuotaManager(
         is_incognito, temp_dir_path, base::ThreadTaskRunnerHandle::Get().get(),
         quota_policy_.get());
-    mock_quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
+    mock_quota_manager_->SetQuota(GURL(kOrigin), blink::StorageType::kTemporary,
                                   1024 * 1024 * 100);
 
     quota_manager_proxy_ = new MockQuotaManagerProxy(
@@ -1507,7 +1507,7 @@
 }
 
 TEST_P(CacheStorageCacheTestP, PutWithSideData_QuotaExceeded) {
-  mock_quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
+  mock_quota_manager_->SetQuota(GURL(kOrigin), blink::StorageType::kTemporary,
                                 expected_blob_data_.size() - 1);
   ServiceWorkerResponse response(body_response_);
   const std::string expected_side_data = "SideData";
@@ -1522,7 +1522,7 @@
 }
 
 TEST_P(CacheStorageCacheTestP, PutWithSideData_QuotaExceededSkipSideData) {
-  mock_quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
+  mock_quota_manager_->SetQuota(GURL(kOrigin), blink::StorageType::kTemporary,
                                 expected_blob_data_.size());
   ServiceWorkerResponse response(body_response_);
   const std::string expected_side_data = "SideData";
@@ -1600,7 +1600,7 @@
 }
 
 TEST_P(CacheStorageCacheTestP, WriteSideData_QuotaExceeded) {
-  mock_quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
+  mock_quota_manager_->SetQuota(GURL(kOrigin), blink::StorageType::kTemporary,
                                 1024 * 1023);
   base::Time response_time(base::Time::Now());
   ServiceWorkerResponse response;
@@ -1721,7 +1721,7 @@
 }
 
 TEST_P(CacheStorageCacheTestP, PutObeysQuotaLimits) {
-  mock_quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
+  mock_quota_manager_->SetQuota(GURL(kOrigin), blink::StorageType::kTemporary,
                                 0);
   EXPECT_FALSE(Put(body_request_, body_response_));
   EXPECT_EQ(CacheStorageError::kErrorQuotaExceeded, callback_error_);
diff --git a/content/browser/cache_storage/cache_storage_manager.cc b/content/browser/cache_storage/cache_storage_manager.cc
index 9d00a42bb..d15a5727 100644
--- a/content/browser/cache_storage/cache_storage_manager.cc
+++ b/content/browser/cache_storage/cache_storage_manager.cc
@@ -32,6 +32,7 @@
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/common/database/database_identifier.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 #include "url/origin.h"
 
@@ -422,7 +423,7 @@
 
   quota_manager_proxy_->NotifyStorageModified(
       storage::QuotaClient::kServiceWorkerCache, origin,
-      storage::kStorageTypeTemporary, -1 * origin_size);
+      blink::StorageType::kTemporary, -1 * origin_size);
   NotifyCacheListChanged(origin);
 
   if (IsMemoryBacked()) {
diff --git a/content/browser/cache_storage/cache_storage_manager_unittest.cc b/content/browser/cache_storage/cache_storage_manager_unittest.cc
index 7372078..23a7aad 100644
--- a/content/browser/cache_storage/cache_storage_manager_unittest.cc
+++ b/content/browser/cache_storage/cache_storage_manager_unittest.cc
@@ -52,7 +52,6 @@
 #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/WebKit/common/quota/quota_status_code.h"
 #include "third_party/WebKit/public/platform/modules/cache_storage/cache_storage.mojom.h"
 
 using blink::mojom::CacheStorageError;
@@ -61,6 +60,8 @@
 namespace content {
 namespace cache_storage_manager_unittest {
 
+using blink::StorageType;
+
 bool IsIndexFileCurrent(const base::FilePath& cache_dir) {
   base::File::Info info;
   const base::FilePath index_path =
@@ -224,10 +225,10 @@
     mock_quota_manager_ = new MockQuotaManager(
         MemoryOnly(), temp_dir_path, base::ThreadTaskRunnerHandle::Get().get(),
         quota_policy_.get());
-    mock_quota_manager_->SetQuota(
-        GURL(origin1_), storage::kStorageTypeTemporary, 1024 * 1024 * 100);
-    mock_quota_manager_->SetQuota(
-        GURL(origin2_), storage::kStorageTypeTemporary, 1024 * 1024 * 100);
+    mock_quota_manager_->SetQuota(GURL(origin1_), StorageType::kTemporary,
+                                  1024 * 1024 * 100);
+    mock_quota_manager_->SetQuota(GURL(origin2_), StorageType::kTemporary,
+                                  1024 * 1024 * 100);
 
     quota_manager_proxy_ = new MockQuotaManagerProxy(
         mock_quota_manager_.get(), base::ThreadTaskRunnerHandle::Get().get());
@@ -543,7 +544,7 @@
     base::RunLoop loop;
     quota_manager_proxy_->GetUsageAndQuota(
         base::ThreadTaskRunnerHandle::Get().get(), origin,
-        StorageType::kStorageTypeTemporary,
+        StorageType::kTemporary,
         base::Bind(&CacheStorageManagerTest::DidGetQuotaOriginUsage,
                    base::Unretained(this), base::Unretained(&usage), &loop));
     loop.Run();
@@ -1678,7 +1679,7 @@
   int64_t QuotaGetOriginUsage(const GURL& origin) {
     base::RunLoop loop;
     quota_client_->GetOriginUsage(
-        origin, storage::kStorageTypeTemporary,
+        origin, StorageType::kTemporary,
         base::Bind(&CacheStorageQuotaClientTest::QuotaUsageCallback,
                    base::Unretained(this), base::Unretained(&loop)));
     loop.Run();
@@ -1688,7 +1689,7 @@
   size_t QuotaGetOriginsForType() {
     base::RunLoop loop;
     quota_client_->GetOriginsForType(
-        storage::kStorageTypeTemporary,
+        StorageType::kTemporary,
         base::Bind(&CacheStorageQuotaClientTest::OriginsCallback,
                    base::Unretained(this), base::Unretained(&loop)));
     loop.Run();
@@ -1698,7 +1699,7 @@
   size_t QuotaGetOriginsForHost(const std::string& host) {
     base::RunLoop loop;
     quota_client_->GetOriginsForHost(
-        storage::kStorageTypeTemporary, host,
+        StorageType::kTemporary, host,
         base::Bind(&CacheStorageQuotaClientTest::OriginsCallback,
                    base::Unretained(this), base::Unretained(&loop)));
     loop.Run();
@@ -1708,14 +1709,14 @@
   bool QuotaDeleteOriginData(const GURL& origin) {
     base::RunLoop loop;
     quota_client_->DeleteOriginData(
-        origin, storage::kStorageTypeTemporary,
+        origin, StorageType::kTemporary,
         base::Bind(&CacheStorageQuotaClientTest::DeleteOriginCallback,
                    base::Unretained(this), base::Unretained(&loop)));
     loop.Run();
     return callback_status_ == blink::QuotaStatusCode::kOk;
   }
 
-  bool QuotaDoesSupport(storage::StorageType type) {
+  bool QuotaDoesSupport(StorageType type) {
     return quota_client_->DoesSupport(type);
   }
 
@@ -1819,11 +1820,11 @@
 }
 
 TEST_P(CacheStorageQuotaClientTestP, QuotaDoesSupport) {
-  EXPECT_TRUE(QuotaDoesSupport(storage::kStorageTypeTemporary));
-  EXPECT_FALSE(QuotaDoesSupport(storage::kStorageTypePersistent));
-  EXPECT_FALSE(QuotaDoesSupport(storage::kStorageTypeSyncable));
-  EXPECT_FALSE(QuotaDoesSupport(storage::kStorageTypeQuotaNotManaged));
-  EXPECT_FALSE(QuotaDoesSupport(storage::kStorageTypeUnknown));
+  EXPECT_TRUE(QuotaDoesSupport(StorageType::kTemporary));
+  EXPECT_FALSE(QuotaDoesSupport(StorageType::kPersistent));
+  EXPECT_FALSE(QuotaDoesSupport(StorageType::kSyncable));
+  EXPECT_FALSE(QuotaDoesSupport(StorageType::kQuotaNotManaged));
+  EXPECT_FALSE(QuotaDoesSupport(StorageType::kUnknown));
 }
 
 INSTANTIATE_TEST_CASE_P(CacheStorageManagerTests,
diff --git a/content/browser/cache_storage/cache_storage_quota_client.cc b/content/browser/cache_storage/cache_storage_quota_client.cc
index 8ac1f97..c5361453 100644
--- a/content/browser/cache_storage/cache_storage_quota_client.cc
+++ b/content/browser/cache_storage/cache_storage_quota_client.cc
@@ -28,7 +28,7 @@
 }
 
 void CacheStorageQuotaClient::GetOriginUsage(const GURL& origin_url,
-                                             storage::StorageType type,
+                                             blink::StorageType type,
                                              const GetUsageCallback& callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
@@ -41,7 +41,7 @@
 }
 
 void CacheStorageQuotaClient::GetOriginsForType(
-    storage::StorageType type,
+    blink::StorageType type,
     const GetOriginsCallback& callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
@@ -54,7 +54,7 @@
 }
 
 void CacheStorageQuotaClient::GetOriginsForHost(
-    storage::StorageType type,
+    blink::StorageType type,
     const std::string& host,
     const GetOriginsCallback& callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
@@ -69,7 +69,7 @@
 
 void CacheStorageQuotaClient::DeleteOriginData(
     const GURL& origin,
-    storage::StorageType type,
+    blink::StorageType type,
     const DeletionCallback& callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
@@ -86,10 +86,10 @@
   cache_manager_->DeleteOriginData(origin, callback);
 }
 
-bool CacheStorageQuotaClient::DoesSupport(storage::StorageType type) const {
+bool CacheStorageQuotaClient::DoesSupport(blink::StorageType type) const {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
-  return type == storage::kStorageTypeTemporary;
+  return type == blink::StorageType::kTemporary;
 }
 
 }  // namespace content
diff --git a/content/browser/cache_storage/cache_storage_quota_client.h b/content/browser/cache_storage/cache_storage_quota_client.h
index 367f270..702b091 100644
--- a/content/browser/cache_storage/cache_storage_quota_client.h
+++ b/content/browser/cache_storage/cache_storage_quota_client.h
@@ -9,7 +9,7 @@
 #include "base/memory/weak_ptr.h"
 #include "content/common/content_export.h"
 #include "storage/browser/quota/quota_client.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 class CacheStorageManager;
@@ -27,17 +27,17 @@
   ID id() const override;
   void OnQuotaManagerDestroyed() override;
   void GetOriginUsage(const GURL& origin_url,
-                      storage::StorageType type,
+                      blink::StorageType type,
                       const GetUsageCallback& callback) override;
-  void GetOriginsForType(storage::StorageType type,
+  void GetOriginsForType(blink::StorageType type,
                          const GetOriginsCallback& callback) override;
-  void GetOriginsForHost(storage::StorageType type,
+  void GetOriginsForHost(blink::StorageType type,
                          const std::string& host,
                          const GetOriginsCallback& callback) override;
   void DeleteOriginData(const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(blink::StorageType type) const override;
 
  private:
   base::WeakPtr<CacheStorageManager> cache_manager_;
diff --git a/content/browser/devtools/devtools_url_interceptor_request_job.cc b/content/browser/devtools/devtools_url_interceptor_request_job.cc
index 157c4ec..2083531 100644
--- a/content/browser/devtools/devtools_url_interceptor_request_job.cc
+++ b/content/browser/devtools/devtools_url_interceptor_request_job.cc
@@ -142,7 +142,8 @@
       resource_request_info->ShouldReportRawHeaders(),
       resource_request_info->IsAsync(),
       resource_request_info->GetPreviewsState(), resource_request_info->body(),
-      resource_request_info->initiated_in_secure_context());
+      resource_request_info->initiated_in_secure_context(),
+      resource_request_info->suggested_filename());
   extra_data->AssociateWithRequest(request_.get());
 
   if (request_details.post_data)
diff --git a/content/browser/devtools/protocol/storage_handler.cc b/content/browser/devtools/protocol/storage_handler.cc
index a988775a..2712d364 100644
--- a/content/browser/devtools/protocol/storage_handler.cc
+++ b/content/browser/devtools/protocol/storage_handler.cc
@@ -17,6 +17,7 @@
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 #include "url/origin.h"
 
@@ -88,7 +89,7 @@
     std::unique_ptr<StorageHandler::GetUsageAndQuotaCallback> callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   manager->GetUsageAndQuotaWithBreakdown(
-      url, storage::kStorageTypeTemporary,
+      url, blink::StorageType::kTemporary,
       base::Bind(&GotUsageAndQuotaDataCallback,
                  base::Passed(std::move(callback))));
 }
diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc
index 0bc679a5..13858f0 100644
--- a/content/browser/download/download_browsertest.cc
+++ b/content/browser/download/download_browsertest.cc
@@ -2665,8 +2665,8 @@
   ASSERT_TRUE(server.ShutdownAndWaitUntilComplete());
 }
 
-// A request for a non-existent resource should still result in a DownloadItem
-// that's created in an interrupted state.
+// A request for a non-existent resource should result in an aborted navigation,
+// and the old site staying current.
 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadAttributeServerError) {
   GURL download_url =
       embedded_test_server()->GetURL("/download/does-not-exist");
@@ -2674,15 +2674,15 @@
       std::string("/download/download-attribute.html?target=") +
       download_url.spec());
 
-  DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url);
-  WaitForInterrupt(download);
-
-  EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_SERVER_BAD_CONTENT,
-            download->GetLastReason());
+  auto observer = std::make_unique<content::TestNavigationObserver>(
+      shell()->web_contents(), 2);
+  NavigateToURL(shell(), document_url);
+  observer->Wait();
+  EXPECT_FALSE(observer->last_navigation_succeeded());
 }
 
 // A request that fails before it gets a response from the server should also
-// result in a DownloadItem that's created in an interrupted state.
+// result in the old page staying current.
 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadAttributeNetworkError) {
   SetupErrorInjectionDownloads();
   GURL url = TestDownloadHttpResponse::GetNextURLForDownload();
@@ -2697,24 +2697,24 @@
   GURL document_url = embedded_test_server()->GetURL(
       std::string("/download/download-attribute.html?target=") +
       server_url.spec());
-  DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url);
-  WaitForInterrupt(download);
-
-  EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED,
-            download->GetLastReason());
+  auto observer = std::make_unique<content::TestNavigationObserver>(
+      shell()->web_contents(), 2);
+  NavigateToURL(shell(), document_url);
+  observer->Wait();
+  EXPECT_FALSE(observer->last_navigation_succeeded());
 }
 
 // A request that fails due to it being rejected by policy should result in a
-// DownloadItem that's marked as interrupted.
+// corresponding navigation.
 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadAttributeInvalidURL) {
-  GURL document_url = embedded_test_server()->GetURL(
+  GURL url = embedded_test_server()->GetURL(
       "/download/download-attribute.html?target=about:version");
-  DownloadItem* download = StartDownloadAndReturnItem(shell(), document_url);
-  WaitForInterrupt(download);
-
-  EXPECT_EQ(DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST,
-            download->GetLastReason());
-  EXPECT_FALSE(download->CanResume());
+  auto observer = std::make_unique<content::TestNavigationObserver>(
+      GURL(url::kAboutBlankURL));
+  observer->WatchExistingWebContents();
+  observer->StartWatchingNewWebContents();
+  NavigateToURL(shell(), url);
+  observer->WaitForNavigationFinished();
 }
 
 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DownloadAttributeBlobURL) {
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 89174b48..fed07b1 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -756,6 +756,7 @@
 void DownloadManagerImpl::InterceptNavigation(
     std::unique_ptr<ResourceRequest> resource_request,
     std::vector<GURL> url_chain,
+    const base::Optional<std::string>& suggested_filename,
     scoped_refptr<ResourceResponse> response,
     mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints,
     net::CertStatus cert_status,
@@ -774,7 +775,7 @@
       on_download_checks_done = base::BindOnce(
           &DownloadManagerImpl::InterceptNavigationOnChecksComplete,
           weak_factory_.GetWeakPtr(), web_contents_getter,
-          std::move(resource_request), std::move(url_chain),
+          std::move(resource_request), std::move(url_chain), suggested_filename,
           std::move(response), cert_status,
           std::move(url_loader_client_endpoints));
 
@@ -989,6 +990,7 @@
     ResourceRequestInfo::WebContentsGetter web_contents_getter,
     std::unique_ptr<ResourceRequest> resource_request,
     std::vector<GURL> url_chain,
+    const base::Optional<std::string>& suggested_filename,
     scoped_refptr<ResourceResponse> response,
     net::CertStatus cert_status,
     mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints,
@@ -1001,7 +1003,8 @@
       base::BindOnce(&DownloadManagerImpl::CreateDownloadHandlerForNavigation,
                      weak_factory_.GetWeakPtr(), web_contents_getter,
                      std::move(resource_request), std::move(url_chain),
-                     std::move(response), std::move(cert_status),
+                     suggested_filename, std::move(response),
+                     std::move(cert_status),
                      std::move(url_loader_client_endpoints)));
 }
 
@@ -1011,6 +1014,7 @@
     ResourceRequestInfo::WebContentsGetter web_contents_getter,
     std::unique_ptr<ResourceRequest> resource_request,
     std::vector<GURL> url_chain,
+    const base::Optional<std::string>& suggested_filename,
     scoped_refptr<ResourceResponse> response,
     net::CertStatus cert_status,
     mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints) {
@@ -1020,7 +1024,7 @@
       ResourceDownloader::InterceptNavigationResponse(
           download_manager, std::move(resource_request),
           std::move(web_contents_getter), std::move(url_chain),
-          std::move(response), std::move(cert_status),
+          suggested_filename, std::move(response), std::move(cert_status),
           std::move(url_loader_client_endpoints));
 
   BrowserThread::PostTask(
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h
index 1891d7af..b09a8a1 100644
--- a/content/browser/download/download_manager_impl.h
+++ b/content/browser/download/download_manager_impl.h
@@ -148,6 +148,7 @@
   void InterceptNavigation(
       std::unique_ptr<ResourceRequest> resource_request,
       std::vector<GURL> url_chain,
+      const base::Optional<std::string>& suggested_filename,
       scoped_refptr<ResourceResponse> response,
       mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints,
       net::CertStatus cert_status,
@@ -221,6 +222,7 @@
       ResourceRequestInfo::WebContentsGetter web_contents_getter,
       std::unique_ptr<ResourceRequest> resource_request,
       std::vector<GURL> url_chain,
+      const base::Optional<std::string>& suggested_filename,
       scoped_refptr<ResourceResponse> response,
       net::CertStatus cert_status,
       mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints,
@@ -234,6 +236,7 @@
       ResourceRequestInfo::WebContentsGetter web_contents_getter,
       std::unique_ptr<ResourceRequest> resource_request,
       std::vector<GURL> url_chain,
+      const base::Optional<std::string>& suggested_filename,
       scoped_refptr<ResourceResponse> response,
       net::CertStatus cert_status,
       mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints);
diff --git a/content/browser/download/download_request_core.cc b/content/browser/download/download_request_core.cc
index 0388d7fb..1031e9b9 100644
--- a/content/browser/download/download_request_core.cc
+++ b/content/browser/download/download_request_core.cc
@@ -15,6 +15,7 @@
 #include "base/metrics/histogram_functions.h"
 #include "base/single_thread_task_runner.h"
 #include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "content/browser/byte_stream.h"
 #include "content/browser/download/download_create_info.h"
@@ -25,6 +26,7 @@
 #include "content/browser/download/download_task_runner.h"
 #include "content/browser/download/download_utils.h"
 #include "content/browser/loader/resource_dispatcher_host_impl.h"
+#include "content/browser/loader/resource_request_info_impl.h"
 #include "content/browser/service_manager/service_manager_context.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/download_interrupt_reasons.h"
@@ -188,6 +190,12 @@
     is_partial_request_ = save_info_->offset > 0;
   } else {
     save_info_.reset(new DownloadSaveInfo);
+    ResourceRequestInfoImpl* request_info =
+        ResourceRequestInfoImpl::ForRequest(request_);
+    if (request_info && request_info->suggested_filename().has_value()) {
+      save_info_->suggested_name =
+          base::UTF8ToUTF16(*request_info->suggested_filename());
+    }
   }
 }
 
diff --git a/content/browser/download/resource_downloader.cc b/content/browser/download/resource_downloader.cc
index b7cc98c9..f943534 100644
--- a/content/browser/download/resource_downloader.cc
+++ b/content/browser/download/resource_downloader.cc
@@ -6,6 +6,7 @@
 
 #include <memory>
 
+#include "base/strings/utf_string_conversions.h"
 #include "content/browser/blob_storage/blob_url_loader_factory.h"
 #include "content/browser/download/download_utils.h"
 #include "content/public/browser/render_frame_host.h"
@@ -103,6 +104,7 @@
     std::unique_ptr<ResourceRequest> resource_request,
     const ResourceRequestInfo::WebContentsGetter& web_contents_getter,
     std::vector<GURL> url_chain,
+    const base::Optional<std::string>& suggested_filename,
     const scoped_refptr<ResourceResponse>& response,
     net::CertStatus cert_status,
     mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints) {
@@ -110,7 +112,7 @@
       delegate, std::move(resource_request), web_contents_getter,
       DownloadItem::kInvalidId);
   downloader->InterceptResponse(std::move(response), std::move(url_chain),
-                                cert_status,
+                                suggested_filename, cert_status,
                                 std::move(url_loader_client_endpoints));
   return downloader;
 }
@@ -174,15 +176,19 @@
 void ResourceDownloader::InterceptResponse(
     const scoped_refptr<ResourceResponse>& response,
     std::vector<GURL> url_chain,
+    const base::Optional<std::string>& suggested_filename,
     net::CertStatus cert_status,
     mojom::URLLoaderClientEndpointsPtr endpoints) {
   // Set the URLLoader.
   url_loader_.Bind(std::move(endpoints->url_loader));
 
   // Create the new URLLoaderClient that will intercept the navigation.
+  auto save_info = std::make_unique<DownloadSaveInfo>();
+  if (suggested_filename.has_value())
+    save_info->suggested_name = base::UTF8ToUTF16(suggested_filename.value());
   url_loader_client_ = std::make_unique<DownloadResponseHandler>(
-      resource_request_.get(), this, std::make_unique<DownloadSaveInfo>(),
-      false, false, false, std::move(url_chain));
+      resource_request_.get(), this, std::move(save_info), false, false, false,
+      std::move(url_chain));
 
   // Simulate on the new URLLoaderClient calls that happened on the old client.
   net::SSLInfo info;
@@ -193,7 +199,7 @@
 
   // Bind the new client.
   url_loader_client_binding_ =
-      base::MakeUnique<mojo::Binding<mojom::URLLoaderClient>>(
+      std::make_unique<mojo::Binding<mojom::URLLoaderClient>>(
           url_loader_client_.get(), std::move(endpoints->url_loader_client));
 }
 
diff --git a/content/browser/download/resource_downloader.h b/content/browser/download/resource_downloader.h
index bba7316..2183152 100644
--- a/content/browser/download/resource_downloader.h
+++ b/content/browser/download/resource_downloader.h
@@ -43,6 +43,7 @@
       std::unique_ptr<ResourceRequest> resource_request,
       const ResourceRequestInfo::WebContentsGetter& web_contents_getter,
       std::vector<GURL> url_chain,
+      const base::Optional<std::string>& suggested_filename,
       const scoped_refptr<ResourceResponse>& response,
       net::CertStatus cert_status,
       mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints);
@@ -71,6 +72,7 @@
   void InterceptResponse(
       const scoped_refptr<ResourceResponse>& response,
       std::vector<GURL> url_chain,
+      const base::Optional<std::string>& suggested_filename,
       net::CertStatus cert_status,
       mojom::URLLoaderClientEndpointsPtr url_loader_client_endpoints);
 
diff --git a/content/browser/fileapi/fileapi_message_filter.h b/content/browser/fileapi/fileapi_message_filter.h
index a4766ee87..c43d3cc 100644
--- a/content/browser/fileapi/fileapi_message_filter.h
+++ b/content/browser/fileapi/fileapi_message_filter.h
@@ -25,7 +25,6 @@
 #include "storage/browser/fileapi/file_system_context.h"
 #include "storage/browser/fileapi/file_system_operation_runner.h"
 #include "storage/common/fileapi/file_system_types.h"
-#include "storage/common/quota/quota_types.h"
 
 class GURL;
 
diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
index 1ab9ee4b..db5c8fc5 100644
--- a/content/browser/frame_host/navigation_request.cc
+++ b/content/browser/frame_host/navigation_request.cc
@@ -270,7 +270,8 @@
           blink::WebMixedContentContextType::kBlockable, is_form_submission,
           GURL() /* searchable_form_url */,
           std::string() /* searchable_form_encoding */, initiator,
-          GURL() /* client_side_redirect_url */),
+          GURL() /* client_side_redirect_url */,
+          base::nullopt /* suggested_filename */),
       request_params, browser_initiated, false /* from_begin_navigation */,
       &frame_entry, &entry));
   return navigation_request;
@@ -845,6 +846,17 @@
     }
   }
 
+  // The response code indicates that this is an error page, but we don't
+  // know how to display the content.  We follow Firefox here and show our
+  // own error page instead of intercepting the request as a stream or a
+  // download.
+  if (is_download && (response->head.headers.get() &&
+                      (response->head.headers->response_code() / 100 != 2))) {
+    navigation_handle_->set_net_error_code(net::ERR_INVALID_RESPONSE);
+    frame_tree_node_->ResetNavigationRequest(false, true);
+    return;
+  }
+
   // Check if the navigation should be allowed to proceed.
   navigation_handle_->WillProcessResponse(
       render_frame_host, response->head.headers.get(),
@@ -1162,8 +1174,9 @@
           BrowserContext::GetDownloadManager(browser_context));
       download_manager->InterceptNavigation(
           std::move(resource_request), navigation_handle_->GetRedirectChain(),
-          response_, std::move(url_loader_client_endpoints_),
-          ssl_info_.cert_status, frame_tree_node_->frame_tree_node_id());
+          begin_params_->suggested_filename, response_,
+          std::move(url_loader_client_endpoints_), ssl_info_.cert_status,
+          frame_tree_node_->frame_tree_node_id());
 
       OnRequestFailed(false, net::ERR_ABORTED, base::nullopt);
       return;
diff --git a/content/browser/indexed_db/database_impl.cc b/content/browser/indexed_db/database_impl.cc
index 10c9ce45..f64dd49 100644
--- a/content/browser/indexed_db/database_impl.cc
+++ b/content/browser/indexed_db/database_impl.cc
@@ -19,6 +19,7 @@
 #include "storage/browser/blob/blob_storage_context.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabaseException.h"
 
 using std::swap;
@@ -917,7 +918,7 @@
 
   indexed_db_context_->quota_manager_proxy()->GetUsageAndQuota(
       indexed_db_context_->TaskRunner(), origin_.GetURL(),
-      storage::kStorageTypeTemporary,
+      blink::StorageType::kTemporary,
       base::Bind(&IDBSequenceHelper::OnGotUsageAndQuotaForCommit,
                  weak_factory_.GetWeakPtr(), transaction_id));
 }
diff --git a/content/browser/indexed_db/indexed_db_context_impl.cc b/content/browser/indexed_db/indexed_db_context_impl.cc
index e686284..4f4d394 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.cc
+++ b/content/browser/indexed_db/indexed_db_context_impl.cc
@@ -36,6 +36,7 @@
 #include "content/public/common/content_switches.h"
 #include "storage/browser/database/database_util.h"
 #include "storage/common/database/database_identifier.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "ui/base/text/bytes_formatting.h"
 #include "url/origin.h"
 
@@ -444,7 +445,7 @@
   DCHECK(TaskRunner()->RunsTasksInCurrentSequence());
   quota_manager_proxy()->NotifyStorageAccessed(
       storage::QuotaClient::kIndexedDatabase, origin.GetURL(),
-      storage::kStorageTypeTemporary);
+      blink::StorageType::kTemporary);
   if (AddToOriginSet(origin)) {
     // A newly created db, notify the quota system.
     QueryDiskAndUpdateQuotaUsage(origin);
@@ -458,7 +459,7 @@
   DCHECK(TaskRunner()->RunsTasksInCurrentSequence());
   quota_manager_proxy()->NotifyStorageAccessed(
       storage::QuotaClient::kIndexedDatabase, origin.GetURL(),
-      storage::kStorageTypeTemporary);
+      blink::StorageType::kTemporary);
   if (factory_.get() && factory_->GetConnectionCount(origin) == 0)
     QueryDiskAndUpdateQuotaUsage(origin);
 }
@@ -583,7 +584,7 @@
     origin_size_map_[origin] = current_disk_usage;
     quota_manager_proxy()->NotifyStorageModified(
         storage::QuotaClient::kIndexedDatabase, origin.GetURL(),
-        storage::kStorageTypeTemporary, difference);
+        blink::StorageType::kTemporary, difference);
     NotifyIndexedDBListChanged(origin);
   }
 }
diff --git a/content/browser/indexed_db/indexed_db_context_impl.h b/content/browser/indexed_db/indexed_db_context_impl.h
index 11b6592..ef0dada 100644
--- a/content/browser/indexed_db/indexed_db_context_impl.h
+++ b/content/browser/indexed_db/indexed_db_context_impl.h
@@ -22,7 +22,6 @@
 #include "content/public/browser/indexed_db_context.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/browser/quota/special_storage_policy.h"
-#include "storage/common/quota/quota_types.h"
 #include "url/gurl.h"
 
 namespace base {
diff --git a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
index 0eba783..d12a260 100644
--- a/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_dispatcher_host_unittest.cc
@@ -172,7 +172,7 @@
                 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)),
             context_impl_,
             ChromeBlobStorageContext::GetFor(&browser_context_))) {
-    quota_manager_->SetQuota(GURL(kOrigin), storage::kStorageTypeTemporary,
+    quota_manager_->SetQuota(GURL(kOrigin), blink::StorageType::kTemporary,
                              kTemporaryQuota);
   }
 
diff --git a/content/browser/indexed_db/indexed_db_quota_client.cc b/content/browser/indexed_db/indexed_db_quota_client.cc
index 2198c12..53a13b0 100644
--- a/content/browser/indexed_db/indexed_db_quota_client.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client.cc
@@ -16,6 +16,7 @@
 #include "third_party/WebKit/common/quota/quota_status_code.h"
 #include "url/origin.h"
 
+using blink::StorageType;
 using storage::QuotaClient;
 using storage::DatabaseUtil;
 
@@ -74,13 +75,13 @@
 void IndexedDBQuotaClient::OnQuotaManagerDestroyed() { delete this; }
 
 void IndexedDBQuotaClient::GetOriginUsage(const GURL& origin_url,
-                                          storage::StorageType type,
+                                          StorageType type,
                                           const GetUsageCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(indexed_db_context_.get());
 
   // IndexedDB is in the temp namespace for now.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(0);
     return;
   }
@@ -93,13 +94,13 @@
 }
 
 void IndexedDBQuotaClient::GetOriginsForType(
-    storage::StorageType type,
+    StorageType type,
     const GetOriginsCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(indexed_db_context_.get());
 
   // All databases are in the temp namespace for now.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
@@ -114,14 +115,14 @@
 }
 
 void IndexedDBQuotaClient::GetOriginsForHost(
-    storage::StorageType type,
+    StorageType type,
     const std::string& host,
     const GetOriginsCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(indexed_db_context_.get());
 
   // All databases are in the temp namespace for now.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
@@ -136,9 +137,9 @@
 }
 
 void IndexedDBQuotaClient::DeleteOriginData(const GURL& origin,
-                                            storage::StorageType type,
+                                            StorageType type,
                                             const DeletionCallback& callback) {
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(blink::QuotaStatusCode::kOk);
     return;
   }
@@ -150,8 +151,8 @@
       callback);
 }
 
-bool IndexedDBQuotaClient::DoesSupport(storage::StorageType type) const {
-  return type == storage::kStorageTypeTemporary;
+bool IndexedDBQuotaClient::DoesSupport(StorageType type) const {
+  return type == StorageType::kTemporary;
 }
 
 }  // namespace content
diff --git a/content/browser/indexed_db/indexed_db_quota_client.h b/content/browser/indexed_db/indexed_db_quota_client.h
index bc96cef..b47a698 100644
--- a/content/browser/indexed_db/indexed_db_quota_client.h
+++ b/content/browser/indexed_db/indexed_db_quota_client.h
@@ -14,7 +14,7 @@
 #include "content/common/content_export.h"
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/quota/quota_task.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace content {
@@ -33,20 +33,20 @@
   ID id() const override;
   void OnQuotaManagerDestroyed() override;
   CONTENT_EXPORT void GetOriginUsage(const GURL& origin_url,
-                                     storage::StorageType type,
+                                     blink::StorageType type,
                                      const GetUsageCallback& callback) override;
   CONTENT_EXPORT void GetOriginsForType(
-      storage::StorageType type,
+      blink::StorageType type,
       const GetOriginsCallback& callback) override;
   CONTENT_EXPORT void GetOriginsForHost(
-      storage::StorageType type,
+      blink::StorageType type,
       const std::string& host,
       const GetOriginsCallback& callback) override;
   CONTENT_EXPORT void DeleteOriginData(
       const GURL& origin,
-      storage::StorageType type,
+      blink::StorageType type,
       const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(blink::StorageType type) const override;
 
  private:
   scoped_refptr<IndexedDBContextImpl> indexed_db_context_;
diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
index 0b12f0a..e989803 100644
--- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc
@@ -24,12 +24,13 @@
 #include "content/public/test/test_utils.h"
 #include "storage/browser/test/mock_quota_manager.h"
 #include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/WebKit/common/quota/quota_status_code.h"
+
+using blink::StorageType;
 
 // Declared to shorten the line lengths.
-static const storage::StorageType kTemp = storage::kStorageTypeTemporary;
-static const storage::StorageType kPerm = storage::kStorageTypePersistent;
-static const storage::StorageType kSync = storage::kStorageTypeSyncable;
+static const StorageType kTemp = StorageType::kTemporary;
+static const StorageType kPerm = StorageType::kPersistent;
+static const StorageType kSync = StorageType::kSyncable;
 
 namespace content {
 
@@ -77,7 +78,7 @@
 
   int64_t GetOriginUsage(storage::QuotaClient* client,
                          const GURL& origin,
-                         storage::StorageType type) {
+                         StorageType type) {
     usage_ = -1;
     client->GetOriginUsage(
         origin,
@@ -90,7 +91,7 @@
   }
 
   const std::set<GURL>& GetOriginsForType(storage::QuotaClient* client,
-                                          storage::StorageType type) {
+                                          StorageType type) {
     origins_.clear();
     client->GetOriginsForType(
         type,
@@ -101,7 +102,7 @@
   }
 
   const std::set<GURL>& GetOriginsForHost(storage::QuotaClient* client,
-                                          storage::StorageType type,
+                                          StorageType type,
                                           const std::string& host) {
     origins_.clear();
     client->GetOriginsForHost(
@@ -115,7 +116,7 @@
 
   blink::QuotaStatusCode DeleteOrigin(storage::QuotaClient* client,
                                       const GURL& origin_url,
-                                      storage::StorageType type) {
+                                      StorageType type) {
     delete_status_ = blink::QuotaStatusCode::kUnknown;
     client->DeleteOriginData(
         origin_url, type,
diff --git a/content/browser/loader/mime_sniffing_resource_handler.cc b/content/browser/loader/mime_sniffing_resource_handler.cc
index 39b0314..42539c8a 100644
--- a/content/browser/loader/mime_sniffing_resource_handler.cc
+++ b/content/browser/loader/mime_sniffing_resource_handler.cc
@@ -517,8 +517,11 @@
 
   std::string disposition;
   request()->GetResponseHeaderByName("content-disposition", &disposition);
-  if (!disposition.empty() &&
-      net::HttpContentDisposition(disposition, std::string()).is_attachment()) {
+  if (GetRequestInfo()->suggested_filename().has_value()) {
+    must_download_ = true;
+  } else if (!disposition.empty() &&
+             net::HttpContentDisposition(disposition, std::string())
+                 .is_attachment()) {
     must_download_ = true;
   } else if (GetContentClient()->browser()->ShouldForceDownloadResource(
                  request()->url(), response_->head.mime_type)) {
diff --git a/content/browser/loader/navigation_url_loader_network_service.cc b/content/browser/loader/navigation_url_loader_network_service.cc
index c1c376f..248c1c7f 100644
--- a/content/browser/loader/navigation_url_loader_network_service.cc
+++ b/content/browser/loader/navigation_url_loader_network_service.cc
@@ -120,14 +120,18 @@
 // TODO(arthursonzogni): IsDownload can't be determined only by the response's
 // headers. The response's body might contain information to guess it.
 // See MimeSniffingResourceHandler.
-bool IsDownload(const ResourceResponse& response, const GURL& url) {
+bool IsDownload(const ResourceResponse& response,
+                const GURL& url,
+                const base::Optional<std::string>& suggested_filename) {
   if (response.head.headers) {
     std::string disposition;
-    if (response.head.headers->GetNormalizedHeader("content-disposition",
-                                                   &disposition) &&
-        !disposition.empty() &&
-        net::HttpContentDisposition(disposition, std::string())
-            .is_attachment()) {
+    if (suggested_filename.has_value()) {
+      return true;
+    } else if (response.head.headers->GetNormalizedHeader("content-disposition",
+                                                          &disposition) &&
+               !disposition.empty() &&
+               net::HttpContentDisposition(disposition, std::string())
+                   .is_attachment()) {
       return true;
     } else if (GetContentClient()->browser()->ShouldForceDownloadResource(
                    url, response.head.mime_type)) {
@@ -666,6 +670,7 @@
     std::vector<std::unique_ptr<URLLoaderRequestHandler>> initial_handlers)
     : delegate_(delegate),
       allow_download_(request_info->common_params.allow_download),
+      suggested_filename_(request_info->begin_params->suggested_filename),
       url_(request_info->common_params.url),
       weak_factory_(this) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
@@ -832,7 +837,8 @@
   // TODO(arthursonzogni): In NavigationMojoResponse, this is false. The info
   // coming from the MimeSniffingResourceHandler must be used.
   DCHECK(response);
-  bool is_download = allow_download_ && IsDownload(*response.get(), url_);
+  bool is_download =
+      allow_download_ && IsDownload(*response.get(), url_, suggested_filename_);
 
   delegate_->OnResponseStarted(
       std::move(response), std::move(url_loader_client_endpoints), nullptr,
diff --git a/content/browser/loader/navigation_url_loader_network_service.h b/content/browser/loader/navigation_url_loader_network_service.h
index 3f73231..a7e435ee 100644
--- a/content/browser/loader/navigation_url_loader_network_service.h
+++ b/content/browser/loader/navigation_url_loader_network_service.h
@@ -71,6 +71,11 @@
 
   bool allow_download_;
 
+  // If this request was triggered by an anchor tag with a download attribute,
+  // the |suggested_filename_| will be the (possibly empty) value of said
+  // attribute.
+  base::Optional<std::string> suggested_filename_;
+
   // Current URL that is being navigated, updated after redirection.
   GURL url_;
 
diff --git a/content/browser/loader/navigation_url_loader_network_service_unittest.cc b/content/browser/loader/navigation_url_loader_network_service_unittest.cc
index 3280ecb7..3a28f08d 100644
--- a/content/browser/loader/navigation_url_loader_network_service_unittest.cc
+++ b/content/browser/loader/navigation_url_loader_network_service_unittest.cc
@@ -112,7 +112,8 @@
             blink::WebMixedContentContextType::kBlockable,
             false /* is_form_submission */, GURL() /* searchable_form_url */,
             std::string() /* searchable_form_encoding */,
-            url::Origin::Create(url), GURL() /* client_side_redirect_url */);
+            url::Origin::Create(url), GURL() /* client_side_redirect_url */,
+            base::nullopt /* suggested_filename */);
 
     CommonNavigationParams common_params;
     common_params.url = url;
diff --git a/content/browser/loader/navigation_url_loader_unittest.cc b/content/browser/loader/navigation_url_loader_unittest.cc
index 84db684..0d61b2d 100644
--- a/content/browser/loader/navigation_url_loader_unittest.cc
+++ b/content/browser/loader/navigation_url_loader_unittest.cc
@@ -153,7 +153,8 @@
             blink::WebMixedContentContextType::kBlockable,
             false /* is_form_submission */, GURL() /* searchable_form_url */,
             std::string() /* searchable_form_encoding */,
-            url::Origin::Create(url), GURL() /* client_side_redirect_url */);
+            url::Origin::Create(url), GURL() /* client_side_redirect_url */,
+            base::nullopt /* suggested_filename */);
     CommonNavigationParams common_params;
     common_params.url = url;
     common_params.allow_download = allow_download;
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index 71ff6d2..563f9a88 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1218,7 +1218,8 @@
           request_data.referrer_policy),
       request_data.is_prerendering, resource_context, report_raw_headers,
       !is_sync_load, previews_state, request_data.request_body,
-      request_data.initiated_in_secure_context);
+      request_data.initiated_in_secure_context,
+      base::nullopt);  // suggested_filename
   extra_info->SetBlobHandles(std::move(blob_handles));
 
   // Request takes ownership.
@@ -1514,7 +1515,8 @@
       true,            // is_async
       previews_state,  // previews_state
       nullptr,         // body
-      false);          // initiated_in_secure_context
+      false,           // initiated_in_secure_context
+      base::nullopt);  // suggested_filename
 }
 
 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(
@@ -1951,7 +1953,8 @@
       // subresource requests, so it doesn't matter what value it gets here.
       // If in the future this changes this should be updated to somehow get a
       // meaningful value.
-      false);  // initiated_in_secure_context
+      false,                                   // initiated_in_secure_context
+      info.begin_params->suggested_filename);  // suggested_filename
   extra_info->SetBlobHandles(std::move(blob_handles));
   extra_info->set_navigation_ui_data(std::move(navigation_ui_data));
 
diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc
index b0cdc50..387edb0 100644
--- a/content/browser/loader/resource_dispatcher_host_unittest.cc
+++ b/content/browser/loader/resource_dispatcher_host_unittest.cc
@@ -814,7 +814,8 @@
               blink::WebMixedContentContextType::kBlockable,
               false /* is_form_submission */, GURL() /* searchable_form_url */,
               std::string() /* searchable_form_encoding */,
-              url::Origin::Create(url), GURL() /* client_side_redirect_url */);
+              url::Origin::Create(url), GURL() /* client_side_redirect_url */,
+              base::nullopt /* suggested_filename */);
       CommonNavigationParams common_params;
       common_params.url = url;
       std::unique_ptr<NavigationRequestInfo> request_info(
diff --git a/content/browser/loader/resource_request_info_impl.cc b/content/browser/loader/resource_request_info_impl.cc
index cbd2ff93..b96745d 100644
--- a/content/browser/loader/resource_request_info_impl.cc
+++ b/content/browser/loader/resource_request_info_impl.cc
@@ -85,7 +85,8 @@
       is_async,                            // is_async
       previews_state,                      // previews_state
       nullptr,                             // body
-      false);                              // initiated_in_secure_context
+      false,                               // initiated_in_secure_context
+      base::nullopt);                      // suggested_filename
   info->AssociateWithRequest(request);
   info->set_navigation_ui_data(std::move(navigation_ui_data));
 }
@@ -153,7 +154,8 @@
     bool is_async,
     PreviewsState previews_state,
     const scoped_refptr<ResourceRequestBody> body,
-    bool initiated_in_secure_context)
+    bool initiated_in_secure_context,
+    const base::Optional<std::string>& suggested_filename)
     : detachable_handler_(nullptr),
       requester_info_(std::move(requester_info)),
       route_id_(route_id),
@@ -183,7 +185,8 @@
       canceled_by_devtools_(false),
       previews_state_(previews_state),
       body_(body),
-      initiated_in_secure_context_(initiated_in_secure_context) {}
+      initiated_in_secure_context_(initiated_in_secure_context),
+      suggested_filename_(suggested_filename) {}
 
 ResourceRequestInfoImpl::~ResourceRequestInfoImpl() {
 }
diff --git a/content/browser/loader/resource_request_info_impl.h b/content/browser/loader/resource_request_info_impl.h
index faab481e..a70967c7 100644
--- a/content/browser/loader/resource_request_info_impl.h
+++ b/content/browser/loader/resource_request_info_impl.h
@@ -13,6 +13,7 @@
 #include "base/gtest_prod_util.h"
 #include "base/macros.h"
 #include "base/memory/ref_counted.h"
+#include "base/optional.h"
 #include "base/supports_user_data.h"
 #include "content/browser/blob_storage/chrome_blob_storage_context.h"
 #include "content/browser/loader/resource_requester_info.h"
@@ -72,7 +73,8 @@
       bool is_async,
       PreviewsState previews_state,
       const scoped_refptr<ResourceRequestBody> body,
-      bool initiated_in_secure_context);
+      bool initiated_in_secure_context,
+      const base::Optional<std::string>& suggested_filename);
   ~ResourceRequestInfoImpl() override;
 
   // ResourceRequestInfo implementation:
@@ -202,6 +204,10 @@
 
   void SetBlobHandles(BlobHandles blob_handles);
 
+  const base::Optional<std::string>& suggested_filename() const {
+    return suggested_filename_;
+  }
+
  private:
   FRIEND_TEST_ALL_PREFIXES(ResourceDispatcherHostTest,
                            DeletedFilterDetached);
@@ -240,6 +246,7 @@
   scoped_refptr<ResourceRequestBody> body_;
   bool initiated_in_secure_context_;
   std::unique_ptr<NavigationUIData> navigation_ui_data_;
+  base::Optional<std::string> suggested_filename_;
 
   // Keeps upload body blobs alive for the duration of the request.
   BlobHandles blob_handles_;
diff --git a/content/browser/locks/lock_manager.cc b/content/browser/locks/lock_manager.cc
index d242713..d02e108 100644
--- a/content/browser/locks/lock_manager.cc
+++ b/content/browser/locks/lock_manager.cc
@@ -5,6 +5,7 @@
 #include "content/browser/locks/lock_manager.h"
 
 #include <algorithm>
+#include <memory>
 #include <utility>
 
 #include "base/stl_util.h"
@@ -25,7 +26,7 @@
                                             int64_t lock_id) {
     blink::mojom::LockHandlePtr ptr;
     mojo::MakeStrongBinding(
-        base::MakeUnique<LockHandleImpl>(std::move(context), origin, lock_id),
+        std::make_unique<LockHandleImpl>(std::move(context), origin, lock_id),
         mojo::MakeRequest(&ptr));
     return ptr;
   }
diff --git a/content/browser/quota_dispatcher_host.cc b/content/browser/quota_dispatcher_host.cc
index a936cdbe..8df8984fd 100644
--- a/content/browser/quota_dispatcher_host.cc
+++ b/content/browser/quota_dispatcher_host.cc
@@ -17,9 +17,9 @@
 #include "third_party/WebKit/common/quota/quota_status_code.h"
 #include "url/origin.h"
 
+using blink::StorageType;
 using storage::QuotaClient;
 using storage::QuotaManager;
-using storage::StorageType;
 
 namespace content {
 
@@ -49,7 +49,7 @@
 
 void QuotaDispatcherHost::QueryStorageUsageAndQuota(
     const url::Origin& origin,
-    storage::StorageType storage_type,
+    StorageType storage_type,
     QueryStorageUsageAndQuotaCallback callback) {
   quota_manager_->GetUsageAndQuotaForWebApps(
       origin.GetURL(), storage_type,
@@ -61,19 +61,19 @@
 void QuotaDispatcherHost::RequestStorageQuota(
     int64_t render_frame_id,
     const url::Origin& origin,
-    storage::StorageType storage_type,
+    StorageType storage_type,
     uint64_t requested_size,
     mojom::QuotaDispatcherHost::RequestStorageQuotaCallback callback) {
-  if (storage_type != storage::kStorageTypeTemporary &&
-      storage_type != storage::kStorageTypePersistent) {
+  if (storage_type != StorageType::kTemporary &&
+      storage_type != StorageType::kPersistent) {
     // Unsupported storage types.
     std::move(callback).Run(blink::QuotaStatusCode::kErrorNotSupported, 0, 0);
     return;
   }
 
-  DCHECK(storage_type == storage::kStorageTypeTemporary ||
-         storage_type == storage::kStorageTypePersistent);
-  if (storage_type == storage::kStorageTypePersistent) {
+  DCHECK(storage_type == StorageType::kTemporary ||
+         storage_type == StorageType::kPersistent);
+  if (storage_type == StorageType::kPersistent) {
     quota_manager_->GetUsageAndQuotaForWebApps(
         origin.GetURL(), storage_type,
         base::Bind(&QuotaDispatcherHost::DidGetPersistentUsageAndQuota,
@@ -100,7 +100,7 @@
 void QuotaDispatcherHost::DidGetPersistentUsageAndQuota(
     int64_t render_frame_id,
     const url::Origin& origin,
-    storage::StorageType storage_type,
+    StorageType storage_type,
     uint64_t requested_quota,
     RequestStorageQuotaCallback callback,
     blink::QuotaStatusCode status,
diff --git a/content/browser/quota_dispatcher_host.h b/content/browser/quota_dispatcher_host.h
index 215325c..fe1c42ed 100644
--- a/content/browser/quota_dispatcher_host.h
+++ b/content/browser/quota_dispatcher_host.h
@@ -9,6 +9,7 @@
 #include "content/common/quota_dispatcher_host.mojom.h"
 #include "content/public/browser/quota_permission_context.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace storage {
 class QuotaManager;
@@ -37,11 +38,11 @@
   // content::mojom::QuotaDispatcherHost:
   void QueryStorageUsageAndQuota(
       const url::Origin& origin,
-      storage::StorageType storage_type,
+      blink::StorageType storage_type,
       QueryStorageUsageAndQuotaCallback callback) override;
   void RequestStorageQuota(int64_t render_frame_id,
                            const url::Origin& origin,
-                           storage::StorageType storage_type,
+                           blink::StorageType storage_type,
                            uint64_t requested_size,
                            RequestStorageQuotaCallback callback) override;
 
@@ -52,7 +53,7 @@
                                     int64_t quota);
   void DidGetPersistentUsageAndQuota(int64_t render_frame_id,
                                      const url::Origin& origin,
-                                     storage::StorageType storage_type,
+                                     blink::StorageType storage_type,
                                      uint64_t requested_quota,
                                      RequestStorageQuotaCallback callback,
                                      blink::QuotaStatusCode status,
diff --git a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc
index 76a102a..6166a7b6 100644
--- a/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc
+++ b/content/browser/renderer_host/pepper/pepper_file_system_browser_host.cc
@@ -26,7 +26,6 @@
 #include "storage/browser/fileapi/isolated_context.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/common/fileapi/file_system_util.h"
-#include "storage/common/quota/quota_types.h"
 
 namespace content {
 
diff --git a/content/browser/renderer_host/web_database_host_impl.cc b/content/browser/renderer_host/web_database_host_impl.cc
index 0731b83..e63e34c 100644
--- a/content/browser/renderer_host/web_database_host_impl.cc
+++ b/content/browser/renderer_host/web_database_host_impl.cc
@@ -19,6 +19,7 @@
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/common/database/database_identifier.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/sqlite/sqlite3.h"
 
 using storage::DatabaseUtil;
@@ -185,7 +186,7 @@
 
   db_tracker_->quota_manager_proxy()->GetUsageAndQuota(
       db_tracker_->task_runner(), origin.GetURL(),
-      storage::kStorageTypeTemporary,
+      blink::StorageType::kTemporary,
       base::Bind(
           [](GetSpaceAvailableCallback callback, blink::QuotaStatusCode status,
              int64_t usage, int64_t quota) {
diff --git a/content/browser/renderer_host/web_database_host_impl.h b/content/browser/renderer_host/web_database_host_impl.h
index aa4d687..52d6367 100644
--- a/content/browser/renderer_host/web_database_host_impl.h
+++ b/content/browser/renderer_host/web_database_host_impl.h
@@ -10,7 +10,6 @@
 #include "base/strings/string16.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "storage/browser/database/database_tracker.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/public/platform/modules/webdatabase/web_database.mojom.h"
 
 namespace url {
diff --git a/content/browser/service_worker/service_worker_quota_client.cc b/content/browser/service_worker/service_worker_quota_client.cc
index 4819a05..32a445fc 100644
--- a/content/browser/service_worker/service_worker_quota_client.cc
+++ b/content/browser/service_worker/service_worker_quota_client.cc
@@ -7,6 +7,7 @@
 #include "content/browser/service_worker/service_worker_context_wrapper.h"
 #include "content/public/browser/browser_thread.h"
 
+using blink::StorageType;
 using storage::QuotaClient;
 
 namespace content {
@@ -62,9 +63,9 @@
 
 void ServiceWorkerQuotaClient::GetOriginUsage(
     const GURL& origin,
-    storage::StorageType type,
+    StorageType type,
     const GetUsageCallback& callback) {
-  if (type != storage::StorageType::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(0);
     return;
   }
@@ -73,9 +74,9 @@
 }
 
 void ServiceWorkerQuotaClient::GetOriginsForType(
-    storage::StorageType type,
+    StorageType type,
     const GetOriginsCallback& callback) {
-  if (type != storage::StorageType::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
@@ -83,10 +84,10 @@
 }
 
 void ServiceWorkerQuotaClient::GetOriginsForHost(
-    storage::StorageType type,
+    StorageType type,
     const std::string& host,
     const GetOriginsCallback& callback) {
-  if (type != storage::StorageType::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
@@ -95,17 +96,17 @@
 
 void ServiceWorkerQuotaClient::DeleteOriginData(
     const GURL& origin,
-    storage::StorageType type,
+    StorageType type,
     const DeletionCallback& callback) {
-  if (type != storage::StorageType::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(blink::QuotaStatusCode::kOk);
     return;
   }
   context_->DeleteForOrigin(origin, base::Bind(&ReportToQuotaStatus, callback));
 }
 
-bool ServiceWorkerQuotaClient::DoesSupport(storage::StorageType type) const {
-  return type == storage::StorageType::kStorageTypeTemporary;
+bool ServiceWorkerQuotaClient::DoesSupport(StorageType type) const {
+  return type == StorageType::kTemporary;
 }
 
 }  // namespace content
diff --git a/content/browser/service_worker/service_worker_quota_client.h b/content/browser/service_worker/service_worker_quota_client.h
index 3c6f84fb..f37b8a9 100644
--- a/content/browser/service_worker/service_worker_quota_client.h
+++ b/content/browser/service_worker/service_worker_quota_client.h
@@ -9,7 +9,7 @@
 #include "base/memory/ref_counted.h"
 #include "content/common/content_export.h"
 #include "storage/browser/quota/quota_client.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 class ServiceWorkerContextWrapper;
@@ -22,17 +22,17 @@
   ID id() const override;
   void OnQuotaManagerDestroyed() override;
   void GetOriginUsage(const GURL& origin,
-                      storage::StorageType type,
+                      blink::StorageType type,
                       const GetUsageCallback& callback) override;
-  void GetOriginsForType(storage::StorageType type,
+  void GetOriginsForType(blink::StorageType type,
                          const GetOriginsCallback& callback) override;
-  void GetOriginsForHost(storage::StorageType type,
+  void GetOriginsForHost(blink::StorageType type,
                          const std::string& host,
                          const GetOriginsCallback& callback) override;
   void DeleteOriginData(const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(blink::StorageType type) const override;
 
  private:
   friend class ServiceWorkerContextWrapper;
diff --git a/content/browser/service_worker/service_worker_storage.cc b/content/browser/service_worker/service_worker_storage.cc
index 38072ab..72dc729 100644
--- a/content/browser/service_worker/service_worker_storage.cc
+++ b/content/browser/service_worker/service_worker_storage.cc
@@ -5,6 +5,7 @@
 #include "content/browser/service_worker/service_worker_storage.h"
 
 #include <stddef.h>
+#include <memory>
 #include <utility>
 
 #include "base/bind_helpers.h"
@@ -28,6 +29,7 @@
 #include "net/base/net_errors.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/browser/quota/special_storage_policy.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/WebKit/common/service_worker/service_worker_object.mojom.h"
 #include "third_party/WebKit/common/service_worker/service_worker_registration.mojom.h"
 #include "third_party/WebKit/public/platform/web_feature.mojom.h"
@@ -546,7 +548,7 @@
   if (!has_checked_for_stale_resources_)
     DeleteStaleResources();
 
-  auto params = base::MakeUnique<DidDeleteRegistrationParams>(
+  auto params = std::make_unique<DidDeleteRegistrationParams>(
       registration_id, origin, std::move(callback));
 
   database_task_runner_->PostTask(
@@ -1377,9 +1379,8 @@
   if (quota_manager_proxy_) {
     // Can be nullptr in tests.
     quota_manager_proxy_->NotifyStorageModified(
-        storage::QuotaClient::kServiceWorker,
-        origin,
-        storage::StorageType::kStorageTypeTemporary,
+        storage::QuotaClient::kServiceWorker, origin,
+        blink::StorageType::kTemporary,
         new_version.resources_total_size_bytes -
             deleted_version.resources_total_size_bytes);
   }
@@ -1416,7 +1417,7 @@
     // Can be nullptr in tests.
     quota_manager_proxy_->NotifyStorageModified(
         storage::QuotaClient::kServiceWorker, params->origin,
-        storage::StorageType::kStorageTypeTemporary,
+        blink::StorageType::kTemporary,
         -deleted_version.resources_total_size_bytes);
   }
   if (origin_state == OriginState::kDelete)
diff --git a/content/browser/storage_partition_impl.cc b/content/browser/storage_partition_impl.cc
index 00bef7e..99fb719 100644
--- a/content/browser/storage_partition_impl.cc
+++ b/content/browser/storage_partition_impl.cc
@@ -52,6 +52,7 @@
 #include "storage/browser/database/database_tracker.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 #if !defined(OS_ANDROID)
 #include "content/browser/host_zoom_map_impl.h"
@@ -124,15 +125,16 @@
 }
 
 void OnQuotaManagedOriginDeleted(const GURL& origin,
-                                 storage::StorageType type,
+                                 blink::StorageType type,
                                  size_t* deletion_task_count,
                                  const base::Closure& callback,
                                  blink::QuotaStatusCode status) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK_GT(*deletion_task_count, 0u);
   if (status != blink::QuotaStatusCode::kOk) {
-    DLOG(ERROR) << "Couldn't remove data of type " << type << " for origin "
-                << origin << ". Status: " << static_cast<int>(status);
+    DLOG(ERROR) << "Couldn't remove data of type " << static_cast<int>(type)
+                << " for origin " << origin
+                << ". Status: " << static_cast<int>(status);
   }
 
   (*deletion_task_count)--;
@@ -338,7 +340,7 @@
       const StoragePartition::OriginMatcherFunction& origin_matcher,
       const base::Closure& callback,
       const std::set<GURL>& origins,
-      storage::StorageType quota_storage_type);
+      blink::StorageType quota_storage_type);
 
   // All of these data are accessed on IO thread.
   uint32_t remove_mask;
@@ -826,7 +828,7 @@
     // within the user-specified timeframe, and deal with the resulting set in
     // ClearQuotaManagedOriginsOnIOThread().
     quota_manager->GetOriginsModifiedSince(
-        storage::kStorageTypePersistent, begin,
+        blink::StorageType::kPersistent, begin,
         base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread,
                    base::Unretained(this), base::RetainedRef(quota_manager),
                    special_storage_policy, origin_matcher, decrement_callback));
@@ -836,7 +838,7 @@
   if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_TEMPORARY) {
     IncrementTaskCountOnIO();
     quota_manager->GetOriginsModifiedSince(
-        storage::kStorageTypeTemporary, begin,
+        blink::StorageType::kTemporary, begin,
         base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread,
                    base::Unretained(this), base::RetainedRef(quota_manager),
                    special_storage_policy, origin_matcher, decrement_callback));
@@ -846,7 +848,7 @@
   if (quota_storage_remove_mask & QUOTA_MANAGED_STORAGE_MASK_SYNCABLE) {
     IncrementTaskCountOnIO();
     quota_manager->GetOriginsModifiedSince(
-        storage::kStorageTypeSyncable, begin,
+        blink::StorageType::kSyncable, begin,
         base::Bind(&QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread,
                    base::Unretained(this), base::RetainedRef(quota_manager),
                    special_storage_policy, origin_matcher, decrement_callback));
@@ -855,14 +857,15 @@
   DecrementTaskCountOnIO();
 }
 
-void
-StoragePartitionImpl::QuotaManagedDataDeletionHelper::ClearOriginsOnIOThread(
-    storage::QuotaManager* quota_manager,
-    const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy,
-    const StoragePartition::OriginMatcherFunction& origin_matcher,
-    const base::Closure& callback,
-    const std::set<GURL>& origins,
-    storage::StorageType quota_storage_type) {
+void StoragePartitionImpl::QuotaManagedDataDeletionHelper::
+    ClearOriginsOnIOThread(
+        storage::QuotaManager* quota_manager,
+        const scoped_refptr<storage::SpecialStoragePolicy>&
+            special_storage_policy,
+        const StoragePartition::OriginMatcherFunction& origin_matcher,
+        const base::Closure& callback,
+        const std::set<GURL>& origins,
+        blink::StorageType quota_storage_type) {
   // The QuotaManager manages all storage other than cookies, LocalStorage,
   // and SessionStorage. This loop wipes out most HTML5 storage for the given
   // origins.
diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc
index 24ef1bf6..445ade0 100644
--- a/content/browser/storage_partition_impl_unittest.cc
+++ b/content/browser/storage_partition_impl_unittest.cc
@@ -69,8 +69,8 @@
 const GURL kOrigin3(kTestOrigin3);
 const GURL kOriginDevTools(kTestOriginDevTools);
 
-const storage::StorageType kTemporary = storage::kStorageTypeTemporary;
-const storage::StorageType kPersistent = storage::kStorageTypePersistent;
+const blink::StorageType kTemporary = blink::StorageType::kTemporary;
+const blink::StorageType kPersistent = blink::StorageType::kPersistent;
 
 const storage::QuotaClient::ID kClientFile = storage::QuotaClient::kFileSystem;
 
diff --git a/content/browser/web_contents/web_contents_android.cc b/content/browser/web_contents/web_contents_android.cc
index 0b1f5c2..5715a00c 100644
--- a/content/browser/web_contents/web_contents_android.cc
+++ b/content/browser/web_contents/web_contents_android.cc
@@ -698,43 +698,6 @@
   return native_view->GetEventForwarder();
 }
 
-void WebContentsAndroid::CreateJavaBridgeDispatcherHost(
-    JNIEnv* env,
-    const JavaParamRef<jobject>& obj,
-    const JavaParamRef<jobject>& retained_javascript_objects) {
-  DCHECK(!java_bridge_dispatcher_host_);
-  java_bridge_dispatcher_host_ = new GinJavaBridgeDispatcherHost(
-      web_contents_, retained_javascript_objects);
-}
-
-void WebContentsAndroid::SetAllowJavascriptInterfacesInspection(
-    JNIEnv* env,
-    const JavaParamRef<jobject>& obj,
-    jboolean allow) {
-  DCHECK(java_bridge_dispatcher_host_);
-  java_bridge_dispatcher_host_->SetAllowObjectContentsInspection(allow);
-}
-
-void WebContentsAndroid::AddJavascriptInterface(
-    JNIEnv* env,
-    const JavaParamRef<jobject>& /* obj */,
-    const JavaParamRef<jobject>& object,
-    const JavaParamRef<jstring>& name,
-    const JavaParamRef<jclass>& safe_annotation_clazz) {
-  DCHECK(java_bridge_dispatcher_host_);
-  java_bridge_dispatcher_host_->AddNamedObject(
-      ConvertJavaStringToUTF8(env, name), object, safe_annotation_clazz);
-}
-
-void WebContentsAndroid::RemoveJavascriptInterface(
-    JNIEnv* env,
-    const JavaParamRef<jobject>& /* obj */,
-    const JavaParamRef<jstring>& name) {
-  DCHECK(java_bridge_dispatcher_host_);
-  java_bridge_dispatcher_host_->RemoveNamedObject(
-      ConvertJavaStringToUTF8(env, name));
-}
-
 void WebContentsAndroid::OnFinishGetContentBitmap(
     const JavaRef<jobject>& obj,
     const JavaRef<jobject>& callback,
diff --git a/content/browser/web_contents/web_contents_android.h b/content/browser/web_contents/web_contents_android.h
index 31d24d4..8930d4c 100644
--- a/content/browser/web_contents/web_contents_android.h
+++ b/content/browser/web_contents/web_contents_android.h
@@ -10,7 +10,6 @@
 #include <memory>
 
 #include "base/android/jni_android.h"
-#include "base/android/scoped_java_ref.h"
 #include "base/compiler_specific.h"
 #include "base/macros.h"
 #include "base/memory/weak_ptr.h"
@@ -23,7 +22,6 @@
 
 namespace content {
 
-class GinJavaBridgeDispatcherHost;
 class WebContentsImpl;
 
 // Android wrapper around WebContents that provides safer passage from java and
@@ -268,9 +266,6 @@
   NavigationControllerAndroid navigation_controller_;
   base::android::ScopedJavaGlobalRef<jobject> obj_;
 
-  // Manages injecting Java objects.
-  scoped_refptr<GinJavaBridgeDispatcherHost> java_bridge_dispatcher_host_;
-
   base::WeakPtrFactory<WebContentsAndroid> weak_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(WebContentsAndroid);
diff --git a/content/browser/webauth/authenticator_impl_unittest.cc b/content/browser/webauth/authenticator_impl_unittest.cc
index 8fb1ff8..98dc4185 100644
--- a/content/browser/webauth/authenticator_impl_unittest.cc
+++ b/content/browser/webauth/authenticator_impl_unittest.cc
@@ -4,6 +4,7 @@
 
 #include "content/browser/webauth/authenticator_impl.h"
 
+#include <memory>
 #include <string>
 
 #include "base/base64url.h"
@@ -699,7 +700,7 @@
       new base::TestMockTimeTaskRunner(base::Time::Now(),
                                        base::TimeTicks::Now()));
   std::unique_ptr<base::TickClock> tick_clock = task_runner->GetMockTickClock();
-  auto timer = base::MakeUnique<base::OneShotTimer>(tick_clock.get());
+  auto timer = std::make_unique<base::OneShotTimer>(tick_clock.get());
   timer->SetTaskRunner(task_runner);
   AuthenticatorPtr authenticator =
       ConnectToAuthenticator(connector.get(), std::move(timer));
diff --git a/content/browser/webrtc/webrtc_internals_unittest.cc b/content/browser/webrtc/webrtc_internals_unittest.cc
index 231bbf4..b98d02e 100644
--- a/content/browser/webrtc/webrtc_internals_unittest.cc
+++ b/content/browser/webrtc/webrtc_internals_unittest.cc
@@ -150,7 +150,8 @@
   TestBrowserThreadBundle test_browser_thread_bundle_;
 };
 
-TEST_F(WebRtcInternalsTest, AddRemoveObserver) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_AddRemoveObserver) {
   base::RunLoop loop;
   MockWebRtcInternalsProxy observer(&loop);
   WebRTCInternalsForTest webrtc_internals;
@@ -169,7 +170,8 @@
   webrtc_internals.OnRemovePeerConnection(3, 4);
 }
 
-TEST_F(WebRtcInternalsTest, EnsureNoLogWhenNoObserver) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_EnsureNoLogWhenNoObserver) {
   base::RunLoop loop;
   WebRTCInternalsForTest webrtc_internals;
   webrtc_internals.OnAddPeerConnection(0, 3, 4, kUrl, kRtcConfiguration,
@@ -194,7 +196,8 @@
   webrtc_internals.OnRemovePeerConnection(3, 4);
 }
 
-TEST_F(WebRtcInternalsTest, EnsureLogIsRemovedWhenObserverIsRemoved) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_EnsureLogIsRemovedWhenObserverIsRemoved) {
   base::RunLoop loop;
   WebRTCInternalsForTest webrtc_internals;
   MockWebRtcInternalsProxy observer;
@@ -230,7 +233,8 @@
   webrtc_internals.OnRemovePeerConnection(3, 4);
 }
 
-TEST_F(WebRtcInternalsTest, SendAddPeerConnectionUpdate) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_SendAddPeerConnectionUpdate) {
   base::RunLoop loop;
   MockWebRtcInternalsProxy observer(&loop);
   WebRTCInternalsForTest webrtc_internals;
@@ -255,7 +259,8 @@
   webrtc_internals.OnRemovePeerConnection(1, 2);
 }
 
-TEST_F(WebRtcInternalsTest, SendRemovePeerConnectionUpdate) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_SendRemovePeerConnectionUpdate) {
   base::RunLoop loop;
   MockWebRtcInternalsProxy observer(&loop);
   WebRTCInternalsForTest webrtc_internals;
@@ -277,7 +282,8 @@
   webrtc_internals.RemoveObserver(&observer);
 }
 
-TEST_F(WebRtcInternalsTest, SendUpdatePeerConnectionUpdate) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_SendUpdatePeerConnectionUpdate) {
   base::RunLoop loop;
   MockWebRtcInternalsProxy observer(&loop);
   WebRTCInternalsForTest webrtc_internals;
@@ -309,7 +315,8 @@
   webrtc_internals.RemoveObserver(&observer);
 }
 
-TEST_F(WebRtcInternalsTest, AddGetUserMedia) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_AddGetUserMedia) {
   base::RunLoop loop;
   MockWebRtcInternalsProxy observer(&loop);
   WebRTCInternalsForTest webrtc_internals;
@@ -333,7 +340,8 @@
   webrtc_internals.RemoveObserver(&observer);
 }
 
-TEST_F(WebRtcInternalsTest, SendAllUpdateWithGetUserMedia) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_SendAllUpdateWithGetUserMedia) {
   const int rid = 1;
   const int pid = 2;
   const std::string audio_constraint = "aaa";
@@ -354,7 +362,8 @@
   webrtc_internals.RemoveObserver(&observer);
 }
 
-TEST_F(WebRtcInternalsTest, SendAllUpdatesWithPeerConnectionUpdate) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_SendAllUpdatesWithPeerConnectionUpdate) {
   const int rid = 0, pid = 1, lid = 2;
   const std::string update_type = "fakeType";
   const std::string update_value = "fakeValue";
@@ -399,7 +408,8 @@
   EXPECT_FALSE(time.empty());
 }
 
-TEST_F(WebRtcInternalsTest, OnAddStats) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_OnAddStats) {
   const int rid = 0, pid = 1, lid = 2;
   base::RunLoop loop;
   MockWebRtcInternalsProxy observer(&loop);
@@ -426,7 +436,9 @@
   VerifyList(dict, "reports", list);
 }
 
-TEST_F(WebRtcInternalsTest, AudioDebugRecordingsFileSelectionCanceled) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest,
+       DISABLED_AudioDebugRecordingsFileSelectionCanceled) {
   base::RunLoop loop;
 
   MockWebRtcInternalsProxy observer(&loop);
@@ -441,7 +453,8 @@
   EXPECT_EQ(nullptr, observer.value());
 }
 
-TEST_F(WebRtcInternalsTest, WakeLock) {
+// Flaky: crbug.com/796047.
+TEST_F(WebRtcInternalsTest, DISABLED_WakeLock) {
   int kRenderProcessId = 1;
   const int pid = 1;
   const int lid[] = {1, 2, 3};
diff --git a/content/common/navigation_params.mojom b/content/common/navigation_params.mojom
index d98fcd6..6f053d2 100644
--- a/content/common/navigation_params.mojom
+++ b/content/common/navigation_params.mojom
@@ -55,5 +55,10 @@
   // If the transition type is a client side redirect, then this holds the URL
   // of the page that had the client side redirect.
   url.mojom.Url client_side_redirect_url;
+
+  // If the anchor element that triggered this navigation had a download
+  // attribute, this field will be set to the attribute's (possibly empty)
+  // value.
+  string? suggested_filename;
 };
 
diff --git a/content/network/url_loader_unittest.cc b/content/network/url_loader_unittest.cc
index 8475ad8..f5b31049a 100644
--- a/content/network/url_loader_unittest.cc
+++ b/content/network/url_loader_unittest.cc
@@ -594,7 +594,13 @@
   LoadAndCompareFile("empty.html");
 }
 
-TEST_F(URLLoaderTest, BasicSSL) {
+// Fails on Fuchsia bots, crbug.com/798253.
+#if defined(OS_FUCHSIA)
+#define MAYBE_BasicSSL DISABLED_BasicSSL
+#else
+#define MAYBE_BasicSSL BasicSSL
+#endif
+TEST_F(URLLoaderTest, MAYBE_BasicSSL) {
   net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
   https_server.ServeFilesFromSourceDirectory(
       base::FilePath(FILE_PATH_LITERAL("content/test/data")));
@@ -609,7 +615,13 @@
   ASSERT_TRUE(https_server.GetCertificate()->Equals(ssl_info()->cert.get()));
 }
 
-TEST_F(URLLoaderTest, SSLSentOnlyWhenRequested) {
+// Fails on Fuchsia bots, crbug.com/798253.
+#if defined(OS_FUCHSIA)
+#define MAYBE_SSLSentOnlyWhenRequested DISABLED_SSLSentOnlyWhenRequested
+#else
+#define MAYBE_SSLSentOnlyWhenRequested SSLSentOnlyWhenRequested
+#endif
+TEST_F(URLLoaderTest, MAYBE_SSLSentOnlyWhenRequested) {
   net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
   https_server.ServeFilesFromSourceDirectory(
       base::FilePath(FILE_PATH_LITERAL("content/test/data")));
@@ -1316,7 +1328,15 @@
 
 // Tests that SSLInfo is not attached to OnComplete messages when there is no
 // certificate error.
-TEST_F(URLLoaderTest, NoSSLInfoWithoutCertificateError) {
+//
+// Fails on Fuchsia bots, crbug.com/798253.
+#if defined(OS_FUCHSIA)
+#define MAYBE_NoSSLInfoWithoutCertificateError \
+  DISABLED_NoSSLInfoWithoutCertificateError
+#else
+#define MAYBE_NoSSLInfoWithoutCertificateError NoSSLInfoWithoutCertificateError
+#endif
+TEST_F(URLLoaderTest, MAYBE_NoSSLInfoWithoutCertificateError) {
   net::EmbeddedTestServer https_server(net::EmbeddedTestServer::TYPE_HTTPS);
   ASSERT_TRUE(https_server.Start());
   set_send_ssl_for_cert_error();
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
index 07225814..d5a9fb9 100644
--- a/content/public/android/BUILD.gn
+++ b/content/public/android/BUILD.gn
@@ -130,6 +130,7 @@
     "java/src/org/chromium/content/browser/GpuProcessCallback.java",
     "java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java",
     "java/src/org/chromium/content/browser/InterstitialPageDelegateAndroid.java",
+    "java/src/org/chromium/content/browser/JavascriptInjectorImpl.java",
     "java/src/org/chromium/content/browser/JavascriptInterface.java",
     "java/src/org/chromium/content/browser/LauncherThread.java",
     "java/src/org/chromium/content/browser/MediaResourceGetter.java",
@@ -232,6 +233,7 @@
     "java/src/org/chromium/content_public/browser/ImeEventObserver.java",
     "java/src/org/chromium/content_public/browser/InterfaceRegistrar.java",
     "java/src/org/chromium/content_public/browser/JavaScriptCallback.java",
+    "java/src/org/chromium/content_public/browser/JavascriptInjector.java",
     "java/src/org/chromium/content_public/browser/LoadUrlParams.java",
     "java/src/org/chromium/content_public/browser/MediaSession.java",
     "java/src/org/chromium/content_public/browser/MediaSessionObserver.java",
@@ -354,6 +356,7 @@
     "java/src/org/chromium/content/browser/GpuProcessCallback.java",
     "java/src/org/chromium/content/browser/InterfaceRegistrarImpl.java",
     "java/src/org/chromium/content/browser/InterstitialPageDelegateAndroid.java",
+    "java/src/org/chromium/content/browser/JavascriptInjectorImpl.java",
     "java/src/org/chromium/content/browser/LauncherThread.java",
     "java/src/org/chromium/content/browser/MediaResourceGetter.java",
     "java/src/org/chromium/content/browser/MediaSessionImpl.java",
diff --git a/content/public/android/java/src/org/chromium/content/browser/JavascriptInjectorImpl.java b/content/public/android/java/src/org/chromium/content/browser/JavascriptInjectorImpl.java
new file mode 100644
index 0000000..9e8f966
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/JavascriptInjectorImpl.java
@@ -0,0 +1,85 @@
+// 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.
+
+package org.chromium.content.browser;
+
+import android.util.Pair;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.content.browser.webcontents.WebContentsUserData;
+import org.chromium.content.browser.webcontents.WebContentsUserData.UserDataFactory;
+import org.chromium.content_public.browser.JavascriptInjector;
+import org.chromium.content_public.browser.WebContents;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Implementation class of the interface {@link JavascriptInjector}.
+ */
+@JNINamespace("content")
+public class JavascriptInjectorImpl implements JavascriptInjector {
+    private static final class UserDataFactoryLazyHolder {
+        private static final UserDataFactory<JavascriptInjectorImpl> INSTANCE =
+                JavascriptInjectorImpl::new;
+    }
+
+    private final Set<Object> mRetainedObjects = new HashSet<>();
+    private final Map<String, Pair<Object, Class>> mInjectedObjects = new HashMap<>();
+    private long mNativePtr;
+
+    /**
+     * @param webContents {@link WebContents} object.
+     * @return {@link JavascriptInjector} object used for the give WebContents.
+     *         Creates one if not present.
+     */
+    public static JavascriptInjector fromWebContents(WebContents webContents) {
+        return WebContentsUserData.fromWebContents(
+                webContents, JavascriptInjectorImpl.class, UserDataFactoryLazyHolder.INSTANCE);
+    }
+
+    public JavascriptInjectorImpl(WebContents webContents) {
+        mNativePtr = nativeInit(webContents, mRetainedObjects);
+    }
+
+    @CalledByNative
+    private void onDestroy() {
+        mNativePtr = 0;
+    }
+
+    @Override
+    public Map<String, Pair<Object, Class>> getInterfaces() {
+        return mInjectedObjects;
+    }
+
+    @Override
+    public void setAllowInspection(boolean allow) {
+        if (mNativePtr != 0) nativeSetAllowInspection(mNativePtr, allow);
+    }
+
+    @Override
+    public void addPossiblyUnsafeInterface(
+            Object object, String name, Class<? extends Annotation> requiredAnnotation) {
+        if (mNativePtr != 0 && object != null) {
+            mInjectedObjects.put(name, new Pair<Object, Class>(object, requiredAnnotation));
+            nativeAddInterface(mNativePtr, object, name, requiredAnnotation);
+        }
+    }
+
+    @Override
+    public void removeInterface(String name) {
+        mInjectedObjects.remove(name);
+        if (mNativePtr != 0) nativeRemoveInterface(mNativePtr, name);
+    }
+
+    private native long nativeInit(WebContents webContents, Object retainedObjects);
+    private native void nativeSetAllowInspection(long nativeJavascriptInjector, boolean allow);
+    private native void nativeAddInterface(
+            long nativeJavascriptInjector, Object object, String name, Class requiredAnnotation);
+    private native void nativeRemoveInterface(long nativeJavascriptInjector, String name);
+}
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
index 047ca4b..69124676 100644
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
@@ -14,7 +14,6 @@
 import android.os.ParcelUuid;
 import android.os.Parcelable;
 import android.support.annotation.Nullable;
-import android.util.Pair;
 
 import org.chromium.base.Log;
 import org.chromium.base.ThreadUtils;
@@ -43,10 +42,8 @@
 import org.chromium.ui.base.EventForwarder;
 import org.chromium.ui.base.WindowAndroid;
 
-import java.lang.annotation.Annotation;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.UUID;
@@ -169,8 +166,6 @@
     private InternalsHolder mInternalsHolder;
 
     private static class WebContentsInternalsImpl implements WebContentsInternals {
-        public HashSet<Object> retainedObjects;
-        public HashMap<String, Pair<Object, Class>> injectedObjects;
         public HashMap<Class, WebContentsUserData> userDataMap;
     }
 
@@ -183,14 +178,11 @@
         // inside WebContentsImpl. It holds a strong reference until an embedder invokes
         // |setInternalsHolder| to get the internals handed over to it.
         WebContentsInternalsImpl internals = new WebContentsInternalsImpl();
-        internals.retainedObjects = new HashSet<Object>();
-        internals.injectedObjects = new HashMap<String, Pair<Object, Class>>();
         internals.userDataMap = new HashMap<>();
 
         mRenderCoordinates = new RenderCoordinates();
         mRenderCoordinates.reset();
 
-        nativeCreateJavaBridgeDispatcherHost(mNativeWebContentsAndroid, internals.retainedObjects);
         mInternalsHolder = new DefaultInternalsHolder();
         mInternalsHolder.set(internals);
     }
@@ -700,42 +692,6 @@
         return new Rect(0, 0, width, height);
     }
 
-    @Override
-    public Map<String, Pair<Object, Class>> getJavascriptInterfaces() {
-        WebContentsInternals internals = mInternalsHolder.get();
-        if (internals == null) return null;
-        return ((WebContentsInternalsImpl) internals).injectedObjects;
-    }
-
-    @Override
-    public void setAllowJavascriptInterfacesInspection(boolean allow) {
-        nativeSetAllowJavascriptInterfacesInspection(mNativeWebContentsAndroid, allow);
-    }
-
-    @Override
-    public void addPossiblyUnsafeJavascriptInterface(
-            Object object, String name, Class<? extends Annotation> requiredAnnotation) {
-        if (mNativeWebContentsAndroid != 0 && object != null) {
-            Map<String, Pair<Object, Class>> jsInterface = getJavascriptInterfaces();
-            // The interface map is available as long as the callsite is alive, which should
-            // hold true since it is the callsite that is invoking this API.
-            assert jsInterface != null;
-            jsInterface.put(name, new Pair<Object, Class>(object, requiredAnnotation));
-            nativeAddJavascriptInterface(
-                    mNativeWebContentsAndroid, object, name, requiredAnnotation);
-        }
-    }
-
-    @Override
-    public void removeJavascriptInterface(String name) {
-        Map<String, Pair<Object, Class>> jsInterface = getJavascriptInterfaces();
-        assert jsInterface != null;
-        jsInterface.remove(name);
-        if (mNativeWebContentsAndroid != 0) {
-            nativeRemoveJavascriptInterface(mNativeWebContentsAndroid, name);
-        }
-    }
-
     /**
      * Returns {@link RenderCoordinates}. This method is intended for use in content layer only.
      */
@@ -784,8 +740,6 @@
     private static native WebContents nativeFromNativePtr(long webContentsAndroidPtr);
 
     private native WindowAndroid nativeGetTopLevelNativeWindow(long nativeWebContentsAndroid);
-    private native void nativeCreateJavaBridgeDispatcherHost(
-            long nativeWebContentsAndroid, Object retainedJavascriptObjects);
     private native RenderFrameHost nativeGetMainFrame(long nativeWebContentsAndroid);
     private native String nativeGetTitle(long nativeWebContentsAndroid);
     private native String nativeGetVisibleURL(long nativeWebContentsAndroid);
@@ -852,9 +806,4 @@
     private native Rect nativeGetFullscreenVideoSize(long nativeWebContentsAndroid);
     private native void nativeSetSize(long nativeWebContentsAndroid, int width, int height);
     private native EventForwarder nativeGetOrCreateEventForwarder(long nativeWebContentsAndroid);
-    private native void nativeSetAllowJavascriptInterfacesInspection(
-            long nativeWebContentsAndroid, boolean allow);
-    private native void nativeAddJavascriptInterface(
-            long nativeWebContentsAndroid, Object object, String name, Class requiredAnnotation);
-    private native void nativeRemoveJavascriptInterface(long nativeWebContentsAndroid, String name);
 }
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/JavascriptInjector.java b/content/public/android/java/src/org/chromium/content_public/browser/JavascriptInjector.java
new file mode 100644
index 0000000..9d37f1ac
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content_public/browser/JavascriptInjector.java
@@ -0,0 +1,98 @@
+// 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.
+
+package org.chromium.content_public.browser;
+
+import android.util.Pair;
+
+import org.chromium.content.browser.JavascriptInjectorImpl;
+
+import java.lang.annotation.Annotation;
+import java.util.Map;
+
+/**
+ * Interface that provides API used to inject user-defined objects that allow
+ * custom Javascript interfaces.
+ */
+public interface JavascriptInjector {
+    /**
+     * @param webContents {@link WebContents} object.
+     * @return {@link JavascriptInjector} object used for the give WebContents.
+     *         Creates one if not present.
+     */
+    static JavascriptInjector fromWebContents(WebContents webContents) {
+        return JavascriptInjectorImpl.fromWebContents(webContents);
+    }
+
+    /**
+     * Returns Javascript interface objects previously injected via
+     * {@link #addPossiblyUnsafeInterface(Object, String)}.
+     *
+     * @return the mapping of names to interface objects and corresponding annotation classes
+     */
+    Map<String, Pair<Object, Class>> getInterfaces();
+
+    /**
+     * Enables or disables inspection of Javascript objects added via
+     * {@link #addInterface(Object, String)} by means of Object.keys() method and
+     * &quot;for .. in&quot; loop. Being able to inspect Javascript objects is useful
+     * when debugging hybrid Android apps, but can't be enabled for legacy applications due
+     * to compatibility risks.
+     *
+     * @param allow Whether to allow Javascript objects inspection.
+     */
+    void setAllowInspection(boolean allow);
+
+    /**
+     * This method injects the supplied Java object into the WebContents.
+     * The object is injected into the Javascript context of the main frame,
+     * using the supplied name. This allows the Java object to be accessed from
+     * Javascript. Note that that injected objects will not appear in
+     * Javascript until the page is next (re)loaded. For example:
+     * <pre> view.addJavascriptInterface(new Object(), "injectedObject");
+     * view.loadData("<!DOCTYPE html><title></title>", "text/html", null);
+     * view.loadUrl("javascript:alert(injectedObject.toString())");</pre>
+     * <p><strong>IMPORTANT:</strong>
+     * <ul>
+     * <li> addInterface() can be used to allow Javascript to control
+     * the host application. This is a powerful feature, but also presents a
+     * security risk. Use of this method in a WebContents containing
+     * untrusted content could allow an attacker to manipulate the host
+     * application in unintended ways, executing Java code with the permissions
+     * of the host application. Use extreme care when using this method in a
+     * WebContents which could contain untrusted content. Particular care
+     * should be taken to avoid unintentional access to inherited methods, such
+     * as {@link Object#getClass()}. To prevent access to inherited methods,
+     * pass an annotation for {@code requiredAnnotation}.  This will ensure
+     * that only methods with {@code requiredAnnotation} are exposed to the
+     * Javascript layer.  {@code requiredAnnotation} will be passed to all
+     * subsequently injected Java objects if any methods return an object.  This
+     * means the same restrictions (or lack thereof) will apply.  Alternatively,
+     * {@link #addInterface(Object, String)} can be called, which
+     * automatically uses the {@link JavascriptInterface} annotation.
+     * <li> Javascript interacts with Java objects on a private, background
+     * thread of the WebContents. Care is therefore required to maintain
+     * thread safety.</li>
+     * </ul></p>
+     *
+     * @param object             The Java object to inject into the
+     *                           WebContents's Javascript context. Null
+     *                           values are ignored.
+     * @param name               The name used to expose the instance in
+     *                           Javascript.
+     * @param requiredAnnotation Restrict exposed methods to ones with this
+     *                           annotation.  If {@code null} all methods are
+     *                           exposed.
+     *
+     */
+    void addPossiblyUnsafeInterface(
+            Object object, String name, Class<? extends Annotation> requiredAnnotation);
+
+    /**
+     * Removes a previously added Javascript interface with the given name.
+     *
+     * @param name The name of the interface to remove.
+     */
+    void removeInterface(String name);
+}
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java b/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
index 68ae63b..1f5db6d 100644
--- a/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/WebContents.java
@@ -8,16 +8,12 @@
 import android.os.Handler;
 import android.os.Parcelable;
 import android.support.annotation.Nullable;
-import android.util.Pair;
 
 import org.chromium.base.VisibleForTesting;
 import org.chromium.ui.OverscrollRefreshHandler;
 import org.chromium.ui.base.EventForwarder;
 import org.chromium.ui.base.WindowAndroid;
 
-import java.lang.annotation.Annotation;
-import java.util.Map;
-
 /**
  * The WebContents Java wrapper to allow communicating with the native WebContents object.
  *
@@ -495,75 +491,4 @@
      * @param height The height of the view.
      */
     void setSize(int width, int height);
-
-    /**
-     * Returns JavaScript interface objects previously injected via
-     * {@link #addJavascriptInterface(Object, String)}.
-     *
-     * @return the mapping of names to interface objects and corresponding annotation classes
-     */
-    Map<String, Pair<Object, Class>> getJavascriptInterfaces();
-
-    /**
-     * Enables or disables inspection of JavaScript objects added via
-     * {@link #addJavascriptInterface(Object, String)} by means of Object.keys() method and
-     * &quot;for .. in&quot; loop. Being able to inspect JavaScript objects is useful
-     * when debugging hybrid Android apps, but can't be enabled for legacy applications due
-     * to compatibility risks.
-     *
-     * @param allow Whether to allow JavaScript objects inspection.
-     */
-    void setAllowJavascriptInterfacesInspection(boolean allow);
-
-    /**
-     * This method injects the supplied Java object into the WebContents.
-     * The object is injected into the JavaScript context of the main frame,
-     * using the supplied name. This allows the Java object to be accessed from
-     * JavaScript. Note that that injected objects will not appear in
-     * JavaScript until the page is next (re)loaded. For example:
-     * <pre> view.addJavascriptInterface(new Object(), "injectedObject");
-     * view.loadData("<!DOCTYPE html><title></title>", "text/html", null);
-     * view.loadUrl("javascript:alert(injectedObject.toString())");</pre>
-     * <p><strong>IMPORTANT:</strong>
-     * <ul>
-     * <li> addJavascriptInterface() can be used to allow JavaScript to control
-     * the host application. This is a powerful feature, but also presents a
-     * security risk. Use of this method in a WebContents containing
-     * untrusted content could allow an attacker to manipulate the host
-     * application in unintended ways, executing Java code with the permissions
-     * of the host application. Use extreme care when using this method in a
-     * WebContents which could contain untrusted content. Particular care
-     * should be taken to avoid unintentional access to inherited methods, such
-     * as {@link Object#getClass()}. To prevent access to inherited methods,
-     * pass an annotation for {@code requiredAnnotation}.  This will ensure
-     * that only methods with {@code requiredAnnotation} are exposed to the
-     * Javascript layer.  {@code requiredAnnotation} will be passed to all
-     * subsequently injected Java objects if any methods return an object.  This
-     * means the same restrictions (or lack thereof) will apply.  Alternatively,
-     * {@link #addJavascriptInterface(Object, String)} can be called, which
-     * automatically uses the {@link JavascriptInterface} annotation.
-     * <li> JavaScript interacts with Java objects on a private, background
-     * thread of the WebContents. Care is therefore required to maintain
-     * thread safety.</li>
-     * </ul></p>
-     *
-     * @param object             The Java object to inject into the
-     *                           WebContents's JavaScript context. Null
-     *                           values are ignored.
-     * @param name               The name used to expose the instance in
-     *                           JavaScript.
-     * @param requiredAnnotation Restrict exposed methods to ones with this
-     *                           annotation.  If {@code null} all methods are
-     *                           exposed.
-     *
-     */
-    void addPossiblyUnsafeJavascriptInterface(
-            Object object, String name, Class<? extends Annotation> requiredAnnotation);
-
-    /**
-     * Removes a previously added JavaScript interface with the given name.
-     *
-     * @param name The name of the interface to remove.
-     */
-    void removeJavascriptInterface(String name);
 }
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBareboneTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBareboneTest.java
index 7fdd9f91..a9719cf 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBareboneTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBareboneTest.java
@@ -44,7 +44,7 @@
         mActivityTestRule.runOnUiThread(new Runnable() {
             @Override
             public void run() {
-                mActivityTestRule.getWebContents().addPossiblyUnsafeJavascriptInterface(
+                mActivityTestRule.getJavascriptInjector().addPossiblyUnsafeInterface(
                         new Object(), name, null);
             }
         });
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
index 20186fa..cdfe705 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeBasicsTest.java
@@ -148,7 +148,7 @@
         InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
-                mActivityTestRule.getWebContents().addPossiblyUnsafeJavascriptInterface(
+                mActivityTestRule.getJavascriptInjector().addPossiblyUnsafeInterface(
                         new Object(), "testObject", null);
             }
         });
@@ -172,7 +172,7 @@
         InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
-                mActivityTestRule.getWebContents().removeJavascriptInterface("testObject");
+                mActivityTestRule.getJavascriptInjector().removeInterface("testObject");
             }
         });
         // Check that the Java object is being held by the Java bridge, thus it's not
@@ -196,7 +196,7 @@
         InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
-                mActivityTestRule.getWebContents().removeJavascriptInterface("foo");
+                mActivityTestRule.getJavascriptInjector().removeInterface("foo");
                 mActivityTestRule.getWebContents().getNavigationController().reload(true);
             }
         });
@@ -953,7 +953,7 @@
         InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
-                mActivityTestRule.getWebContents().setAllowJavascriptInterfacesInspection(false);
+                mActivityTestRule.getJavascriptInjector().setAllowInspection(false);
             }
         });
 
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java
index 3fbb461..4194c84 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeCoercionTest.java
@@ -706,7 +706,7 @@
         mActivityTestRule.runOnUiThread(new Runnable() {
             @Override
             public void run() {
-                mActivityTestRule.getWebContents().addPossiblyUnsafeJavascriptInterface(
+                mActivityTestRule.getJavascriptInjector().addPossiblyUnsafeInterface(
                         selfConsuming, "selfConsuming", null);
             }
         });
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestCommon.java b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestCommon.java
index d145881..4bf8b257 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestCommon.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/JavaBridgeTestCommon.java
@@ -10,6 +10,7 @@
 
 import org.chromium.base.test.util.UrlUtils;
 import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.JavascriptInjector;
 import org.chromium.content_public.browser.LoadUrlParams;
 import org.chromium.content_public.browser.WebContents;
 import org.chromium.content_shell_apk.ContentShellActivity;
@@ -104,11 +105,10 @@
                 @Override
                 public void run() {
                     WebContents webContents = mCallback.getWebContentsForTestCommon();
-                    webContents.addPossiblyUnsafeJavascriptInterface(
-                            object1, name1, requiredAnnotation);
+                    JavascriptInjector injector = JavascriptInjector.fromWebContents(webContents);
+                    injector.addPossiblyUnsafeInterface(object1, name1, requiredAnnotation);
                     if (object2 != null && name2 != null) {
-                        webContents.addPossiblyUnsafeJavascriptInterface(
-                                object2, name2, requiredAnnotation);
+                        injector.addPossiblyUnsafeInterface(object2, name2, requiredAnnotation);
                     }
                     webContents.getNavigationController().reload(true);
                 }
diff --git a/content/public/browser/quota_permission_context.h b/content/public/browser/quota_permission_context.h
index 905b14ec..ca2293f 100644
--- a/content/public/browser/quota_permission_context.h
+++ b/content/public/browser/quota_permission_context.h
@@ -8,7 +8,6 @@
 #include "base/callback.h"
 #include "base/memory/ref_counted.h"
 #include "content/public/common/storage_quota_params.h"
-#include "storage/common/quota/quota_types.h"
 
 namespace content {
 
diff --git a/content/public/common/storage_quota_params.h b/content/public/common/storage_quota_params.h
index 8ba04b91..6e45a13 100644
--- a/content/public/common/storage_quota_params.h
+++ b/content/public/common/storage_quota_params.h
@@ -9,7 +9,7 @@
 
 #include "content/common/content_export.h"
 #include "ipc/ipc_message.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace content {
@@ -19,13 +19,13 @@
 struct CONTENT_EXPORT StorageQuotaParams {
   StorageQuotaParams()
       : render_frame_id(MSG_ROUTING_NONE),
-        storage_type(storage::kStorageTypeTemporary),
+        storage_type(blink::StorageType::kTemporary),
         requested_size(0) {}
 
   int render_frame_id;
   // TODO(sashab): Change this to url::Origin, crbug.com/598424.
   GURL origin_url;
-  storage::StorageType storage_type;
+  blink::StorageType storage_type;
   uint64_t requested_size;
 };
 
diff --git a/content/public/test/content_browser_test_utils_mac.mm b/content/public/test/content_browser_test_utils_mac.mm
index 2f4548f6..608decdc 100644
--- a/content/public/test/content_browser_test_utils_mac.mm
+++ b/content/public/test/content_browser_test_utils_mac.mm
@@ -7,6 +7,8 @@
 #include <Carbon/Carbon.h>
 #import <Cocoa/Cocoa.h>
 
+#include <memory>
+
 #include "base/lazy_instance.h"
 #include "base/mac/scoped_objc_class_swizzler.h"
 #include "base/strings/stringprintf.h"
@@ -95,7 +97,7 @@
   SEL selector = NSSelectorFromString([NSString
       stringWithUTF8String:base::StringPrintf("%s:", kDidAddSubview).c_str()]);
   rwhvcocoa_swizzlers_[kDidAddSubview] =
-      base::MakeUnique<ScopedObjCClassSwizzler>(
+      std::make_unique<ScopedObjCClassSwizzler>(
           GetRenderWidgetHostViewCocoaClassForTesting(),
           [RenderWidgetHostViewCocoaSwizzler class], selector);
 }
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc
index 9a7757c..545f327 100644
--- a/content/public/test/navigation_simulator.cc
+++ b/content/public/test/navigation_simulator.cc
@@ -818,7 +818,8 @@
           blink::WebMixedContentContextType::kBlockable,
           false /* is_form_submission */, GURL() /* searchable_form_url */,
           std::string() /* searchable_form_encoding */, url::Origin(),
-          GURL() /* client_side_redirect_url */);
+          GURL() /* client_side_redirect_url */,
+          base::nullopt /* suggested_filename */);
   CommonNavigationParams common_params;
   common_params.url = navigation_url_;
   common_params.referrer = referrer_;
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index 420ae6f3..c6b9520 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -30,6 +30,7 @@
 #include "third_party/WebKit/public/platform/WebTouchEvent.h"
 #include "third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h"
 #include "third_party/WebKit/public/web/WebDocument.h"
+#include "third_party/WebKit/public/web/WebFrameWidget.h"
 #include "third_party/WebKit/public/web/WebLocalFrame.h"
 #include "third_party/WebKit/public/web/WebNode.h"
 #include "ui/events/blink/web_input_event_traits.h"
@@ -168,6 +169,18 @@
                                        point_in_pixel.x(), point_in_pixel.y()))
                                    .GetNode();
 
+  // TODO(crbug.com/797828): When the node is null the caller may
+  // need to do extra checks. Like maybe update the layout and then
+  // call the hit-testing API. Either way it might be better to have
+  // a DCHECK for the node rather than a null check here.
+  if (result_node.IsNull()) {
+    auto* web_widget = widget_->GetWebWidget();
+    DCHECK(web_widget->IsWebFrameWidget());
+    auto* frame_widget = static_cast<blink::WebFrameWidget*>(web_widget);
+    blink::WebFrame* web_frame = frame_widget->LocalRoot();
+    return RenderFrame::GetRoutingIdForWebFrame(web_frame);
+  }
+
   blink::WebFrame* result_frame =
       blink::WebFrame::FromFrameOwnerElement(result_node);
   if (!result_frame) {
diff --git a/content/renderer/java/gin_java_bridge_dispatcher.h b/content/renderer/java/gin_java_bridge_dispatcher.h
index 8b8063f..3080cf37 100644
--- a/content/renderer/java/gin_java_bridge_dispatcher.h
+++ b/content/renderer/java/gin_java_bridge_dispatcher.h
@@ -61,7 +61,6 @@
   void OnAddNamedObject(const std::string& name,
                         ObjectID object_id);
   void OnRemoveNamedObject(const std::string& name);
-  void OnSetAllowObjectContentsInspection(bool allow);
 
   typedef std::map<std::string, ObjectID> NamedObjectMap;
   NamedObjectMap named_objects_;
diff --git a/content/renderer/quota_dispatcher.cc b/content/renderer/quota_dispatcher.cc
index c13df85..d3673ed 100644
--- a/content/renderer/quota_dispatcher.cc
+++ b/content/renderer/quota_dispatcher.cc
@@ -18,11 +18,11 @@
 #include "third_party/WebKit/public/platform/WebStorageQuotaType.h"
 #include "url/origin.h"
 
+using blink::QuotaStatusCode;
+using blink::StorageType;
 using blink::WebStorageQuotaCallbacks;
 using blink::WebStorageQuotaError;
 using blink::WebStorageQuotaType;
-using blink::QuotaStatusCode;
-using storage::StorageType;
 
 namespace content {
 
@@ -182,10 +182,10 @@
 }
 
 static_assert(int(blink::kWebStorageQuotaTypeTemporary) ==
-                  int(storage::kStorageTypeTemporary),
+                  int(StorageType::kTemporary),
               "mismatching enums: kStorageTypeTemporary");
 static_assert(int(blink::kWebStorageQuotaTypePersistent) ==
-                  int(storage::kStorageTypePersistent),
+                  int(StorageType::kPersistent),
               "mismatching enums: kStorageTypePersistent");
 
 static_assert(int(blink::kWebStorageQuotaErrorNotSupported) ==
diff --git a/content/renderer/quota_dispatcher.h b/content/renderer/quota_dispatcher.h
index 1a56a8f..0935cff5 100644
--- a/content/renderer/quota_dispatcher.h
+++ b/content/renderer/quota_dispatcher.h
@@ -16,6 +16,7 @@
 #include "content/common/quota_dispatcher_host.mojom.h"
 #include "content/public/renderer/worker_thread.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace blink {
 class WebStorageQuotaCallbacks;
@@ -55,11 +56,11 @@
   void WillStopCurrentWorkerThread() override;
 
   void QueryStorageUsageAndQuota(const url::Origin& origin,
-                                 storage::StorageType type,
+                                 blink::StorageType type,
                                  std::unique_ptr<Callback> callback);
   void RequestStorageQuota(int render_frame_id,
                            const url::Origin& origin,
-                           storage::StorageType type,
+                           blink::StorageType type,
                            int64_t requested_size,
                            std::unique_ptr<Callback> callback);
 
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 0ef75ca..5d1c785a 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -168,6 +168,7 @@
 #include "third_party/WebKit/common/associated_interfaces/associated_interface_provider.h"
 #include "third_party/WebKit/common/frame_policy.h"
 #include "third_party/WebKit/common/page/page_visibility_state.mojom.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/WebKit/common/sandbox_flags.h"
 #include "third_party/WebKit/public/platform/FilePathConversion.h"
 #include "third_party/WebKit/public/platform/InterfaceProvider.h"
@@ -5119,7 +5120,7 @@
     return;
   }
   RenderThreadImpl::current()->quota_dispatcher()->RequestStorageQuota(
-      routing_id_, origin, static_cast<storage::StorageType>(type),
+      routing_id_, origin, static_cast<blink::StorageType>(type),
       requested_size,
       QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
 }
@@ -6670,7 +6671,11 @@
           GetRequestContextTypeForWebURLRequest(info.url_request),
           GetMixedContentContextTypeForWebURLRequest(info.url_request),
           is_form_submission, searchable_form_url, searchable_form_encoding,
-          initiator_origin, client_side_redirect_url);
+          initiator_origin, client_side_redirect_url,
+          info.url_request.GetSuggestedFilename().has_value()
+              ? base::Optional<std::string>(
+                    info.url_request.GetSuggestedFilename()->Utf8())
+              : base::nullopt);
 
   GetFrameHost()->BeginNavigation(MakeCommonNavigationParams(info, load_flags),
                                   std::move(begin_navigation_params));
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index d224eb8..c8f81c3 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -97,8 +97,8 @@
 #include "services/service_manager/public/cpp/interface_provider.h"
 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
 #include "storage/common/database/database_identifier.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/origin_trials/trial_token_validator.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/WebKit/public/platform/BlameContext.h"
 #include "third_party/WebKit/public/platform/FilePathConversion.h"
 #include "third_party/WebKit/public/platform/URLConversion.h"
@@ -1372,7 +1372,7 @@
     blink::WebStorageQuotaCallbacks callbacks) {
   QuotaDispatcher::ThreadSpecificInstance(default_task_runner_)
       ->QueryStorageUsageAndQuota(
-          storage_partition, static_cast<storage::StorageType>(type),
+          storage_partition, static_cast<blink::StorageType>(type),
           QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
 }
 
diff --git a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
index 783c46f..1cbd179 100644
--- a/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
+++ b/content/shell/android/javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java
@@ -19,6 +19,7 @@
 import org.chromium.content.browser.ContentViewCoreImpl;
 import org.chromium.content.browser.RenderCoordinates;
 import org.chromium.content.browser.test.util.TestCallbackHelperContainer;
+import org.chromium.content_public.browser.JavascriptInjector;
 import org.chromium.content_public.browser.LoadUrlParams;
 import org.chromium.content_public.browser.NavigationController;
 import org.chromium.content_public.browser.WebContents;
@@ -106,6 +107,10 @@
         return mDelegate.getRenderCoordinates();
     }
 
+    public JavascriptInjector getJavascriptInjector() {
+        return JavascriptInjector.fromWebContents(getWebContents());
+    }
+
     /**
      * Waits for the Active shell to finish loading.  This times out after
      * WAIT_FOR_ACTIVE_SHELL_LOADING_TIMEOUT milliseconds and it shouldn't be used for long
diff --git a/content/shell/browser/shell_quota_permission_context.cc b/content/shell/browser/shell_quota_permission_context.cc
index ff3a954..3674d3e 100644
--- a/content/shell/browser/shell_quota_permission_context.cc
+++ b/content/shell/browser/shell_quota_permission_context.cc
@@ -4,7 +4,7 @@
 
 #include "content/shell/browser/shell_quota_permission_context.h"
 
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 
@@ -14,7 +14,7 @@
     const StorageQuotaParams& params,
     int render_process_id,
     const PermissionCallback& callback) {
-  if (params.storage_type != storage::kStorageTypePersistent) {
+  if (params.storage_type != blink::StorageType::kPersistent) {
     // For now we only support requesting quota with this interface
     // for Persistent storage type.
     callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
diff --git a/content/shell/test_runner/test_runner.cc b/content/shell/test_runner/test_runner.cc
index 91e4997..2b4236a 100644
--- a/content/shell/test_runner/test_runner.cc
+++ b/content/shell/test_runner/test_runner.cc
@@ -2556,6 +2556,7 @@
 
 void TestRunner::WaitUntilExternalURLLoad() {
   layout_test_runtime_flags_.set_wait_until_external_url_load(true);
+  layout_test_runtime_flags_.set_wait_until_done(true);
   OnLayoutTestRuntimeFlagsChanged();
 }
 
diff --git a/content/shell/test_runner/web_frame_test_client.cc b/content/shell/test_runner/web_frame_test_client.cc
index 14f025d..d477b1077 100644
--- a/content/shell/test_runner/web_frame_test_client.cc
+++ b/content/shell/test_runner/web_frame_test_client.cc
@@ -385,6 +385,15 @@
 void WebFrameTestClient::DidStartProvisionalLoad(
     blink::WebDocumentLoader* document_loader,
     blink::WebURLRequest& request) {
+  if (request.GetSuggestedFilename().has_value() &&
+      test_runner()->shouldWaitUntilExternalURLLoad()) {
+    delegate_->PrintMessage(
+        std::string("Downloading URL with suggested filename \"") +
+        request.GetSuggestedFilename()->Utf8() + "\"\n");
+    delegate_->PostTask(base::BindRepeating(&WebTestDelegate::TestFinished,
+                                            base::Unretained(delegate_)));
+  }
+
   // PlzNavigate
   // A provisional load notification is received when a frame navigation is
   // sent to the browser. We don't want to log it again during commit.
diff --git a/content/test/data/download/download-attribute-blob.html b/content/test/data/download/download-attribute-blob.html
index b114c0d..5bfbd75 100644
--- a/content/test/data/download/download-attribute-blob.html
+++ b/content/test/data/download/download-attribute-blob.html
@@ -15,7 +15,6 @@
 var url = URL.createObjectURL(blob);
 anchorElement.href = url;
 anchorElement.click();
-URL.revokeObjectURL(url);
 </script>
 </body>
 </html>
diff --git a/content/test/test_render_frame_host.cc b/content/test/test_render_frame_host.cc
index aab25a5..b900bc3 100644
--- a/content/test/test_render_frame_host.cc
+++ b/content/test/test_render_frame_host.cc
@@ -501,7 +501,8 @@
             blink::WebMixedContentContextType::kBlockable,
             false /* is_form_submission */, GURL() /* searchable_form_url */,
             std::string() /* searchable_form_encoding */, url::Origin(),
-            GURL() /* client_side_redirect_url */);
+            GURL() /* client_side_redirect_url */,
+            base::nullopt /* suggested_filename */);
     CommonNavigationParams common_params;
     common_params.url = url;
     common_params.referrer = Referrer(GURL(), blink::kWebReferrerPolicyDefault);
diff --git a/docs/emacs.md b/docs/emacs.md
index 3bc5bccd..1dc555a 100644
--- a/docs/emacs.md
+++ b/docs/emacs.md
@@ -6,102 +6,6 @@
 
 [Linux Debugging](linux_debugging.md) has some Emacs-specific debugging tips.
 
-
-## Blink Style (WebKit)
-
-Chrome and Blink/WebKit style differ. You can use
-[directory-local variables](http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html)
-to make the tab key do the right thing. E.g., in `third_party/WebKit`, add a
-`.dir-locals.el` that contains
-
-```el
-((nil . ((indent-tabs-mode . nil)
-         (c-basic-offset . 4)
-         (fill-column . 120))))
-```
-
-This turns off tabs, sets your indent to four spaces, and makes `M-q` wrap at
-120 columns (WebKit doesn't define a wrap column, but there's a soft limit
-somewhere in that area for comments. Some reviewers do enforce the no wrap
-limit, which Emacs can deal with gracefully; see below.)
-
-Be sure to `echo .dir-locals.el >> .git/info/exclude` so `git clean` doesn't
-delete your file.
-
-It can be useful to set up a WebKit specific indent style. It's not too much
-different so it's easy to base off of the core Google style. Somewhere after
-you've loaded google.el (most likely in your .emacs file), add:
-
-```el
-(c-add-style "WebKit" '("Google"
-                        (c-basic-offset . 4)
-                        (c-offsets-alist . ((innamespace . 0)
-                                            (access-label . -)
-                                            (case-label . 0)
-                                            (member-init-intro . +)
-                                            (topmost-intro . 0)
-                                            (arglist-cont-nonempty . +)))))
-```
-
-then you can add
-
-```el
-(c-mode . ((c-file-style . "WebKit")))
-(c++-mode . ((c-file-style . "WebKit"))))
-```
-
-to the end of the .dir-locals.el file you created above. Note that this style
-may not yet be complete, but it covers the most common differences.
-
-Now that you have a WebKit specific style being applied, and assuming you have
-font locking and it's default jit locking turned on, you can also get Emacs 23
-to wrap long lines more intelligently by adding the following to your .emacs
-file:
-
-```el
-;; For dealing with WebKit long lines and word wrapping.
-(defun c-mode-adaptive-indent (beg end)
-  "Set the wrap-prefix for the region between BEG and END with adaptive filling."
-  (goto-char beg)
-  (while
-      (let ((lbp (line-beginning-position))
-            (lep (line-end-position)))
-        (put-text-property lbp lep 'wrap-prefix (concat (fill-context-prefix lbp lep) (make-string c-basic-offset ? )))
-        (search-forward "\n" end t))))
-
-(define-minor-mode c-adaptive-wrap-mode
-  "Wrap the buffer text with adaptive filling for c-mode."
-  :lighter ""
-  (save-excursion
-    (save-restriction
-      (widen)
-      (let ((buffer-undo-list t)
-            (inhibit-read-only t)
-            (mod (buffer-modified-p)))
-        (if c-adaptive-wrap-mode
-            (jit-lock-register 'c-mode-adaptive-indent)
-          (jit-lock-unregister 'c-mode-adaptive-indent)
-          (remove-text-properties (point-min) (point-max) '(wrap-prefix pref)))
-        (restore-buffer-modified-p mod)))))
-
-(defun c-adaptive-wrap-mode-for-webkit ()
-  "Turn on visual line mode and adaptive wrapping for WebKit source files."
-  (if (or (string-equal "webkit" c-indentation-style)
-          (string-equal "WebKit" c-indentation-style))
-      (progn
-        (visual-line-mode t)
-        (c-adaptive-wrap-mode t))))
-
-(add-hook 'c-mode-common-hook 'c-adaptive-wrap-mode-for-webkit)
-(add-hook 'hack-local-variables-hook 'c-adaptive-wrap-mode-for-webkit)
-```
-
-This turns on visual wrap mode for files using the WebKit c style, and sets up a
-hook to dynamically set the indent on the wrapped lines. It's not quite as
-intelligent as it could be (e.g., what would the wrap be if there really were a
-newline there?), but it's very fast. It makes dealing with long code lines
-anywhere much more tolerable (not just in WebKit).
-
 ## Syntax-error Highlighting
 
 [Ninja](ninja_build.md) users get in-line highlighting of syntax errors using
diff --git a/google_apis/gaia/oauth2_token_service.h b/google_apis/gaia/oauth2_token_service.h
index 059a4b6a..f1e0f88 100644
--- a/google_apis/gaia/oauth2_token_service.h
+++ b/google_apis/gaia/oauth2_token_service.h
@@ -123,7 +123,7 @@
     // Called when receiving request for access token.
     virtual void OnAccessTokenRequested(const std::string& account_id,
                                         const std::string& consumer_id,
-                                        const ScopeSet& scopes) = 0;
+                                        const ScopeSet& scopes) {}
     // Called when access token fetching finished successfully or
     // unsuccessfully. |expiration_time| are only valid with
     // successful completion.
@@ -131,9 +131,9 @@
                                             const std::string& consumer_id,
                                             const ScopeSet& scopes,
                                             GoogleServiceAuthError error,
-                                            base::Time expiration_time) = 0;
+                                            base::Time expiration_time) {}
     virtual void OnTokenRemoved(const std::string& account_id,
-                                const ScopeSet& scopes) = 0;
+                                const ScopeSet& scopes) {}
   };
 
   explicit OAuth2TokenService(
diff --git a/headless/lib/browser/DEPS b/headless/lib/browser/DEPS
index 78c24cf..328f550 100644
--- a/headless/lib/browser/DEPS
+++ b/headless/lib/browser/DEPS
@@ -8,6 +8,7 @@
   "+storage/browser/quota",
   "+storage/common/quota",
   "+third_party/skia/include",
+  "+third_party/WebKit/common/quota",
   "+ui/aura",
   "+ui/compositor",
 ]
diff --git a/headless/lib/browser/headless_quota_permission_context.cc b/headless/lib/browser/headless_quota_permission_context.cc
index b75f01b..185946d 100644
--- a/headless/lib/browser/headless_quota_permission_context.cc
+++ b/headless/lib/browser/headless_quota_permission_context.cc
@@ -4,7 +4,7 @@
 
 #include "headless/lib/browser/headless_quota_permission_context.h"
 
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace headless {
 
@@ -14,7 +14,7 @@
     const content::StorageQuotaParams& params,
     int render_process_id,
     const PermissionCallback& callback) {
-  if (params.storage_type != storage::kStorageTypePersistent) {
+  if (params.storage_type != blink::StorageType::kPersistent) {
     // For now we only support requesting quota with this interface
     // for Persistent storage type.
     callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
diff --git a/ios/PRESUBMIT.py b/ios/PRESUBMIT.py
index eb6f23d..3bbc311 100644
--- a/ios/PRESUBMIT.py
+++ b/ios/PRESUBMIT.py
@@ -12,11 +12,19 @@
 
 TODO_PATTERN = r'TO[D]O\(([^\)]*)\)'
 CRBUG_PATTERN = r'crbug\.com/\d+$'
-ARC_COMPILE_GUARD = '''\
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-'''
+ARC_COMPILE_GUARD = [
+    '#if !defined(__has_feature) || !__has_feature(objc_arc)',
+    '#error "This file requires ARC support."',
+    '#endif',
+]
+
+def IsSubListOf(needle, hay):
+  """Returns whether there is a slice of |hay| equal to |needle|."""
+  for i, line in enumerate(hay):
+    if line == needle[0]:
+      if needle == hay[i:i+len(needle)]:
+        return True
+  return False
 
 def _CheckARCCompilationGuard(input_api, output_api):
   """ Checks whether new objc files have proper ARC compile guards."""
@@ -29,8 +37,8 @@
     if ext not in ('.m', '.mm'):
       continue
 
-    if ARC_COMPILE_GUARD not in f.NewContents():
-        files_without_headers.append(f.LocalPath())
+    if not IsSubListOf(ARC_COMPILE_GUARD, f.NewContents()):
+      files_without_headers.append(f.LocalPath())
 
   if not files_without_headers:
     return []
@@ -39,9 +47,8 @@
   error_message = '\n'.join([
       'Found new Objective-C implementation file%(plural)s without compile'
       ' guard%(plural)s. Please use the following compile guard'
-      ':' % {'plural': plural_suffix},
-      ARC_COMPILE_GUARD,
-  ] + files_without_headers) + '\n'
+      ':' % {'plural': plural_suffix}
+  ] + ARC_COMPILE_GUARD + files_without_headers) + '\n'
 
   return [output_api.PresubmitError(error_message)]
 
diff --git a/ios/PRESUBMIT_test.py b/ios/PRESUBMIT_test.py
index f8d2935..48c5a36 100644
--- a/ios/PRESUBMIT_test.py
+++ b/ios/PRESUBMIT_test.py
@@ -16,11 +16,11 @@
 
   def testGoodImplementationFiles(self):
     """Test that .m and .mm files with a guard don't raise any errors."""
-    text = "foobar \n" + PRESUBMIT.ARC_COMPILE_GUARD
+    lines = ["foobar"] + PRESUBMIT.ARC_COMPILE_GUARD
     mock_input = PRESUBMIT_test_mocks.MockInputApi()
     mock_input.files = [
-      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.mm', text),
-      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.m', text),
+      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.mm', lines),
+      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.m', lines),
     ]
     mock_output = PRESUBMIT_test_mocks.MockOutputApi()
     errors = PRESUBMIT._CheckARCCompilationGuard(mock_input, mock_output)
@@ -28,11 +28,11 @@
 
   def testBadImplementationFiles(self):
     """Test that .m and .mm files without a guard raise an error."""
-    text = "foobar \n"
+    lines = ["foobar"]
     mock_input = PRESUBMIT_test_mocks.MockInputApi()
     mock_input.files = [
-      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.mm', text),
-      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.m', text),
+      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.mm', lines),
+      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.m', lines),
     ]
     mock_output = PRESUBMIT_test_mocks.MockOutputApi()
     errors = PRESUBMIT._CheckARCCompilationGuard(mock_input, mock_output)
@@ -43,12 +43,12 @@
 
   def testOtherFiles(self):
     """Test that other files without a guard don't raise errors."""
-    text = "foobar \n"
+    lines = ["foobar"]
     mock_input = PRESUBMIT_test_mocks.MockInputApi()
     mock_input.files = [
-      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.h', text),
-      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.cc', text),
-      PRESUBMIT_test_mocks.MockFile('ios/path/BUILD.gn', text),
+      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.h', lines),
+      PRESUBMIT_test_mocks.MockFile('ios/path/foo_controller.cc', lines),
+      PRESUBMIT_test_mocks.MockFile('ios/path/BUILD.gn', lines),
     ]
     mock_output = PRESUBMIT_test_mocks.MockOutputApi()
     errors = PRESUBMIT._CheckARCCompilationGuard(mock_input, mock_output)
diff --git a/ios/chrome/app/chrome_overlay_window.mm b/ios/chrome/app/chrome_overlay_window.mm
index 0c28376..16e0706b 100644
--- a/ios/chrome/app/chrome_overlay_window.mm
+++ b/ios/chrome/app/chrome_overlay_window.mm
@@ -55,6 +55,7 @@
   if (IsIPadIdiom()) {
     _sizeClassRecorder = [[SizeClassRecorder alloc]
         initWithHorizontalSizeClass:self.traitCollection.horizontalSizeClass];
+    // Remove use of this notification.
     [[NSNotificationCenter defaultCenter]
         addObserver:self
            selector:@selector(pageLoaded:)
diff --git a/ios/chrome/browser/autofill/BUILD.gn b/ios/chrome/browser/autofill/BUILD.gn
index de03e87..0bcc21c 100644
--- a/ios/chrome/browser/autofill/BUILD.gn
+++ b/ios/chrome/browser/autofill/BUILD.gn
@@ -59,6 +59,7 @@
     "//ios/chrome/browser/passwords:passwords_generation_utils",
     "//ios/chrome/browser/signin",
     "//ios/chrome/browser/ui",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/web",
     "//third_party/libaddressinput",
     "//ui/base",
diff --git a/ios/chrome/browser/autofill/form_input_accessory_view.mm b/ios/chrome/browser/autofill/form_input_accessory_view.mm
index 87fd5fb..c20f70c3 100644
--- a/ios/chrome/browser/autofill/form_input_accessory_view.mm
+++ b/ios/chrome/browser/autofill/form_input_accessory_view.mm
@@ -9,7 +9,7 @@
 #include "base/i18n/rtl.h"
 #include "base/logging.h"
 #import "ios/chrome/browser/autofill/form_input_accessory_view_delegate.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #include "ios/chrome/browser/ui/ui_util.h"
 #import "ios/chrome/browser/ui/util/constraints_ui_util.h"
 #include "ios/chrome/grit/ios_strings.h"
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm
index bfc7516f..553e94ad 100644
--- a/ios/chrome/browser/passwords/password_controller_unittest.mm
+++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -711,10 +711,6 @@
      "<input id=\"un6'\" type='text' name=\"u6'\">"
      "<input id=\"pw6'\" type='password' name=\"p6'\">"
      "</form>"
-     "<form>"
-     "<input id='un8' type='text'>"
-     "<input id='pw8' type='password'>"
-     "</form>"
      "<iframe name='pf'></iframe>"
      "<script>"
      "  var doc = frames['pf'].document.open();"
@@ -727,7 +723,14 @@
      "  doc.write('<input id=\\'pw8\\' type=\\'text\\' name=\\'p4\\'>');"
      "  doc.write('</form>');"
      "  doc.close();"
-     "</script>";
+     "</script>"
+     "<form>"
+     "<input id='un9' type='text'>"
+     "<input id='pw9' type='password'>"
+     "</form>"
+     "<form id='form10'></form>"
+     "<input id='un10' type='text' form='form10'>"
+     "<input id='pw10' type='password' form='form10'>";
 
 // A script that resets all text fields, including those in iframes.
 static NSString* kClearInputFieldsScript =
@@ -878,12 +881,22 @@
     {
       base_url,
       base_url,
-      "un8",
+      "un9",
       "test_user",
-      "pw8",
+      "pw9",
       "test_password",
       YES,
-      @"un8=test_user;pw8=test_password;"
+      @"un9=test_user;pw9=test_password;"
+    },
+    {
+      base_url,
+      base_url,
+      "un10",
+      "test_user",
+      "pw10",
+      "test_password",
+      YES,
+      @"un10=test_user;pw10=test_password;"
     },
   };
   // clang-format on
diff --git a/ios/chrome/browser/passwords/resources/password_controller.js b/ios/chrome/browser/passwords/resources/password_controller.js
index 03ed8b3f..a34bdad 100644
--- a/ios/chrome/browser/passwords/resources/password_controller.js
+++ b/ios/chrome/browser/passwords/resources/password_controller.js
@@ -156,6 +156,17 @@
      return null;
     }
 
+    /**
+     * Returns an array of input elements in a form.
+     * @param {Element} form A form element for which the input elements are
+     *   returned.
+     * @return {Array<InputElement>}
+     */
+    var getFormInputElements_ = function(form) {
+        return __gCrWeb.common.getFormControlElements(form).
+          filter(function(element) { return element.tagName === "INPUT"; });
+    }
+
   /**
    * Returns the password form with the given |identifier| as a JSON string.
    * @param {string} name The name of the form to extract.
@@ -224,7 +235,7 @@
       if (formData.action != normalizedFormAction)
         continue;
 
-      var inputs = form.getElementsByTagName('input');
+      var inputs = getFormInputElements_(form);
       var usernameInput =
           findInputByFieldIdentifier_(inputs, formData.fields[0].name);
       if (usernameInput == null || !__gCrWeb.common.isTextField(usernameInput)
@@ -301,7 +312,7 @@
    * @return {Object} Object of data from formElement.
    */
   __gCrWeb.getPasswordFormData = function(formElement) {
-    var inputs = formElement.getElementsByTagName('input');
+    var inputs = getFormInputElements_(formElement);
 
     var fields = [];
     var passwords = [];
diff --git a/ios/chrome/browser/snapshots/BUILD.gn b/ios/chrome/browser/snapshots/BUILD.gn
index cb01e6c..00e1662 100644
--- a/ios/chrome/browser/snapshots/BUILD.gn
+++ b/ios/chrome/browser/snapshots/BUILD.gn
@@ -77,6 +77,7 @@
     "//base",
     "//ios/chrome/browser/browser_state:test_support",
     "//ios/chrome/browser/ui",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/web",
     "//ios/web/public/test",
     "//ios/web/public/test/fakes:fakes",
diff --git a/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm b/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm
index b5dece45..0abe3a0 100644
--- a/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm
+++ b/ios/chrome/browser/snapshots/snapshot_tab_helper_unittest.mm
@@ -10,7 +10,7 @@
 #import "ios/chrome/browser/snapshots/fake_snapshot_generator_delegate.h"
 #import "ios/chrome/browser/snapshots/snapshot_cache.h"
 #import "ios/chrome/browser/snapshots/snapshot_cache_factory.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/uikit_ui_util.h"
 #import "ios/web/public/test/fakes/test_web_state.h"
 #include "ios/web/public/test/test_web_thread_bundle.h"
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index 288ffa97..c3d6c34 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -765,19 +765,7 @@
   }
   GURL lastCommittedURL = webState->GetLastCommittedURL();
 
-  if (_parentTabModel) {
-    [[NSNotificationCenter defaultCenter]
-        postNotificationName:kTabModelTabWillStartLoadingNotification
-                      object:_parentTabModel
-                    userInfo:@{kTabModelTabKey : self}];
-  }
-  [_parentTabModel notifyTabChanged:self];
-  if (_parentTabModel) {
-    [[NSNotificationCenter defaultCenter]
-        postNotificationName:kTabModelTabDidStartLoadingNotification
-                      object:_parentTabModel
-                    userInfo:@{kTabModelTabKey : self}];
-  }
+  [_parentTabModel notifyTabLoading:self];
 
   web::NavigationItem* previousItem = nullptr;
   if (details.previous_item_index >= 0) {
@@ -832,17 +820,14 @@
     [self handleExportableFile:headers.get()];
   }
 
-  [_parentTabModel notifyTabChanged:self];
+  [_parentTabModel notifyTabFinishedLoading:self success:loadSuccess];
 
   if (_parentTabModel) {
+    // This notification is deprecated, and no further observers of it should
+    // be added.
     [[NSNotificationCenter defaultCenter]
         postNotificationName:kTabModelTabDidFinishLoadingNotification
-                      object:_parentTabModel
-                    userInfo:[NSDictionary
-                                 dictionaryWithObjectsAndKeys:
-                                     self, kTabModelTabKey,
-                                     [NSNumber numberWithBool:loadSuccess],
-                                     kTabModelPageLoadSuccess, nil]];
+                      object:_parentTabModel];
   }
 
   if (!self.isPrerenderTab) {
diff --git a/ios/chrome/browser/tabs/tab_model.h b/ios/chrome/browser/tabs/tab_model.h
index 4ae7db2..e1d3d7e 100644
--- a/ios/chrome/browser/tabs/tab_model.h
+++ b/ios/chrome/browser/tabs/tab_model.h
@@ -32,37 +32,17 @@
 class WebState;
 }
 
-// A list of notifications about changes in the model or changes in tab
-// state.
-
-// A tab is about to load a URL. The tab in question is in the userInfo under
-// kTabModelTabKey. This may fire multiple times during a load, for example, on
-// redirects.
-extern NSString* const kTabModelTabWillStartLoadingNotification;
-// A tab started to load a URL. The tab in question is in the userInfo under
-// kTabModelTabKey.
-extern NSString* const kTabModelTabDidStartLoadingNotification;
+// When a tab finishes loading a URL, a notification with the following key is
+// sent. This notification is DEPRECATED and no further observers of it should
+// be added.
 // A tab finished loading a URL. The tab in question is in the userInfo under
 // kTabModelTabKey.
 extern NSString* const kTabModelTabDidFinishLoadingNotification;
+
 // All tabs have finished their shutdown sequences.
 // NOTE: This notification is not sent when closing a single tab that happens
 // to be the last tab.
 extern NSString* const kTabModelAllTabsDidCloseNotification;
-// A tab has lost its status as the currently selected tab. The tab in question
-// is in the userInfo under kTabModelTabKey.
-extern NSString* const kTabModelTabDeselectedNotification;
-// A new tab has been created from a link.
-extern NSString* const kTabModelNewTabWillOpenNotification;
-
-// Keys for the userInfo included with the above notifications:
-
-// Key that indicates whether to open the next tab in the background.
-extern NSString* const kTabModelOpenInBackgroundKey;
-// Key for the tab.
-extern NSString* const kTabModelTabKey;
-// Key for the status of the page load. The value is a NSNumber.
-extern NSString* const kTabModelPageLoadSuccess;
 
 // ---------------------------------------------------------------------------
 
@@ -194,10 +174,24 @@
 // Notifies observers that the given |tab| was changed.
 - (void)notifyTabChanged:(Tab*)tab;
 
+// Notifies observers that the given tab is loading a new URL.
+- (void)notifyTabLoading:(Tab*)tab;
+
+// Notifies observers that the given tab finished loading. |success| is YES if
+// the load was successful, NO otherwise.
+- (void)notifyTabFinishedLoading:(Tab*)tab success:(BOOL)success;
+
+// Notifies observers that the given tab will open. If it isn't the active tab,
+// |background| is YES, NO otherwise.
+- (void)notifyNewTabWillOpen:(Tab*)tab inBackground:(BOOL)background;
+
 // Notifies observers that the snapshot for the given |tab| changed was changed
 // to |image|.
 - (void)notifyTabSnapshotChanged:(Tab*)tab withImage:(UIImage*)image;
 
+// Notifies observers that |tab| was deselected.
+- (void)notifyTabWasDeselected:(Tab*)tab;
+
 // Adds |observer| to the list of observers. |observer| is not retained. Does
 // nothing if |observer| is already in the list. Any added observers must be
 // explicitly removed before the TabModel is destroyed.
diff --git a/ios/chrome/browser/tabs/tab_model.mm b/ios/chrome/browser/tabs/tab_model.mm
index 4f33fb1d..16432ee85 100644
--- a/ios/chrome/browser/tabs/tab_model.mm
+++ b/ios/chrome/browser/tabs/tab_model.mm
@@ -67,21 +67,10 @@
 #error "This file requires ARC support."
 #endif
 
-NSString* const kTabModelTabWillStartLoadingNotification =
-    @"kTabModelTabWillStartLoadingNotification";
-NSString* const kTabModelTabDidStartLoadingNotification =
-    @"kTabModelTabDidStartLoadingNotification";
 NSString* const kTabModelTabDidFinishLoadingNotification =
     @"kTabModelTabDidFinishLoadingNotification";
 NSString* const kTabModelAllTabsDidCloseNotification =
     @"kTabModelAllTabsDidCloseNotification";
-NSString* const kTabModelTabDeselectedNotification =
-    @"kTabModelTabDeselectedNotification";
-NSString* const kTabModelNewTabWillOpenNotification =
-    @"kTabModelNewTabWillOpenNotification";
-NSString* const kTabModelTabKey = @"tab";
-NSString* const kTabModelPageLoadSuccess = @"pageLoadSuccess";
-NSString* const kTabModelOpenInBackgroundKey = @"shouldOpenInBackground";
 
 namespace {
 
@@ -159,7 +148,7 @@
   // The delegate for sync.
   std::unique_ptr<TabModelSyncedWindowDelegate> _syncedWindowDelegate;
 
-  // The observer that sends kTabModelNewTabWillOpenNotification notifications.
+  // The observer that calls -notifyNewTabWillOpen on this object.
   TabModelNotificationObserver* _tabModelNotificationObserver;
 
   // Counters for metrics.
@@ -498,6 +487,25 @@
   [_observers tabModel:self didChangeTab:tab];
 }
 
+- (void)notifyTabLoading:(Tab*)tab {
+  [_observers tabModel:self willStartLoadingTab:tab];
+  [self notifyTabChanged:tab];
+  [_observers tabModel:self didStartLoadingTab:tab];
+}
+
+- (void)notifyTabFinishedLoading:(Tab*)tab success:(BOOL)success {
+  [self notifyTabChanged:tab];
+  [_observers tabModel:self didFinishLoadingTab:tab success:success];
+}
+
+- (void)notifyNewTabWillOpen:(Tab*)tab inBackground:(BOOL)background {
+  [_observers tabModel:self newTabWillOpen:tab inBackground:background];
+}
+
+- (void)notifyTabWasDeselected:(Tab*)tab {
+  [_observers tabModel:self didDeselectTab:tab];
+}
+
 - (void)addObserver:(id<TabModelObserver>)observer {
   [_observers addObserver:observer];
 }
@@ -659,8 +667,8 @@
   DCHECK(_browserState);
   DCHECK(window);
 
-  // Disable sending the kTabModelNewTabWillOpenNotification notification
-  // while restoring a session as it breaks the BVC (see crbug.com/763964).
+  // Disable calling -notifyNewTabWillOpen: while restoring a session as it
+  // breaks the BVC (see crbug.com/763964).
   base::ScopedClosureRunner enableTabModelNotificationObserver;
   if (_tabModelNotificationObserver) {
     _tabModelNotificationObserver->SetDisabled(true);
diff --git a/ios/chrome/browser/tabs/tab_model_notification_observer.mm b/ios/chrome/browser/tabs/tab_model_notification_observer.mm
index 7121784..fcf37b6 100644
--- a/ios/chrome/browser/tabs/tab_model_notification_observer.mm
+++ b/ios/chrome/browser/tabs/tab_model_notification_observer.mm
@@ -30,12 +30,6 @@
     return;
 
   Tab* tab = LegacyTabHelper::GetTabForWebState(web_state);
-  [[NSNotificationCenter defaultCenter]
-      postNotificationName:kTabModelNewTabWillOpenNotification
-                    object:tab_model_
-                  userInfo:@{
-                    kTabModelTabKey : tab,
-                    kTabModelOpenInBackgroundKey : @(!activating)
-                  }];
+  [tab_model_ notifyNewTabWillOpen:tab inBackground:!activating];
 }
 
diff --git a/ios/chrome/browser/tabs/tab_model_observer.h b/ios/chrome/browser/tabs/tab_model_observer.h
index 990e2e9c..40cc02ac5 100644
--- a/ios/chrome/browser/tabs/tab_model_observer.h
+++ b/ios/chrome/browser/tabs/tab_model_observer.h
@@ -54,9 +54,30 @@
 // The number of Tabs in this TabModel changed.
 - (void)tabModelDidChangeTabCount:(TabModel*)model;
 
+// |tab| is about to start loading a new URL.
+- (void)tabModel:(TabModel*)model willStartLoadingTab:(Tab*)tab;
+
 // Some properties about the given tab changed, such as the URL or title.
 - (void)tabModel:(TabModel*)model didChangeTab:(Tab*)tab;
 
+// |tab| started loading a new URL.
+- (void)tabModel:(TabModel*)model didStartLoadingTab:(Tab*)tab;
+
+// |tab| finished loading a new URL. |success| is YES if the load was
+// successful.
+- (void)tabModel:(TabModel*)model
+    didFinishLoadingTab:(Tab*)tab
+                success:(BOOL)success;
+
+// |tab| has been added to the tab model and will open. If |tab| isn't the
+// active tab, |inBackground| is YES, NO otherwise.
+- (void)tabModel:(TabModel*)model
+    newTabWillOpen:(Tab*)tab
+      inBackground:(BOOL)background;
+
+// |tab| stopped being the active tab.
+- (void)tabModel:(TabModel*)model didDeselectTab:(Tab*)tab;
+
 // The |tab|'s snapshot was changed to |image|.
 - (void)tabModel:(TabModel*)model
     didChangeTabSnapshot:(Tab*)tab
diff --git a/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm b/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm
index 92b51ebd..fd15070 100644
--- a/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm
+++ b/ios/chrome/browser/tabs/tab_model_selected_tab_observer.mm
@@ -40,10 +40,7 @@
     // Avoid artificially extending the lifetime of oldTab until the global
     // autoreleasepool is purged.
     @autoreleasepool {
-      [[NSNotificationCenter defaultCenter]
-          postNotificationName:kTabModelTabDeselectedNotification
-                        object:_tabModel
-                      userInfo:@{kTabModelTabKey : oldTab}];
+      [_tabModel notifyTabWasDeselected:oldTab];
     }
   }
 
diff --git a/ios/chrome/browser/ui/BUILD.gn b/ios/chrome/browser/ui/BUILD.gn
index 56782b6..06451dc6 100644
--- a/ios/chrome/browser/ui/BUILD.gn
+++ b/ios/chrome/browser/ui/BUILD.gn
@@ -14,8 +14,6 @@
     "background_generator.mm",
     "file_locations.h",
     "file_locations.mm",
-    "image_util.h",
-    "image_util.mm",
     "native_content_controller.h",
     "native_content_controller.mm",
     "network_activity_indicator_manager.h",
@@ -323,6 +321,7 @@
     "//ios/chrome/browser/ui/history",
     "//ios/chrome/browser/ui/history_popup:coordinator",
     "//ios/chrome/browser/ui/history_popup/requirements",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/keyboard",
     "//ios/chrome/browser/ui/main:feature_flags",
     "//ios/chrome/browser/ui/main_content:main_content_ui",
diff --git a/ios/chrome/browser/ui/autofill/BUILD.gn b/ios/chrome/browser/ui/autofill/BUILD.gn
index 02a46ae..01345b7 100644
--- a/ios/chrome/browser/ui/autofill/BUILD.gn
+++ b/ios/chrome/browser/ui/autofill/BUILD.gn
@@ -59,6 +59,7 @@
     "//base",
     "//components/strings:components_strings_grit",
     "//ios/chrome/browser/ui",
+    "//ios/chrome/browser/ui/image_util",
     "//ui/base:base",
   ]
   libs = [ "UIKit.framework" ]
diff --git a/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm b/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm
index 08efc5f..006d431 100644
--- a/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm
+++ b/ios/chrome/browser/ui/autofill/autofill_edit_accessory_view.mm
@@ -7,7 +7,7 @@
 #include <string>
 
 #include "components/strings/grit/components_strings.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #include "ios/chrome/browser/ui/ui_util.h"
 #include "ui/base/l10n/l10n_util.h"
 
diff --git a/ios/chrome/browser/ui/bookmarks/BUILD.gn b/ios/chrome/browser/ui/bookmarks/BUILD.gn
index be09669..aba33b0 100644
--- a/ios/chrome/browser/ui/bookmarks/BUILD.gn
+++ b/ios/chrome/browser/ui/bookmarks/BUILD.gn
@@ -127,6 +127,7 @@
     "//ios/chrome/browser/ui/colors",
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/icons",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/keyboard",
     "//ios/chrome/browser/ui/main:feature_flags",
     "//ios/chrome/browser/ui/material_components",
diff --git a/ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.mm b/ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.mm
index ee9680d7..d4b00b9 100644
--- a/ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.mm
+++ b/ios/chrome/browser/ui/bookmarks/bookmark_edit_view_controller.mm
@@ -29,7 +29,7 @@
 #import "ios/chrome/browser/ui/bookmarks/cells/bookmark_text_field_item.h"
 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
 #import "ios/chrome/browser/ui/icons/chrome_icon.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/keyboard/UIKeyCommand+Chrome.h"
 #include "ios/chrome/browser/ui/rtl_geometry.h"
 #include "ios/chrome/browser/ui/ui_util.h"
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 2c65ecee..f7d473f 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -7,7 +7,6 @@
 #import <AssetsLibrary/AssetsLibrary.h>
 #import <MobileCoreServices/MobileCoreServices.h>
 #import <PassKit/PassKit.h>
-#import <Photos/Photos.h>
 #import <QuartzCore/QuartzCore.h>
 
 #include <stdint.h>
@@ -18,7 +17,6 @@
 #include "base/command_line.h"
 #include "base/feature_list.h"
 #include "base/files/file_path.h"
-#include "base/format_macros.h"
 #include "base/i18n/rtl.h"
 #include "base/ios/block_types.h"
 #include "base/ios/ios_util.h"
@@ -35,7 +33,6 @@
 #include "base/strings/utf_string_conversions.h"
 #include "base/task_scheduler/post_task.h"
 #include "base/threading/sequenced_worker_pool.h"
-#include "base/threading/thread_restrictions.h"
 #include "components/bookmarks/browser/base_bookmark_model_observer.h"
 #include "components/bookmarks/browser/bookmark_model.h"
 #include "components/favicon/ios/web_favicon_driver.h"
@@ -82,7 +79,6 @@
 #import "ios/chrome/browser/language/url_language_histogram_factory.h"
 #import "ios/chrome/browser/metrics/new_tab_page_uma.h"
 #include "ios/chrome/browser/metrics/tab_usage_recorder.h"
-#import "ios/chrome/browser/open_url_util.h"
 #import "ios/chrome/browser/passwords/password_controller.h"
 #include "ios/chrome/browser/passwords/password_tab_helper.h"
 #include "ios/chrome/browser/pref_names.h"
@@ -156,6 +152,7 @@
 #import "ios/chrome/browser/ui/fullscreen/legacy_fullscreen_controller.h"
 #import "ios/chrome/browser/ui/history_popup/requirements/tab_history_presentation.h"
 #import "ios/chrome/browser/ui/history_popup/tab_history_legacy_coordinator.h"
+#import "ios/chrome/browser/ui/image_util/image_saver.h"
 #import "ios/chrome/browser/ui/key_commands_provider.h"
 #import "ios/chrome/browser/ui/location_bar_notification_names.h"
 #import "ios/chrome/browser/ui/main/main_feature_flags.h"
@@ -252,7 +249,6 @@
 #include "ios/web/public/web_thread.h"
 #import "ios/web/web_state/ui/crw_web_controller.h"
 #import "net/base/mac/url_conversions.h"
-#include "net/base/mime_util.h"
 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
 #include "net/ssl/ssl_info.h"
 #include "net/url_request/url_request_context_getter.h"
@@ -485,10 +481,6 @@
   // Used to display the Print UI. Nil if not visible.
   PrintController* _printController;
 
-  // Records the set of domains for which full screen alert has already been
-  // shown.
-  NSMutableSet* _fullScreenAlertShown;
-
   // Adapter to let BVC be the delegate for WebState.
   std::unique_ptr<web::WebStateDelegateBridge> _webStateDelegate;
 
@@ -665,9 +657,12 @@
 @property(nonatomic, strong) TabStripLegacyCoordinator* tabStripCoordinator;
 // A weak reference to the view of the tab strip on tablet.
 @property(nonatomic, weak) UIView* tabStripView;
+// Helper for saving images.
+@property(nonatomic, strong) ImageSaver* imageSaver;
 
-// The user agent type used to load the currently visible page. User agent type
-// is NONE if there is no visible page or visible page is a native page.
+// The user agent type used to load the currently visible page. User agent
+// type is NONE if there is no visible page or visible page is a native
+// page.
 @property(nonatomic, assign, readonly) web::UserAgentType userAgentType;
 
 // Returns the header views, all the chrome on top of the page, including the
@@ -679,21 +674,22 @@
 // dismissed, it remains allocated so that |userEngaged| remains accessible.
 @property(nonatomic, strong)
     BubbleViewControllerPresenter* tabTipBubblePresenter;
-
 // Used to display the new incognito tab tip in-product help promotion bubble.
 @property(nonatomic, strong)
     BubbleViewControllerPresenter* incognitoTabTipBubblePresenter;
 
 // Vertical offset for fullscreen toolbar.
 @property(nonatomic, strong) NSLayoutConstraint* toolbarOffsetConstraint;
-
 // Y-dimension offset for placement of the header.
 @property(nonatomic, readonly) CGFloat headerOffset;
-
 // Height of the header view for the tab model's current tab.
 @property(nonatomic, readonly) CGFloat headerHeight;
 
-// BVC initialization:
+// The webState of the active tab.
+@property(nonatomic, readonly) web::WebState* currentWebState;
+
+// BVC initialization
+// ------------------
 // If the BVC is initialized with a valid browser state & tab model immediately,
 // the path is straightforward: functionality is enabled, and the UI is built
 // when -viewDidLoad is called.
@@ -704,26 +700,6 @@
 // broken out into the following functions, which have expectations (enforced
 // with DCHECKs) regarding |_browserState|, |_model|, and [self isViewLoaded].
 
-// Registers for notifications.
-- (void)registerForNotifications;
-// Called when a tab is starting to load. If it's a link click or form
-// submission, the user is navigating away from any entries in the forward
-// history. Tell the toolbar so it can update the UI appropriately.
-// See the warning on [Tab webWillStartLoadingURL] about invocation of this
-// method sequence by malicious pages.
-- (void)pageLoadStarting:(NSNotification*)notify;
-// Called when a tab actually starts loading.
-- (void)pageLoadStarted:(NSNotification*)notify;
-// Called when a tab finishes loading. Update the Omnibox with the url and
-// stop any page load progess display.
-- (void)pageLoadComplete:(NSNotification*)notify;
-// Called when a tab is deselected in the model.
-// This notification also occurs when a tab is closed.
-- (void)tabDeselected:(NSNotification*)notify;
-// Animates sliding current tab and rotate-entering new tab while new tab loads
-// in background on the iPhone only.
-- (void)tabWasAdded:(NSNotification*)notify;
-
 // Updates non-view-related functionality with the given browser state and tab
 // model.
 // Does not matter whether or not the view has been loaded.
@@ -748,21 +724,13 @@
 - (void)displayTab:(Tab*)tab isNewSelection:(BOOL)newSelection;
 // Initializes the bookmark interaction controller if not already initialized.
 - (void)initializeBookmarkInteractionController;
-// Add all delegates to the provided |tab|.
-- (void)installDelegatesForTab:(Tab*)tab;
-// Remove delegates from the provided |tab|.
-- (void)uninstallDelegatesForTab:(Tab*)tab;
-// Show the bookmarks page.
-- (void)showAllBookmarks;
-// Shows a panel within the New Tab Page.
-- (void)showNTPPanel:(ntp_home::PanelIdentifier)panel;
-// Dismisses the "rate this app" dialog.
-- (void)dismissRateThisAppDialog;
-// Whether the given tab's URL is an application specific URL.
-- (BOOL)isTabNativePage:(Tab*)tab;
-// Returns the view to use when animating a page in or out, positioning it to
-// fill the content area but not actually adding it to the view hierarchy.
-- (UIImageView*)pageOpenCloseAnimationView;
+// Installs the BVC as overscroll actions controller of |nativeContent| if
+// needed. Sets the style of the overscroll actions toolbar.
+- (void)setOverScrollActionControllerToStaticNativeContent:
+    (StaticHtmlNativeContent*)nativeContent;
+
+// UI Configuration, update and Layout
+// -----------------------------------
 // Updates the toolbar display based on the current tab.
 - (void)updateToolbar;
 // Starts or stops broadcasting the toolbar UI and main content UI depending on
@@ -777,7 +745,31 @@
 // TODO(crbug.com/522721): Support size changes for all popups and modal
 // dialogs.
 - (void)dismissPopups;
+// Returns whether |tab| is scrolled to the top.
+- (BOOL)isTabScrolledToTop:(Tab*)tab;
+// Returns the footer view if one exists (e.g. the voice search bar).
+- (UIView*)footerView;
+// Returns the header height needed for |tab|.
+- (CGFloat)headerHeightForTab:(Tab*)tab;
+// Sets the frame for the headers.
+- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers
+                   atOffset:(CGFloat)headerOffset;
+// Adds a CardView on top of the contentArea either taking the size of the full
+// screen or just the size of the space under the header.
+// Returns the CardView that was added.
+- (CardView*)addCardViewInFullscreen:(BOOL)fullScreen;
 
+// Showing and Dismissing child UI
+// -------------------------------
+// Show the bookmarks page.
+- (void)showAllBookmarks;
+// Shows a panel within the New Tab Page.
+- (void)showNTPPanel:(ntp_home::PanelIdentifier)panel;
+// Dismisses the "rate this app" dialog.
+- (void)dismissRateThisAppDialog;
+
+// Bubble Views
+// ------------
 // Returns a bubble associated with an in-product help promotion if
 // it is valid to show the promotion and |nil| otherwise. |feature| is the
 // base::Feature object associated with the given promotion. |direction| is the
@@ -813,14 +805,9 @@
 // Presents a bubble associated with the new incognito tab tip in-product help
 // promotion. This method requires that |self.browserState| is not NULL.
 - (void)presentNewIncognitoTabTipBubble;
-// Presents the New Tab Tip or New Incognito Tab Tip Bubble if one is
-// eligible. Only one can be eligible per session (as enforced by the
-// FeatureEngagementTracker). If neither is eligible, neither bubble is
-// presented. This method requires that |self.browserState| is not NULL.
-- (void)presentBubblesIfEligible;
-// Returns whether |tab| is scrolled to the top.
-- (BOOL)isTabScrolledToTop:(Tab*)tab;
 
+// Find Bar UI
+// -----------
 // Update find bar with model data. If |shouldFocus| is set to YES, the text
 // field will become first responder.
 - (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus;
@@ -832,66 +819,21 @@
 - (void)showFindBarWithAnimation:(BOOL)animate
                       selectText:(BOOL)selectText
                      shouldFocus:(BOOL)shouldFocus;
+// Redisplays the find bar if necessary furing a view controller size change,
+// using the transition coordinator |coordinator|.
+- (void)reshowFindBarIfNeededWithCoordinator:
+    (id<UIViewControllerTransitionCoordinator>)coordinator;
 
-// Adds a CardView on top of the contentArea either taking the size of the full
-// screen or just the size of the space under the header.
-// Returns the CardView that was added.
-- (CardView*)addCardViewInFullscreen:(BOOL)fullScreen;
-// Called when either a tab finishes loading or when a tab with finished content
-// is added directly to the model via pre-rendering. The tab must be non-nil and
-// must be a member of the tab model controlled by this BrowserViewController.
-- (void)tabLoadComplete:(Tab*)tab withSuccess:(BOOL)success;
-// Evaluates Javascript asynchronously using the current page context.
-- (void)openJavascript:(NSString*)javascript;
+// Alerts
+// ------
 // Shows a self-dismissing snackbar displaying |message|.
 - (void)showSnackbar:(NSString*)message;
-// Induces an intentional crash in the browser process.
-- (void)induceBrowserCrash;
-// Saves the image or display error message, based on privacy settings.
-- (void)managePermissionAndSaveImage:(NSData*)data
-                   withFileExtension:(NSString*)fileExtension;
-// Saves the image. In order to keep the metadata of the image, the image is
-// saved as a temporary file on disk then saved in photos. Saving will happen
-// on a background sequence and the completion block will be invoked on that
-// sequence.
-- (void)saveImage:(NSData*)data
-    withFileExtension:(NSString*)fileExtension
-           completion:(void (^)(BOOL, NSError*))completionBlock;
-// Called when Chrome has been denied access to the photos or videos and the
-// user can change it.
-// Shows a privacy alert on the main queue, allowing the user to go to Chrome's
-// settings. Dismiss previous alert if it has not been dismissed yet.
-- (void)displayImageErrorAlertWithSettingsOnMainQueue;
-// Shows a privacy alert allowing the user to go to Chrome's settings. Dismiss
-// previous alert if it has not been dismissed yet.
-- (void)displayImageErrorAlertWithSettings:(NSURL*)settingURL;
-// Called when Chrome has been denied access to the photos or videos and the
-// user cannot change it.
-// Shows a privacy alert on the main queue, with errorContent as the message.
-// Dismisses previous alert if it has not been dismissed yet.
-- (void)displayPrivacyErrorAlertOnMainQueue:(NSString*)errorContent;
-// Called with the results of saving a picture in the photo album. If error is
-// nil the save succeeded.
-- (void)finishSavingImageWithError:(NSError*)error;
-// Lazily instantiates |_voiceSearchController|.
-- (void)ensureVoiceSearchControllerCreated;
-// Lazily instantiates |_voiceSearchBar| and adds it to the view.
-- (void)ensureVoiceSearchBarCreated;
-// Shows/hides the voice search bar.
-- (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated;
-// Returns the footer view if one exists (e.g. the voice search bar).
-- (UIView*)footerView;
-// Sets the frame for the headers.
-- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers
-                   atOffset:(CGFloat)headerOffset;
-// Performs a search with the image at the given url. The referrer is used to
-// download the image.
-- (void)searchByImageAtURL:(const GURL&)url
-                  referrer:(const web::Referrer)referrer;
-// Saves the image at the given URL on the system's album.  The referrer is used
-// to download the image.
-- (void)saveImageAtURL:(const GURL&)url referrer:(const web::Referrer&)referrer;
+// Shows an alert dialog with |title| and |message|.
+- (void)showErrorAlertWithStringTitle:(NSString*)title
+                              message:(NSString*)message;
 
+// Tap Handling
+// ------------
 // Record the last tap point based on the |originPoint| (if any) passed in
 // |command|.
 - (void)setLastTapPoint:(OpenNewTabCommand*)command;
@@ -900,16 +842,59 @@
 - (CGPoint)lastTapPoint;
 // Store the tap CGPoint in |_lastTapPoint| and the current timestamp.
 - (void)saveContentAreaTapLocation:(UIGestureRecognizer*)gestureRecognizer;
+
+// Tab creation and selection
+// --------------------------
+// Called when either a tab finishes loading or when a tab with finished content
+// is added directly to the model via pre-rendering. The tab must be non-nil and
+// must be a member of the tab model controlled by this BrowserViewController.
+- (void)tabLoadComplete:(Tab*)tab withSuccess:(BOOL)success;
+// Adds a new tab with |url| and |postData| at the end of the model, and make it
+// the selected tab and return it.
+- (Tab*)addSelectedTabWithURL:(const GURL&)url
+                     postData:(TemplateURLRef::PostContent*)postData
+                   transition:(ui::PageTransition)transition;
+// Internal method that all of the similar public and private methods call.
+// Adds a new tab with |url| and |postData| (if not null) at |position| in the
+// tab model (or at the end if |position is NSNotFound|, with |transition| as
+// the page transition type. If |tabAddedCompletion| is nonnull, it's called
+// synchronously after the tab is added.
+- (Tab*)addSelectedTabWithURL:(const GURL&)url
+                     postData:(TemplateURLRef::PostContent*)postData
+                      atIndex:(NSUInteger)position
+                   transition:(ui::PageTransition)transition
+           tabAddedCompletion:(ProceduralBlock)tabAddedCompletion;
+// Whether the given tab's URL is an application specific URL.
+- (BOOL)isTabNativePage:(Tab*)tab;
+// Returns the view to use when animating a page in or out, positioning it to
+// fill the content area but not actually adding it to the view hierarchy.
+- (UIImageView*)pageOpenCloseAnimationView;
+// Add all delegates to the provided |tab|.
+- (void)installDelegatesForTab:(Tab*)tab;
+// Remove delegates from the provided |tab|.
+- (void)uninstallDelegatesForTab:(Tab*)tab;
+// Called when a tab is selected in the model. Make any required view changes.
+// The notification will not be sent when the tab is already the selected tab.
+// |notifyToolbar| indicates whether the toolbar is notified that the tab has
+// changed.
+- (void)tabSelected:(Tab*)tab notifyToolbar:(BOOL)notifyToolbar;
 // Returns the native controller being used by |tab|'s web controller.
 - (id)nativeControllerForTab:(Tab*)tab;
-// Installs the BVC as overscroll actions controller of |nativeContent| if
-// needed. Sets the style of the overscroll actions toolbar.
-- (void)setOverScrollActionControllerToStaticNativeContent:
-    (StaticHtmlNativeContent*)nativeContent;
-// Whether the BVC should declare keyboard commands.
-- (BOOL)shouldRegisterKeyboardCommands;
+
+// Voice Search
+// ------------
+// Lazily instantiates |_voiceSearchController|.
+- (void)ensureVoiceSearchControllerCreated;
+// Lazily instantiates |_voiceSearchBar| and adds it to the view.
+- (void)ensureVoiceSearchBarCreated;
+// Shows/hides the voice search bar.
+- (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated;
+
+// Reading List
+// ------------
 // Adds the given url to the reading list.
 - (void)addToReadingListURL:(const GURL&)URL title:(NSString*)title;
+
 @end
 
 @implementation BrowserViewController
@@ -932,6 +917,7 @@
 @synthesize tabTipBubblePresenter = _tabTipBubblePresenter;
 @synthesize incognitoTabTipBubblePresenter = _incognitoTabTipBubblePresenter;
 @synthesize toolbarOffsetConstraint = _toolbarOffsetConstraint;
+@synthesize imageSaver = _imageSaver;
 // DialogPresenterDelegate property
 @synthesize dialogPresenterDelegateIsPresenting =
     _dialogPresenterDelegateIsPresenting;
@@ -991,10 +977,6 @@
     _inNewTabAnimation = NO;
     if (model && browserState)
       [self updateWithTabModel:model browserState:browserState];
-    if ([[NSUserDefaults standardUserDefaults]
-            boolForKey:@"fullScreenShowAlert"]) {
-      _fullScreenAlertShown = [[NSMutableSet alloc] init];
-    }
   }
   return self;
 }
@@ -1107,6 +1089,13 @@
   return _dialogPresenter;
 }
 
+- (KeyCommandsProvider*)keyCommandsProvider {
+  if (!_keyCommandsProvider) {
+    _keyCommandsProvider = [_dependencyFactory newKeyCommandsProvider];
+  }
+  return _keyCommandsProvider;
+}
+
 - (BOOL)canUseDesktopUserAgent {
   Tab* tab = [_model currentTab];
   if ([self isTabNativePage:tab])
@@ -1241,6 +1230,46 @@
   [self setNeedsStatusBarAppearanceUpdate];
 }
 
+- (NSArray<HeaderDefinition*>*)headerViews {
+  NSMutableArray<HeaderDefinition*>* results = [[NSMutableArray alloc] init];
+  if (![self isViewLoaded])
+    return results;
+
+  if (!IsIPadIdiom()) {
+    if (_toolbarCoordinator.toolbarViewController.view) {
+      [results addObject:[HeaderDefinition
+                             definitionWithView:_toolbarCoordinator
+                                                    .toolbarViewController.view
+                                headerBehaviour:Hideable
+                               heightAdjustment:0.0
+                                          inset:0.0]];
+    }
+  } else {
+    if (self.tabStripView) {
+      [results addObject:[HeaderDefinition definitionWithView:self.tabStripView
+                                              headerBehaviour:Hideable
+                                             heightAdjustment:0.0
+                                                        inset:0.0]];
+    }
+    if (_toolbarCoordinator.toolbarViewController.view) {
+      [results addObject:[HeaderDefinition
+                             definitionWithView:_toolbarCoordinator
+                                                    .toolbarViewController.view
+                                headerBehaviour:Hideable
+                               heightAdjustment:0.0
+                                          inset:0.0]];
+    }
+    if ([_findBarController view]) {
+      [results addObject:[HeaderDefinition
+                             definitionWithView:[_findBarController view]
+                                headerBehaviour:Overlap
+                               heightAdjustment:0.0
+                                          inset:kIPadFindBarOverlap]];
+    }
+  }
+  return [results copy];
+}
+
 - (CGFloat)headerOffset {
   if (IsIPadIdiom())
     return StatusBarHeight();
@@ -1251,6 +1280,10 @@
   return [self headerHeightForTab:[_model currentTab]];
 }
 
+- (web::WebState*)currentWebState {
+  return [[_model currentTab] webState];
+}
+
 #pragma mark - Public methods
 
 - (void)setPrimary:(BOOL)primary {
@@ -1454,6 +1487,40 @@
   return YES;
 }
 
+#pragma mark - UIResponder
+
+- (NSArray*)keyCommands {
+  if (![self shouldRegisterKeyboardCommands]) {
+    return nil;
+  }
+  return [self.keyCommandsProvider
+      keyCommandsForConsumer:self
+          baseViewController:self
+                  dispatcher:self.dispatcher
+                 editingText:![self isFirstResponder]];
+}
+
+#pragma mark - UIResponder helpers
+
+// Whether the BVC should declare keyboard commands.
+- (BOOL)shouldRegisterKeyboardCommands {
+  if ([self presentedViewController])
+    return NO;
+
+  if (_voiceSearchController && _voiceSearchController->IsVisible())
+    return NO;
+
+  // If there is no first responder, try to make the webview the first
+  // responder.
+  if (!GetFirstResponder()) {
+    web::WebState* webState = _model.currentTab.webState;
+    if (webState)
+      [webState->GetWebViewProxy() becomeFirstResponder];
+  }
+
+  return YES;
+}
+
 #pragma mark - UIViewController
 
 // Perform additional set up after loading the view, typically from a nib.
@@ -1643,33 +1710,6 @@
   [self reshowFindBarIfNeededWithCoordinator:coordinator];
 }
 
-- (void)reshowFindBarIfNeededWithCoordinator:
-    (id<UIViewControllerTransitionCoordinator>)coordinator {
-  if (![_findBarController isFindInPageShown])
-    return;
-
-  // Record focused state.
-  BOOL isFocusedBeforeReshow = [_findBarController isFocused];
-
-  [self hideFindBarWithAnimation:NO];
-
-  __weak BrowserViewController* weakSelf = self;
-  void (^completion)(id<UIViewControllerTransitionCoordinatorContext>) = ^(
-      id<UIViewControllerTransitionCoordinatorContext> context) {
-    BrowserViewController* strongSelf = weakSelf;
-    if (strongSelf)
-      [strongSelf showFindBarWithAnimation:NO
-                                selectText:NO
-                               shouldFocus:isFocusedBeforeReshow];
-  };
-
-  BOOL enqueued =
-      [coordinator animateAlongsideTransition:nil completion:completion];
-  if (!enqueued) {
-    completion(nil);
-  }
-}
-
 - (void)dismissViewControllerAnimated:(BOOL)flag
                            completion:(void (^)())completion {
   // It is an error to call this method when no VC is being presented.
@@ -1781,263 +1821,9 @@
                                             : UIStatusBarStyleDefault;
 }
 
-#pragma mark - Notification handling
+#pragma mark - ** Private BVC Methods **
 
-- (void)registerForNotifications {
-  DCHECK(_model);
-  NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
-  [defaultCenter addObserver:self
-                    selector:@selector(pageLoadStarting:)
-                        name:kTabModelTabWillStartLoadingNotification
-                      object:_model];
-  [defaultCenter addObserver:self
-                    selector:@selector(pageLoadStarted:)
-                        name:kTabModelTabDidStartLoadingNotification
-                      object:_model];
-  [defaultCenter addObserver:self
-                    selector:@selector(pageLoadComplete:)
-                        name:kTabModelTabDidFinishLoadingNotification
-                      object:_model];
-  [defaultCenter addObserver:self
-                    selector:@selector(tabDeselected:)
-                        name:kTabModelTabDeselectedNotification
-                      object:_model];
-  [defaultCenter addObserver:self
-                    selector:@selector(tabWasAdded:)
-                        name:kTabModelNewTabWillOpenNotification
-                      object:_model];
-}
-
-- (void)pageLoadStarting:(NSNotification*)notify {
-  Tab* tab = notify.userInfo[kTabModelTabKey];
-  DCHECK(tab && ([_model indexOfTab:tab] != NSNotFound));
-
-  // Stop any Find in Page searches and close the find bar when navigating to a
-  // new page.
-  [self closeFindInPage];
-
-  if (tab == [_model currentTab]) {
-    // TODO(pinkerton): Fill in here about hiding the forward button on
-    // navigation.
-  }
-}
-
-- (void)pageLoadStarted:(NSNotification*)notify {
-  Tab* tab = notify.userInfo[kTabModelTabKey];
-  DCHECK(tab);
-  if (tab == [_model currentTab]) {
-    if (![self isTabNativePage:tab]) {
-      [_toolbarCoordinator currentPageLoadStarted];
-    }
-    [self updateVoiceSearchBarVisibilityAnimated:NO];
-  }
-}
-
-- (void)pageLoadComplete:(NSNotification*)notify {
-  // Update the UI, but only if the current tab.
-  Tab* tab = notify.userInfo[kTabModelTabKey];
-  if (tab == [_model currentTab]) {
-    // There isn't any need to update the toolbar here. When the page finishes,
-    // it will have already sent us |-tabModel:didChangeTab:| which will do it.
-  }
-
-  BOOL loadingSucceeded = [notify.userInfo[kTabModelPageLoadSuccess] boolValue];
-
-  [self tabLoadComplete:tab withSuccess:loadingSucceeded];
-}
-
-- (void)tabDeselected:(NSNotification*)notify {
-  DCHECK(notify);
-  Tab* tab = notify.userInfo[kTabModelTabKey];
-  DCHECK(tab);
-  [tab wasHidden];
-  [self dismissPopups];
-}
-
-- (void)tabWasAdded:(NSNotification*)notify {
-  Tab* tab = notify.userInfo[kTabModelTabKey];
-  DCHECK(tab);
-
-  _temporaryNativeController = nil;
-
-  // When adding new tabs, check what kind of reminder infobar should
-  // be added to the new tab. Try to add only one of them.
-  // This check is done when a new tab is added either through the Tools Menu
-  // "New Tab" or through "New Tab" in Stack View Controller. This method
-  // is called after a new tab has added and finished initial navigation.
-  // If this is added earlier, the initial navigation may end up clearing
-  // the infobar(s) that are just added. See http://crbug/340250 for details.
-  web::WebState* webState = tab.webState;
-  DCHECK(webState);
-
-  infobars::InfoBarManager* infoBarManager =
-      InfoBarManagerImpl::FromWebState(webState);
-  [[UpgradeCenter sharedInstance] addInfoBarToManager:infoBarManager
-                                             forTabId:[tab tabId]];
-  if (!ReSignInInfoBarDelegate::Create(_browserState, tab,
-                                       self /* id<SigninPresenter> */)) {
-    DisplaySyncErrors(_browserState, tab, self /* id<SyncPresenter> */);
-  }
-
-  // The rest of this function initiates the new tab animation, which is
-  // phone-specific.  Call the foreground tab added completion block; for
-  // iPhones, this will get executed after the animation has finished.
-  if (IsIPadIdiom()) {
-    if (self.foregroundTabWasAddedCompletionBlock) {
-      // This callback is called before webState is activated (on
-      // kTabModelNewTabWillOpenNotification notification). Dispatch the
-      // callback asynchronously to be sure the activation is complete.
-      dispatch_async(dispatch_get_main_queue(), ^() {
-        // Test existence again as the block may have been deleted.
-        if (self.foregroundTabWasAddedCompletionBlock) {
-          self.foregroundTabWasAddedCompletionBlock();
-          self.foregroundTabWasAddedCompletionBlock = nil;
-        }
-      });
-    }
-    return;
-  }
-
-  // Do nothing if browsing is currently suspended.  The BVC will set everything
-  // up correctly when browsing resumes.
-  if (!self.visible || ![_model webUsageEnabled])
-    return;
-
-  BOOL inBackground = [notify.userInfo[kTabModelOpenInBackgroundKey] boolValue];
-
-  // Block that starts voice search at the end of new Tab animation if
-  // necessary.
-  ProceduralBlock startVoiceSearchIfNecessaryBlock = ^void() {
-    if (_startVoiceSearchAfterNewTabAnimation) {
-      _startVoiceSearchAfterNewTabAnimation = NO;
-      [self startVoiceSearchWithOriginView:nil];
-    }
-  };
-
-  self.inNewTabAnimation = YES;
-  if (!inBackground) {
-    UIView* animationParentView = _contentArea;
-    // Create the new page image, and load with the new tab snapshot except if
-    // it is the NTP.
-    CGFloat newPageOffset = 0;
-    UIView* newPage;
-    CGFloat offset = 0;
-    if (tab.webState->GetLastCommittedURL() == kChromeUINewTabURL &&
-        !_isOffTheRecord && !IsIPadIdiom()) {
-      offset = 0;
-      animationParentView = self.view;
-      newPage = tab.view;
-      newPage.userInteractionEnabled = NO;
-      // Compute a frame for the new page by removing the status bar height from
-      // the bounds of |self.view|.
-      CGRect viewBounds, remainder;
-      CGRectDivide(self.view.bounds, &remainder, &viewBounds, StatusBarHeight(),
-                   CGRectMinYEdge);
-      newPage.frame = viewBounds;
-    } else {
-      UIImageView* pageScreenshot = [self pageOpenCloseAnimationView];
-      tab.view.frame = _contentArea.bounds;
-      pageScreenshot.image = SnapshotTabHelper::FromWebState(tab.webState)
-                                 ->UpdateSnapshot(/*with_overlays=*/true,
-                                                  /*visible_frame_only=*/true);
-      newPage = pageScreenshot;
-      offset =
-          pageScreenshot.frame.size.height - pageScreenshot.image.size.height;
-    }
-    newPageOffset = newPage.frame.origin.y;
-
-    [animationParentView addSubview:newPage];
-    CGPoint origin = [self lastTapPoint];
-    page_animation_util::AnimateInPaperWithAnimationAndCompletion(
-        newPage, -newPageOffset, offset, origin, _isOffTheRecord, NULL, ^{
-          [tab view].frame = _contentArea.bounds;
-          newPage.userInteractionEnabled = YES;
-          [newPage removeFromSuperview];
-          self.inNewTabAnimation = NO;
-          // Use the model's currentTab here because it is possible that it can
-          // be reset to a new value before the new Tab animation finished (e.g.
-          // if another Tab shows a dialog via |dialogPresenter|). However, that
-          // tab's view hasn't been displayed yet because it was in a new tab
-          // animation.
-          Tab* currentTab = [_model currentTab];
-          if (currentTab) {
-            [self tabSelected:currentTab notifyToolbar:NO];
-          }
-          startVoiceSearchIfNecessaryBlock();
-
-          if (self.foregroundTabWasAddedCompletionBlock) {
-            self.foregroundTabWasAddedCompletionBlock();
-            self.foregroundTabWasAddedCompletionBlock = nil;
-          }
-        });
-  } else {
-    // SnapshotTabHelper::UpdateSnapshot will force a screen redraw, so take the
-    // snapshot before adding the views needed for the background animation.
-    Tab* topTab = [_model currentTab];
-    UIImage* image =
-        SnapshotTabHelper::FromWebState(topTab.webState)
-            ->UpdateSnapshot(/*with_overlays=*/true,
-                             /*visible_frame_only=*/self.isToolbarOnScreen);
-
-    // The size of the |image| above can be wrong if the snapshot fails, grab
-    // the correct size here.
-    CGRect imageFrame = CGRectZero;
-    if (self.isToolbarOnScreen) {
-      imageFrame = UIEdgeInsetsInsetRect(
-          _contentArea.bounds, [self snapshotEdgeInsetsForTab:topTab]);
-    } else {
-      imageFrame = [topTab.webState->GetView() bounds];
-    }
-
-    // Add three layers in order on top of the contentArea for the animation:
-    // 1. The black "background" screen.
-    UIView* background = [[UIView alloc] initWithFrame:[_contentArea bounds]];
-    InstallBackgroundInView(background);
-    [_contentArea addSubview:background];
-
-    // 2. A CardView displaying the data from the current tab.
-    CardView* topCard = [self addCardViewInFullscreen:!self.isToolbarOnScreen];
-    NSString* title = [topTab title];
-    if (![title length])
-      title = [topTab urlDisplayString];
-    [topCard setTitle:title];
-    [topCard setImage:image];
-    [topCard setFavicon:nil];
-
-    favicon::FaviconDriver* faviconDriver =
-        favicon::WebFaviconDriver::FromWebState(topTab.webState);
-    if (faviconDriver && faviconDriver->FaviconIsValid()) {
-      gfx::Image favicon = faviconDriver->GetFavicon();
-      if (!favicon.IsEmpty())
-        [topCard setFavicon:favicon.ToUIImage()];
-    }
-
-    // 3. A new, blank CardView to represent the new tab being added.
-    // Launch the new background tab animation.
-    page_animation_util::AnimateNewBackgroundPageWithCompletion(
-        topCard, [_contentArea frame], imageFrame, IsPortrait(), ^{
-          [background removeFromSuperview];
-          [topCard removeFromSuperview];
-          self.inNewTabAnimation = NO;
-          // Resnapshot the top card if it has its own toolbar, as the toolbar
-          // will be captured in the new tab animation, but isn't desired for
-          // the stack view snapshots.
-          id nativeController = [self nativeControllerForTab:topTab];
-          if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)]) {
-            SnapshotTabHelper::FromWebState(topTab.webState)
-                ->UpdateSnapshot(/*with_overlays=*/true,
-                                 /*visible_frame_only=*/true);
-          }
-          startVoiceSearchIfNecessaryBlock();
-        });
-    // Reset the foreground tab completion block so that it can never be
-    // called more than once regardless of foreground/background tab
-    // appearances.
-    self.foregroundTabWasAddedCompletionBlock = nil;
-  }
-}
-
-#pragma mark - UI Configuration and Layout
+#pragma mark - Private Methods: BVC Initialization
 
 - (void)updateWithTabModel:(TabModel*)model
               browserState:(ios::ChromeBrowserState*)browserState {
@@ -2059,10 +1845,9 @@
   for (NSUInteger index = 0; index < count; ++index)
     [self installDelegatesForTab:[_model tabAtIndex:index]];
 
-  [self registerForNotifications];
-
   _imageFetcher = base::MakeUnique<image_fetcher::IOSImageDataFetcherWrapper>(
       _browserState->GetRequestContext());
+  self.imageSaver = [[ImageSaver alloc] initWithBaseViewController:self];
   _dominantColorCache = [[NSMutableDictionary alloc] init];
 
   // Register for bookmark changed notification (BookmarkModel may be null
@@ -2364,6 +2149,23 @@
                 dispatcher:self.dispatcher];
 }
 
+- (void)setOverScrollActionControllerToStaticNativeContent:
+    (StaticHtmlNativeContent*)nativeContent {
+  if (!IsIPadIdiom()) {
+    OverscrollActionsController* controller =
+        [[OverscrollActionsController alloc]
+            initWithScrollView:[nativeContent scrollView]];
+    [controller setDelegate:self];
+    OverscrollStyle style = _isOffTheRecord
+                                ? OverscrollStyle::REGULAR_PAGE_INCOGNITO
+                                : OverscrollStyle::REGULAR_PAGE_NON_INCOGNITO;
+    controller.style = style;
+    nativeContent.overscrollActionsController = controller;
+  }
+}
+
+#pragma mark - Private Methods: UI Configuration, update and Layout
+
 // Update the state of back and forward buttons, hiding the forward button if
 // there is nowhere to go. Assumes the model's current tab is up to date.
 - (void)updateToolbar {
@@ -2421,6 +2223,130 @@
   [self.incognitoTabTipBubblePresenter dismissAnimated:NO];
 }
 
+- (BOOL)isTabScrolledToTop:(Tab*)tab {
+  CGPoint scrollOffset =
+      tab.webState->GetWebViewProxy().scrollViewProxy.contentOffset;
+
+  // If there is a native controller, use the native controller's scroll offset.
+  id nativeController = [self nativeControllerForTab:tab];
+  if ([nativeController conformsToProtocol:@protocol(CRWNativeContent)] &&
+      [nativeController respondsToSelector:@selector(scrollOffset)]) {
+    scrollOffset = [nativeController scrollOffset];
+  }
+  return CGPointEqualToPoint(scrollOffset, CGPointZero);
+}
+
+- (UIView*)footerView {
+  return _voiceSearchBar;
+}
+
+- (CGFloat)headerHeightForTab:(Tab*)tab {
+  id nativeController = [self nativeControllerForTab:tab];
+  if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] &&
+      [nativeController respondsToSelector:@selector(toolbarHeight)] &&
+      [nativeController toolbarHeight] > 0.0 && !IsIPadIdiom()) {
+    // On iPhone, don't add any header height for ToolbarOwner native
+    // controllers when they're displaying their own toolbar.
+    return 0;
+  }
+
+  NSArray<HeaderDefinition*>* views = [self headerViews];
+
+  CGFloat height = self.headerOffset;
+  for (HeaderDefinition* header in views) {
+    if (header.view && header.behaviour == Hideable) {
+      height += CGRectGetHeight([header.view frame]) -
+                header.heightAdjustement - header.inset;
+    }
+  }
+
+  return height - StatusBarHeight();
+}
+
+- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers
+                   atOffset:(CGFloat)headerOffset {
+  CGFloat height = self.headerOffset;
+  for (HeaderDefinition* header in headers) {
+    CGFloat yOrigin = height - headerOffset - header.inset;
+    // Make sure the toolbarView's constraints are also updated.  Leaving the
+    // -setFrame call to minimize changes in this CL -- otherwise the way
+    // toolbar_view manages it's alpha changes would also need to be updated.
+    // TODO(crbug.com/778822): This can be cleaned up when the new fullscreen
+    // is enabled.
+    if (IsSafeAreaCompatibleToolbarEnabled() &&
+        header.view == _toolbarCoordinator.toolbarViewController.view &&
+        !IsIPadIdiom()) {
+      self.toolbarOffsetConstraint.constant = yOrigin;
+    }
+    CGRect frame = [header.view frame];
+    frame.origin.y = yOrigin;
+    [header.view setFrame:frame];
+    if (header.behaviour != Overlap)
+      height += CGRectGetHeight(frame);
+  }
+}
+
+- (CardView*)addCardViewInFullscreen:(BOOL)fullScreen {
+  CGRect frame = [_contentArea frame];
+  if (!fullScreen) {
+    // Changing the origin here is unnecessary, it's set in page_animation_util.
+    frame.size.height -= self.headerHeight;
+  }
+
+  CGFloat shortAxis = frame.size.width;
+  CGFloat shortInset = kCardImageInsets.left + kCardImageInsets.right;
+  shortAxis -= shortInset + 2 * page_animation_util::kCardMargin;
+  CGFloat aspectRatio = frame.size.height / frame.size.width;
+  CGFloat longAxis = std::floor(aspectRatio * shortAxis);
+  CGFloat longInset = kCardImageInsets.top + kCardImageInsets.bottom;
+  CGSize cardSize = CGSizeMake(shortAxis + shortInset, longAxis + longInset);
+  CGRect cardFrame = {frame.origin, cardSize};
+
+  CardView* card =
+      [[CardView alloc] initWithFrame:cardFrame isIncognito:_isOffTheRecord];
+  card.closeButtonSide = IsPortrait() ? CardCloseButtonSide::TRAILING
+                                      : CardCloseButtonSide::LEADING;
+  [_contentArea addSubview:card];
+  return card;
+}
+
+#pragma mark - Private Methods: Showing and Dismissing Child UI
+
+- (void)showAllBookmarks {
+  DCHECK(self.visible || self.dismissingModal);
+  GURL URL(kChromeUIBookmarksURL);
+  Tab* tab = [_model currentTab];
+  web::NavigationManager::WebLoadParams params(URL);
+  params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
+  [tab navigationManager]->LoadURLWithParams(params);
+}
+
+- (void)showNTPPanel:(ntp_home::PanelIdentifier)panel {
+  DCHECK(self.visible || self.dismissingModal);
+  GURL url(kChromeUINewTabURL);
+  std::string fragment(NewTabPage::FragmentFromIdentifier(panel));
+  if (fragment != "") {
+    GURL::Replacements replacement;
+    replacement.SetRefStr(fragment);
+    url = url.ReplaceComponents(replacement);
+  }
+  Tab* tab = [_model currentTab];
+  web::NavigationManager::WebLoadParams params(url);
+  params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
+  [tab navigationManager]->LoadURLWithParams(params);
+}
+
+- (void)dismissRateThisAppDialog {
+  if (_rateThisAppDialog) {
+    base::RecordAction(base::UserMetricsAction(
+        "IOSRateThisAppDialogDismissedProgramatically"));
+    [_rateThisAppDialog dismiss];
+    _rateThisAppDialog = nil;
+  }
+}
+
+#pragma mark - Private Methods: Bubble views
+
 - (BubbleViewControllerPresenter*)
 bubblePresenterForFeature:(const base::Feature&)feature
                 direction:(BubbleArrowDirection)direction
@@ -2586,110 +2512,109 @@
   [_toolbarCoordinator triggerToolsMenuButtonAnimation];
 }
 
-- (BOOL)isTabScrolledToTop:(Tab*)tab {
-  CGPoint scrollOffset =
-      tab.webState->GetWebViewProxy().scrollViewProxy.contentOffset;
+#pragma mark - Private Methods: Find Bar UI
 
-  // If there is a native controller, use the native controller's scroll offset.
-  id nativeController = [self nativeControllerForTab:tab];
-  if ([nativeController conformsToProtocol:@protocol(CRWNativeContent)] &&
-      [nativeController respondsToSelector:@selector(scrollOffset)]) {
-    scrollOffset = [nativeController scrollOffset];
-  }
-  return CGPointEqualToPoint(scrollOffset, CGPointZero);
+- (void)hideFindBarWithAnimation:(BOOL)animate {
+  [_findBarController hideFindBarView:animate];
 }
 
-- (NSArray<HeaderDefinition*>*)headerViews {
-  NSMutableArray<HeaderDefinition*>* results = [[NSMutableArray alloc] init];
-  if (![self isViewLoaded])
-    return results;
+- (void)showFindBarWithAnimation:(BOOL)animate
+                      selectText:(BOOL)selectText
+                     shouldFocus:(BOOL)shouldFocus {
+  DCHECK(_findBarController);
+  Tab* tab = [_model currentTab];
+  DCHECK(tab);
+  CRWWebController* webController = tab.webController;
 
-  if (!IsIPadIdiom()) {
-    if (_toolbarCoordinator.toolbarViewController.view) {
-      [results addObject:[HeaderDefinition
-                             definitionWithView:_toolbarCoordinator
-                                                    .toolbarViewController.view
-                                headerBehaviour:Hideable
-                               heightAdjustment:0.0
-                                          inset:0.0]];
-    }
+  CGRect referenceFrame = CGRectZero;
+  if (IsIPadIdiom()) {
+    referenceFrame = webController.visibleFrame;
+    referenceFrame.origin.y -= kIPadFindBarOverlap;
   } else {
-    if (self.tabStripView) {
-      [results addObject:[HeaderDefinition definitionWithView:self.tabStripView
-                                              headerBehaviour:Hideable
-                                             heightAdjustment:0.0
-                                                        inset:0.0]];
-    }
-    if (_toolbarCoordinator.toolbarViewController.view) {
-      [results addObject:[HeaderDefinition
-                             definitionWithView:_toolbarCoordinator
-                                                    .toolbarViewController.view
-                                headerBehaviour:Hideable
-                               heightAdjustment:0.0
-                                          inset:0.0]];
-    }
-    if ([_findBarController view]) {
-      [results addObject:[HeaderDefinition
-                             definitionWithView:[_findBarController view]
-                                headerBehaviour:Overlap
-                               heightAdjustment:0.0
-                                          inset:kIPadFindBarOverlap]];
-    }
-  }
-  return [results copy];
-}
-
-- (UIView*)footerView {
-  return _voiceSearchBar;
-}
-
-- (CGFloat)headerHeightForTab:(Tab*)tab {
-  id nativeController = [self nativeControllerForTab:tab];
-  if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)] &&
-      [nativeController respondsToSelector:@selector(toolbarHeight)] &&
-      [nativeController toolbarHeight] > 0.0 && !IsIPadIdiom()) {
-    // On iPhone, don't add any header height for ToolbarOwner native
-    // controllers when they're displaying their own toolbar.
-    return 0;
+    referenceFrame = _contentArea.frame;
   }
 
-  NSArray<HeaderDefinition*>* views = [self headerViews];
-
-  CGFloat height = self.headerOffset;
-  for (HeaderDefinition* header in views) {
-    if (header.view && header.behaviour == Hideable) {
-      height += CGRectGetHeight([header.view frame]) -
-                header.heightAdjustement - header.inset;
-    }
-  }
-
-  return height - StatusBarHeight();
+  CGRect omniboxFrame = [_toolbarCoordinator visibleOmniboxFrame];
+  [_findBarController addFindBarView:animate
+                            intoView:self.view
+                           withFrame:referenceFrame
+                      alignWithFrame:omniboxFrame
+                          selectText:selectText];
+  [self updateFindBar:YES shouldFocus:shouldFocus];
 }
 
-- (void)setFramesForHeaders:(NSArray<HeaderDefinition*>*)headers
-                   atOffset:(CGFloat)headerOffset {
-  CGFloat height = self.headerOffset;
-  for (HeaderDefinition* header in headers) {
-    CGFloat yOrigin = height - headerOffset - header.inset;
-    // Make sure the toolbarView's constraints are also updated.  Leaving the
-    // -setFrame call to minimize changes in this CL -- otherwise the way
-    // toolbar_view manages it's alpha changes would also need to be updated.
-    // TODO(crbug.com/778822): This can be cleaned up when the new fullscreen
-    // is enabled.
-    if (IsSafeAreaCompatibleToolbarEnabled() &&
-        header.view == _toolbarCoordinator.toolbarViewController.view &&
-        !IsIPadIdiom()) {
-      self.toolbarOffsetConstraint.constant = yOrigin;
+- (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus {
+  // TODO(crbug.com/731045): This early return temporarily replaces a DCHECK.
+  // For unknown reasons, this DCHECK sometimes was hit in the wild, resulting
+  // in a crash.
+  if (![_model currentTab]) {
+    return;
+  }
+  auto* helper = FindTabHelper::FromWebState([_model currentTab].webState);
+  if (helper && helper->IsFindUIActive()) {
+    if (initialUpdate && !_isOffTheRecord) {
+      helper->RestoreSearchTerm();
     }
-    CGRect frame = [header.view frame];
-    frame.origin.y = yOrigin;
-    [header.view setFrame:frame];
-    if (header.behaviour != Overlap)
-      height += CGRectGetHeight(frame);
+
+    [self setFramesForHeaders:[self headerViews]
+                     atOffset:[self currentHeaderOffset]];
+    [_findBarController updateView:helper->GetFindResult()
+                     initialUpdate:initialUpdate
+                    focusTextfield:shouldFocus];
+  } else {
+    [self hideFindBarWithAnimation:YES];
   }
 }
 
-#pragma mark - Tap handling
+- (void)reshowFindBarIfNeededWithCoordinator:
+    (id<UIViewControllerTransitionCoordinator>)coordinator {
+  if (![_findBarController isFindInPageShown])
+    return;
+
+  // Record focused state.
+  BOOL isFocusedBeforeReshow = [_findBarController isFocused];
+
+  [self hideFindBarWithAnimation:NO];
+
+  __weak BrowserViewController* weakSelf = self;
+  void (^completion)(id<UIViewControllerTransitionCoordinatorContext>) =
+      ^(id<UIViewControllerTransitionCoordinatorContext> context) {
+        BrowserViewController* strongSelf = weakSelf;
+        if (strongSelf)
+          [strongSelf showFindBarWithAnimation:NO
+                                    selectText:NO
+                                   shouldFocus:isFocusedBeforeReshow];
+      };
+
+  BOOL enqueued =
+      [coordinator animateAlongsideTransition:nil completion:completion];
+  if (!enqueued) {
+    completion(nil);
+  }
+}
+
+#pragma mark - Private Methods: Alerts
+
+- (void)showErrorAlertWithStringTitle:(NSString*)title
+                              message:(NSString*)message {
+  // Dismiss current alert.
+  [_alertCoordinator stop];
+
+  _alertCoordinator = [_dependencyFactory alertCoordinatorWithTitle:title
+                                                            message:message
+                                                     viewController:self];
+  [_alertCoordinator start];
+}
+
+- (void)showSnackbar:(NSString*)text {
+  MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text];
+  message.accessibilityLabel = text;
+  message.duration = 2.0;
+  message.category = kBrowserViewControllerSnackbarCategory;
+  [self.dispatcher showSnackbarMessage:message];
+}
+
+#pragma mark - Private Methods: Tap handling
 
 - (void)setLastTapPoint:(OpenNewTabCommand*)command {
   if (CGPointEqualToPoint(command.originPoint, CGPointZero)) {
@@ -2716,7 +2641,7 @@
   _lastTapTime = CACurrentMediaTime();
 }
 
-#pragma mark - Tab creation and selection
+#pragma mark - Private Methods: Tab creation and selection
 
 // Called when either a tab finishes loading or when a tab with finished content
 // is added directly to the model via pre-rendering.
@@ -2779,7 +2704,6 @@
   return tab;
 }
 
-// Whether the given tab's URL is an application specific URL.
 - (BOOL)isTabNativePage:(Tab*)tab {
   web::WebState* webState = tab.webState;
   if (!webState)
@@ -2914,10 +2838,6 @@
   SnapshotTabHelper::FromWebState(tab.webState)->SetDelegate(nil);
 }
 
-// Called when a tab is selected in the model. Make any required view changes.
-// The notification will not be sent when the tab is already the selected tab.
-// |notifyToolbar| indicates whether the toolbar is notified that the tab has
-// changed.
 - (void)tabSelected:(Tab*)tab notifyToolbar:(BOOL)notifyToolbar {
   DCHECK(tab);
 
@@ -2940,6 +2860,77 @@
   }
 }
 
+- (id)nativeControllerForTab:(Tab*)tab {
+  id nativeController = tab.webController.nativeController;
+  return nativeController ? nativeController : _temporaryNativeController;
+}
+
+#pragma mark - Private Methods: Voice Search
+
+- (void)ensureVoiceSearchControllerCreated {
+  if (!_voiceSearchController) {
+    VoiceSearchProvider* provider =
+        ios::GetChromeBrowserProvider()->GetVoiceSearchProvider();
+    if (provider) {
+      _voiceSearchController =
+          provider->CreateVoiceSearchController(_browserState);
+      _voiceSearchController->SetDelegate(
+          [_toolbarCoordinator voiceSearchDelegate]);
+    }
+  }
+}
+
+- (void)ensureVoiceSearchBarCreated {
+  if (_voiceSearchBar)
+    return;
+
+  CGFloat width = CGRectGetWidth([[self view] bounds]);
+  CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight;
+  CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight);
+  _voiceSearchBar = ios::GetChromeBrowserProvider()
+                        ->GetVoiceSearchProvider()
+                        ->BuildVoiceSearchBar(frame, self.dispatcher);
+  [_voiceSearchBar setVoiceSearchBarDelegate:self];
+  [_voiceSearchBar setHidden:YES];
+  [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin |
+                                       UIViewAutoresizingFlexibleWidth];
+  [self.view insertSubview:_voiceSearchBar
+              belowSubview:_infoBarContainer->view()];
+}
+
+- (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated {
+  // Voice search bar exists and is shown/hidden.
+  BOOL show = self.shouldShowVoiceSearchBar;
+  if (_voiceSearchBar && _voiceSearchBar.hidden != show)
+    return;
+
+  // Voice search bar doesn't exist and thus is not visible.
+  if (!_voiceSearchBar && !show)
+    return;
+
+  if (animated)
+    [_voiceSearchBar animateToBecomeVisible:show];
+  else
+    _voiceSearchBar.hidden = !show;
+}
+
+#pragma mark - Private Methods: Reading List
+
+- (void)addToReadingListURL:(const GURL&)URL title:(NSString*)title {
+  base::RecordAction(UserMetricsAction("MobileReadingListAdd"));
+
+  ReadingListModel* readingModel =
+      ReadingListModelFactory::GetForBrowserState(_browserState);
+  readingModel->AddEntry(URL, base::SysNSStringToUTF8(title),
+                         reading_list::ADDED_VIA_CURRENT_APP);
+
+  TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
+  [self showSnackbar:l10n_util::GetNSString(
+                         IDS_IOS_READING_LIST_SNACKBAR_MESSAGE)];
+}
+
+#pragma mark - ** Protocol Implementations and Helpers **
+
 #pragma mark - SnapshotOverlayProvider methods
 
 - (NSArray*)snapshotOverlaysForTab:(Tab*)tab {
@@ -3032,55 +3023,6 @@
   }
 }
 
-#pragma mark - Voice Search
-
-- (void)ensureVoiceSearchControllerCreated {
-  if (!_voiceSearchController) {
-    VoiceSearchProvider* provider =
-        ios::GetChromeBrowserProvider()->GetVoiceSearchProvider();
-    if (provider) {
-      _voiceSearchController =
-          provider->CreateVoiceSearchController(_browserState);
-      _voiceSearchController->SetDelegate(
-          [_toolbarCoordinator voiceSearchDelegate]);
-    }
-  }
-}
-
-- (void)ensureVoiceSearchBarCreated {
-  if (_voiceSearchBar)
-    return;
-
-  CGFloat width = CGRectGetWidth([[self view] bounds]);
-  CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight;
-  CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight);
-  _voiceSearchBar = ios::GetChromeBrowserProvider()
-                        ->GetVoiceSearchProvider()
-                        ->BuildVoiceSearchBar(frame, self.dispatcher);
-  [_voiceSearchBar setVoiceSearchBarDelegate:self];
-  [_voiceSearchBar setHidden:YES];
-  [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin |
-                                       UIViewAutoresizingFlexibleWidth];
-  [self.view insertSubview:_voiceSearchBar
-              belowSubview:_infoBarContainer->view()];
-}
-
-- (void)updateVoiceSearchBarVisibilityAnimated:(BOOL)animated {
-  // Voice search bar exists and is shown/hidden.
-  BOOL show = self.shouldShowVoiceSearchBar;
-  if (_voiceSearchBar && _voiceSearchBar.hidden != show)
-    return;
-
-  // Voice search bar doesn't exist and thus is not visible.
-  if (!_voiceSearchBar && !show)
-    return;
-
-  if (animated)
-    [_voiceSearchBar animateToBecomeVisible:show];
-  else
-    _voiceSearchBar.hidden = !show;
-}
-
 #pragma mark - PassKitDialogProvider methods
 
 - (void)presentPassKitDialog:(NSData*)data {
@@ -3396,6 +3338,95 @@
                                       completionHandler:handler];
 }
 
+#pragma mark - CRWWebStateDelegate helpers
+
+// Evaluates Javascript asynchronously using the current page context.
+- (void)openJavascript:(NSString*)javascript {
+  DCHECK(javascript);
+  javascript = [javascript stringByRemovingPercentEncoding];
+  web::WebState* webState = [[_model currentTab] webState];
+  if (webState) {
+    webState->ExecuteJavaScript(base::SysNSStringToUTF16(javascript));
+  }
+}
+
+// Performs a search with the image at the given url. The referrer is used to
+// download the image.
+- (void)searchByImageAtURL:(const GURL&)url
+                  referrer:(const web::Referrer)referrer {
+  DCHECK(url.is_valid());
+  __weak BrowserViewController* weakSelf = self;
+  const GURL image_source_url = url;
+  image_fetcher::IOSImageDataFetcherCallback callback =
+      ^(NSData* data, const image_fetcher::RequestMetadata& metadata) {
+        DCHECK(data);
+        dispatch_async(dispatch_get_main_queue(), ^{
+          [weakSelf searchByImageData:data atURL:image_source_url];
+        });
+      };
+  _imageFetcher->FetchImageDataWebpDecoded(
+      url, callback, web::ReferrerHeaderValueForNavigation(url, referrer),
+      web::PolicyForNavigation(url, referrer));
+}
+
+// Performs a search using |data| and |imageURL| as inputs.
+- (void)searchByImageData:(NSData*)data atURL:(const GURL&)imageURL {
+  NSData* imageData = data;
+  UIImage* image = [UIImage imageWithData:imageData];
+  // Downsize the image if its area exceeds kSearchByImageMaxImageArea AND
+  // (either its width exceeds kSearchByImageMaxImageWidth OR its height exceeds
+  // kSearchByImageMaxImageHeight).
+  if (image &&
+      image.size.height * image.size.width > kSearchByImageMaxImageArea &&
+      (image.size.width > kSearchByImageMaxImageWidth ||
+       image.size.height > kSearchByImageMaxImageHeight)) {
+    CGSize newImageSize =
+        CGSizeMake(kSearchByImageMaxImageWidth, kSearchByImageMaxImageHeight);
+    image = [image gtm_imageByResizingToSize:newImageSize
+                         preserveAspectRatio:YES
+                                   trimToFit:NO];
+    imageData = UIImageJPEGRepresentation(image, 1.0);
+  }
+
+  char const* bytes = reinterpret_cast<const char*>([imageData bytes]);
+  std::string byteString(bytes, [imageData length]);
+
+  TemplateURLService* templateUrlService =
+      ios::TemplateURLServiceFactory::GetForBrowserState(_browserState);
+  const TemplateURL* defaultURL =
+      templateUrlService->GetDefaultSearchProvider();
+  DCHECK(!defaultURL->image_url().empty());
+  DCHECK(defaultURL->image_url_ref().IsValid(
+      templateUrlService->search_terms_data()));
+  TemplateURLRef::SearchTermsArgs search_args(base::ASCIIToUTF16(""));
+  search_args.image_url = imageURL;
+  search_args.image_thumbnail_content = byteString;
+
+  // Generate the URL and populate |post_content| with the content type and
+  // HTTP body for the request.
+  TemplateURLRef::PostContent post_content;
+  GURL result(defaultURL->image_url_ref().ReplaceSearchTerms(
+      search_args, templateUrlService->search_terms_data(), &post_content));
+  [self addSelectedTabWithURL:result
+                     postData:&post_content
+                   transition:ui::PAGE_TRANSITION_TYPED];
+}
+
+// Saves the image at the given URL on the system's album.  The referrer is used
+// to download the image.
+- (void)saveImageAtURL:(const GURL&)url
+              referrer:(const web::Referrer&)referrer {
+  DCHECK(url.is_valid());
+
+  image_fetcher::IOSImageDataFetcherCallback callback =
+      ^(NSData* data, const image_fetcher::RequestMetadata& metadata) {
+        [self.imageSaver saveImageData:data withMetadata:metadata];
+      };
+  _imageFetcher->FetchImageDataWebpDecoded(
+      url, callback, web::ReferrerHeaderValueForNavigation(url, referrer),
+      web::PolicyForNavigation(url, referrer));
+}
+
 #pragma mark - LegacyFullscreenControllerDelegate methods
 
 // TODO(crbug.com/798064): Remove these methods and their helpers once the
@@ -3533,23 +3564,6 @@
     [controller setToolbarInsetsForHeaderOffset:offset];
 }
 
-#pragma mark - Install OverScrollActionController method.
-
-- (void)setOverScrollActionControllerToStaticNativeContent:
-    (StaticHtmlNativeContent*)nativeContent {
-  if (!IsIPadIdiom()) {
-    OverscrollActionsController* controller =
-        [[OverscrollActionsController alloc]
-            initWithScrollView:[nativeContent scrollView]];
-    [controller setDelegate:self];
-    OverscrollStyle style = _isOffTheRecord
-                                ? OverscrollStyle::REGULAR_PAGE_INCOGNITO
-                                : OverscrollStyle::REGULAR_PAGE_NON_INCOGNITO;
-    controller.style = style;
-    nativeContent.overscrollActionsController = controller;
-  }
-}
-
 #pragma mark - OverscrollActionsControllerDelegate methods.
 
 - (void)overscrollActionsController:(OverscrollActionsController*)controller
@@ -3762,11 +3776,6 @@
   return downloadController;
 }
 
-- (id)nativeControllerForTab:(Tab*)tab {
-  id nativeController = tab.webController.nativeController;
-  return nativeController ? nativeController : _temporaryNativeController;
-}
-
 #pragma mark - DialogPresenterDelegate methods
 
 - (void)dialogPresenter:(DialogPresenter*)presenter
@@ -3854,301 +3863,6 @@
   }
 }
 
-#pragma mark - Context menu methods
-
-- (void)searchByImageAtURL:(const GURL&)url
-                  referrer:(const web::Referrer)referrer {
-  DCHECK(url.is_valid());
-  __weak BrowserViewController* weakSelf = self;
-  const GURL image_source_url = url;
-  image_fetcher::IOSImageDataFetcherCallback callback = ^(
-      NSData* data, const image_fetcher::RequestMetadata& metadata) {
-    DCHECK(data);
-    dispatch_async(dispatch_get_main_queue(), ^{
-      [weakSelf searchByImageData:data atURL:image_source_url];
-    });
-  };
-  _imageFetcher->FetchImageDataWebpDecoded(
-      url, callback, web::ReferrerHeaderValueForNavigation(url, referrer),
-      web::PolicyForNavigation(url, referrer));
-}
-
-- (void)searchByImageData:(NSData*)data atURL:(const GURL&)imageURL {
-  NSData* imageData = data;
-  UIImage* image = [UIImage imageWithData:imageData];
-  // Downsize the image if its area exceeds kSearchByImageMaxImageArea AND
-  // (either its width exceeds kSearchByImageMaxImageWidth OR its height exceeds
-  // kSearchByImageMaxImageHeight).
-  if (image &&
-      image.size.height * image.size.width > kSearchByImageMaxImageArea &&
-      (image.size.width > kSearchByImageMaxImageWidth ||
-       image.size.height > kSearchByImageMaxImageHeight)) {
-    CGSize newImageSize =
-        CGSizeMake(kSearchByImageMaxImageWidth, kSearchByImageMaxImageHeight);
-    image = [image gtm_imageByResizingToSize:newImageSize
-                         preserveAspectRatio:YES
-                                   trimToFit:NO];
-    imageData = UIImageJPEGRepresentation(image, 1.0);
-  }
-
-  char const* bytes = reinterpret_cast<const char*>([imageData bytes]);
-  std::string byteString(bytes, [imageData length]);
-
-  TemplateURLService* templateUrlService =
-      ios::TemplateURLServiceFactory::GetForBrowserState(_browserState);
-  const TemplateURL* defaultURL =
-      templateUrlService->GetDefaultSearchProvider();
-  DCHECK(!defaultURL->image_url().empty());
-  DCHECK(defaultURL->image_url_ref().IsValid(
-      templateUrlService->search_terms_data()));
-  TemplateURLRef::SearchTermsArgs search_args(base::ASCIIToUTF16(""));
-  search_args.image_url = imageURL;
-  search_args.image_thumbnail_content = byteString;
-
-  // Generate the URL and populate |post_content| with the content type and
-  // HTTP body for the request.
-  TemplateURLRef::PostContent post_content;
-  GURL result(defaultURL->image_url_ref().ReplaceSearchTerms(
-      search_args, templateUrlService->search_terms_data(), &post_content));
-  [self addSelectedTabWithURL:result
-                     postData:&post_content
-                   transition:ui::PAGE_TRANSITION_TYPED];
-}
-
-- (void)saveImageAtURL:(const GURL&)url
-              referrer:(const web::Referrer&)referrer {
-  DCHECK(url.is_valid());
-
-  image_fetcher::IOSImageDataFetcherCallback callback = ^(
-      NSData* data, const image_fetcher::RequestMetadata& metadata) {
-    DCHECK(data);
-
-    if ([data length] == 0) {
-      [self displayPrivacyErrorAlertOnMainQueue:
-                l10n_util::GetNSString(
-                    IDS_IOS_SAVE_IMAGE_NO_INTERNET_CONNECTION)];
-      return;
-    }
-
-    base::FilePath::StringType extension;
-
-    bool extensionSuccess =
-        net::GetPreferredExtensionForMimeType(metadata.mime_type, &extension);
-    if (!extensionSuccess || extension.length() == 0) {
-      extension = "png";
-    }
-
-    NSString* fileExtension =
-        [@"." stringByAppendingString:base::SysUTF8ToNSString(extension)];
-    [self managePermissionAndSaveImage:data withFileExtension:fileExtension];
-  };
-  _imageFetcher->FetchImageDataWebpDecoded(
-      url, callback, web::ReferrerHeaderValueForNavigation(url, referrer),
-      web::PolicyForNavigation(url, referrer));
-}
-
-- (void)managePermissionAndSaveImage:(NSData*)data
-                   withFileExtension:(NSString*)fileExtension {
-  switch ([PHPhotoLibrary authorizationStatus]) {
-    // User was never asked for permission to access photos.
-    case PHAuthorizationStatusNotDetermined: {
-      [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
-        // Call -saveImage again to check if chrome needs to display an error or
-        // saves the image.
-        if (status != PHAuthorizationStatusNotDetermined)
-          [self managePermissionAndSaveImage:data
-                           withFileExtension:fileExtension];
-      }];
-      break;
-    }
-
-    // The application doesn't have permission to access photo and the user
-    // cannot grant it.
-    case PHAuthorizationStatusRestricted:
-      [self displayPrivacyErrorAlertOnMainQueue:
-                l10n_util::GetNSString(
-                    IDS_IOS_SAVE_IMAGE_RESTRICTED_PRIVACY_ALERT_MESSAGE)];
-      break;
-
-    // The application doesn't have permission to access photo and the user
-    // can grant it.
-    case PHAuthorizationStatusDenied:
-      [self displayImageErrorAlertWithSettingsOnMainQueue];
-      break;
-
-    // The application has permission to access the photos.
-    default:
-      __weak BrowserViewController* weakSelf = self;
-      [self saveImage:data
-          withFileExtension:fileExtension
-                 completion:^(BOOL success, NSError* error) {
-                   [weakSelf finishSavingImageWithError:error];
-                 }];
-      break;
-  }
-}
-
-- (void)saveImage:(NSData*)data
-    withFileExtension:(NSString*)fileExtension
-           completion:(void (^)(BOOL, NSError*))completion {
-  base::PostTaskWithTraits(
-      FROM_HERE,
-      {base::MayBlock(), base::TaskPriority::BACKGROUND,
-       base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
-      base::BindBlockArc(^{
-        base::AssertBlockingAllowed();
-
-        NSString* fileName = [[[NSProcessInfo processInfo] globallyUniqueString]
-            stringByAppendingString:fileExtension];
-        NSURL* fileURL = [NSURL
-            fileURLWithPath:[NSTemporaryDirectory()
-                                stringByAppendingPathComponent:fileName]];
-        NSError* error = nil;
-        [data writeToURL:fileURL options:NSDataWritingAtomic error:&error];
-        if (error) {
-          if (completion)
-            completion(NO, error);
-          return;
-        }
-
-        [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
-          [PHAssetChangeRequest
-              creationRequestForAssetFromImageAtFileURL:fileURL];
-        }
-            completionHandler:^(BOOL success, NSError* error) {
-              base::PostTaskWithTraits(
-                  FROM_HERE,
-                  {base::MayBlock(), base::TaskPriority::BACKGROUND,
-                   base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
-                  base::BindBlockArc(^{
-                    base::AssertBlockingAllowed();
-                    if (completion)
-                      completion(success, error);
-
-                    // Cleanup the temporary file.
-                    NSError* deleteFileError = nil;
-                    [[NSFileManager defaultManager]
-                        removeItemAtURL:fileURL
-                                  error:&deleteFileError];
-                  }));
-            }];
-      }));
-}
-
-- (void)displayImageErrorAlertWithSettingsOnMainQueue {
-  NSURL* settingURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
-  BOOL canGoToSetting =
-      [[UIApplication sharedApplication] canOpenURL:settingURL];
-  if (canGoToSetting) {
-    dispatch_async(dispatch_get_main_queue(), ^{
-      [self displayImageErrorAlertWithSettings:settingURL];
-    });
-  } else {
-    [self displayPrivacyErrorAlertOnMainQueue:
-              l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_MESSAGE)];
-  }
-}
-
-- (void)displayImageErrorAlertWithSettings:(NSURL*)settingURL {
-  // Dismiss current alert.
-  [_alertCoordinator stop];
-
-  NSString* title =
-      l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_TITLE);
-  NSString* message = l10n_util::GetNSString(
-      IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_MESSAGE_GO_TO_SETTINGS);
-
-  _alertCoordinator =
-      [[AlertCoordinator alloc] initWithBaseViewController:self
-                                                     title:title
-                                                   message:message];
-
-  [_alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_CANCEL)
-                               action:nil
-                                style:UIAlertActionStyleCancel];
-
-  [_alertCoordinator
-      addItemWithTitle:l10n_util::GetNSString(
-                           IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_GO_TO_SETTINGS)
-                action:^{
-                  OpenUrlWithCompletionHandler(settingURL, nil);
-                }
-                 style:UIAlertActionStyleDefault];
-
-  [_alertCoordinator start];
-}
-
-- (void)displayPrivacyErrorAlertOnMainQueue:(NSString*)errorContent {
-  dispatch_async(dispatch_get_main_queue(), ^{
-    NSString* title =
-        l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_TITLE);
-    [self showErrorAlertWithStringTitle:title message:errorContent];
-  });
-}
-
-// This callback is triggered when the image is effectively saved onto the photo
-// album, or if the save failed for some reason.
-- (void)finishSavingImageWithError:(NSError*)error {
-  // Was there an error?
-  if (error) {
-    // Saving photo failed even though user has granted access to Photos.
-    // Display the error information from the NSError object for user.
-    NSString* errorMessage = [NSString
-        stringWithFormat:@"%@ (%@ %" PRIdNS ")", [error localizedDescription],
-                         [error domain], [error code]];
-    // This code may be execute outside of the main thread. Make sure to display
-    // the error on the main thread.
-    [self displayPrivacyErrorAlertOnMainQueue:errorMessage];
-  } else {
-    // TODO(noyau): Ideally I'd like to show an infobar with a link to switch to
-    // the photo application. The current behaviour is to create the photo there
-    // but not providing any link to it is suboptimal. That's what Safari is
-    // doing, and what the PM want, but it doesn't make it right.
-  }
-}
-
-#pragma mark - Showing popups
-
-- (void)addToReadingListURL:(const GURL&)URL title:(NSString*)title {
-  base::RecordAction(UserMetricsAction("MobileReadingListAdd"));
-
-  ReadingListModel* readingModel =
-      ReadingListModelFactory::GetForBrowserState(_browserState);
-  readingModel->AddEntry(URL, base::SysNSStringToUTF8(title),
-                         reading_list::ADDED_VIA_CURRENT_APP);
-
-  TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
-  [self showSnackbar:l10n_util::GetNSString(
-                         IDS_IOS_READING_LIST_SNACKBAR_MESSAGE)];
-}
-
-#pragma mark - Keyboard commands management
-
-- (BOOL)shouldRegisterKeyboardCommands {
-  if ([self presentedViewController])
-    return NO;
-
-  if (_voiceSearchController && _voiceSearchController->IsVisible())
-    return NO;
-
-  // If there is no first responder, try to make the webview the first
-  // responder.
-  if (!GetFirstResponder()) {
-    web::WebState* webState = _model.currentTab.webState;
-    if (webState)
-      [webState->GetWebViewProxy() becomeFirstResponder];
-  }
-
-  return YES;
-}
-
-- (KeyCommandsProvider*)keyCommandsProvider {
-  if (!_keyCommandsProvider) {
-    _keyCommandsProvider = [_dependencyFactory newKeyCommandsProvider];
-  }
-  return _keyCommandsProvider;
-}
-
 #pragma mark - KeyCommandsPlumbing
 
 - (BOOL)isOffTheRecord {
@@ -4221,29 +3935,7 @@
   return _mainContentUIUpdater.state;
 }
 
-#pragma mark - UIResponder
-
-- (NSArray*)keyCommands {
-  if (![self shouldRegisterKeyboardCommands]) {
-    return nil;
-  }
-  return [self.keyCommandsProvider
-      keyCommandsForConsumer:self
-          baseViewController:self
-                  dispatcher:self.dispatcher
-                 editingText:![self isFirstResponder]];
-}
-
-// Induce an intentional crash in the browser process.
-- (void)induceBrowserCrash {
-  CHECK(false);
-  // Call another function, so that the above CHECK can't be tail-call
-  // optimized. This ensures that this method's name will show up in the stack
-  // for easier identification.
-  CHECK(true);
-}
-
-#pragma mark - UrlLoader (public protocol)
+#pragma mark - UrlLoader (Public)
 
 - (void)loadURL:(const GURL&)url
              referrer:(const web::Referrer&)referrer
@@ -4371,12 +4063,8 @@
     prerenderService->CancelPrerender();
   }
   DCHECK([_model currentTab]);
-  if ([self currentWebState])
-    [self currentWebState]->ExecuteUserJavaScript(script);
-}
-
-- (web::WebState*)currentWebState {
-  return [[_model currentTab] webState];
+  if (self.currentWebState)
+    self.currentWebState->ExecuteUserJavaScript(script);
 }
 
 // Load a new URL on a new page/tab.
@@ -4434,16 +4122,18 @@
           sessionTab->navigations));
 }
 
-- (void)openJavascript:(NSString*)javascript {
-  DCHECK(javascript);
-  javascript = [javascript stringByRemovingPercentEncoding];
-  web::WebState* webState = [[_model currentTab] webState];
-  if (webState) {
-    webState->ExecuteJavaScript(base::SysNSStringToUTF16(javascript));
-  }
+#pragma mark - UrlLoader helpers
+
+// Induce an intentional crash in the browser process.
+- (void)induceBrowserCrash {
+  CHECK(false);
+  // Call another function, so that the above CHECK can't be tail-call
+  // optimized. This ensures that this method's name will show up in the stack
+  // for easier identification.
+  CHECK(true);
 }
 
-#pragma mark - WebToolbarDelegate methods
+#pragma mark - WebToolbarDelegate (Public)
 
 - (void)locationBarDidBecomeFirstResponder {
   if (_locationBarHasFocus)
@@ -4514,29 +4204,6 @@
   return _toolbarModelIOS.get();
 }
 
-- (CardView*)addCardViewInFullscreen:(BOOL)fullScreen {
-  CGRect frame = [_contentArea frame];
-  if (!fullScreen) {
-    // Changing the origin here is unnecessary, it's set in page_animation_util.
-    frame.size.height -= self.headerHeight;
-  }
-
-  CGFloat shortAxis = frame.size.width;
-  CGFloat shortInset = kCardImageInsets.left + kCardImageInsets.right;
-  shortAxis -= shortInset + 2 * page_animation_util::kCardMargin;
-  CGFloat aspectRatio = frame.size.height / frame.size.width;
-  CGFloat longAxis = std::floor(aspectRatio * shortAxis);
-  CGFloat longInset = kCardImageInsets.top + kCardImageInsets.bottom;
-  CGSize cardSize = CGSizeMake(shortAxis + shortInset, longAxis + longInset);
-  CGRect cardFrame = {frame.origin, cardSize};
-
-  CardView* card =
-      [[CardView alloc] initWithFrame:cardFrame isIncognito:_isOffTheRecord];
-  card.closeButtonSide = IsPortrait() ? CardCloseButtonSide::TRAILING
-                                      : CardCloseButtonSide::LEADING;
-  [_contentArea addSubview:card];
-  return card;
-}
 
 #pragma mark - ToolsMenuConfigurationProvider
 
@@ -4949,94 +4616,7 @@
   }
 }
 
-#pragma mark - Find Bar
-
-- (void)hideFindBarWithAnimation:(BOOL)animate {
-  [_findBarController hideFindBarView:animate];
-}
-
-- (void)showFindBarWithAnimation:(BOOL)animate
-                      selectText:(BOOL)selectText
-                     shouldFocus:(BOOL)shouldFocus {
-  DCHECK(_findBarController);
-  Tab* tab = [_model currentTab];
-  DCHECK(tab);
-  CRWWebController* webController = tab.webController;
-
-  CGRect referenceFrame = CGRectZero;
-  if (IsIPadIdiom()) {
-    referenceFrame = webController.visibleFrame;
-    referenceFrame.origin.y -= kIPadFindBarOverlap;
-  } else {
-    referenceFrame = _contentArea.frame;
-  }
-
-  CGRect omniboxFrame = [_toolbarCoordinator visibleOmniboxFrame];
-  [_findBarController addFindBarView:animate
-                            intoView:self.view
-                           withFrame:referenceFrame
-                      alignWithFrame:omniboxFrame
-                          selectText:selectText];
-  [self updateFindBar:YES shouldFocus:shouldFocus];
-}
-
-- (void)updateFindBar:(BOOL)initialUpdate shouldFocus:(BOOL)shouldFocus {
-  // TODO(crbug.com/731045): This early return temporarily replaces a DCHECK.
-  // For unknown reasons, this DCHECK sometimes was hit in the wild, resulting
-  // in a crash.
-  if (![_model currentTab]) {
-    return;
-  }
-  auto* helper = FindTabHelper::FromWebState([_model currentTab].webState);
-  if (helper && helper->IsFindUIActive()) {
-    if (initialUpdate && !_isOffTheRecord) {
-      helper->RestoreSearchTerm();
-    }
-
-    [self setFramesForHeaders:[self headerViews]
-                     atOffset:[self currentHeaderOffset]];
-    [_findBarController updateView:helper->GetFindResult()
-                     initialUpdate:initialUpdate
-                    focusTextfield:shouldFocus];
-  } else {
-    [self hideFindBarWithAnimation:YES];
-  }
-}
-
-- (void)showAllBookmarks {
-  DCHECK(self.visible || self.dismissingModal);
-  GURL URL(kChromeUIBookmarksURL);
-  Tab* tab = [_model currentTab];
-  web::NavigationManager::WebLoadParams params(URL);
-  params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
-  [tab navigationManager]->LoadURLWithParams(params);
-}
-
-- (void)showNTPPanel:(ntp_home::PanelIdentifier)panel {
-  DCHECK(self.visible || self.dismissingModal);
-  GURL url(kChromeUINewTabURL);
-  std::string fragment(NewTabPage::FragmentFromIdentifier(panel));
-  if (fragment != "") {
-    GURL::Replacements replacement;
-    replacement.SetRefStr(fragment);
-    url = url.ReplaceComponents(replacement);
-  }
-  Tab* tab = [_model currentTab];
-  web::NavigationManager::WebLoadParams params(url);
-  params.transition_type = ui::PAGE_TRANSITION_AUTO_BOOKMARK;
-  [tab navigationManager]->LoadURLWithParams(params);
-}
-
-- (void)dismissRateThisAppDialog {
-  if (_rateThisAppDialog) {
-    base::RecordAction(base::UserMetricsAction(
-        "IOSRateThisAppDialogDismissedProgramatically"));
-    [_rateThisAppDialog dismiss];
-    _rateThisAppDialog = nil;
-  }
-}
-
-#pragma mark - ToolbarOwner
+#pragma mark - ToolbarOwner (Public)
 
 - (CGFloat)toolbarHeight {
   return self.headerHeight;
@@ -5105,7 +4685,12 @@
   [self tabSelected:newTab notifyToolbar:YES];
 }
 
-// Observer method, tab changed.
+- (void)tabModel:(TabModel*)model willStartLoadingTab:(Tab*)tab {
+  // Stop any Find in Page searches and close the find bar when navigating to a
+  // new page.
+  [self closeFindInPage];
+}
+
 - (void)tabModel:(TabModel*)model didChangeTab:(Tab*)tab {
   DCHECK(tab && ([_model indexOfTab:tab] != NSNotFound));
   if (tab == [_model currentTab]) {
@@ -5113,6 +4698,207 @@
   }
 }
 
+- (void)tabModel:(TabModel*)model didStartLoadingTab:(Tab*)tab {
+  if (tab == [_model currentTab]) {
+    if (![self isTabNativePage:tab]) {
+      [_toolbarCoordinator currentPageLoadStarted];
+    }
+    [self updateVoiceSearchBarVisibilityAnimated:NO];
+  }
+}
+
+- (void)tabModel:(TabModel*)model
+    didFinishLoadingTab:(Tab*)tab
+                suceess:(BOOL)success {
+  [self tabLoadComplete:tab withSuccess:success];
+}
+
+- (void)tabModel:(TabModel*)model
+    newTabWillOpen:(Tab*)tab
+      inBackground:(BOOL)background {
+  DCHECK(tab);
+  _temporaryNativeController = nil;
+
+  // When adding new tabs, check what kind of reminder infobar should
+  // be added to the new tab. Try to add only one of them.
+  // This check is done when a new tab is added either through the Tools Menu
+  // "New Tab" or through "New Tab" in Stack View Controller. This method
+  // is called after a new tab has added and finished initial navigation.
+  // If this is added earlier, the initial navigation may end up clearing
+  // the infobar(s) that are just added. See http://crbug/340250 for details.
+  web::WebState* webState = tab.webState;
+  DCHECK(webState);
+
+  infobars::InfoBarManager* infoBarManager =
+      InfoBarManagerImpl::FromWebState(webState);
+  [[UpgradeCenter sharedInstance] addInfoBarToManager:infoBarManager
+                                             forTabId:[tab tabId]];
+  if (!ReSignInInfoBarDelegate::Create(_browserState, tab,
+                                       self /* id<SigninPresenter> */)) {
+    DisplaySyncErrors(_browserState, tab, self /* id<SyncPresenter> */);
+  }
+
+  // The rest of this function initiates the new tab animation, which is
+  // phone-specific.  Call the foreground tab added completion block; for
+  // iPhones, this will get executed after the animation has finished.
+  if (IsIPadIdiom()) {
+    if (self.foregroundTabWasAddedCompletionBlock) {
+      // This callback is called before webState is activated (on
+      // kTabModelNewTabWillOpenNotification notification). Dispatch the
+      // callback asynchronously to be sure the activation is complete.
+      dispatch_async(dispatch_get_main_queue(), ^() {
+        // Test existence again as the block may have been deleted.
+        if (self.foregroundTabWasAddedCompletionBlock) {
+          self.foregroundTabWasAddedCompletionBlock();
+          self.foregroundTabWasAddedCompletionBlock = nil;
+        }
+      });
+    }
+    return;
+  }
+
+  // Do nothing if browsing is currently suspended.  The BVC will set everything
+  // up correctly when browsing resumes.
+  if (!self.visible || ![_model webUsageEnabled])
+    return;
+
+  // Block that starts voice search at the end of new Tab animation if
+  // necessary.
+  ProceduralBlock startVoiceSearchIfNecessaryBlock = ^void() {
+    if (_startVoiceSearchAfterNewTabAnimation) {
+      _startVoiceSearchAfterNewTabAnimation = NO;
+      [self startVoiceSearchWithOriginView:nil];
+    }
+  };
+
+  self.inNewTabAnimation = YES;
+  if (!background) {
+    UIView* animationParentView = _contentArea;
+    // Create the new page image, and load with the new tab snapshot except if
+    // it is the NTP.
+    CGFloat newPageOffset = 0;
+    UIView* newPage;
+    CGFloat offset = 0;
+    if (tab.webState->GetLastCommittedURL() == kChromeUINewTabURL &&
+        !_isOffTheRecord && !IsIPadIdiom()) {
+      offset = 0;
+      animationParentView = self.view;
+      newPage = tab.view;
+      newPage.userInteractionEnabled = NO;
+      // Compute a frame for the new page by removing the status bar height from
+      // the bounds of |self.view|.
+      CGRect viewBounds, remainder;
+      CGRectDivide(self.view.bounds, &remainder, &viewBounds, StatusBarHeight(),
+                   CGRectMinYEdge);
+      newPage.frame = viewBounds;
+    } else {
+      UIImageView* pageScreenshot = [self pageOpenCloseAnimationView];
+      tab.view.frame = _contentArea.bounds;
+      pageScreenshot.image = SnapshotTabHelper::FromWebState(tab.webState)
+                                 ->UpdateSnapshot(/*with_overlays=*/true,
+                                                  /*visible_frame_only=*/true);
+      newPage = pageScreenshot;
+      offset =
+          pageScreenshot.frame.size.height - pageScreenshot.image.size.height;
+    }
+    newPageOffset = newPage.frame.origin.y;
+
+    [animationParentView addSubview:newPage];
+    CGPoint origin = [self lastTapPoint];
+    page_animation_util::AnimateInPaperWithAnimationAndCompletion(
+        newPage, -newPageOffset, offset, origin, _isOffTheRecord, NULL, ^{
+          [tab view].frame = _contentArea.bounds;
+          newPage.userInteractionEnabled = YES;
+          [newPage removeFromSuperview];
+          self.inNewTabAnimation = NO;
+          // Use the model's currentTab here because it is possible that it can
+          // be reset to a new value before the new Tab animation finished (e.g.
+          // if another Tab shows a dialog via |dialogPresenter|). However, that
+          // tab's view hasn't been displayed yet because it was in a new tab
+          // animation.
+          Tab* currentTab = [_model currentTab];
+          if (currentTab) {
+            [self tabSelected:currentTab notifyToolbar:NO];
+          }
+          startVoiceSearchIfNecessaryBlock();
+
+          if (self.foregroundTabWasAddedCompletionBlock) {
+            self.foregroundTabWasAddedCompletionBlock();
+            self.foregroundTabWasAddedCompletionBlock = nil;
+          }
+        });
+  } else {
+    // SnapshotTabHelper::UpdateSnapshot will force a screen redraw, so take the
+    // snapshot before adding the views needed for the background animation.
+    Tab* topTab = [_model currentTab];
+    UIImage* image =
+        SnapshotTabHelper::FromWebState(topTab.webState)
+            ->UpdateSnapshot(/*with_overlays=*/true,
+                             /*visible_frame_only=*/self.isToolbarOnScreen);
+
+    // The size of the |image| above can be wrong if the snapshot fails, grab
+    // the correct size here.
+    CGRect imageFrame = CGRectZero;
+    if (self.isToolbarOnScreen) {
+      imageFrame = UIEdgeInsetsInsetRect(
+          _contentArea.bounds, [self snapshotEdgeInsetsForTab:topTab]);
+    } else {
+      imageFrame = [topTab.webState->GetView() bounds];
+    }
+
+    // Add three layers in order on top of the contentArea for the animation:
+    // 1. The black "background" screen.
+    UIView* background = [[UIView alloc] initWithFrame:[_contentArea bounds]];
+    InstallBackgroundInView(background);
+    [_contentArea addSubview:background];
+
+    // 2. A CardView displaying the data from the current tab.
+    CardView* topCard = [self addCardViewInFullscreen:!self.isToolbarOnScreen];
+    NSString* title = [topTab title];
+    if (![title length])
+      title = [topTab urlDisplayString];
+    [topCard setTitle:title];
+    [topCard setImage:image];
+    [topCard setFavicon:nil];
+
+    favicon::FaviconDriver* faviconDriver =
+        favicon::WebFaviconDriver::FromWebState(topTab.webState);
+    if (faviconDriver && faviconDriver->FaviconIsValid()) {
+      gfx::Image favicon = faviconDriver->GetFavicon();
+      if (!favicon.IsEmpty())
+        [topCard setFavicon:favicon.ToUIImage()];
+    }
+
+    // 3. A new, blank CardView to represent the new tab being added.
+    // Launch the new background tab animation.
+    page_animation_util::AnimateNewBackgroundPageWithCompletion(
+        topCard, [_contentArea frame], imageFrame, IsPortrait(), ^{
+          [background removeFromSuperview];
+          [topCard removeFromSuperview];
+          self.inNewTabAnimation = NO;
+          // Resnapshot the top card if it has its own toolbar, as the toolbar
+          // will be captured in the new tab animation, but isn't desired for
+          // the stack view snapshots.
+          id nativeController = [self nativeControllerForTab:topTab];
+          if ([nativeController conformsToProtocol:@protocol(ToolbarOwner)]) {
+            SnapshotTabHelper::FromWebState(topTab.webState)
+                ->UpdateSnapshot(/*with_overlays=*/true,
+                                 /*visible_frame_only=*/true);
+          }
+          startVoiceSearchIfNecessaryBlock();
+        });
+    // Reset the foreground tab completion block so that it can never be
+    // called more than once regardless of foreground/background tab
+    // appearances.
+    self.foregroundTabWasAddedCompletionBlock = nil;
+  }
+}
+
+- (void)tabModel:(TabModel*)model didDeselectTab:(Tab*)tab {
+  [tab wasHidden];
+  [self dismissPopups];
+}
+
 // Observer method, tab replaced.
 - (void)tabModel:(TabModel*)model
     didReplaceTab:(Tab*)oldTab
@@ -5353,27 +5139,6 @@
   // No-op -- required by BookmarkModelBridgeObserver but not used.
 }
 
-#pragma mark - Alerts
-
-- (void)showErrorAlertWithStringTitle:(NSString*)title
-                              message:(NSString*)message {
-  // Dismiss current alert.
-  [_alertCoordinator stop];
-
-  _alertCoordinator = [_dependencyFactory alertCoordinatorWithTitle:title
-                                                            message:message
-                                                     viewController:self];
-  [_alertCoordinator start];
-}
-
-- (void)showSnackbar:(NSString*)text {
-  MDCSnackbarMessage* message = [MDCSnackbarMessage messageWithText:text];
-  message.accessibilityLabel = text;
-  message.duration = 2.0;
-  message.category = kBrowserViewControllerSnackbarCategory;
-  [self.dispatcher showSnackbarMessage:message];
-}
-
 #pragma mark - NetExportTabHelperDelegate
 
 - (void)netExportTabHelper:(NetExportTabHelper*)tabHelper
@@ -5484,7 +5249,7 @@
       ->UpdateSnapshot(/*with_overlays=*/true, /*visible_frame_only=*/true);
 }
 
-#pragma mark - VoiceSearchPresenter
+#pragma mark - VoiceSearchPresenter (Public)
 
 - (UIView*)voiceSearchButton {
   return _voiceSearchButton;
@@ -5674,7 +5439,7 @@
   }
 }
 
-#pragma mark - SyncPresenter
+#pragma mark - SyncPresenter (Public)
 
 - (void)showReauthenticateSignin {
   [self.dispatcher
diff --git a/ios/chrome/browser/ui/browser_view_controller_unittest.mm b/ios/chrome/browser/ui/browser_view_controller_unittest.mm
index 7783a6d..8a68c500 100644
--- a/ios/chrome/browser/ui/browser_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/browser_view_controller_unittest.mm
@@ -30,6 +30,7 @@
 #import "ios/chrome/browser/snapshots/snapshot_tab_helper.h"
 #import "ios/chrome/browser/tabs/tab.h"
 #import "ios/chrome/browser/tabs/tab_model.h"
+#import "ios/chrome/browser/tabs/tab_model_observer.h"
 #import "ios/chrome/browser/tabs/tab_private.h"
 #import "ios/chrome/browser/ui/activity_services/share_protocol.h"
 #import "ios/chrome/browser/ui/activity_services/share_to_data.h"
@@ -77,7 +78,7 @@
 
 // Private methods in BrowserViewController to test.
 @interface BrowserViewController (
-    Testing)<CRWNativeContentProvider, PassKitDialogProvider>
+    Testing)<CRWNativeContentProvider, PassKitDialogProvider, TabModelObserver>
 - (void)pageLoadStarted:(NSNotification*)notification;
 - (void)pageLoadComplete:(NSNotification*)notification;
 - (void)tabSelected:(Tab*)tab notifyToolbar:(BOOL)notifyToolbar;
@@ -333,32 +334,6 @@
   UIWindow* window_;
 };
 
-// TODO(crbug.com/228714): These tests pretty much only tested that BVC passed
-// notifications on to the toolbar, and that the toolbar worked correctly. The
-// former should be an integration test, and the latter should be a toolbar
-// test.  Leaving DISABLED_ for now to remind us to move them to toolbar tests.
-TEST_F(BrowserViewControllerTest, DISABLED_TestPageLoadStarted) {
-  NSDictionary* userInfoWithThisTab =
-      [NSDictionary dictionaryWithObject:tab_ forKey:kTabModelTabKey];
-  NSNotification* notification = [NSNotification
-      notificationWithName:kTabModelTabWillStartLoadingNotification
-                    object:nil
-                  userInfo:userInfoWithThisTab];
-  [bvc_ pageLoadStarted:notification];
-  EXPECT_TRUE([bvc_ testing_isLoading]);
-}
-
-TEST_F(BrowserViewControllerTest, DISABLED_TestPageLoadComplete) {
-  NSDictionary* userInfoWithThisTab =
-      [NSDictionary dictionaryWithObject:tab_ forKey:kTabModelTabKey];
-  NSNotification* notification = [NSNotification
-      notificationWithName:kTabModelTabDidFinishLoadingNotification
-                    object:nil
-                  userInfo:userInfoWithThisTab];
-  [bvc_ pageLoadComplete:notification];
-  EXPECT_FALSE([bvc_ testing_isLoading]);
-}
-
 TEST_F(BrowserViewControllerTest, TestTabSelected) {
   id tabMock = (id)tab_;
   [[tabMock expect] wasShown];
@@ -382,13 +357,7 @@
 TEST_F(BrowserViewControllerTest, TestTabDeselected) {
   OCMockObject* tabMock = static_cast<OCMockObject*>(tab_);
   [[tabMock expect] wasHidden];
-  NSDictionary* userInfoWithThisTab =
-      [NSDictionary dictionaryWithObject:tab_ forKey:kTabModelTabKey];
-  NSNotification* notification =
-      [NSNotification notificationWithName:kTabModelTabDeselectedNotification
-                                    object:nil
-                                  userInfo:userInfoWithThisTab];
-  [bvc_ tabDeselected:notification];
+  [bvc_ tabModel:nil didDeselectTab:tab_];
   EXPECT_OCMOCK_VERIFY(tabMock);
 }
 
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm
index ea3d283..e65e15ff 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_header_view_controller.mm
@@ -180,10 +180,6 @@
     self.headerView = [[NewTabPageHeaderView alloc] init];
     [self addFakeOmnibox];
 
-    self.logoVendor.view.isAccessibilityElement = YES;
-    self.logoVendor.view.accessibilityLabel =
-        l10n_util::GetNSString(IDS_IOS_NEW_TAB_LOGO_ACCESSIBILITY_LABEL);
-
     [self.headerView addSubview:self.logoVendor.view];
     [self.headerView addSubview:self.fakeOmnibox];
     self.logoVendor.view.translatesAutoresizingMaskIntoConstraints = NO;
diff --git a/ios/chrome/browser/ui/image_util/BUILD.gn b/ios/chrome/browser/ui/image_util/BUILD.gn
new file mode 100644
index 0000000..b1fe214
--- /dev/null
+++ b/ios/chrome/browser/ui/image_util/BUILD.gn
@@ -0,0 +1,24 @@
+# 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.
+
+source_set("image_util") {
+  sources = [
+    "image_saver.h",
+    "image_saver.mm",
+    "image_util.h",
+    "image_util.mm",
+  ]
+  deps = [
+    "//base",
+    "//components/image_fetcher/core",
+    "//components/image_fetcher/ios",
+    "//components/strings",
+    "//ios/chrome/app/strings",
+    "//ios/chrome/browser",
+    "//ios/chrome/browser/ui/alert_coordinator",
+    "//net",
+    "//ui/base",
+  ]
+  configs += [ "//build/config/compiler:enable_arc" ]
+}
diff --git a/ios/chrome/browser/ui/image_util/OWNERS b/ios/chrome/browser/ui/image_util/OWNERS
new file mode 100644
index 0000000..f192143
--- /dev/null
+++ b/ios/chrome/browser/ui/image_util/OWNERS
@@ -0,0 +1,4 @@
+gambard@chromium.org
+
+# TEAM: ios-directory-owners@chromium.org
+# OS: iOS
diff --git a/ios/chrome/browser/ui/image_util/image_saver.h b/ios/chrome/browser/ui/image_util/image_saver.h
new file mode 100644
index 0000000..c9dce93
--- /dev/null
+++ b/ios/chrome/browser/ui/image_util/image_saver.h
@@ -0,0 +1,25 @@
+// 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 IOS_CHROME_BROWSER_UI_IMAGE_UTIL_IMAGE_SAVER_H_
+#define IOS_CHROME_BROWSER_UI_IMAGE_UTIL_IMAGE_SAVER_H_
+
+#import <UIKit/UIKit.h>
+
+#include "components/image_fetcher/core/request_metadata.h"
+
+// Object saving images to the system's album.
+@interface ImageSaver : NSObject
+
+// Init the ImageSaver with a |baseViewController| used to display alerts.
+- (instancetype)initWithBaseViewController:
+    (UIViewController*)baseViewController;
+
+// Saves the image's |data|, with |metadata| to the system's album.
+- (void)saveImageData:(NSData*)data
+         withMetadata:(const image_fetcher::RequestMetadata&)metadata;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_IMAGE_UTIL_IMAGE_SAVER_H_
diff --git a/ios/chrome/browser/ui/image_util/image_saver.mm b/ios/chrome/browser/ui/image_util/image_saver.mm
new file mode 100644
index 0000000..237ce01d
--- /dev/null
+++ b/ios/chrome/browser/ui/image_util/image_saver.mm
@@ -0,0 +1,256 @@
+// 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.
+
+#import "ios/chrome/browser/ui/image_util/image_saver.h"
+
+#import <Photos/Photos.h>
+
+#include "base/files/file_path.h"
+#include "base/format_macros.h"
+#include "base/mac/bind_objc_block.h"
+#include "base/strings/sys_string_conversions.h"
+#include "base/task_scheduler/post_task.h"
+#include "base/threading/thread_restrictions.h"
+#include "components/image_fetcher/ios/ios_image_data_fetcher_wrapper.h"
+#include "components/strings/grit/components_strings.h"
+#import "ios/chrome/browser/open_url_util.h"
+#import "ios/chrome/browser/ui/alert_coordinator/alert_coordinator.h"
+#include "ios/chrome/grit/ios_chromium_strings.h"
+#include "ios/chrome/grit/ios_strings.h"
+#include "net/base/mime_util.h"
+#include "ui/base/l10n/l10n_util.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+@interface ImageSaver ()
+// Base view controller for the alerts.
+@property(nonatomic, weak) UIViewController* baseViewController;
+// Alert coordinator to give feedback to the user.
+@property(nonatomic, strong) AlertCoordinator* alertCoordinator;
+@end
+
+@implementation ImageSaver
+
+@synthesize alertCoordinator = _alertCoordinator;
+@synthesize baseViewController = _baseViewController;
+
+- (instancetype)initWithBaseViewController:
+    (UIViewController*)baseViewController {
+  self = [super init];
+  if (self) {
+    _baseViewController = baseViewController;
+  }
+  return self;
+}
+
+- (void)saveImageData:(NSData*)data
+         withMetadata:(const image_fetcher::RequestMetadata&)metadata {
+  DCHECK(data);
+
+  if ([data length] == 0) {
+    [self
+        displayPrivacyErrorAlertOnMainQueue:
+            l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_NO_INTERNET_CONNECTION)];
+    return;
+  }
+
+  base::FilePath::StringType extension;
+
+  bool extensionSuccess =
+      net::GetPreferredExtensionForMimeType(metadata.mime_type, &extension);
+  if (!extensionSuccess || extension.length() == 0) {
+    extension = "png";
+  }
+
+  NSString* fileExtension =
+      [@"." stringByAppendingString:base::SysUTF8ToNSString(extension)];
+  [self managePermissionAndSaveImage:data withFileExtension:fileExtension];
+}
+
+// Saves the image or display error message, based on privacy settings.
+- (void)managePermissionAndSaveImage:(NSData*)data
+                   withFileExtension:(NSString*)fileExtension {
+  switch ([PHPhotoLibrary authorizationStatus]) {
+    // User was never asked for permission to access photos.
+    case PHAuthorizationStatusNotDetermined: {
+      [PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
+        // Call -saveImage again to check if chrome needs to display an error or
+        // saves the image.
+        if (status != PHAuthorizationStatusNotDetermined)
+          [self managePermissionAndSaveImage:data
+                           withFileExtension:fileExtension];
+      }];
+      break;
+    }
+
+    // The application doesn't have permission to access photo and the user
+    // cannot grant it.
+    case PHAuthorizationStatusRestricted:
+      [self displayPrivacyErrorAlertOnMainQueue:
+                l10n_util::GetNSString(
+                    IDS_IOS_SAVE_IMAGE_RESTRICTED_PRIVACY_ALERT_MESSAGE)];
+      break;
+
+    // The application doesn't have permission to access photo and the user
+    // can grant it.
+    case PHAuthorizationStatusDenied:
+      [self displayImageErrorAlertWithSettingsOnMainQueue];
+      break;
+
+    // The application has permission to access the photos.
+    default:
+      __weak ImageSaver* weakSelf = self;
+      [self saveImage:data
+          withFileExtension:fileExtension
+                 completion:^(BOOL success, NSError* error) {
+                   [weakSelf finishSavingImageWithError:error];
+                 }];
+      break;
+  }
+}
+
+// Saves the image. In order to keep the metadata of the image, the image is
+// saved as a temporary file on disk then saved in photos. Saving will happen
+// on a background sequence and the completion block will be invoked on that
+// sequence.
+- (void)saveImage:(NSData*)data
+    withFileExtension:(NSString*)fileExtension
+           completion:(void (^)(BOOL, NSError*))completion {
+  base::PostTaskWithTraits(
+      FROM_HERE,
+      {base::MayBlock(), base::TaskPriority::BACKGROUND,
+       base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
+      base::BindBlockArc(^{
+        base::AssertBlockingAllowed();
+
+        NSString* fileName = [[[NSProcessInfo processInfo] globallyUniqueString]
+            stringByAppendingString:fileExtension];
+        NSURL* fileURL = [NSURL
+            fileURLWithPath:[NSTemporaryDirectory()
+                                stringByAppendingPathComponent:fileName]];
+        NSError* error = nil;
+        [data writeToURL:fileURL options:NSDataWritingAtomic error:&error];
+        if (error) {
+          if (completion)
+            completion(NO, error);
+          return;
+        }
+
+        [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
+          [PHAssetChangeRequest
+              creationRequestForAssetFromImageAtFileURL:fileURL];
+        }
+            completionHandler:^(BOOL success, NSError* error) {
+              base::PostTaskWithTraits(
+                  FROM_HERE,
+                  {base::MayBlock(), base::TaskPriority::BACKGROUND,
+                   base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
+                  base::BindBlockArc(^{
+                    base::AssertBlockingAllowed();
+                    if (completion)
+                      completion(success, error);
+
+                    // Cleanup the temporary file.
+                    NSError* deleteFileError = nil;
+                    [[NSFileManager defaultManager]
+                        removeItemAtURL:fileURL
+                                  error:&deleteFileError];
+                  }));
+            }];
+      }));
+}
+
+// Called when Chrome has been denied access to the photos or videos and the
+// user can change it.
+// Shows a privacy alert on the main queue, allowing the user to go to Chrome's
+// settings. Dismiss previous alert if it has not been dismissed yet.
+- (void)displayImageErrorAlertWithSettingsOnMainQueue {
+  NSURL* settingURL = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
+  BOOL canGoToSetting =
+      [[UIApplication sharedApplication] canOpenURL:settingURL];
+  if (canGoToSetting) {
+    dispatch_async(dispatch_get_main_queue(), ^{
+      [self displayImageErrorAlertWithSettings:settingURL];
+    });
+  } else {
+    [self displayPrivacyErrorAlertOnMainQueue:
+              l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_MESSAGE)];
+  }
+}
+
+// Shows a privacy alert allowing the user to go to Chrome's settings. Dismiss
+// previous alert if it has not been dismissed yet.
+- (void)displayImageErrorAlertWithSettings:(NSURL*)settingURL {
+  // Dismiss current alert.
+  [_alertCoordinator stop];
+
+  NSString* title =
+      l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_TITLE);
+  NSString* message = l10n_util::GetNSString(
+      IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_MESSAGE_GO_TO_SETTINGS);
+
+  self.alertCoordinator = [[AlertCoordinator alloc]
+      initWithBaseViewController:self.baseViewController
+                           title:title
+                         message:message];
+
+  [self.alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_CANCEL)
+                                   action:nil
+                                    style:UIAlertActionStyleCancel];
+
+  [_alertCoordinator
+      addItemWithTitle:l10n_util::GetNSString(
+                           IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_GO_TO_SETTINGS)
+                action:^{
+                  OpenUrlWithCompletionHandler(settingURL, nil);
+                }
+                 style:UIAlertActionStyleDefault];
+
+  [_alertCoordinator start];
+}
+
+// Called when Chrome has been denied access to the photos or videos and the
+// user cannot change it.
+// Shows a privacy alert on the main queue, with errorContent as the message.
+// Dismisses previous alert if it has not been dismissed yet.
+- (void)displayPrivacyErrorAlertOnMainQueue:(NSString*)errorContent {
+  dispatch_async(dispatch_get_main_queue(), ^{
+    NSString* title =
+        l10n_util::GetNSString(IDS_IOS_SAVE_IMAGE_PRIVACY_ALERT_TITLE);
+    // Dismiss current alert.
+    [self.alertCoordinator stop];
+
+    self.alertCoordinator = [[AlertCoordinator alloc]
+        initWithBaseViewController:self.baseViewController
+                             title:title
+                           message:errorContent];
+    [self.alertCoordinator addItemWithTitle:l10n_util::GetNSString(IDS_OK)
+                                     action:nil
+                                      style:UIAlertActionStyleDefault];
+    [self.alertCoordinator start];
+  });
+}
+
+// This callback is triggered when the image is effectively saved onto the photo
+// album, or if the save failed for some reason.
+- (void)finishSavingImageWithError:(NSError*)error {
+  // Was there an error?
+  if (error) {
+    // Saving photo failed even though user has granted access to Photos.
+    // Display the error information from the NSError object for user.
+    NSString* errorMessage = [NSString
+        stringWithFormat:@"%@ (%@ %" PRIdNS ")", [error localizedDescription],
+                         [error domain], [error code]];
+    // This code may be execute outside of the main thread. Make sure to display
+    // the error on the main thread.
+    [self displayPrivacyErrorAlertOnMainQueue:errorMessage];
+  } else {
+    // TODO(crbug.com/797277): Provide a way for the user to easily reach the
+    // photos app.
+  }
+}
+
+@end
diff --git a/ios/chrome/browser/ui/image_util.h b/ios/chrome/browser/ui/image_util/image_util.h
similarity index 85%
rename from ios/chrome/browser/ui/image_util.h
rename to ios/chrome/browser/ui/image_util/image_util.h
index bb95367..2dee4bc 100644
--- a/ios/chrome/browser/ui/image_util.h
+++ b/ios/chrome/browser/ui/image_util/image_util.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_
-#define IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_
+#ifndef IOS_CHROME_BROWSER_UI_IMAGE_UTIL_IMAGE_UTIL_H_
+#define IOS_CHROME_BROWSER_UI_IMAGE_UTIL_IMAGE_UTIL_H_
 
 #import <CoreGraphics/CoreGraphics.h>
 #import <Foundation/Foundation.h>
@@ -31,4 +31,4 @@
                                NSInteger left_cap_width,
                                NSInteger top_cap_height);
 
-#endif  // IOS_CHROME_BROWSER_UI_IMAGE_UTIL_H_
+#endif  // IOS_CHROME_BROWSER_UI_IMAGE_UTIL_IMAGE_UTIL_H_
diff --git a/ios/chrome/browser/ui/image_util.mm b/ios/chrome/browser/ui/image_util/image_util.mm
similarity index 86%
rename from ios/chrome/browser/ui/image_util.mm
rename to ios/chrome/browser/ui/image_util/image_util.mm
index 08c8c124..8e2f0bd 100644
--- a/ios/chrome/browser/ui/image_util.mm
+++ b/ios/chrome/browser/ui/image_util/image_util.mm
@@ -4,7 +4,7 @@
 
 #import <UIKit/UIKit.h>
 
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 
 #include "ui/gfx/color_analysis.h"
 #include "ui/gfx/image/image.h"
@@ -25,10 +25,9 @@
 UIImage* StretchableImageFromUIImage(UIImage* image,
                                      NSInteger left_cap_width,
                                      NSInteger top_cap_height) {
-  UIEdgeInsets insets =
-      UIEdgeInsetsMake(top_cap_height, left_cap_width,
-                       image.size.height - top_cap_height + 1.0,
-                       image.size.width - left_cap_width + 1.0);
+  UIEdgeInsets insets = UIEdgeInsetsMake(
+      top_cap_height, left_cap_width, image.size.height - top_cap_height + 1.0,
+      image.size.width - left_cap_width + 1.0);
   return [image resizableImageWithCapInsets:insets];
 }
 
diff --git a/ios/chrome/browser/ui/ntp/BUILD.gn b/ios/chrome/browser/ui/ntp/BUILD.gn
index d111720..fff67a8 100644
--- a/ios/chrome/browser/ui/ntp/BUILD.gn
+++ b/ios/chrome/browser/ui/ntp/BUILD.gn
@@ -32,6 +32,7 @@
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/content_suggestions:content_suggestions_ui_util",
     "//ios/chrome/browser/ui/favicon:favicon_ui",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/toolbar",
     "//ios/chrome/browser/ui/toolbar:resource_macros",
     "//ios/chrome/browser/ui/toolbar:toolbar_ui",
diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
index 993db07..b70636b 100644
--- a/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
+++ b/ios/chrome/browser/ui/ntp/new_tab_page_header_view.mm
@@ -8,7 +8,7 @@
 #import "ios/chrome/browser/tabs/tab_model.h"
 #import "ios/chrome/browser/tabs/tab_model_observer.h"
 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_collection_utils.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h"
 #import "ios/chrome/browser/ui/ntp/new_tab_page_toolbar_controller.h"
 #import "ios/chrome/browser/ui/toolbar/public/toolbar_utils.h"
diff --git a/ios/chrome/browser/ui/stack_view/BUILD.gn b/ios/chrome/browser/ui/stack_view/BUILD.gn
index a86115b..86fa501 100644
--- a/ios/chrome/browser/ui/stack_view/BUILD.gn
+++ b/ios/chrome/browser/ui/stack_view/BUILD.gn
@@ -52,6 +52,7 @@
     "//ios/chrome/browser/tabs",
     "//ios/chrome/browser/ui",
     "//ios/chrome/browser/ui/commands",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/keyboard",
     "//ios/chrome/browser/ui/main:feature_flags",
     "//ios/chrome/browser/ui/ntp",
diff --git a/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm b/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm
index 2be9abf..cf91e5a 100644
--- a/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm
+++ b/ios/chrome/browser/ui/stack_view/stack_view_toolbar_controller.mm
@@ -10,7 +10,7 @@
 #import "ios/chrome/browser/ui/commands/application_commands.h"
 #import "ios/chrome/browser/ui/commands/browser_commands.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/rtl_geometry.h"
 #import "ios/chrome/browser/ui/toolbar/new_tab_button.h"
 #import "ios/chrome/browser/ui/toolbar/public/toolbar_controller_constants.h"
diff --git a/ios/chrome/browser/ui/tab_switcher/BUILD.gn b/ios/chrome/browser/ui/tab_switcher/BUILD.gn
index b50cfdf..d9c09de 100644
--- a/ios/chrome/browser/ui/tab_switcher/BUILD.gn
+++ b/ios/chrome/browser/ui/tab_switcher/BUILD.gn
@@ -80,6 +80,7 @@
     "//ios/chrome/browser/ui/authentication:authentication_ui",
     "//ios/chrome/browser/ui/colors",
     "//ios/chrome/browser/ui/commands",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/keyboard",
     "//ios/chrome/browser/ui/material_components",
     "//ios/chrome/browser/ui/ntp/recent_tabs/views",
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
index a57a729..7ea8b81b 100644
--- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
+++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_cell.mm
@@ -7,7 +7,7 @@
 #include "components/favicon/ios/web_favicon_driver.h"
 #import "ios/chrome/browser/tabs/tab.h"
 #import "ios/chrome/browser/ui/fade_truncated_label.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_button.h"
 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_cache.h"
 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.h"
diff --git a/ios/chrome/browser/ui/tabs/BUILD.gn b/ios/chrome/browser/ui/tabs/BUILD.gn
index 9966d30..a72194d 100644
--- a/ios/chrome/browser/ui/tabs/BUILD.gn
+++ b/ios/chrome/browser/ui/tabs/BUILD.gn
@@ -49,6 +49,7 @@
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/fullscreen",
     "//ios/chrome/browser/ui/fullscreen:new_fullscreen",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/tabs/requirements",
     "//ios/chrome/browser/ui/util",
     "//ios/third_party/material_components_ios",
diff --git a/ios/chrome/browser/ui/tabs/tab_view.mm b/ios/chrome/browser/ui/tabs/tab_view.mm
index afb41c0..bcce226 100644
--- a/ios/chrome/browser/ui/tabs/tab_view.mm
+++ b/ios/chrome/browser/ui/tabs/tab_view.mm
@@ -16,7 +16,7 @@
 #include "ios/chrome/browser/experimental_flags.h"
 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
 #import "ios/chrome/browser/ui/commands/generic_chrome_command.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #include "ios/chrome/browser/ui/rtl_geometry.h"
 #include "ios/chrome/browser/ui/ui_util.h"
 #import "ios/chrome/browser/ui/util/constraints_ui_util.h"
diff --git a/ios/chrome/browser/ui/toolbar/BUILD.gn b/ios/chrome/browser/ui/toolbar/BUILD.gn
index 7d540e70..262ebfa 100644
--- a/ios/chrome/browser/ui/toolbar/BUILD.gn
+++ b/ios/chrome/browser/ui/toolbar/BUILD.gn
@@ -76,6 +76,7 @@
     "//ios/chrome/browser/ui/fullscreen:new_fullscreen_ui",
     "//ios/chrome/browser/ui/history",
     "//ios/chrome/browser/ui/history_popup/requirements",
+    "//ios/chrome/browser/ui/image_util",
     "//ios/chrome/browser/ui/keyboard",
     "//ios/chrome/browser/ui/location_bar",
     "//ios/chrome/browser/ui/ntp",
diff --git a/ios/chrome/browser/ui/toolbar/clean/BUILD.gn b/ios/chrome/browser/ui/toolbar/clean/BUILD.gn
index 99d8f1a..0e1bbe8 100644
--- a/ios/chrome/browser/ui/toolbar/clean/BUILD.gn
+++ b/ios/chrome/browser/ui/toolbar/clean/BUILD.gn
@@ -110,6 +110,7 @@
     "//ios/chrome/app/strings",
     "//ios/chrome/app/theme",
     "//ios/chrome/browser/ui",
+    "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/toolbar:resource_macros",
     "//ios/chrome/browser/ui/toolbar/public",
     "//ios/public/provider/chrome/browser",
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h
index def8359..9aa3fbe2 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h
@@ -9,12 +9,15 @@
 
 #import "ios/chrome/browser/ui/toolbar/clean/toolbar_style.h"
 
+@protocol ApplicationCommands;
+@protocol BrowserCommands;
 @class ToolbarButton;
 @class ToolbarToolsMenuButton;
 @class ToolbarConfiguration;
 
 // ToolbarButton Factory protocol to create ToolbarButton objects with certain
 // style and configuration, depending of the implementation.
+// A dispatcher is used to send the commands associated with the buttons.
 @interface ToolbarButtonFactory : NSObject
 
 - (instancetype)initWithStyle:(ToolbarStyle)style NS_DESIGNATED_INITIALIZER;
@@ -25,29 +28,31 @@
 // of the buttons title.
 @property(nonatomic, strong, readonly)
     ToolbarConfiguration* toolbarConfiguration;
+// Dispatcher used to initialize targets for the buttons.
+@property(nonatomic, weak) id<ApplicationCommands, BrowserCommands> dispatcher;
 
 // Back ToolbarButton.
-- (ToolbarButton*)backToolbarButton;
+- (ToolbarButton*)backButton;
 // Forward ToolbarButton.
-- (ToolbarButton*)forwardToolbarButton;
+- (ToolbarButton*)forwardButton;
 // Tab Switcher Strip ToolbarButton.
-- (ToolbarButton*)tabSwitcherStripToolbarButton;
+- (ToolbarButton*)tabSwitcherStripButton;
 // Tab Switcher Grid ToolbarButton.
-- (ToolbarButton*)tabSwitcherGridToolbarButton;
+- (ToolbarButton*)tabSwitcherGridButton;
 // Tools Menu ToolbarButton.
-- (ToolbarToolsMenuButton*)toolsMenuToolbarButton;
+- (ToolbarToolsMenuButton*)toolsMenuButton;
 // Share ToolbarButton.
-- (ToolbarButton*)shareToolbarButton;
+- (ToolbarButton*)shareButton;
 // Reload ToolbarButton.
-- (ToolbarButton*)reloadToolbarButton;
+- (ToolbarButton*)reloadButton;
 // Stop ToolbarButton.
-- (ToolbarButton*)stopToolbarButton;
+- (ToolbarButton*)stopButton;
 // Bookmark ToolbarButton.
-- (ToolbarButton*)bookmarkToolbarButton;
+- (ToolbarButton*)bookmarkButton;
 // VoiceSearch ToolbarButton.
 - (ToolbarButton*)voiceSearchButton;
 // ContractToolbar ToolbarButton.
-- (ToolbarButton*)contractToolbarButton;
+- (ToolbarButton*)contractButton;
 // LocationBar LeadingButton. Currently used for the incognito icon when the
 // Toolbar is expanded on incognito mode. It can return nil.
 - (ToolbarButton*)locationBarLeadingButton;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm
index 86085587..defa133 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.mm
@@ -5,6 +5,8 @@
 #import "ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h"
 
 #include "components/strings/grit/components_strings.h"
+#import "ios/chrome/browser/ui/commands/application_commands.h"
+#import "ios/chrome/browser/ui/commands/browser_commands.h"
 #import "ios/chrome/browser/ui/rtl_geometry.h"
 #import "ios/chrome/browser/ui/toolbar/clean/toolbar_button.h"
 #import "ios/chrome/browser/ui/toolbar/clean/toolbar_configuration.h"
@@ -39,6 +41,7 @@
 
 @synthesize toolbarConfiguration = _toolbarConfiguration;
 @synthesize style = _style;
+@synthesize dispatcher = _dispatcher;
 
 - (instancetype)initWithStyle:(ToolbarStyle)style {
   self = [super init];
@@ -51,7 +54,7 @@
 
 #pragma mark - Buttons
 
-- (ToolbarButton*)backToolbarButton {
+- (ToolbarButton*)backButton {
   int backButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_THREE_STATE(BACK);
   ToolbarButton* backButton = [ToolbarButton
@@ -68,10 +71,18 @@
                                                                [DISABLED],
                                                YES)];
   backButton.accessibilityLabel = l10n_util::GetNSString(IDS_ACCNAME_BACK);
+  [self configureButton:backButton width:kToolbarButtonWidth];
+  if (!IsIPadIdiom()) {
+    backButton.imageEdgeInsets =
+        UIEdgeInsetsMakeDirected(0, 0, 0, kBackButtonImageInset);
+  }
+  [backButton addTarget:self.dispatcher
+                 action:@selector(goBack)
+       forControlEvents:UIControlEventTouchUpInside];
   return backButton;
 }
 
-- (ToolbarButton*)forwardToolbarButton {
+- (ToolbarButton*)forwardButton {
   int forwardButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_THREE_STATE(FORWARD);
   ToolbarButton* forwardButton = [ToolbarButton
@@ -89,10 +100,18 @@
                                                YES)];
   forwardButton.accessibilityLabel =
       l10n_util::GetNSString(IDS_ACCNAME_FORWARD);
+  if (!IsIPadIdiom()) {
+    forwardButton.imageEdgeInsets =
+        UIEdgeInsetsMakeDirected(0, kForwardButtonImageInset, 0, 0);
+  }
+  [self configureButton:forwardButton width:kToolbarButtonWidth];
+  [forwardButton addTarget:self.dispatcher
+                    action:@selector(goForward)
+          forControlEvents:UIControlEventTouchUpInside];
   return forwardButton;
 }
 
-- (ToolbarButton*)tabSwitcherStripToolbarButton {
+- (ToolbarButton*)tabSwitcherStripButton {
   int tabSwitcherButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_THREE_STATE(OVERVIEW);
   ToolbarButton* tabSwitcherStripButton = [ToolbarButton
@@ -112,10 +131,15 @@
   [tabSwitcherStripButton
       setTitleColor:[self.toolbarConfiguration buttonTitleHighlightedColor]
            forState:UIControlStateHighlighted];
+  [self configureButton:tabSwitcherStripButton width:kToolbarButtonWidth];
+  [tabSwitcherStripButton addTarget:self.dispatcher
+                             action:@selector(displayTabSwitcher)
+                   forControlEvents:UIControlEventTouchUpInside];
+
   return tabSwitcherStripButton;
 }
 
-- (ToolbarButton*)tabSwitcherGridToolbarButton {
+- (ToolbarButton*)tabSwitcherGridButton {
   ToolbarButton* tabSwitcherGridButton =
       [ToolbarButton toolbarButtonWithImageForNormalState:
                          [UIImage imageNamed:@"tabswitcher_tab_switcher_button"]
@@ -126,7 +150,7 @@
   return tabSwitcherGridButton;
 }
 
-- (ToolbarToolsMenuButton*)toolsMenuToolbarButton {
+- (ToolbarToolsMenuButton*)toolsMenuButton {
   ToolbarControllerStyle style = self.style == NORMAL
                                      ? ToolbarControllerStyleLightMode
                                      : ToolbarControllerStyleIncognitoMode;
@@ -135,10 +159,14 @@
 
   SetA11yLabelAndUiAutomationName(toolsMenuButton, IDS_IOS_TOOLBAR_SETTINGS,
                                   kToolbarToolsMenuButtonIdentifier);
+  [self configureButton:toolsMenuButton width:kToolsMenuButtonWidth];
+  [toolsMenuButton addTarget:self.dispatcher
+                      action:@selector(showToolsMenu)
+            forControlEvents:UIControlEventTouchUpInside];
   return toolsMenuButton;
 }
 
-- (ToolbarButton*)shareToolbarButton {
+- (ToolbarButton*)shareButton {
   int shareButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_THREE_STATE(SHARE);
   ToolbarButton* shareButton = [ToolbarButton
@@ -153,10 +181,15 @@
                                                                 [DISABLED])];
   SetA11yLabelAndUiAutomationName(shareButton, IDS_IOS_TOOLS_MENU_SHARE,
                                   kToolbarShareButtonIdentifier);
+  [self configureButton:shareButton width:kToolbarButtonWidth];
+  shareButton.titleLabel.text = @"Share";
+  [shareButton addTarget:self.dispatcher
+                  action:@selector(sharePage)
+        forControlEvents:UIControlEventTouchUpInside];
   return shareButton;
 }
 
-- (ToolbarButton*)reloadToolbarButton {
+- (ToolbarButton*)reloadButton {
   int reloadButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_THREE_STATE(RELOAD);
   ToolbarButton* reloadButton = [ToolbarButton
@@ -174,10 +207,14 @@
                                                YES)];
   reloadButton.accessibilityLabel =
       l10n_util::GetNSString(IDS_IOS_ACCNAME_RELOAD);
+  [self configureButton:reloadButton width:kToolbarButtonWidth];
+  [reloadButton addTarget:self.dispatcher
+                   action:@selector(reload)
+         forControlEvents:UIControlEventTouchUpInside];
   return reloadButton;
 }
 
-- (ToolbarButton*)stopToolbarButton {
+- (ToolbarButton*)stopButton {
   int stopButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_THREE_STATE(STOP);
   ToolbarButton* stopButton = [ToolbarButton
@@ -191,10 +228,14 @@
                                                stopButtonImages[self.style]
                                                                [DISABLED])];
   stopButton.accessibilityLabel = l10n_util::GetNSString(IDS_IOS_ACCNAME_STOP);
+  [self configureButton:stopButton width:kToolbarButtonWidth];
+  [stopButton addTarget:self.dispatcher
+                 action:@selector(stopLoading)
+       forControlEvents:UIControlEventTouchUpInside];
   return stopButton;
 }
 
-- (ToolbarButton*)bookmarkToolbarButton {
+- (ToolbarButton*)bookmarkButton {
   int bookmarkButtonImages[styleCount][TOOLBAR_STATE_COUNT] =
       TOOLBAR_IDR_TWO_STATE(STAR);
   ToolbarButton* bookmarkButton = [ToolbarButton
@@ -210,6 +251,11 @@
       setImage:NativeImage(bookmarkButtonImages[self.style][PRESSED])
       forState:UIControlStateSelected];
   bookmarkButton.accessibilityLabel = l10n_util::GetNSString(IDS_TOOLTIP_STAR);
+  [self configureButton:bookmarkButton width:kToolbarButtonWidth];
+  [bookmarkButton addTarget:self.dispatcher
+                     action:@selector(bookmarkPage)
+           forControlEvents:UIControlEventTouchUpInside];
+
   return bookmarkButton;
 }
 
@@ -221,20 +267,29 @@
                                     imageForDisabledState:nil];
   voiceSearchButton.accessibilityLabel =
       l10n_util::GetNSString(IDS_IOS_ACCNAME_VOICE_SEARCH);
+  [self configureButton:voiceSearchButton width:kToolbarButtonWidth];
+  voiceSearchButton.enabled = NO;
   return voiceSearchButton;
 }
 
-- (ToolbarButton*)contractToolbarButton {
+- (ToolbarButton*)contractButton {
   NSString* collapseName = _style ? @"collapse_incognito" : @"collapse";
   NSString* collapsePressedName =
       _style ? @"collapse_pressed_incognito" : @"collapse_pressed";
-  ToolbarButton* contractToolbarButton = [ToolbarButton
+  ToolbarButton* contractButton = [ToolbarButton
       toolbarButtonWithImageForNormalState:[UIImage imageNamed:collapseName]
                   imageForHighlightedState:[UIImage
                                                imageNamed:collapsePressedName]
                      imageForDisabledState:nil];
-  contractToolbarButton.accessibilityLabel = l10n_util::GetNSString(IDS_CANCEL);
-  return contractToolbarButton;
+  contractButton.accessibilityLabel = l10n_util::GetNSString(IDS_CANCEL);
+  contractButton.alpha = 0;
+  contractButton.hidden = YES;
+  [self configureButton:contractButton width:kToolbarButtonWidth];
+  [contractButton addTarget:self.dispatcher
+                     action:@selector(contractToolbar)
+           forControlEvents:UIControlEventTouchUpInside];
+
+  return contractButton;
 }
 
 - (ToolbarButton*)locationBarLeadingButton {
@@ -247,12 +302,29 @@
                        imageForDisabledState:
                            [UIImage imageNamed:@"incognito_marker_typing"]];
     locationBarLeadingButton.enabled = NO;
+    [self configureButton:locationBarLeadingButton
+                    width:kLeadingLocationBarButtonWidth];
+    locationBarLeadingButton.imageEdgeInsets =
+        UIEdgeInsetsMakeDirected(0, kLeadingLocationBarButtonImageInset, 0, 0);
   }
+
   return locationBarLeadingButton;
 }
 
 #pragma mark - Helpers
 
+// Sets the |button| width to |width| with a priority of
+// UILayoutPriorityRequired - 1. If the priority is |UILayoutPriorityRequired|,
+// there is a conflict when the buttons are hidden as the stack view is setting
+// their width to 0. Setting the priority to UILayoutPriorityDefaultHigh doesn't
+// work as they would have a lower priority than other elements.
+- (void)configureButton:(UIView*)button width:(CGFloat)width {
+  NSLayoutConstraint* constraint =
+      [button.widthAnchor constraintEqualToConstant:width];
+  constraint.priority = UILayoutPriorityRequired - 1;
+  constraint.active = YES;
+}
+
 - (NSArray<UIImage*>*)voiceSearchImages {
   // The voice search images can be overridden by the branded image provider.
   int imageID;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm
index 0a88910..3c85536 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_coordinator.mm
@@ -146,6 +146,7 @@
   ToolbarStyle style = isIncognito ? INCOGNITO : NORMAL;
   ToolbarButtonFactory* factory =
       [[ToolbarButtonFactory alloc] initWithStyle:style];
+  factory.dispatcher = self.dispatcher;
 
   self.buttonUpdater = [[ToolbarButtonUpdater alloc] init];
   self.buttonUpdater.factory = factory;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_view.h
index bc6464e..92a671a0 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view.h
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view.h
@@ -7,6 +7,11 @@
 
 #import <UIKit/UIKit.h>
 
+@class MDCProgressView;
+@class ToolbarButton;
+@class ToolbarButtonFactory;
+@class ToolbarToolsMenuButton;
+
 // TODO(crbug.com/792440): Once the new notification for fullscreen is
 // completed, this protocol can be removed. Protocol handling the fullscreen for
 // the Toolbar.
@@ -18,9 +23,95 @@
 // The view displaying the toolbar.
 @interface ToolbarView : UIView
 
+// Top anchor at the bottom of the safeAreaLayoutGuide. Used so views don't
+// overlap with the Status Bar.
+@property(nonatomic, strong) NSLayoutYAxisAnchor* topSafeAnchor;
+
 // The delegate used to handle frame changes.
 @property(nonatomic, weak) id<ToolbarViewFullscreenDelegate> delegate;
 
+// Factory used to create the buttons.
+@property(nonatomic, strong) ToolbarButtonFactory* buttonFactory;
+
+// Margin between the leading edge of the view and the leading stack view.
+@property(nonatomic, assign) CGFloat leadingMargin;
+
+// The location bar view, containing the omnibox.
+@property(nonatomic, strong) UIView* locationBarView;
+
+// The main objects in the view. Positionned as
+// [leadingStackView][locationBarContainer][trailingStackView]. The stack views
+// contain the buttons which should be shown on each sides of the location bar.
+@property(nonatomic, strong, readonly) UIStackView* leadingStackView;
+@property(nonatomic, strong, readonly) UIView* locationBarContainer;
+@property(nonatomic, strong, readonly) UIStackView* trailingStackView;
+
+// Buttons contained in the main stack views.
+@property(nonatomic, strong, readonly) ToolbarToolsMenuButton* toolsMenuButton;
+@property(nonatomic, strong, readonly) ToolbarButton* backButton;
+@property(nonatomic, strong, readonly) ToolbarButton* forwardButton;
+@property(nonatomic, strong, readonly) ToolbarButton* tabSwitchStripButton;
+@property(nonatomic, strong, readonly) ToolbarButton* shareButton;
+@property(nonatomic, strong, readonly) ToolbarButton* reloadButton;
+@property(nonatomic, strong, readonly) ToolbarButton* stopButton;
+
+// Views contained in the locationBarContainer.
+@property(nonatomic, strong, readonly)
+    UIStackView* locationBarContainerStackView;
+@property(nonatomic, strong, readonly) ToolbarButton* locationBarLeadingButton;
+@property(nonatomic, strong, readonly) ToolbarButton* contractButton;
+@property(nonatomic, strong, readonly) ToolbarButton* voiceSearchButton;
+@property(nonatomic, strong, readonly) ToolbarButton* bookmarkButton;
+
+// The shadow below the toolbar when the omnibox is contracted. Lazily
+// instantiated.
+@property(nonatomic, strong, readonly) UIImageView* shadowView;
+// The shadow below the expanded omnibox. Lazily instantiated.
+@property(nonatomic, strong, readonly) UIImageView* fullBleedShadowView;
+// The shadow below the contracted location bar.
+@property(nonatomic, strong, readonly) UIImageView* locationBarShadow;
+
+// Progress bar displayed below the toolbar.
+@property(nonatomic, strong, readonly) MDCProgressView* progressBar;
+
+// Background view, used to display the incognito NTP background color on the
+// toolbar.
+@property(nonatomic, strong, readonly) UIView* backgroundView;
+
+// Constraints used for the regular/contracted Toolbar state that will be
+// deactivated and replaced by |_expandedToolbarConstraints| when animating the
+// toolbar expansion.
+@property(nonatomic, strong, readonly)
+    NSMutableArray* regularToolbarConstraints;
+// Constraints used to layout the Toolbar to its expanded state. If these are
+// active the locationBarContainer will expand to the size of this VC's view.
+// The locationBarView will only expand up to the VC's view safeAreaLayoutGuide.
+@property(nonatomic, strong, readonly) NSArray* expandedToolbarConstraints;
+
+// These constraints pin the content view to the safe area. They are temporarily
+// disabled when a fake safe area is simulated by calling
+// activateFakeSafeAreaInsets.
+@property(nonatomic, strong, readonly)
+    NSLayoutConstraint* leadingSafeAreaConstraint;
+@property(nonatomic, strong, readonly)
+    NSLayoutConstraint* trailingSafeAreaConstraint;
+// Leading and trailing safe area constraint for faking a safe area. These
+// constraints are activated by calling activateFakeSafeAreaInsets and
+// deactivateFakeSafeAreaInsets.
+@property(nonatomic, strong, readonly)
+    NSLayoutConstraint* leadingFakeSafeAreaConstraint;
+@property(nonatomic, strong, readonly)
+    NSLayoutConstraint* trailingFakeSafeAreaConstraint;
+
+// Array containing all the |_leadingStackView| buttons, lazily instantiated.
+@property(nonatomic, strong, readonly)
+    NSArray<ToolbarButton*>* leadingStackViewButtons;
+// Array containing all the |_trailingStackView| buttons, lazily instantiated.
+@property(nonatomic, strong, readonly)
+    NSArray<ToolbarButton*>* trailingStackViewButtons;
+
+- (void)setUp;
+
 @end
 
 #endif  // IOS_CHROME_BROWSER_UI_TOOLBAR_CLEAN_TOOLBAR_VIEW_H_
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm
index ec8af3f..e4e4754e 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view.mm
@@ -4,17 +4,482 @@
 
 #import "ios/chrome/browser/ui/toolbar/clean/toolbar_view.h"
 
+#import "base/mac/foundation_util.h"
+#import "ios/chrome/browser/ui/toolbar/clean/toolbar_button.h"
+#import "ios/chrome/browser/ui/toolbar/clean/toolbar_button_factory.h"
+#import "ios/chrome/browser/ui/toolbar/clean/toolbar_configuration.h"
+#import "ios/chrome/browser/ui/toolbar/clean/toolbar_constants.h"
+#import "ios/chrome/browser/ui/toolbar/clean/toolbar_tools_menu_button.h"
+#import "ios/chrome/browser/ui/toolbar/public/toolbar_controller_constants.h"
+#import "ios/chrome/browser/ui/toolbar/public/web_toolbar_controller_constants.h"
+#import "ios/chrome/browser/ui/uikit_ui_util.h"
+#import "ios/chrome/browser/ui/util/constraints_ui_util.h"
+#include "ios/chrome/grit/ios_theme_resources.h"
+#import "ios/third_party/material_components_ios/src/components/ProgressView/src/MaterialProgressView.h"
+
 #if !defined(__has_feature) || !__has_feature(objc_arc)
 #error "This file requires ARC support."
 #endif
 
+@interface ToolbarView ()
+// Redefined as readwrite.
+@property(nonatomic, strong, readwrite) UIStackView* leadingStackView;
+@property(nonatomic, strong, readwrite) UIView* locationBarContainer;
+@property(nonatomic, strong, readwrite) UIStackView* trailingStackView;
+@property(nonatomic, strong, readwrite) ToolbarToolsMenuButton* toolsMenuButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* backButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* forwardButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* tabSwitchStripButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* shareButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* reloadButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* stopButton;
+@property(nonatomic, strong, readwrite)
+    UIStackView* locationBarContainerStackView;
+@property(nonatomic, strong, readwrite) ToolbarButton* locationBarLeadingButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* contractButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* voiceSearchButton;
+@property(nonatomic, strong, readwrite) ToolbarButton* bookmarkButton;
+@property(nonatomic, strong, readwrite) UIImageView* shadowView;
+@property(nonatomic, strong, readwrite) UIImageView* fullBleedShadowView;
+@property(nonatomic, strong, readwrite) UIImageView* locationBarShadow;
+@property(nonatomic, strong, readwrite) MDCProgressView* progressBar;
+@property(nonatomic, strong, readwrite) UIView* backgroundView;
+@property(nonatomic, strong, readwrite)
+    NSMutableArray* regularToolbarConstraints;
+@property(nonatomic, strong, readwrite) NSArray* expandedToolbarConstraints;
+@property(nonatomic, strong, readwrite)
+    NSLayoutConstraint* leadingSafeAreaConstraint;
+@property(nonatomic, strong, readwrite)
+    NSLayoutConstraint* trailingSafeAreaConstraint;
+@property(nonatomic, strong, readwrite)
+    NSLayoutConstraint* leadingFakeSafeAreaConstraint;
+@property(nonatomic, strong, readwrite)
+    NSLayoutConstraint* trailingFakeSafeAreaConstraint;
+@property(nonatomic, strong, readwrite)
+    NSArray<ToolbarButton*>* leadingStackViewButtons;
+@property(nonatomic, strong, readwrite)
+    NSArray<ToolbarButton*>* trailingStackViewButtons;
+@end
+
 @implementation ToolbarView
 
 @synthesize delegate = _delegate;
+@synthesize buttonFactory = _buttonFactory;
+@synthesize leadingStackViewButtons = _leadingStackViewButtons;
+@synthesize trailingStackViewButtons = _trailingStackViewButtons;
+@synthesize backgroundView = _backgroundView;
+@synthesize leadingStackView = _leadingStackView;
+@synthesize trailingStackView = _trailingStackView;
+@synthesize locationBarContainer = _locationBarContainer;
+@synthesize backButton = _backButton;
+@synthesize forwardButton = _forwardButton;
+@synthesize tabSwitchStripButton = _tabSwitchStripButton;
+@synthesize toolsMenuButton = _toolsMenuButton;
+@synthesize shareButton = _shareButton;
+@synthesize reloadButton = _reloadButton;
+@synthesize stopButton = _stopButton;
+@synthesize voiceSearchButton = _voiceSearchButton;
+@synthesize bookmarkButton = _bookmarkButton;
+@synthesize contractButton = _contractButton;
+@synthesize locationBarLeadingButton = _locationBarLeadingButton;
+@synthesize progressBar = _progressBar;
+@synthesize locationBarContainerStackView = _locationBarContainerStackView;
+@synthesize shadowView = _shadowView;
+@synthesize fullBleedShadowView = _fullBleedShadowView;
+@synthesize locationBarShadow = _locationBarShadow;
+@synthesize expandedToolbarConstraints = _expandedToolbarConstraints;
+@synthesize regularToolbarConstraints = _regularToolbarConstraints;
+@synthesize leadingFakeSafeAreaConstraint = _leadingFakeSafeAreaConstraint;
+@synthesize trailingFakeSafeAreaConstraint = _trailingFakeSafeAreaConstraint;
+@synthesize leadingSafeAreaConstraint = _leadingSafeAreaConstraint;
+@synthesize trailingSafeAreaConstraint = _trailingSafeAreaConstraint;
+@synthesize topSafeAnchor = _topSafeAnchor;
+@synthesize locationBarView = _locationBarView;
+@synthesize leadingMargin = _leadingMargin;
+
+#pragma mark - UIView
 
 - (void)setFrame:(CGRect)frame {
   [super setFrame:frame];
   [self.delegate toolbarViewFrameChanged];
 }
 
+#pragma mark - Public
+
+- (void)setUp {
+  [self setUpToolbarButtons];
+  [self setUpLocationBarContainer];
+  [self setUpProgressBar];
+  // The view can be obstructed by the background view.
+  self.backgroundColor =
+      [self.buttonFactory.toolbarConfiguration backgroundColor];
+
+  [self setUpToolbarStackView];
+  [self setUpLocationBarContainerView];
+  [self addSubview:self.leadingStackView];
+  [self addSubview:self.trailingStackView];
+  // Since the |_locationBarContainer| will expand and cover the stackViews, its
+  // important to add it after them so the |_locationBarContainer| has a higher
+  // Z order.
+  [self addSubview:self.locationBarContainer];
+  [self addSubview:self.shadowView];
+  [self addSubview:self.fullBleedShadowView];
+  [self addSubview:self.progressBar];
+  [self setConstraints];
+}
+
+- (void)setUpToolbarButtons {
+  self.backButton = [self.buttonFactory backButton];
+  self.forwardButton = [self.buttonFactory forwardButton];
+  self.tabSwitchStripButton = [self.buttonFactory tabSwitcherStripButton];
+  self.toolsMenuButton = [self.buttonFactory toolsMenuButton];
+  self.shareButton = [self.buttonFactory shareButton];
+  self.reloadButton = [self.buttonFactory reloadButton];
+  self.stopButton = [self.buttonFactory stopButton];
+  self.bookmarkButton = [self.buttonFactory bookmarkButton];
+
+  // Voice Search button.
+  self.voiceSearchButton = [self.buttonFactory voiceSearchButton];
+  self.voiceSearchButton.enabled = NO;
+
+  // Contract button.
+  self.contractButton = [self.buttonFactory contractButton];
+
+  self.contractButton.alpha = 0;
+  self.contractButton.hidden = YES;
+
+  // LocationBar LeadingButton.
+  self.locationBarLeadingButton = [self.buttonFactory locationBarLeadingButton];
+  self.locationBarLeadingButton.alpha = 0;
+  self.locationBarLeadingButton.hidden = YES;
+}
+
+#pragma mark - Properties
+
+- (UIView*)locationBarView {
+  if (!_locationBarView) {
+    _locationBarView = [[UIView alloc] initWithFrame:CGRectZero];
+    _locationBarView.translatesAutoresizingMaskIntoConstraints = NO;
+    [_locationBarView
+        setContentHuggingPriority:UILayoutPriorityDefaultLow
+                          forAxis:UILayoutConstraintAxisHorizontal];
+    _locationBarView.clipsToBounds = YES;
+  }
+  return _locationBarView;
+}
+
+- (void)setLocationBarView:(UIView*)view {
+  if (_locationBarView == view) {
+    return;
+  }
+  view.translatesAutoresizingMaskIntoConstraints = NO;
+  [view setContentHuggingPriority:UILayoutPriorityDefaultLow
+                          forAxis:UILayoutConstraintAxisHorizontal];
+  if (self.locationBarContainerStackView) {
+    NSInteger index = 0;
+    for (UIView* arrangedView in self.locationBarContainerStackView
+             .arrangedSubviews) {
+      if (arrangedView == _locationBarView)
+        break;
+      index++;
+    }
+    [self.locationBarContainerStackView removeArrangedSubview:_locationBarView];
+    [self.locationBarContainerStackView insertArrangedSubview:view
+                                                      atIndex:index];
+  }
+  _locationBarView = view;
+}
+
+- (NSArray<ToolbarButton*>*)leadingStackViewButtons {
+  if (!_leadingStackViewButtons) {
+    _leadingStackViewButtons =
+        [self toolbarButtonsInStackView:self.leadingStackView];
+  }
+  return _leadingStackViewButtons;
+}
+
+- (NSArray<ToolbarButton*>*)trailingStackViewButtons {
+  if (!_trailingStackViewButtons) {
+    _trailingStackViewButtons =
+        [self toolbarButtonsInStackView:self.trailingStackView];
+  }
+  return _trailingStackViewButtons;
+}
+
+- (UIView*)backgroundView {
+  if (!_backgroundView) {
+    _backgroundView = [[UIView alloc] initWithFrame:CGRectZero];
+    _backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
+    _backgroundView.backgroundColor =
+        self.buttonFactory.toolbarConfiguration.NTPBackgroundColor;
+    [self insertSubview:_backgroundView atIndex:0];
+    AddSameConstraints(self, _backgroundView);
+  }
+  return _backgroundView;
+}
+
+- (NSMutableArray*)regularToolbarConstraints {
+  if (!_regularToolbarConstraints) {
+    _regularToolbarConstraints = [[NSMutableArray alloc] init];
+  }
+  return _regularToolbarConstraints;
+}
+
+- (NSArray*)expandedToolbarConstraints {
+  if (!_expandedToolbarConstraints) {
+    _expandedToolbarConstraints = @[
+      [self.locationBarContainer.topAnchor
+          constraintEqualToAnchor:self.topAnchor],
+      [self.locationBarContainer.bottomAnchor
+          constraintEqualToAnchor:self.bottomAnchor],
+      [self.locationBarContainer.leadingAnchor
+          constraintEqualToAnchor:self.leadingAnchor],
+      [self.locationBarContainer.trailingAnchor
+          constraintEqualToAnchor:self.trailingAnchor],
+    ];
+  }
+  return _expandedToolbarConstraints;
+}
+
+- (UIImageView*)shadowView {
+  if (!_shadowView) {
+    _shadowView = [[UIImageView alloc] init];
+    _shadowView.translatesAutoresizingMaskIntoConstraints = NO;
+    _shadowView.userInteractionEnabled = NO;
+    _shadowView.image = NativeImage(IDR_IOS_TOOLBAR_SHADOW);
+  }
+  return _shadowView;
+}
+
+- (UIImageView*)fullBleedShadowView {
+  if (!_fullBleedShadowView) {
+    _fullBleedShadowView = [[UIImageView alloc] init];
+    _fullBleedShadowView.translatesAutoresizingMaskIntoConstraints = NO;
+    _fullBleedShadowView.userInteractionEnabled = NO;
+    _fullBleedShadowView.alpha = 0;
+    _fullBleedShadowView.image = NativeImage(IDR_IOS_TOOLBAR_SHADOW_FULL_BLEED);
+  }
+  return _fullBleedShadowView;
+}
+
+#pragma mark - Private
+
+// Sets up the StackView that contains toolbar navigation items.
+- (void)setUpToolbarStackView {
+  self.leadingStackView = [[UIStackView alloc] initWithArrangedSubviews:@[
+    self.backButton, self.forwardButton, self.reloadButton, self.stopButton
+  ]];
+  self.leadingStackView.translatesAutoresizingMaskIntoConstraints = NO;
+  self.leadingStackView.distribution = UIStackViewDistributionFill;
+
+  self.trailingStackView = [[UIStackView alloc] initWithArrangedSubviews:@[
+    self.shareButton, self.tabSwitchStripButton, self.toolsMenuButton
+  ]];
+  self.trailingStackView.translatesAutoresizingMaskIntoConstraints = NO;
+  self.trailingStackView.spacing = kStackViewSpacing;
+  self.trailingStackView.distribution = UIStackViewDistributionFill;
+}
+
+// Sets up the LocationContainerView. Which contains a StackView containing the
+// locationBarView, and other buttons like Voice Search, Bookmarks and Contract
+// Toolbar.
+- (void)setUpLocationBarContainerView {
+  self.locationBarContainerStackView =
+      [[UIStackView alloc] initWithArrangedSubviews:@[ self.locationBarView ]];
+  self.locationBarContainerStackView.translatesAutoresizingMaskIntoConstraints =
+      NO;
+  self.locationBarContainerStackView.spacing = kStackViewSpacing;
+  self.locationBarContainerStackView.distribution = UIStackViewDistributionFill;
+  // Bookmarks and Voice Search buttons will only be part of the Toolbar on
+  // iPad. On the other hand the contract button is only needed on non iPad
+  // devices, since iPad doesn't animate, thus it doesn't need to contract.
+  if (IsIPadIdiom()) {
+    [self.locationBarContainerStackView addArrangedSubview:self.bookmarkButton];
+    [self.locationBarContainerStackView
+        addArrangedSubview:self.voiceSearchButton];
+  } else {
+    [self.locationBarContainerStackView addArrangedSubview:self.contractButton];
+  }
+  // If |self.locationBarLeadingButton| exists add it to the StackView.
+  if (self.locationBarLeadingButton) {
+    [self.locationBarContainerStackView
+        insertArrangedSubview:self.locationBarLeadingButton
+                      atIndex:0];
+  }
+  [self.locationBarContainer addSubview:self.locationBarContainerStackView];
+}
+
+- (void)setUpLocationBarContainer {
+  UIView* locationBarContainer = [[UIView alloc] initWithFrame:CGRectZero];
+  locationBarContainer.translatesAutoresizingMaskIntoConstraints = NO;
+  locationBarContainer.backgroundColor =
+      [self.buttonFactory.toolbarConfiguration omniboxBackgroundColor];
+  locationBarContainer.layer.borderWidth = kLocationBarBorderWidth;
+  locationBarContainer.layer.cornerRadius = kLocationBarShadowHeight;
+  locationBarContainer.layer.borderColor =
+      [self.buttonFactory.toolbarConfiguration omniboxBorderColor].CGColor;
+
+  self.locationBarShadow =
+      [[UIImageView alloc] initWithImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)];
+  self.locationBarShadow.translatesAutoresizingMaskIntoConstraints = NO;
+  self.locationBarShadow.userInteractionEnabled = NO;
+
+  [locationBarContainer addSubview:self.locationBarShadow];
+
+  [locationBarContainer
+      setContentHuggingPriority:UILayoutPriorityDefaultLow
+                        forAxis:UILayoutConstraintAxisHorizontal];
+  self.locationBarContainer = locationBarContainer;
+}
+
+- (void)setUpProgressBar {
+  MDCProgressView* progressBar = [[MDCProgressView alloc] init];
+  progressBar.translatesAutoresizingMaskIntoConstraints = NO;
+  progressBar.hidden = YES;
+  self.progressBar = progressBar;
+}
+
+// Sets the constraints for the different subviews.
+- (void)setConstraints {
+  self.translatesAutoresizingMaskIntoConstraints = NO;
+  [self.bottomAnchor constraintEqualToAnchor:self.topSafeAnchor
+                                    constant:kToolbarHeight]
+      .active = YES;
+
+  // ProgressBar constraints.
+  [NSLayoutConstraint activateConstraints:@[
+    [self.progressBar.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
+    [self.progressBar.trailingAnchor
+        constraintEqualToAnchor:self.trailingAnchor],
+    [self.progressBar.bottomAnchor constraintEqualToAnchor:self.bottomAnchor],
+    [self.progressBar.heightAnchor
+        constraintEqualToConstant:kProgressBarHeight],
+  ]];
+
+  // Shadows constraints.
+  [NSLayoutConstraint activateConstraints:@[
+    [self.shadowView.topAnchor constraintEqualToAnchor:self.bottomAnchor],
+    [self.shadowView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor],
+    [self.shadowView.trailingAnchor
+        constraintEqualToAnchor:self.trailingAnchor],
+    [self.shadowView.heightAnchor
+        constraintEqualToConstant:kToolbarShadowHeight],
+    [self.fullBleedShadowView.topAnchor
+        constraintEqualToAnchor:self.bottomAnchor],
+    [self.fullBleedShadowView.leadingAnchor
+        constraintEqualToAnchor:self.leadingAnchor],
+    [self.fullBleedShadowView.trailingAnchor
+        constraintEqualToAnchor:self.trailingAnchor],
+    [self.fullBleedShadowView.heightAnchor
+        constraintEqualToConstant:kToolbarFullBleedShadowHeight],
+  ]];
+
+  // Stack views constraints.
+  // Layout: |[leadingStackView]-[locationBarContainer]-[trailingStackView]|.
+  // Safe Area constraints.
+  UILayoutGuide* viewSafeAreaGuide = SafeAreaLayoutGuideForView(self);
+  self.leadingSafeAreaConstraint = [self.leadingStackView.leadingAnchor
+      constraintEqualToAnchor:viewSafeAreaGuide.leadingAnchor
+                     constant:self.leadingMargin];
+  self.trailingSafeAreaConstraint = [self.trailingStackView.trailingAnchor
+      constraintEqualToAnchor:viewSafeAreaGuide.trailingAnchor];
+  [NSLayoutConstraint activateConstraints:@[
+    self.leadingSafeAreaConstraint, self.trailingSafeAreaConstraint
+  ]];
+
+  // Fake safe area constraints. Not activated by default.
+  self.leadingFakeSafeAreaConstraint = [self.leadingStackView.leadingAnchor
+      constraintEqualToAnchor:self.leadingAnchor];
+  self.trailingFakeSafeAreaConstraint = [self.trailingStackView.trailingAnchor
+      constraintEqualToAnchor:self.trailingAnchor];
+
+  // Stackviews and locationBar Spacing constraints. These will be disabled when
+  // expanding the omnibox.
+  NSArray<NSLayoutConstraint*>* stackViewSpacingConstraint = [NSLayoutConstraint
+      constraintsWithVisualFormat:
+          @"H:[leadingStack]-(spacing)-[locationBar]-(spacing)-[trailingStack]"
+                          options:0
+                          metrics:@{
+                            @"spacing" : @(kHorizontalMargin)
+                          }
+                            views:@{
+                              @"leadingStack" : self.leadingStackView,
+                              @"locationBar" : self.locationBarContainer,
+                              @"trailingStack" : self.trailingStackView
+                            }];
+  [self.regularToolbarConstraints
+      addObjectsFromArray:stackViewSpacingConstraint];
+  // Vertical constraints.
+  [NSLayoutConstraint activateConstraints:stackViewSpacingConstraint];
+  ApplyVisualConstraintsWithMetrics(
+      @[
+        @"V:[leadingStack(height)]-(margin)-|",
+        @"V:[trailingStack(height)]-(margin)-|"
+      ],
+      @{
+        @"leadingStack" : self.leadingStackView,
+        @"trailingStack" : self.trailingStackView
+      },
+      @{
+        @"height" : @(kToolbarHeight - 2 * kButtonVerticalMargin),
+        @"margin" : @(kButtonVerticalMargin),
+      });
+
+  // LocationBarContainer constraints.
+  NSArray* locationBarRegularConstraints = @[
+    [self.bottomAnchor
+        constraintEqualToAnchor:self.locationBarContainer.bottomAnchor
+                       constant:kLocationBarVerticalMargin],
+    [self.locationBarContainer.heightAnchor
+        constraintEqualToConstant:kToolbarHeight -
+                                  2 * kLocationBarVerticalMargin],
+  ];
+  [self.regularToolbarConstraints
+      addObjectsFromArray:locationBarRegularConstraints];
+  [NSLayoutConstraint activateConstraints:locationBarRegularConstraints];
+  // LocationBarContainer shadow constraints.
+  [NSLayoutConstraint activateConstraints:@[
+    [self.locationBarShadow.heightAnchor
+        constraintEqualToConstant:kLocationBarShadowHeight],
+    [self.locationBarShadow.leadingAnchor
+        constraintEqualToAnchor:self.locationBarContainer.leadingAnchor
+                       constant:kLocationBarShadowInset],
+    [self.locationBarShadow.trailingAnchor
+        constraintEqualToAnchor:self.locationBarContainer.trailingAnchor
+                       constant:-kLocationBarShadowInset],
+    [self.locationBarShadow.topAnchor
+        constraintEqualToAnchor:self.locationBarContainer.bottomAnchor
+                       constant:-kLocationBarBorderWidth],
+  ]];
+
+  // LocationBarStackView constraints. The StackView inside the
+  // LocationBarContainer View.
+  UILayoutGuide* locationBarContainerSafeAreaGuide =
+      SafeAreaLayoutGuideForView(self.locationBarContainer);
+  [NSLayoutConstraint activateConstraints:@[
+    [self.locationBarContainerStackView.bottomAnchor
+        constraintEqualToAnchor:self.bottomAnchor
+                       constant:-(klocationBarStackViewBottomMargin +
+                                  kLocationBarVerticalMargin)],
+    [self.locationBarContainerStackView.trailingAnchor
+        constraintEqualToAnchor:locationBarContainerSafeAreaGuide
+                                    .trailingAnchor],
+    [self.locationBarContainerStackView.leadingAnchor
+        constraintEqualToAnchor:locationBarContainerSafeAreaGuide
+                                    .leadingAnchor],
+  ]];
+}
+
+// Returns all the ToolbarButtons in a given UIStackView.
+- (NSArray<ToolbarButton*>*)toolbarButtonsInStackView:(UIStackView*)stackView {
+  NSMutableArray<ToolbarButton*>* buttons = [[NSMutableArray alloc] init];
+  for (UIView* view in stackView.arrangedSubviews) {
+    if ([view isKindOfClass:[ToolbarButton class]]) {
+      ToolbarButton* button = base::mac::ObjCCastStrict<ToolbarButton>(view);
+      [buttons addObject:button];
+    }
+  }
+  return buttons;
+}
+
 @end
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h
index 2433d544..5f4c0913 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.h
@@ -41,8 +41,6 @@
 
 // The dispatcher for this view controller.
 @property(nonatomic, weak) id<ApplicationCommands, BrowserCommands> dispatcher;
-// The location bar view, containing the omnibox.
-@property(nonatomic, strong) UIView* locationBarView;
 // The ToolsMenu button.
 @property(nonatomic, strong, readonly) ToolbarToolsMenuButton* toolsMenuButton;
 // Whether the toolbar is in the expanded state or not.
@@ -50,6 +48,9 @@
 // Omnibox focuser.
 @property(nonatomic, weak) id<OmniboxFocuser> omniboxFocuser;
 
+// Sets the location bar view, containing the omnibox.
+- (void)setLocationBarView:(UIView*)locationBarView;
+
 // Adds the toolbar expanded state animations to |animator|, and changes the
 // toolbar constraints in preparation for the animation.
 - (void)addToolbarExpansionAnimations:(UIViewPropertyAnimator*)animator;
diff --git a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm
index f7a029f..78f9864 100644
--- a/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm
+++ b/ios/chrome/browser/ui/toolbar/clean/toolbar_view_controller.mm
@@ -39,108 +39,22 @@
 @property(nonatomic, strong) ToolbarButtonFactory* buttonFactory;
 @property(nonatomic, strong) ToolbarButtonUpdater* buttonUpdater;
 
-// The main objects in the view. Positionned as
-// [leadingStackView][locationBarContainer][trailingStackView]. The stack views
-// contain the buttons which should be shown on each sides of the location bar.
-@property(nonatomic, strong) UIStackView* leadingStackView;
-@property(nonatomic, strong) UIView* locationBarContainer;
-@property(nonatomic, strong) UIStackView* trailingStackView;
-
-// Array containing all the |_leadingStackView| buttons, lazily instantiated.
-@property(nonatomic, strong) NSArray<ToolbarButton*>* leadingStackViewButtons;
-// Array containing all the |_trailingStackView| buttons, lazily instantiated.
-@property(nonatomic, strong) NSArray<ToolbarButton*>* trailingStackViewButtons;
-@property(nonatomic, strong) ToolbarButton* backButton;
-@property(nonatomic, strong) ToolbarButton* forwardButton;
-@property(nonatomic, strong) ToolbarButton* tabSwitchStripButton;
-@property(nonatomic, strong, readwrite) ToolbarToolsMenuButton* toolsMenuButton;
-@property(nonatomic, strong) ToolbarButton* shareButton;
-@property(nonatomic, strong) ToolbarButton* reloadButton;
-@property(nonatomic, strong) ToolbarButton* stopButton;
-@property(nonatomic, strong) ToolbarButton* voiceSearchButton;
-@property(nonatomic, strong) ToolbarButton* bookmarkButton;
-@property(nonatomic, strong) ToolbarButton* contractButton;
-@property(nonatomic, strong) ToolbarButton* locationBarLeadingButton;
 @property(nonatomic, assign) BOOL voiceSearchEnabled;
-@property(nonatomic, strong) MDCProgressView* progressBar;
-@property(nonatomic, strong) UIStackView* locationBarContainerStackView;
-// The shadow below the toolbar when the omnibox is contracted. Lazily
-// instantiated.
-@property(nonatomic, strong) UIImageView* shadowView;
-// The shadow below the expanded omnibox. Lazily instantiated.
-@property(nonatomic, strong) UIImageView* fullBleedShadowView;
-// The shadow below the contracted location bar.
-@property(nonatomic, strong) UIImageView* locationBarShadow;
-// Background view, used to display the incognito NTP background color on the
-// toolbar.
-@property(nonatomic, strong) UIView* backgroundView;
 // Whether a page is loading.
 @property(nonatomic, assign, getter=isLoading) BOOL loading;
-// Constraints used for the regular/contracted Toolbar state that will be
-// deactivated and replaced by |_expandedToolbarConstraints| when animating the
-// toolbar expansion.
-@property(nonatomic, strong) NSMutableArray* regularToolbarConstraints;
-// Constraints used to layout the Toolbar to its expanded state. If these are
-// active the locationBarContainer will expand to the size of this VC's view.
-// The locationBarView will only expand up to the VC's view safeAreaLayoutGuide.
-@property(nonatomic, strong) NSArray* expandedToolbarConstraints;
-// Top anchor at the bottom of the safeAreaLayoutGuide. Used so views don't
-// overlap with the Status Bar.
-@property(nonatomic, strong) NSLayoutYAxisAnchor* topSafeAnchor;
-
-// These constraints pin the content view to the safe area. They are temporarily
-// disabled when a fake safe area is simulated by calling
-// activateFakeSafeAreaInsets.
-@property(nonatomic, strong) NSLayoutConstraint* leadingSafeAreaConstraint;
-@property(nonatomic, strong) NSLayoutConstraint* trailingSafeAreaConstraint;
-// Leading and trailing safe area constraint for faking a safe area. These
-// constraints are activated by calling activateFakeSafeAreaInsets and
-// deactivateFakeSafeAreaInsets.
-@property(nonatomic, strong) NSLayoutConstraint* leadingFakeSafeAreaConstraint;
-@property(nonatomic, strong) NSLayoutConstraint* trailingFakeSafeAreaConstraint;
 
 @property(nonatomic, strong) ToolbarView* view;
 @end
 
 @implementation ToolbarViewController
 @dynamic view;
-@synthesize leadingStackViewButtons = _leadingStackViewButtons;
-@synthesize trailingStackViewButtons = _trailingStackViewButtons;
-@synthesize backgroundView = _backgroundView;
 @synthesize buttonFactory = _buttonFactory;
 @synthesize buttonUpdater = _buttonUpdater;
+@synthesize loading = _loading;
+@synthesize voiceSearchEnabled = _voiceSearchEnabled;
+@synthesize omniboxFocuser = _omniboxFocuser;
 @synthesize dispatcher = _dispatcher;
 @synthesize expanded = _expanded;
-@synthesize locationBarView = _locationBarView;
-@synthesize leadingStackView = _leadingStackView;
-@synthesize trailingStackView = _trailingStackView;
-@synthesize loading = _loading;
-@synthesize locationBarContainer = _locationBarContainer;
-@synthesize backButton = _backButton;
-@synthesize forwardButton = _forwardButton;
-@synthesize tabSwitchStripButton = _tabSwitchStripButton;
-@synthesize toolsMenuButton = _toolsMenuButton;
-@synthesize shareButton = _shareButton;
-@synthesize reloadButton = _reloadButton;
-@synthesize stopButton = _stopButton;
-@synthesize voiceSearchButton = _voiceSearchButton;
-@synthesize bookmarkButton = _bookmarkButton;
-@synthesize contractButton = _contractButton;
-@synthesize locationBarLeadingButton = _locationBarLeadingButton;
-@synthesize voiceSearchEnabled = _voiceSearchEnabled;
-@synthesize progressBar = _progressBar;
-@synthesize locationBarContainerStackView = _locationBarContainerStackView;
-@synthesize shadowView = _shadowView;
-@synthesize fullBleedShadowView = _fullBleedShadowView;
-@synthesize locationBarShadow = _locationBarShadow;
-@synthesize expandedToolbarConstraints = _expandedToolbarConstraints;
-@synthesize topSafeAnchor = _topSafeAnchor;
-@synthesize regularToolbarConstraints = _regularToolbarConstraints;
-@synthesize leadingFakeSafeAreaConstraint = _leadingFakeSafeAreaConstraint;
-@synthesize trailingFakeSafeAreaConstraint = _trailingFakeSafeAreaConstraint;
-@synthesize leadingSafeAreaConstraint = _leadingSafeAreaConstraint;
-@synthesize trailingSafeAreaConstraint = _trailingSafeAreaConstraint;
-@synthesize omniboxFocuser = _omniboxFocuser;
 
 #pragma mark - Public
 
@@ -155,9 +69,6 @@
     _buttonFactory = buttonFactory;
     _buttonUpdater = buttonUpdater;
     _omniboxFocuser = omniboxFocuser;
-    [self setUpToolbarButtons];
-    [self setUpLocationBarContainer];
-    [self setUpProgressBar];
     _expanded = NO;
   }
   return self;
@@ -166,77 +77,75 @@
 - (void)addToolbarExpansionAnimations:(UIViewPropertyAnimator*)animator {
   // iPad should never try to animate.
   DCHECK(!IsIPadIdiom());
-  [NSLayoutConstraint deactivateConstraints:self.regularToolbarConstraints];
-  [NSLayoutConstraint activateConstraints:self.expandedToolbarConstraints];
+  [NSLayoutConstraint
+      deactivateConstraints:self.view.regularToolbarConstraints];
+  [NSLayoutConstraint activateConstraints:self.view.expandedToolbarConstraints];
   // By unhiding the button we will make it layout into the correct position in
   // the StackView.
-  self.contractButton.hidden = NO;
-  self.contractButton.alpha = 0;
+  self.view.contractButton.hidden = NO;
+  self.view.contractButton.alpha = 0;
+
+  void (^animations)() = ^{
+    [self setHorizontalTranslationOffset:kToolbarButtonAnimationOffset
+                                forViews:self.view.leadingStackViewButtons];
+    [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset
+                                forViews:self.view.trailingStackViewButtons];
+    [self setAllToolbarButtonsOpacity:0];
+  };
 
   [UIViewPropertyAnimator
       runningPropertyAnimatorWithDuration:ios::material::kDuration2
                                     delay:0
                                   options:UIViewAnimationOptionCurveEaseIn
-                               animations:^{
-                                 [self
-                                     setHorizontalTranslationOffset:
-                                         kToolbarButtonAnimationOffset
-                                                           forViews:
-                                                  self.leadingStackViewButtons];
-                                 [self
-                                     setHorizontalTranslationOffset:
-                                         -kToolbarButtonAnimationOffset
-                                                           forViews:
-                                                 self.trailingStackViewButtons];
-                                 [self setAllToolbarButtonsOpacity:0];
-                               }
+                               animations:animations
                                completion:nil];
 
   [animator addAnimations:^{
     [self.view layoutIfNeeded];
-    self.shadowView.alpha = 0;
-    self.fullBleedShadowView.alpha = 1;
-    self.locationBarShadow.alpha = 0;
+    self.view.shadowView.alpha = 0;
+    self.view.fullBleedShadowView.alpha = 1;
+    self.view.locationBarShadow.alpha = 0;
   }];
 
   // If locationBarLeadingButton exists fade it in.
-  if (self.locationBarLeadingButton) {
-    [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset
-                                forViews:@[ self.locationBarLeadingButton ]];
+  if (self.view.locationBarLeadingButton) {
+    [self
+        setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset
+                              forViews:@[ self.view.locationBarLeadingButton ]];
     [animator addAnimations:^{
-      self.locationBarLeadingButton.hidden = NO;
+      self.view.locationBarLeadingButton.hidden = NO;
       [self setHorizontalTranslationOffset:0
-                                  forViews:@[ self.locationBarLeadingButton ]];
-      self.locationBarLeadingButton.alpha = 1;
+                                  forViews:@[
+                                    self.view.locationBarLeadingButton
+                                  ]];
+      self.view.locationBarLeadingButton.alpha = 1;
     }
                 delayFactor:ios::material::kDuration2];
   }
 
   // When the locationBarContainer has been expanded the Contract button will
   // fade in.
+  void (^contractButtonAnimation)() = ^{
+    self.view.contractButton.alpha = 1;
+    [self setHorizontalTranslationOffset:0
+                                forViews:@[ self.view.contractButton ]];
+  };
   [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
     [self setHorizontalTranslationOffset:kToolbarButtonAnimationOffset
-                                forViews:@[ self.contractButton ]];
+                                forViews:@[ self.view.contractButton ]];
 
     [UIViewPropertyAnimator
         runningPropertyAnimatorWithDuration:ios::material::kDuration1
                                       delay:ios::material::kDuration4
                                     options:UIViewAnimationOptionCurveEaseOut
-                                 animations:^{
-                                   self.contractButton.alpha = 1;
-                                   [self
-                                       setHorizontalTranslationOffset:0
-                                                             forViews:@[
-                                                            self.contractButton
-                                                             ]];
-                                 }
+                                 animations:contractButtonAnimation
                                  completion:nil];
   }];
   [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
     CGFloat borderWidth = (finalPosition == UIViewAnimatingPositionEnd)
                               ? 0
                               : kLocationBarBorderWidth;
-    self.locationBarContainer.layer.borderWidth = borderWidth;
+    self.view.locationBarContainer.layer.borderWidth = borderWidth;
   }];
 
   self.expanded = YES;
@@ -248,105 +157,104 @@
 
   // If locationBarLeadingButton exists fade it out before the rest of the
   // Toolbar is contracted.
-  if (self.locationBarLeadingButton) {
+  if (self.view.locationBarLeadingButton) {
     [UIViewPropertyAnimator
         runningPropertyAnimatorWithDuration:ios::material::kDuration2
         delay:0
         options:UIViewAnimationOptionCurveEaseIn
         animations:^{
-          self.locationBarLeadingButton.alpha = 0;
+          self.view.locationBarLeadingButton.alpha = 0;
           [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset
                                       forViews:@[
-                                        self.locationBarLeadingButton
+                                        self.view.locationBarLeadingButton
                                       ]];
         }
         completion:^(UIViewAnimatingPosition finalPosition) {
           [self setHorizontalTranslationOffset:0
                                       forViews:@[
-                                        self.locationBarLeadingButton
+                                        self.view.locationBarLeadingButton
                                       ]];
         }];
   }
 
-  [NSLayoutConstraint deactivateConstraints:self.expandedToolbarConstraints];
-  [NSLayoutConstraint activateConstraints:self.regularToolbarConstraints];
+  [NSLayoutConstraint
+      deactivateConstraints:self.view.expandedToolbarConstraints];
+  [NSLayoutConstraint activateConstraints:self.view.regularToolbarConstraints];
   // Change the Toolbar buttons opacity to 0 since these will fade in once the
   // locationBarContainer has been contracted.
   [self setAllToolbarButtonsOpacity:0];
   [animator addAnimations:^{
-    self.locationBarContainer.layer.borderWidth = kLocationBarBorderWidth;
+    self.view.locationBarContainer.layer.borderWidth = kLocationBarBorderWidth;
     [self.view layoutIfNeeded];
-    self.contractButton.hidden = YES;
-    self.contractButton.alpha = 0;
-    self.shadowView.alpha = 1;
-    self.fullBleedShadowView.alpha = 0;
-    self.locationBarShadow.alpha = 1;
-    self.locationBarLeadingButton.hidden = YES;
+    self.view.contractButton.hidden = YES;
+    self.view.contractButton.alpha = 0;
+    self.view.shadowView.alpha = 1;
+    self.view.fullBleedShadowView.alpha = 0;
+    self.view.locationBarShadow.alpha = 1;
+    self.view.locationBarLeadingButton.hidden = YES;
   }];
 
   // Once the locationBarContainer has been contracted fade in ToolbarButtons.
+  void (^fadeButtonsIn)() = ^{
+    [self.view layoutIfNeeded];
+    [self setHorizontalTranslationOffset:0
+                                forViews:self.view.leadingStackViewButtons];
+    [self setHorizontalTranslationOffset:0
+                                forViews:self.view.trailingStackViewButtons];
+    [self setAllToolbarButtonsOpacity:1];
+  };
   [animator addCompletion:^(UIViewAnimatingPosition finalPosition) {
     [self setHorizontalTranslationOffset:kToolbarButtonAnimationOffset
-                                forViews:self.leadingStackViewButtons];
+                                forViews:self.view.leadingStackViewButtons];
     [self setHorizontalTranslationOffset:-kToolbarButtonAnimationOffset
-                                forViews:self.trailingStackViewButtons];
+                                forViews:self.view.trailingStackViewButtons];
     [UIViewPropertyAnimator
         runningPropertyAnimatorWithDuration:ios::material::kDuration1
                                       delay:ios::material::kDuration4
                                     options:UIViewAnimationOptionCurveEaseOut
-                                 animations:^{
-                                   [self.view layoutIfNeeded];
-                                   [self
-                                       setHorizontalTranslationOffset:0
-                                                             forViews:
-                                                  self.leadingStackViewButtons];
-                                   [self
-                                       setHorizontalTranslationOffset:0
-                                                             forViews:
-                                                 self.trailingStackViewButtons];
-                                   [self setAllToolbarButtonsOpacity:1];
-                                 }
+                                 animations:fadeButtonsIn
                                  completion:nil];
   }];
   self.expanded = NO;
 }
 
 - (void)updateForSideSwipeSnapshotOnNTP:(BOOL)onNTP {
-  self.progressBar.hidden = YES;
+  self.view.progressBar.hidden = YES;
   if (onNTP) {
-    self.backgroundView.alpha = 1;
-    self.locationBarContainer.hidden = YES;
+    self.view.backgroundView.alpha = 1;
+    self.view.locationBarContainer.hidden = YES;
     // The back button is visible only if the forward button is enabled.
-    self.backButton.hiddenInCurrentState = !self.forwardButton.enabled;
+    self.view.backButton.hiddenInCurrentState =
+        !self.view.forwardButton.enabled;
   }
 }
 
 - (void)resetAfterSideSwipeSnapshot {
-  self.backgroundView.alpha = 0;
-  self.locationBarContainer.hidden = NO;
-  self.backButton.hiddenInCurrentState = NO;
+  self.view.backgroundView.alpha = 0;
+  self.view.locationBarContainer.hidden = NO;
+  self.view.backButton.hiddenInCurrentState = NO;
 }
 
 - (void)setBackgroundToIncognitoNTPColorWithAlpha:(CGFloat)alpha {
-  self.backgroundView.alpha = alpha;
-  self.shadowView.alpha = 1 - alpha;
+  self.view.backgroundView.alpha = alpha;
+  self.view.shadowView.alpha = 1 - alpha;
 }
 
 - (void)showPrerenderingAnimation {
   __weak ToolbarViewController* weakSelf = self;
-  [self.progressBar setProgress:0];
-  [self.progressBar setHidden:NO
-                     animated:YES
-                   completion:^(BOOL finished) {
-                     [weakSelf stopProgressBar];
-                   }];
+  [self.view.progressBar setProgress:0];
+  [self.view.progressBar setHidden:NO
+                          animated:YES
+                        completion:^(BOOL finished) {
+                          [weakSelf stopProgressBar];
+                        }];
 }
 
 - (CGRect)visibleOmniboxFrame {
-  CGRect frame = self.locationBarContainer.frame;
-  frame =
-      [self.view.superview convertRect:frame
-                              fromView:[self.locationBarContainer superview]];
+  CGRect frame = self.view.locationBarContainer.frame;
+  frame = [self.view.superview
+      convertRect:frame
+         fromView:[self.view.locationBarContainer superview]];
   // Needed by the find in page view.
   return CGRectInset(frame, -kBackgroundImageVisibleRectOffset, 0);
 }
@@ -354,25 +262,25 @@
 - (void)locationBarIsFirstResonderOnIPad:(BOOL)isFirstResponder {
   // This is an iPad only function.
   DCHECK(IsIPadIdiom());
-  self.bookmarkButton.hiddenInCurrentState = isFirstResponder;
+  self.view.bookmarkButton.hiddenInCurrentState = isFirstResponder;
 }
 
 - (void)activateFakeSafeAreaInsets:(UIEdgeInsets)fakeSafeAreaInsets {
-  self.leadingFakeSafeAreaConstraint.constant =
+  self.view.leadingFakeSafeAreaConstraint.constant =
       UIEdgeInsetsGetLeading(fakeSafeAreaInsets) + [self leadingMargin];
-  self.trailingFakeSafeAreaConstraint.constant =
+  self.view.trailingFakeSafeAreaConstraint.constant =
       -UIEdgeInsetsGetTrailing(fakeSafeAreaInsets);
-  self.leadingSafeAreaConstraint.active = NO;
-  self.trailingSafeAreaConstraint.active = NO;
-  self.leadingFakeSafeAreaConstraint.active = YES;
-  self.trailingFakeSafeAreaConstraint.active = YES;
+  self.view.leadingSafeAreaConstraint.active = NO;
+  self.view.trailingSafeAreaConstraint.active = NO;
+  self.view.leadingFakeSafeAreaConstraint.active = YES;
+  self.view.trailingFakeSafeAreaConstraint.active = YES;
 }
 
 - (void)deactivateFakeSafeAreaInsets {
-  self.leadingFakeSafeAreaConstraint.active = NO;
-  self.trailingFakeSafeAreaConstraint.active = NO;
-  self.leadingSafeAreaConstraint.active = YES;
-  self.trailingSafeAreaConstraint.active = YES;
+  self.view.leadingFakeSafeAreaConstraint.active = NO;
+  self.view.trailingFakeSafeAreaConstraint.active = NO;
+  self.view.leadingSafeAreaConstraint.active = YES;
+  self.view.trailingSafeAreaConstraint.active = YES;
 }
 
 #pragma mark - View lifecyle
@@ -380,25 +288,16 @@
 - (void)loadView {
   self.view = [[ToolbarView alloc] init];
   self.view.delegate = self;
-}
+  self.view.buttonFactory = self.buttonFactory;
+  if (@available(iOS 11, *)) {
+    self.view.topSafeAnchor = self.view.safeAreaLayoutGuide.topAnchor;
+  } else {
+    self.view.topSafeAnchor = self.topLayoutGuide.bottomAnchor;
+  }
+  self.view.leadingMargin = [self leadingMargin];
 
-- (void)viewDidLoad {
-  // The view can be obstructed by the background view.
-  self.view.backgroundColor =
-      [self.buttonFactory.toolbarConfiguration backgroundColor];
-
-  [self setUpToolbarStackView];
-  [self setUpLocationBarContainerView];
-  [self.view addSubview:self.leadingStackView];
-  [self.view addSubview:self.trailingStackView];
-  // Since the |_locationBarContainer| will expand and cover the stackViews, its
-  // important to add it after them so the |_locationBarContainer| has a higher
-  // Z order.
-  [self.view addSubview:self.locationBarContainer];
-  [self.view addSubview:self.shadowView];
-  [self.view addSubview:self.fullBleedShadowView];
-  [self.view addSubview:self.progressBar];
-  [self setConstraints];
+  [self.view setUp];
+  [self setUpToolbarButtons];
 }
 
 - (void)viewDidAppear:(BOOL)animated {
@@ -406,389 +305,93 @@
   [super viewDidAppear:animated];
 }
 
-#pragma mark - View Setup
+#pragma mark - Property accessors
 
-// Sets up the StackView that contains toolbar navigation items.
-- (void)setUpToolbarStackView {
-  self.leadingStackView = [[UIStackView alloc] initWithArrangedSubviews:@[
-    self.backButton, self.forwardButton, self.reloadButton, self.stopButton
-  ]];
-  self.leadingStackView.translatesAutoresizingMaskIntoConstraints = NO;
-  self.leadingStackView.distribution = UIStackViewDistributionFill;
-
-  self.trailingStackView = [[UIStackView alloc] initWithArrangedSubviews:@[
-    self.shareButton, self.tabSwitchStripButton, self.toolsMenuButton
-  ]];
-  self.trailingStackView.translatesAutoresizingMaskIntoConstraints = NO;
-  self.trailingStackView.spacing = kStackViewSpacing;
-  self.trailingStackView.distribution = UIStackViewDistributionFill;
+- (void)setLocationBarView:(UIView*)locationBarView {
+  self.view.locationBarView = locationBarView;
 }
 
-// Sets up the LocationContainerView. Which contains a StackView containing the
-// locationBarView, and other buttons like Voice Search, Bookmarks and Contract
-// Toolbar.
-- (void)setUpLocationBarContainerView {
-  self.locationBarContainerStackView =
-      [[UIStackView alloc] initWithArrangedSubviews:@[ self.locationBarView ]];
-  self.locationBarContainerStackView.translatesAutoresizingMaskIntoConstraints =
-      NO;
-  self.locationBarContainerStackView.spacing = kStackViewSpacing;
-  self.locationBarContainerStackView.distribution = UIStackViewDistributionFill;
-  // Bookmarks and Voice Search buttons will only be part of the Toolbar on
-  // iPad. On the other hand the contract button is only needed on non iPad
-  // devices, since iPad doesn't animate, thus it doesn't need to contract.
-  if (IsIPadIdiom()) {
-    [self.locationBarContainerStackView addArrangedSubview:self.bookmarkButton];
-    [self.locationBarContainerStackView
-        addArrangedSubview:self.voiceSearchButton];
-  } else {
-    [self.locationBarContainerStackView addArrangedSubview:self.contractButton];
-  }
-  // If |self.locationBarLeadingButton| exists add it to the StackView.
-  if (self.locationBarLeadingButton) {
-    [self.locationBarContainerStackView
-        insertArrangedSubview:self.locationBarLeadingButton
-                      atIndex:0];
-  }
-  [self.locationBarContainer addSubview:self.locationBarContainerStackView];
-}
-
-- (void)setConstraints {
-  self.view.translatesAutoresizingMaskIntoConstraints = NO;
-  [self.view.bottomAnchor constraintEqualToAnchor:self.topSafeAnchor
-                                         constant:kToolbarHeight]
-      .active = YES;
-
-  // ProgressBar constraints.
-  [NSLayoutConstraint activateConstraints:@[
-    [self.progressBar.leadingAnchor
-        constraintEqualToAnchor:self.view.leadingAnchor],
-    [self.progressBar.trailingAnchor
-        constraintEqualToAnchor:self.view.trailingAnchor],
-    [self.progressBar.bottomAnchor
-        constraintEqualToAnchor:self.view.bottomAnchor],
-    [self.progressBar.heightAnchor
-        constraintEqualToConstant:kProgressBarHeight],
-  ]];
-
-  // Shadows constraints.
-  [NSLayoutConstraint activateConstraints:@[
-    [self.shadowView.topAnchor constraintEqualToAnchor:self.view.bottomAnchor],
-    [self.shadowView.leadingAnchor
-        constraintEqualToAnchor:self.view.leadingAnchor],
-    [self.shadowView.trailingAnchor
-        constraintEqualToAnchor:self.view.trailingAnchor],
-    [self.shadowView.heightAnchor
-        constraintEqualToConstant:kToolbarShadowHeight],
-    [self.fullBleedShadowView.topAnchor
-        constraintEqualToAnchor:self.view.bottomAnchor],
-    [self.fullBleedShadowView.leadingAnchor
-        constraintEqualToAnchor:self.view.leadingAnchor],
-    [self.fullBleedShadowView.trailingAnchor
-        constraintEqualToAnchor:self.view.trailingAnchor],
-    [self.fullBleedShadowView.heightAnchor
-        constraintEqualToConstant:kToolbarFullBleedShadowHeight],
-  ]];
-
-  // Stack views constraints.
-  // Layout: |[leadingStackView]-[locationBarContainer]-[trailingStackView]|.
-  // Safe Area constraints.
-  UILayoutGuide* viewSafeAreaGuide = SafeAreaLayoutGuideForView(self.view);
-  self.leadingSafeAreaConstraint = [self.leadingStackView.leadingAnchor
-      constraintEqualToAnchor:viewSafeAreaGuide.leadingAnchor
-                     constant:[self leadingMargin]];
-  self.trailingSafeAreaConstraint = [self.trailingStackView.trailingAnchor
-      constraintEqualToAnchor:viewSafeAreaGuide.trailingAnchor];
-  [NSLayoutConstraint activateConstraints:@[
-    self.leadingSafeAreaConstraint, self.trailingSafeAreaConstraint
-  ]];
-
-  // Fake safe area constraints. Not activated by default.
-  self.leadingFakeSafeAreaConstraint = [self.leadingStackView.leadingAnchor
-      constraintEqualToAnchor:self.view.leadingAnchor];
-  self.trailingFakeSafeAreaConstraint = [self.trailingStackView.trailingAnchor
-      constraintEqualToAnchor:self.view.trailingAnchor];
-
-  // Stackviews and locationBar Spacing constraints. These will be disabled when
-  // expanding the omnibox.
-  NSArray<NSLayoutConstraint*>* stackViewSpacingConstraint = [NSLayoutConstraint
-      constraintsWithVisualFormat:
-          @"H:[leadingStack]-(spacing)-[locationBar]-(spacing)-[trailingStack]"
-                          options:0
-                          metrics:@{
-                            @"spacing" : @(kHorizontalMargin)
-                          }
-                            views:@{
-                              @"leadingStack" : self.leadingStackView,
-                              @"locationBar" : self.locationBarContainer,
-                              @"trailingStack" : self.trailingStackView
-                            }];
-  [self.regularToolbarConstraints
-      addObjectsFromArray:stackViewSpacingConstraint];
-  // Vertical constraints.
-  [NSLayoutConstraint activateConstraints:stackViewSpacingConstraint];
-  ApplyVisualConstraintsWithMetrics(
-      @[
-        @"V:[leadingStack(height)]-(margin)-|",
-        @"V:[trailingStack(height)]-(margin)-|"
-      ],
-      @{
-        @"leadingStack" : self.leadingStackView,
-        @"trailingStack" : self.trailingStackView
-      },
-      @{
-        @"height" : @(kToolbarHeight - 2 * kButtonVerticalMargin),
-        @"margin" : @(kButtonVerticalMargin),
-      });
-
-  // LocationBarContainer constraints.
-  NSArray* locationBarRegularConstraints = @[
-    [self.view.bottomAnchor
-        constraintEqualToAnchor:self.locationBarContainer.bottomAnchor
-                       constant:kLocationBarVerticalMargin],
-    [self.locationBarContainer.heightAnchor
-        constraintEqualToConstant:kToolbarHeight -
-                                  2 * kLocationBarVerticalMargin],
-  ];
-  [self.regularToolbarConstraints
-      addObjectsFromArray:locationBarRegularConstraints];
-  [NSLayoutConstraint activateConstraints:locationBarRegularConstraints];
-  // LocationBarContainer shadow constraints.
-  [NSLayoutConstraint activateConstraints:@[
-    [self.locationBarShadow.heightAnchor
-        constraintEqualToConstant:kLocationBarShadowHeight],
-    [self.locationBarShadow.leadingAnchor
-        constraintEqualToAnchor:self.locationBarContainer.leadingAnchor
-                       constant:kLocationBarShadowInset],
-    [self.locationBarShadow.trailingAnchor
-        constraintEqualToAnchor:self.locationBarContainer.trailingAnchor
-                       constant:-kLocationBarShadowInset],
-    [self.locationBarShadow.topAnchor
-        constraintEqualToAnchor:self.locationBarContainer.bottomAnchor
-                       constant:-kLocationBarBorderWidth],
-  ]];
-
-  // LocationBarStackView constraints. The StackView inside the
-  // LocationBarContainer View.
-  UILayoutGuide* locationBarContainerSafeAreaGuide =
-      SafeAreaLayoutGuideForView(self.locationBarContainer);
-  [NSLayoutConstraint activateConstraints:@[
-    [self.locationBarContainerStackView.bottomAnchor
-        constraintEqualToAnchor:self.view.bottomAnchor
-                       constant:-(klocationBarStackViewBottomMargin +
-                                  kLocationBarVerticalMargin)],
-    [self.locationBarContainerStackView.trailingAnchor
-        constraintEqualToAnchor:locationBarContainerSafeAreaGuide
-                                    .trailingAnchor],
-    [self.locationBarContainerStackView.leadingAnchor
-        constraintEqualToAnchor:locationBarContainerSafeAreaGuide
-                                    .leadingAnchor],
-  ]];
+- (ToolbarToolsMenuButton*)toolsMenuButton {
+  return self.view.toolsMenuButton;
 }
 
 #pragma mark - Components Setup
 
 - (void)setUpToolbarButtons {
-  NSMutableArray* buttonConstraints = [[NSMutableArray alloc] init];
-
   // Back button.
-  self.backButton = [self.buttonFactory backToolbarButton];
-  self.backButton.visibilityMask = ToolbarComponentVisibilityCompactWidth |
-                                   ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.backButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  if (!IsIPadIdiom()) {
-    self.backButton.imageEdgeInsets =
-        UIEdgeInsetsMakeDirected(0, 0, 0, kBackButtonImageInset);
-  }
-  [self.backButton addTarget:self.dispatcher
-                      action:@selector(goBack)
-            forControlEvents:UIControlEventTouchUpInside];
+  self.view.backButton.visibilityMask = ToolbarComponentVisibilityCompactWidth |
+                                        ToolbarComponentVisibilityRegularWidth;
   UILongPressGestureRecognizer* backHistoryLongPress =
       [[UILongPressGestureRecognizer alloc]
           initWithTarget:self
                   action:@selector(handleLongPress:)];
-  [self.backButton addGestureRecognizer:backHistoryLongPress];
-  [self addStandardActionsForButton:self.backButton];
+  [self.view.backButton addGestureRecognizer:backHistoryLongPress];
+  [self addStandardActionsForButton:self.view.backButton];
 
   // Forward button.
-  self.forwardButton = [self.buttonFactory forwardToolbarButton];
-  self.forwardButton.visibilityMask =
+  self.view.forwardButton.visibilityMask =
       ToolbarComponentVisibilityCompactWidthOnlyWhenEnabled |
       ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.forwardButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  if (!IsIPadIdiom()) {
-    self.forwardButton.imageEdgeInsets =
-        UIEdgeInsetsMakeDirected(0, kForwardButtonImageInset, 0, 0);
-  }
-  [self.forwardButton addTarget:self.dispatcher
-                         action:@selector(goForward)
-               forControlEvents:UIControlEventTouchUpInside];
   UILongPressGestureRecognizer* forwardHistoryLongPress =
       [[UILongPressGestureRecognizer alloc]
           initWithTarget:self
                   action:@selector(handleLongPress:)];
-  [self.forwardButton addGestureRecognizer:forwardHistoryLongPress];
-  [self addStandardActionsForButton:self.forwardButton];
+  [self.view.forwardButton addGestureRecognizer:forwardHistoryLongPress];
+  [self addStandardActionsForButton:self.view.forwardButton];
 
-  // Tab switcher Strip button.
-  self.tabSwitchStripButton =
-      [self.buttonFactory tabSwitcherStripToolbarButton];
-  self.tabSwitchStripButton.visibilityMask =
+  // TabSwitcher button.
+  self.view.tabSwitchStripButton.visibilityMask =
       ToolbarComponentVisibilityIPhoneOnly;
-  [buttonConstraints
-      addObject:[self.tabSwitchStripButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  [self.tabSwitchStripButton addTarget:self.dispatcher
-                                action:@selector(displayTabSwitcher)
-                      forControlEvents:UIControlEventTouchUpInside];
-  [self addStandardActionsForButton:self.tabSwitchStripButton];
+  [self addStandardActionsForButton:self.view.tabSwitchStripButton];
 
   // Tools menu button.
-  self.toolsMenuButton = [self.buttonFactory toolsMenuToolbarButton];
-  self.toolsMenuButton.visibilityMask = ToolbarComponentVisibilityCompactWidth |
-                                        ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.toolsMenuButton.widthAnchor
-                    constraintEqualToConstant:kToolsMenuButtonWidth]];
-  [self.toolsMenuButton addTarget:self.dispatcher
-                           action:@selector(showToolsMenu)
-                 forControlEvents:UIControlEventTouchUpInside];
-  [self addStandardActionsForButton:self.toolsMenuButton];
-
-  // Share button.
-  self.shareButton = [self.buttonFactory shareToolbarButton];
-  self.shareButton.visibilityMask = ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.shareButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  self.shareButton.titleLabel.text = @"Share";
-  [self.shareButton addTarget:self.dispatcher
-                       action:@selector(sharePage)
-             forControlEvents:UIControlEventTouchUpInside];
-  [self addStandardActionsForButton:self.shareButton];
-
-  // Reload button.
-  self.reloadButton = [self.buttonFactory reloadToolbarButton];
-  self.reloadButton.visibilityMask = ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.reloadButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  [self.reloadButton addTarget:self.dispatcher
-                        action:@selector(reload)
-              forControlEvents:UIControlEventTouchUpInside];
-  [self addStandardActionsForButton:self.reloadButton];
-
-  // Stop button.
-  self.stopButton = [self.buttonFactory stopToolbarButton];
-  self.stopButton.visibilityMask = ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.stopButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  [self.stopButton addTarget:self.dispatcher
-                      action:@selector(stopLoading)
-            forControlEvents:UIControlEventTouchUpInside];
-  [self addStandardActionsForButton:self.stopButton];
-
-  // Voice Search button.
-  self.voiceSearchButton = [self.buttonFactory voiceSearchButton];
-  self.voiceSearchButton.visibilityMask =
-      ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.voiceSearchButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  self.voiceSearchButton.enabled = NO;
-  [self addStandardActionsForButton:self.voiceSearchButton];
-
-  // Bookmark button.
-  self.bookmarkButton = [self.buttonFactory bookmarkToolbarButton];
-  self.bookmarkButton.visibilityMask = ToolbarComponentVisibilityRegularWidth;
-  [buttonConstraints
-      addObject:[self.bookmarkButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  [self.bookmarkButton addTarget:self.dispatcher
-                          action:@selector(bookmarkPage)
-                forControlEvents:UIControlEventTouchUpInside];
-  [self addStandardActionsForButton:self.bookmarkButton];
-
-  // Contract button.
-  self.contractButton = [self.buttonFactory contractToolbarButton];
-  self.contractButton.visibilityMask = ToolbarComponentVisibilityCompactWidth |
-                                       ToolbarComponentVisibilityRegularWidth;
-  self.contractButton.alpha = 0;
-  self.contractButton.hidden = YES;
-  [buttonConstraints
-      addObject:[self.contractButton.widthAnchor
-                    constraintEqualToConstant:kToolbarButtonWidth]];
-  [self.contractButton addTarget:self.dispatcher
-                          action:@selector(contractToolbar)
-                forControlEvents:UIControlEventTouchUpInside];
-
-  // Add buttons to button updater.
-  self.buttonUpdater.backButton = self.backButton;
-  self.buttonUpdater.forwardButton = self.forwardButton;
-  self.buttonUpdater.voiceSearchButton = self.voiceSearchButton;
-
-  for (NSLayoutConstraint* constraint in buttonConstraints) {
-    // The buttons are added to a UIStackView. If the priority is
-    // |UILayoutPriorityRequired|, there is a conflict when the buttons are
-    // hidden as the stack view is setting their width to 0. Setting the
-    // priority to UILayoutPriorityDefaultHigh doesn't work as they would have a
-    // lower priority than the location bar which would expand.
-    constraint.priority = UILayoutPriorityRequired - 1;
-  }
-
-  [NSLayoutConstraint activateConstraints:buttonConstraints];
-}
-
-- (void)setUpLocationBarContainer {
-  UIView* locationBarContainer = [[UIView alloc] initWithFrame:CGRectZero];
-  locationBarContainer.translatesAutoresizingMaskIntoConstraints = NO;
-  locationBarContainer.backgroundColor =
-      [self.buttonFactory.toolbarConfiguration omniboxBackgroundColor];
-  locationBarContainer.layer.borderWidth = kLocationBarBorderWidth;
-  locationBarContainer.layer.cornerRadius = kLocationBarShadowHeight;
-  locationBarContainer.layer.borderColor =
-      [self.buttonFactory.toolbarConfiguration omniboxBorderColor].CGColor;
-
-  self.locationBarShadow =
-      [[UIImageView alloc] initWithImage:NativeImage(IDR_IOS_TOOLBAR_SHADOW)];
-  self.locationBarShadow.translatesAutoresizingMaskIntoConstraints = NO;
-  self.locationBarShadow.userInteractionEnabled = NO;
-
-  [locationBarContainer addSubview:self.locationBarShadow];
-
-  [locationBarContainer
-      setContentHuggingPriority:UILayoutPriorityDefaultLow
-                        forAxis:UILayoutConstraintAxisHorizontal];
-  self.locationBarContainer = locationBarContainer;
-
-  // LocationBar LeadingButton
-  self.locationBarLeadingButton = [self.buttonFactory locationBarLeadingButton];
-  self.locationBarLeadingButton.visibilityMask =
+  self.view.toolsMenuButton.visibilityMask =
       ToolbarComponentVisibilityCompactWidth |
       ToolbarComponentVisibilityRegularWidth;
-  self.locationBarLeadingButton.alpha = 0;
-  self.locationBarLeadingButton.hidden = YES;
-  NSLayoutConstraint* width = [self.locationBarLeadingButton.widthAnchor
-      constraintEqualToConstant:kLeadingLocationBarButtonWidth];
-  // The button is added to a UIStackView. If the priority is
-  // |UILayoutPriorityRequired|, there is a conflict when the button is hidden
-  // as the stack view is setting the width to 0.
-  width.priority = UILayoutPriorityRequired - 1;
-  width.active = YES;
-  self.locationBarLeadingButton.imageEdgeInsets =
-      UIEdgeInsetsMakeDirected(0, kLeadingLocationBarButtonImageInset, 0, 0);
-}
+  [self addStandardActionsForButton:self.view.toolsMenuButton];
 
-- (void)setUpProgressBar {
-  MDCProgressView* progressBar = [[MDCProgressView alloc] init];
-  progressBar.translatesAutoresizingMaskIntoConstraints = NO;
-  progressBar.hidden = YES;
-  self.progressBar = progressBar;
+  // Share button.
+  self.view.shareButton.visibilityMask = ToolbarComponentVisibilityRegularWidth;
+  [self addStandardActionsForButton:self.view.shareButton];
+
+  // Reload button.
+  self.view.reloadButton.visibilityMask =
+      ToolbarComponentVisibilityRegularWidth;
+  [self addStandardActionsForButton:self.view.reloadButton];
+
+  // Stop button.
+  self.view.stopButton.visibilityMask = ToolbarComponentVisibilityRegularWidth;
+  [self addStandardActionsForButton:self.view.stopButton];
+
+  // Voice Search button.
+  self.view.voiceSearchButton.visibilityMask =
+      ToolbarComponentVisibilityRegularWidth;
+  self.view.voiceSearchButton.enabled = NO;
+  [self addStandardActionsForButton:self.view.voiceSearchButton];
+
+  // Bookmark button.
+  self.view.bookmarkButton.visibilityMask =
+      ToolbarComponentVisibilityRegularWidth;
+  [self addStandardActionsForButton:self.view.bookmarkButton];
+
+  // Contract button.
+  self.view.contractButton.visibilityMask =
+      ToolbarComponentVisibilityCompactWidth |
+      ToolbarComponentVisibilityRegularWidth;
+  self.view.contractButton.alpha = 0;
+  self.view.contractButton.hidden = YES;
+
+  // LocationBar LeadingButton
+  self.view.locationBarLeadingButton.visibilityMask =
+      ToolbarComponentVisibilityCompactWidth |
+      ToolbarComponentVisibilityRegularWidth;
+  self.view.locationBarLeadingButton.alpha = 0;
+  self.view.locationBarLeadingButton.hidden = YES;
+
+  // Add buttons to button updater.
+  self.buttonUpdater.backButton = self.view.backButton;
+  self.buttonUpdater.forwardButton = self.view.forwardButton;
+  self.buttonUpdater.voiceSearchButton = self.view.voiceSearchButton;
 }
 
 #pragma mark - Button Actions
@@ -797,9 +400,9 @@
   if (gesture.state != UIGestureRecognizerStateBegan)
     return;
 
-  if (gesture.view == self.backButton) {
+  if (gesture.view == self.view.backButton) {
     [self.dispatcher showTabHistoryPopupForBackwardHistory];
-  } else if (gesture.view == self.forwardButton) {
+  } else if (gesture.view == self.view.forwardButton) {
     [self.dispatcher showTabHistoryPopupForForwardHistory];
   }
 }
@@ -822,12 +425,12 @@
 
 - (void)didMoveToParentViewController:(UIViewController*)parent {
   UILayoutGuide* omniboxPopupGuide = FindNamedGuide(kOmniboxGuide, self.view);
-  AddSameConstraints(self.locationBarContainer, omniboxPopupGuide);
+  AddSameConstraints(self.view.locationBarContainer, omniboxPopupGuide);
   UILayoutGuide* backButtonGuide = FindNamedGuide(kBackButtonGuide, self.view);
-  AddSameConstraints(self.backButton.imageView, backButtonGuide);
+  AddSameConstraints(self.view.backButton.imageView, backButtonGuide);
   UILayoutGuide* forwardButtonGuide =
       FindNamedGuide(kForwardButtonGuide, self.view);
-  AddSameConstraints(self.forwardButton.imageView, forwardButtonGuide);
+  AddSameConstraints(self.view.forwardButton.imageView, forwardButtonGuide);
 }
 
 #pragma mark - Trait Collection Changes
@@ -843,43 +446,43 @@
 #pragma mark - ToolbarWebStateConsumer
 
 - (void)setCanGoForward:(BOOL)canGoForward {
-  self.forwardButton.enabled = canGoForward;
+  self.view.forwardButton.enabled = canGoForward;
   // Update the visibility since the Forward button will be hidden on
   // CompactWidth when disabled.
-  [self.forwardButton updateHiddenInCurrentSizeClass];
+  [self.view.forwardButton updateHiddenInCurrentSizeClass];
 }
 
 - (void)setCanGoBack:(BOOL)canGoBack {
-  self.backButton.enabled = canGoBack;
+  self.view.backButton.enabled = canGoBack;
 }
 
 - (void)setLoadingState:(BOOL)loading {
   _loading = loading;
-  self.reloadButton.hiddenInCurrentState = loading;
-  self.stopButton.hiddenInCurrentState = !loading;
+  self.view.reloadButton.hiddenInCurrentState = loading;
+  self.view.stopButton.hiddenInCurrentState = !loading;
   if (!loading) {
     [self stopProgressBar];
-  } else if (self.progressBar.hidden) {
-    [self.progressBar setProgress:0];
-    [self.progressBar setHidden:NO animated:YES completion:nil];
+  } else if (self.view.progressBar.hidden) {
+    [self.view.progressBar setProgress:0];
+    [self.view.progressBar setHidden:NO animated:YES completion:nil];
     // Layout if needed the progress bar to avoir having the progress bar going
     // backward when opening a page from the NTP.
-    [self.progressBar layoutIfNeeded];
+    [self.view.progressBar layoutIfNeeded];
   }
 }
 
 - (void)setLoadingProgressFraction:(double)progress {
-  [self.progressBar setProgress:progress animated:YES completion:nil];
+  [self.view.progressBar setProgress:progress animated:YES completion:nil];
 }
 
 - (void)setTabCount:(int)tabCount {
   // Return if tabSwitchStripButton wasn't initialized.
-  if (!self.tabSwitchStripButton)
+  if (!self.view.tabSwitchStripButton)
     return;
 
-  // Update the text shown in the |self.tabSwitchStripButton|. Note that the
-  // button's title may be empty or contain an easter egg, but the accessibility
-  // value will always be equal to |tabCount|.
+  // Update the text shown in the |self.view.tabSwitchStripButton|. Note that
+  // the button's title may be empty or contain an easter egg, but the
+  // accessibility value will always be equal to |tabCount|.
   NSString* tabStripButtonValue = [NSString stringWithFormat:@"%d", tabCount];
   NSString* tabStripButtonTitle;
   if (tabCount <= 0) {
@@ -888,43 +491,43 @@
     // As an easter egg, show a smiley face instead of the count if the user has
     // more than 99 tabs open.
     tabStripButtonTitle = @":)";
-    [[self.tabSwitchStripButton titleLabel]
+    [[self.view.tabSwitchStripButton titleLabel]
         setFont:[UIFont boldSystemFontOfSize:kFontSizeFewerThanTenTabs]];
   } else {
     tabStripButtonTitle = tabStripButtonValue;
     if (tabCount < 10) {
-      [[self.tabSwitchStripButton titleLabel]
+      [[self.view.tabSwitchStripButton titleLabel]
           setFont:[UIFont boldSystemFontOfSize:kFontSizeFewerThanTenTabs]];
     } else {
-      [[self.tabSwitchStripButton titleLabel]
+      [[self.view.tabSwitchStripButton titleLabel]
           setFont:[UIFont boldSystemFontOfSize:kFontSizeTenTabsOrMore]];
     }
   }
 
-  [self.tabSwitchStripButton setTitle:tabStripButtonTitle
-                             forState:UIControlStateNormal];
-  [self.tabSwitchStripButton setAccessibilityValue:tabStripButtonValue];
+  [self.view.tabSwitchStripButton setTitle:tabStripButtonTitle
+                                  forState:UIControlStateNormal];
+  [self.view.tabSwitchStripButton setAccessibilityValue:tabStripButtonValue];
 }
 
 - (void)setPageBookmarked:(BOOL)bookmarked {
-  self.bookmarkButton.selected = bookmarked;
+  self.view.bookmarkButton.selected = bookmarked;
 }
 
 - (void)setVoiceSearchEnabled:(BOOL)voiceSearchEnabled {
   _voiceSearchEnabled = voiceSearchEnabled;
   if (voiceSearchEnabled) {
-    self.voiceSearchButton.enabled = YES;
-    [self.voiceSearchButton addTarget:self.dispatcher
-                               action:@selector(preloadVoiceSearch)
-                     forControlEvents:UIControlEventTouchDown];
-    [self.voiceSearchButton addTarget:self
-                               action:@selector(startVoiceSearch:)
-                     forControlEvents:UIControlEventTouchUpInside];
+    self.view.voiceSearchButton.enabled = YES;
+    [self.view.voiceSearchButton addTarget:self.dispatcher
+                                    action:@selector(preloadVoiceSearch)
+                          forControlEvents:UIControlEventTouchDown];
+    [self.view.voiceSearchButton addTarget:self
+                                    action:@selector(startVoiceSearch:)
+                          forControlEvents:UIControlEventTouchUpInside];
   }
 }
 
 - (void)setShareMenuEnabled:(BOOL)enabled {
-  self.shareButton.enabled = enabled;
+  self.view.shareButton.enabled = enabled;
 }
 
 #pragma mark - ToolbarViewFullscreenDelegate
@@ -937,41 +540,41 @@
           : -1 * frame.origin.y;
   CGFloat fraction = 1 - fmin(distanceOffscreen / kScrollFadeDistance, 1);
 
-  self.leadingStackView.alpha = fraction;
-  self.locationBarContainer.alpha = fraction;
-  self.trailingStackView.alpha = fraction;
+  self.view.leadingStackView.alpha = fraction;
+  self.view.locationBarContainer.alpha = fraction;
+  self.view.trailingStackView.alpha = fraction;
 }
 
 #pragma mark - ActivityServicePositioner
 
 - (UIView*)shareButtonView {
-  return self.shareButton;
+  return self.view.shareButton;
 }
 
 #pragma mark - BubbleViewAnchorPointProvider
 
 - (CGPoint)anchorPointForTabSwitcherButton:(BubbleArrowDirection)direction {
   CGPoint anchorPoint = bubble_util::AnchorPoint(
-      self.tabSwitchStripButton.imageView.frame, direction);
-  return [self.tabSwitchStripButton.imageView.superview
+      self.view.tabSwitchStripButton.imageView.frame, direction);
+  return [self.view.tabSwitchStripButton.imageView.superview
       convertPoint:anchorPoint
-            toView:self.tabSwitchStripButton.imageView.window];
+            toView:self.view.tabSwitchStripButton.imageView.window];
 }
 
 - (CGPoint)anchorPointForToolsMenuButton:(BubbleArrowDirection)direction {
   CGPoint anchorPoint =
-      bubble_util::AnchorPoint(self.toolsMenuButton.frame, direction);
-  return
-      [self.toolsMenuButton.superview convertPoint:anchorPoint
-                                            toView:self.toolsMenuButton.window];
+      bubble_util::AnchorPoint(self.view.toolsMenuButton.frame, direction);
+  return [self.view.toolsMenuButton.superview
+      convertPoint:anchorPoint
+            toView:self.view.toolsMenuButton.window];
 }
 
 #pragma mark - FullscreenUIElement
 
 - (void)updateForFullscreenProgress:(CGFloat)progress {
-  self.leadingStackView.alpha = progress;
-  self.locationBarContainer.alpha = progress;
-  self.trailingStackView.alpha = progress;
+  self.view.leadingStackView.alpha = progress;
+  self.view.locationBarContainer.alpha = progress;
+  self.view.trailingStackView.alpha = progress;
 }
 
 - (void)updateForFullscreenEnabled:(BOOL)enabled {
@@ -992,129 +595,23 @@
 // Updates all Buttons visibility to match any recent WebState change.
 - (void)updateAllButtonsVisibility {
   NSMutableArray* allButtons = [[NSMutableArray alloc] init];
-  [allButtons addObjectsFromArray:self.leadingStackViewButtons];
-  [allButtons addObjectsFromArray:self.trailingStackViewButtons];
-  [allButtons
-      addObjectsFromArray:@[ self.voiceSearchButton, self.bookmarkButton ]];
+  [allButtons addObjectsFromArray:self.view.leadingStackViewButtons];
+  [allButtons addObjectsFromArray:self.view.trailingStackViewButtons];
+  [allButtons addObjectsFromArray:@[
+    self.view.voiceSearchButton, self.view.bookmarkButton
+  ]];
   for (ToolbarButton* button in allButtons) {
     [button updateHiddenInCurrentSizeClass];
   }
 }
 
-#pragma mark - Setters & Getters.
-
-- (NSArray<ToolbarButton*>*)leadingStackViewButtons {
-  if (!_leadingStackViewButtons) {
-    _leadingStackViewButtons =
-        [self toolbarButtonsInStackView:self.leadingStackView];
-  }
-  return _leadingStackViewButtons;
-}
-
-- (NSArray<ToolbarButton*>*)trailingStackViewButtons {
-  if (!_trailingStackViewButtons) {
-    _trailingStackViewButtons =
-        [self toolbarButtonsInStackView:self.trailingStackView];
-  }
-  return _trailingStackViewButtons;
-}
-
-- (UIView*)backgroundView {
-  if (!_backgroundView) {
-    _backgroundView = [[UIView alloc] initWithFrame:CGRectZero];
-    _backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
-    _backgroundView.backgroundColor =
-        self.buttonFactory.toolbarConfiguration.NTPBackgroundColor;
-    [self.view insertSubview:_backgroundView atIndex:0];
-    AddSameConstraints(self.view, _backgroundView);
-  }
-  return _backgroundView;
-}
-
-- (NSLayoutYAxisAnchor*)topSafeAnchor {
-  if (!_topSafeAnchor) {
-    if (@available(iOS 11, *)) {
-      _topSafeAnchor = self.view.safeAreaLayoutGuide.topAnchor;
-    } else {
-      _topSafeAnchor = self.topLayoutGuide.bottomAnchor;
-    }
-  }
-  return _topSafeAnchor;
-}
-
-- (NSMutableArray*)regularToolbarConstraints {
-  if (!_regularToolbarConstraints) {
-    _regularToolbarConstraints = [[NSMutableArray alloc] init];
-  }
-  return _regularToolbarConstraints;
-}
-
-- (NSArray*)expandedToolbarConstraints {
-  if (!_expandedToolbarConstraints) {
-    _expandedToolbarConstraints = @[
-      [self.locationBarContainer.topAnchor
-          constraintEqualToAnchor:self.view.topAnchor],
-      [self.locationBarContainer.bottomAnchor
-          constraintEqualToAnchor:self.view.bottomAnchor],
-      [self.locationBarContainer.leadingAnchor
-          constraintEqualToAnchor:self.view.leadingAnchor],
-      [self.locationBarContainer.trailingAnchor
-          constraintEqualToAnchor:self.view.trailingAnchor],
-    ];
-  }
-  return _expandedToolbarConstraints;
-}
-
-- (UIView*)locationBarView {
-  if (!_locationBarView) {
-    _locationBarView = [[UIView alloc] initWithFrame:CGRectZero];
-    _locationBarView.translatesAutoresizingMaskIntoConstraints = NO;
-    [_locationBarView
-        setContentHuggingPriority:UILayoutPriorityDefaultLow
-                          forAxis:UILayoutConstraintAxisHorizontal];
-    _locationBarView.clipsToBounds = YES;
-  }
-  return _locationBarView;
-}
-
-- (void)setLocationBarView:(UIView*)view {
-  if (_locationBarView == view) {
-    return;
-  }
-  view.translatesAutoresizingMaskIntoConstraints = NO;
-  [view setContentHuggingPriority:UILayoutPriorityDefaultLow
-                          forAxis:UILayoutConstraintAxisHorizontal];
-  _locationBarView = view;
-}
-
-- (UIImageView*)shadowView {
-  if (!_shadowView) {
-    _shadowView = [[UIImageView alloc] init];
-    _shadowView.translatesAutoresizingMaskIntoConstraints = NO;
-    _shadowView.userInteractionEnabled = NO;
-    _shadowView.image = NativeImage(IDR_IOS_TOOLBAR_SHADOW);
-  }
-  return _shadowView;
-}
-
-- (UIImageView*)fullBleedShadowView {
-  if (!_fullBleedShadowView) {
-    _fullBleedShadowView = [[UIImageView alloc] init];
-    _fullBleedShadowView.translatesAutoresizingMaskIntoConstraints = NO;
-    _fullBleedShadowView.userInteractionEnabled = NO;
-    _fullBleedShadowView.alpha = 0;
-    _fullBleedShadowView.image = NativeImage(IDR_IOS_TOOLBAR_SHADOW_FULL_BLEED);
-  }
-  return _fullBleedShadowView;
-}
-
 #pragma mark - Private
 
 // Sets the progress of the progressBar to 1 then hides it.
 - (void)stopProgressBar {
-  __weak MDCProgressView* weakProgressBar = self.progressBar;
+  __weak MDCProgressView* weakProgressBar = self.view.progressBar;
   __weak ToolbarViewController* weakSelf = self;
-  [self.progressBar
+  [self.view.progressBar
       setProgress:1
          animated:YES
        completion:^(BOOL finished) {
@@ -1135,9 +632,9 @@
 
 // Sets all Toolbar Buttons opacity to |alpha|.
 - (void)setAllToolbarButtonsOpacity:(CGFloat)alpha {
-  for (UIButton* button in [self.leadingStackViewButtons
-           arrayByAddingObjectsFromArray:self.trailingStackViewButtons]) {
-      button.alpha = alpha;
+  for (UIButton* button in [self.view.leadingStackViewButtons
+           arrayByAddingObjectsFromArray:self.view.trailingStackViewButtons]) {
+    button.alpha = alpha;
   }
 }
 
@@ -1154,18 +651,6 @@
   }
 }
 
-// Returns all the ToolbarButtons in a given UIStackView.
-- (NSArray<ToolbarButton*>*)toolbarButtonsInStackView:(UIStackView*)stackView {
-  NSMutableArray<ToolbarButton*>* buttons = [[NSMutableArray alloc] init];
-  for (UIView* view in stackView.arrangedSubviews) {
-    if ([view isKindOfClass:[ToolbarButton class]]) {
-      ToolbarButton* button = base::mac::ObjCCastStrict<ToolbarButton>(view);
-      [buttons addObject:button];
-    }
-  }
-  return buttons;
-}
-
 // Returns the leading margin for the leading stack view.
 - (CGFloat)leadingMargin {
   return IsIPadIdiom() ? kLeadingMarginIPad : 0;
@@ -1173,7 +658,7 @@
 
 // Registers the actions which will be triggered when tapping the button.
 - (void)addStandardActionsForButton:(UIButton*)button {
-  if (button != self.toolsMenuButton) {
+  if (button != self.view.toolsMenuButton) {
     [button addTarget:self.omniboxFocuser
                   action:@selector(cancelOmniboxEdit)
         forControlEvents:UIControlEventTouchUpInside];
@@ -1185,23 +670,23 @@
 
 // Records the use of a button.
 - (IBAction)recordUserMetrics:(id)sender {
-  if (sender == self.backButton) {
+  if (sender == self.view.backButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarBack"));
-  } else if (sender == self.forwardButton) {
+  } else if (sender == self.view.forwardButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarForward"));
-  } else if (sender == self.reloadButton) {
+  } else if (sender == self.view.reloadButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarReload"));
-  } else if (sender == self.stopButton) {
+  } else if (sender == self.view.stopButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarStop"));
-  } else if (sender == self.voiceSearchButton) {
+  } else if (sender == self.view.voiceSearchButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarVoiceSearch"));
-  } else if (sender == self.bookmarkButton) {
+  } else if (sender == self.view.bookmarkButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarToggleBookmark"));
-  } else if (sender == self.toolsMenuButton) {
+  } else if (sender == self.view.toolsMenuButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarShowMenu"));
-  } else if (sender == self.tabSwitchStripButton) {
+  } else if (sender == self.view.tabSwitchStripButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarShowStackView"));
-  } else if (sender == self.shareButton) {
+  } else if (sender == self.view.shareButton) {
     base::RecordAction(base::UserMetricsAction("MobileToolbarShareMenu"));
   } else {
     NOTREACHED();
diff --git a/ios/chrome/browser/ui/toolbar/new_tab_button.mm b/ios/chrome/browser/ui/toolbar/new_tab_button.mm
index 5522fbd..a3de1f1 100644
--- a/ios/chrome/browser/ui/toolbar/new_tab_button.mm
+++ b/ios/chrome/browser/ui/toolbar/new_tab_button.mm
@@ -6,7 +6,7 @@
 
 #include "base/logging.h"
 #import "ios/chrome/browser/ui/commands/open_new_tab_command.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/rtl_geometry.h"
 #import "ios/chrome/browser/ui/uikit_ui_util.h"
 #import "ios/chrome/common/material_timing.h"
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/toolbar_controller.mm
index 9a505e6..5c4e8b5 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_controller.mm
+++ b/ios/chrome/browser/ui/toolbar/toolbar_controller.mm
@@ -19,7 +19,7 @@
 #import "ios/chrome/browser/ui/commands/application_commands.h"
 #import "ios/chrome/browser/ui/commands/browser_commands.h"
 #import "ios/chrome/browser/ui/fullscreen/fullscreen_scroll_end_animator.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #import "ios/chrome/browser/ui/reversed_animation.h"
 #include "ios/chrome/browser/ui/rtl_geometry.h"
 #import "ios/chrome/browser/ui/toolbar/clean/toolbar_tools_menu_button.h"
diff --git a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
index 5303d65..012570b 100644
--- a/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
+++ b/ios/chrome/browser/ui/toolbar/web_toolbar_controller.mm
@@ -45,7 +45,7 @@
 #import "ios/chrome/browser/ui/commands/external_search_commands.h"
 #import "ios/chrome/browser/ui/commands/start_voice_search_command.h"
 #import "ios/chrome/browser/ui/fullscreen/fullscreen_features.h"
-#import "ios/chrome/browser/ui/image_util.h"
+#import "ios/chrome/browser/ui/image_util/image_util.h"
 #include "ios/chrome/browser/ui/location_bar/location_bar_view.h"
 #include "ios/chrome/browser/ui/omnibox/location_bar_controller.h"
 #include "ios/chrome/browser/ui/omnibox/location_bar_controller_impl.h"
@@ -303,6 +303,7 @@
       _browserState->IsOffTheRecord() ? INCOGNITO : NORMAL;
   ToolbarButtonFactory* factory =
       [[ToolbarButtonFactory alloc] initWithStyle:incognitoStyle];
+  factory.dispatcher = self.dispatcher;
   _buttonUpdater = [[ToolbarButtonUpdater alloc] init];
   _buttonUpdater.factory = factory;
 
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index dae9e08..9a4646d9 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -3742,10 +3742,12 @@
     // WKWebViews with invalid or empty frames have exhibited rendering bugs, so
     // resize the view to match the container view upon creation.
     [_webView setFrame:[_containerView bounds]];
+  }
 
-    // If the visible NavigationItem should be loaded in this web view, display
-    // it immediately.  Otherwise, it will be displayed when the pending load is
-    // committed.
+  // If web view is not currently displayed and if the visible NavigationItem
+  // should be loaded in this web view, display it immediately.  Otherwise, it
+  // will be displayed when the pending load is committed.
+  if (![_containerView webViewContentView]) {
     web::NavigationItem* visibleItem =
         self.navigationManagerImpl->GetVisibleItem();
     const GURL& visibleURL =
diff --git a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
index eaa6f8c8..f7d4b311 100644
--- a/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
+++ b/media/gpu/vaapi/vaapi_video_encode_accelerator.cc
@@ -43,7 +43,9 @@
 // Subjectively chosen.
 const size_t kNumInputBuffers = 4;
 const size_t kMaxNumReferenceFrames = 4;
-const size_t kExtraOutputBufferSize = 8192;  // bytes
+
+// TODO(owenlin): Adjust the value after b/71367113 is fixed
+const size_t kExtraOutputBufferSize = 32768;  // bytes
 
 // We need up to kMaxNumReferenceFrames surfaces for reference, plus one
 // for input and one for encode (which will be added to the set of reference
diff --git a/net/quic/core/quic_server_id_test.cc b/net/quic/core/quic_server_id_test.cc
index 22dd95b2..be8eeb1 100644
--- a/net/quic/core/quic_server_id_test.cc
+++ b/net/quic/core/quic_server_id_test.cc
@@ -4,6 +4,7 @@
 
 #include "net/quic/core/quic_server_id.h"
 
+#include "net/quic/platform/api/quic_estimate_memory_usage.h"
 #include "net/quic/platform/api/quic_test.h"
 
 using std::string;
@@ -152,6 +153,13 @@
   EXPECT_FALSE(new_a_10_https_no_private == a_10_https_private);
 }
 
+TEST_F(QuicServerIdTest, EstimateMemoryUsage) {
+  HostPortPair host_port_pair("this is a rather very quite long hostname", 10);
+  QuicServerId server_id(host_port_pair, PRIVACY_MODE_ENABLED);
+  EXPECT_EQ(QuicEstimateMemoryUsage(host_port_pair),
+            QuicEstimateMemoryUsage(server_id));
+}
+
 }  // namespace
 
 }  // namespace net
diff --git a/storage/browser/database/database_quota_client.cc b/storage/browser/database/database_quota_client.cc
index bd6f49c..67da171 100644
--- a/storage/browser/database/database_quota_client.cc
+++ b/storage/browser/database/database_quota_client.cc
@@ -22,6 +22,7 @@
 #include "storage/common/database/database_identifier.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
 
+using blink::StorageType;
 using storage::QuotaClient;
 
 namespace storage {
@@ -116,13 +117,13 @@
 }
 
 void DatabaseQuotaClient::GetOriginUsage(const GURL& origin_url,
-                                         storage::StorageType type,
+                                         StorageType type,
                                          const GetUsageCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(db_tracker_.get());
 
   // All databases are in the temp namespace for now.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(0);
     return;
   }
@@ -135,13 +136,13 @@
 }
 
 void DatabaseQuotaClient::GetOriginsForType(
-    storage::StorageType type,
+    StorageType type,
     const GetOriginsCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(db_tracker_.get());
 
   // All databases are in the temp namespace for now.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
@@ -155,14 +156,14 @@
 }
 
 void DatabaseQuotaClient::GetOriginsForHost(
-    storage::StorageType type,
+    StorageType type,
     const std::string& host,
     const GetOriginsCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(db_tracker_.get());
 
   // All databases are in the temp namespace for now.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(std::set<GURL>());
     return;
   }
@@ -177,13 +178,13 @@
 }
 
 void DatabaseQuotaClient::DeleteOriginData(const GURL& origin,
-                                           storage::StorageType type,
+                                           StorageType type,
                                            const DeletionCallback& callback) {
   DCHECK(!callback.is_null());
   DCHECK(db_tracker_.get());
 
   // All databases are in the temp namespace for now, so nothing to delete.
-  if (type != storage::kStorageTypeTemporary) {
+  if (type != StorageType::kTemporary) {
     callback.Run(blink::QuotaStatusCode::kOk);
     return;
   }
@@ -203,8 +204,8 @@
       static_cast<base::OnceCallback<void(int)>>(delete_callback));
 }
 
-bool DatabaseQuotaClient::DoesSupport(storage::StorageType type) const {
-  return type == storage::kStorageTypeTemporary;
+bool DatabaseQuotaClient::DoesSupport(StorageType type) const {
+  return type == StorageType::kTemporary;
 }
 
 }  // namespace storage
diff --git a/storage/browser/database/database_quota_client.h b/storage/browser/database/database_quota_client.h
index 66f9626c..e20c18bf 100644
--- a/storage/browser/database/database_quota_client.h
+++ b/storage/browser/database/database_quota_client.h
@@ -13,7 +13,7 @@
 #include "base/single_thread_task_runner.h"
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/storage_browser_export.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace storage {
 
@@ -31,17 +31,17 @@
   ID id() const override;
   void OnQuotaManagerDestroyed() override;
   void GetOriginUsage(const GURL& origin_url,
-                      storage::StorageType type,
+                      blink::StorageType type,
                       const GetUsageCallback& callback) override;
-  void GetOriginsForType(storage::StorageType type,
+  void GetOriginsForType(blink::StorageType type,
                          const GetOriginsCallback& callback) override;
-  void GetOriginsForHost(storage::StorageType type,
+  void GetOriginsForHost(blink::StorageType type,
                          const std::string& host,
                          const GetOriginsCallback& callback) override;
   void DeleteOriginData(const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(blink::StorageType type) const override;
 
  private:
   scoped_refptr<DatabaseTracker> db_tracker_;  // only used on its sequence
diff --git a/storage/browser/database/database_quota_client_unittest.cc b/storage/browser/database/database_quota_client_unittest.cc
index 4db4769..ef38638 100644
--- a/storage/browser/database/database_quota_client_unittest.cc
+++ b/storage/browser/database/database_quota_client_unittest.cc
@@ -30,8 +30,8 @@
 namespace content {
 
 // Declared to shorten the line lengths.
-static const storage::StorageType kTemp = storage::kStorageTypeTemporary;
-static const storage::StorageType kPerm = storage::kStorageTypePersistent;
+static const blink::StorageType kTemp = blink::StorageType::kTemporary;
+static const blink::StorageType kPerm = blink::StorageType::kPersistent;
 
 // Mock tracker class the mocks up those methods of the tracker
 // that are used by the QuotaClient.
@@ -140,7 +140,7 @@
 
   int64_t GetOriginUsage(storage::QuotaClient* client,
                          const GURL& origin,
-                         storage::StorageType type) {
+                         blink::StorageType type) {
     usage_ = 0;
     client->GetOriginUsage(
         origin, type,
@@ -152,7 +152,7 @@
   }
 
   const std::set<GURL>& GetOriginsForType(storage::QuotaClient* client,
-                                          storage::StorageType type) {
+                                          blink::StorageType type) {
     origins_.clear();
     client->GetOriginsForType(
         type, base::AdaptCallbackForRepeating(
@@ -163,7 +163,7 @@
   }
 
   const std::set<GURL>& GetOriginsForHost(storage::QuotaClient* client,
-                                          storage::StorageType type,
+                                          blink::StorageType type,
                                           const std::string& host) {
     origins_.clear();
     client->GetOriginsForHost(
@@ -176,7 +176,7 @@
   }
 
   bool DeleteOriginData(storage::QuotaClient* client,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const GURL& origin) {
     delete_status_ = blink::QuotaStatusCode::kUnknown;
     client->DeleteOriginData(
diff --git a/storage/browser/database/database_tracker.cc b/storage/browser/database/database_tracker.cc
index e4ee15f..ca5db00 100644
--- a/storage/browser/database/database_tracker.cc
+++ b/storage/browser/database/database_tracker.cc
@@ -25,6 +25,7 @@
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/browser/quota/special_storage_policy.h"
 #include "storage/common/database/database_identifier.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/sqlite/sqlite3.h"
 
 namespace storage {
@@ -117,7 +118,7 @@
     quota_manager_proxy_->NotifyStorageAccessed(
         storage::QuotaClient::kDatabase,
         storage::GetOriginFromIdentifier(origin_identifier),
-        storage::kStorageTypeTemporary);
+        blink::StorageType::kTemporary);
 
   InsertOrUpdateDatabaseDetails(origin_identifier, database_name,
                                 database_description, estimated_size);
@@ -154,7 +155,7 @@
     quota_manager_proxy_->NotifyStorageAccessed(
         storage::QuotaClient::kDatabase,
         storage::GetOriginFromIdentifier(origin_identifier),
-        storage::kStorageTypeTemporary);
+        blink::StorageType::kTemporary);
 
   UpdateOpenDatabaseSizeAndNotify(origin_identifier, database_name);
   if (database_connections_.RemoveConnection(origin_identifier, database_name))
@@ -372,8 +373,7 @@
     quota_manager_proxy_->NotifyStorageModified(
         storage::QuotaClient::kDatabase,
         storage::GetOriginFromIdentifier(origin_identifier),
-        storage::kStorageTypeTemporary,
-        -db_file_size);
+        blink::StorageType::kTemporary, -db_file_size);
 
   // Clean up the main database and invalidate the cached record.
   databases_table_->DeleteDatabaseDetails(origin_identifier, database_name);
@@ -433,8 +433,7 @@
     quota_manager_proxy_->NotifyStorageModified(
         storage::QuotaClient::kDatabase,
         storage::GetOriginFromIdentifier(origin_identifier),
-        storage::kStorageTypeTemporary,
-        -deleted_size);
+        blink::StorageType::kTemporary, -deleted_size);
   }
 
   return true;
@@ -631,8 +630,7 @@
       quota_manager_proxy_->NotifyStorageModified(
           storage::QuotaClient::kDatabase,
           storage::GetOriginFromIdentifier(origin_id),
-          storage::kStorageTypeTemporary,
-          new_size - old_size);
+          blink::StorageType::kTemporary, new_size - old_size);
     for (auto& observer : observers_)
       observer.OnDatabaseSizeChanged(origin_id, name, new_size);
   }
diff --git a/storage/browser/database/database_tracker_unittest.cc b/storage/browser/database/database_tracker_unittest.cc
index e3fb1fa4..441461e 100644
--- a/storage/browser/database/database_tracker_unittest.cc
+++ b/storage/browser/database/database_tracker_unittest.cc
@@ -107,18 +107,18 @@
 
   void NotifyStorageAccessed(storage::QuotaClient::ID client_id,
                              const GURL& origin,
-                             storage::StorageType type) override {
+                             blink::StorageType type) override {
     EXPECT_EQ(storage::QuotaClient::kDatabase, client_id);
-    EXPECT_EQ(storage::kStorageTypeTemporary, type);
+    EXPECT_EQ(blink::StorageType::kTemporary, type);
     accesses_[origin] += 1;
   }
 
   void NotifyStorageModified(storage::QuotaClient::ID client_id,
                              const GURL& origin,
-                             storage::StorageType type,
+                             blink::StorageType type,
                              int64_t delta) override {
     EXPECT_EQ(storage::QuotaClient::kDatabase, client_id);
-    EXPECT_EQ(storage::kStorageTypeTemporary, type);
+    EXPECT_EQ(blink::StorageType::kTemporary, type);
     modifications_[origin].first += 1;
     modifications_[origin].second += delta;
   }
@@ -128,11 +128,11 @@
   void NotifyOriginNoLongerInUse(const GURL& origin) override {}
   void SetUsageCacheEnabled(storage::QuotaClient::ID client_id,
                             const GURL& origin,
-                            storage::StorageType type,
+                            blink::StorageType type,
                             bool enabled) override {}
   void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner,
                         const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const UsageAndQuotaCallback& callback) override {}
 
   void SimulateQuotaManagerDestroyed() {
diff --git a/storage/browser/fileapi/file_system_quota_client.cc b/storage/browser/fileapi/file_system_quota_client.cc
index e6274ae..81e2ec2 100644
--- a/storage/browser/fileapi/file_system_quota_client.cc
+++ b/storage/browser/fileapi/file_system_quota_client.cc
@@ -21,7 +21,7 @@
 #include "third_party/WebKit/common/quota/quota_status_code.h"
 #include "url/gurl.h"
 
-using storage::StorageType;
+using blink::StorageType;
 
 namespace storage {
 
@@ -177,8 +177,7 @@
       callback);
 }
 
-bool FileSystemQuotaClient::DoesSupport(
-    storage::StorageType storage_type) const {
+bool FileSystemQuotaClient::DoesSupport(StorageType storage_type) const {
   FileSystemType type = QuotaStorageTypeToFileSystemType(storage_type);
   DCHECK(type != kFileSystemTypeUnknown);
   return file_system_context_->IsSandboxFileSystem(type);
diff --git a/storage/browser/fileapi/file_system_quota_client.h b/storage/browser/fileapi/file_system_quota_client.h
index 67adb9a..bfd975c 100644
--- a/storage/browser/fileapi/file_system_quota_client.h
+++ b/storage/browser/fileapi/file_system_quota_client.h
@@ -17,6 +17,7 @@
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/storage_browser_export.h"
 #include "storage/common/fileapi/file_system_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace base {
 class SequencedTaskRunner;
@@ -42,17 +43,17 @@
   storage::QuotaClient::ID id() const override;
   void OnQuotaManagerDestroyed() override;
   void GetOriginUsage(const GURL& origin_url,
-                      storage::StorageType type,
+                      blink::StorageType type,
                       const GetUsageCallback& callback) override;
-  void GetOriginsForType(storage::StorageType type,
+  void GetOriginsForType(blink::StorageType type,
                          const GetOriginsCallback& callback) override;
-  void GetOriginsForHost(storage::StorageType type,
+  void GetOriginsForHost(blink::StorageType type,
                          const std::string& host,
                          const GetOriginsCallback& callback) override;
   void DeleteOriginData(const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(blink::StorageType type) const override;
 
  private:
   base::SequencedTaskRunner* file_task_runner() const;
diff --git a/storage/browser/fileapi/file_system_quota_client_unittest.cc b/storage/browser/fileapi/file_system_quota_client_unittest.cc
index 1e6c93a..bddc906f7 100644
--- a/storage/browser/fileapi/file_system_quota_client_unittest.cc
+++ b/storage/browser/fileapi/file_system_quota_client_unittest.cc
@@ -20,11 +20,12 @@
 #include "storage/browser/test/test_file_system_context.h"
 #include "storage/common/fileapi/file_system_types.h"
 #include "storage/common/fileapi/file_system_util.h"
-#include "storage/common/quota/quota_types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
+using blink::StorageType;
 using content::AsyncFileTestHelper;
 using storage::FileSystemQuotaClient;
 using storage::FileSystemURL;
@@ -37,8 +38,8 @@
 const char kDummyURL3[] = "http://www.bleh";
 
 // Declared to shorten the variable names.
-const storage::StorageType kTemporary = storage::kStorageTypeTemporary;
-const storage::StorageType kPersistent = storage::kStorageTypePersistent;
+const StorageType kTemporary = StorageType::kTemporary;
+const StorageType kPersistent = StorageType::kPersistent;
 
 }  // namespace
 
@@ -60,7 +61,7 @@
     const char* name;
     int64_t size;
     const char* origin_url;
-    storage::StorageType type;
+    StorageType type;
   };
 
  protected:
@@ -70,7 +71,7 @@
 
   void GetOriginUsageAsync(FileSystemQuotaClient* quota_client,
                            const std::string& origin_url,
-                           storage::StorageType type) {
+                           StorageType type) {
     quota_client->GetOriginUsage(
         GURL(origin_url), type,
         base::Bind(&FileSystemQuotaClientTest::OnGetUsage,
@@ -79,14 +80,14 @@
 
   int64_t GetOriginUsage(FileSystemQuotaClient* quota_client,
                          const std::string& origin_url,
-                         storage::StorageType type) {
+                         StorageType type) {
     GetOriginUsageAsync(quota_client, origin_url, type);
     base::RunLoop().RunUntilIdle();
     return usage_;
   }
 
   const std::set<GURL>& GetOriginsForType(FileSystemQuotaClient* quota_client,
-                                          storage::StorageType type) {
+                                          StorageType type) {
     origins_.clear();
     quota_client->GetOriginsForType(
         type,
@@ -97,7 +98,7 @@
   }
 
   const std::set<GURL>& GetOriginsForHost(FileSystemQuotaClient* quota_client,
-                                          storage::StorageType type,
+                                          StorageType type,
                                           const std::string& host) {
     origins_.clear();
     quota_client->GetOriginsForHost(
@@ -110,7 +111,7 @@
 
   void RunAdditionalOriginUsageTask(FileSystemQuotaClient* quota_client,
                                     const std::string& origin_url,
-                                    storage::StorageType type) {
+                                    StorageType type) {
     quota_client->GetOriginUsage(
         GURL(origin_url), type,
         base::Bind(&FileSystemQuotaClientTest::OnGetAdditionalUsage,
@@ -119,7 +120,7 @@
 
   bool CreateFileSystemDirectory(const base::FilePath& file_path,
                                  const std::string& origin_url,
-                                 storage::StorageType storage_type) {
+                                 StorageType storage_type) {
     storage::FileSystemType type =
         storage::QuotaStorageTypeToFileSystemType(storage_type);
     FileSystemURL url = file_system_context_->CreateCrackedFileSystemURL(
@@ -133,7 +134,7 @@
   bool CreateFileSystemFile(const base::FilePath& file_path,
                             int64_t file_size,
                             const std::string& origin_url,
-                            storage::StorageType storage_type) {
+                            StorageType storage_type) {
     if (file_path.empty())
       return false;
 
@@ -183,7 +184,7 @@
   int64_t ComputeFilePathsCostForOriginAndType(const TestFile* files,
                                                int num_files,
                                                const std::string& origin_url,
-                                               storage::StorageType type) {
+                                               StorageType type) {
     int64_t file_paths_cost = 0;
     for (int i = 0; i < num_files; i++) {
       if (files[i].type == type &&
@@ -200,7 +201,7 @@
 
   void DeleteOriginData(FileSystemQuotaClient* quota_client,
                         const std::string& origin,
-                        storage::StorageType type) {
+                        StorageType type) {
     deletion_status_ = blink::QuotaStatusCode::kUnknown;
     quota_client->DeleteOriginData(
         GURL(origin), type,
diff --git a/storage/browser/fileapi/obfuscated_file_util_unittest.cc b/storage/browser/fileapi/obfuscated_file_util_unittest.cc
index 35ae9f78..2a937875 100644
--- a/storage/browser/fileapi/obfuscated_file_util_unittest.cc
+++ b/storage/browser/fileapi/obfuscated_file_util_unittest.cc
@@ -41,7 +41,6 @@
 #include "storage/browser/test/sandbox_file_system_test_helper.h"
 #include "storage/browser/test/test_file_system_context.h"
 #include "storage/common/database/database_identifier.h"
-#include "storage/common/quota/quota_types.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 using content::AsyncFileTestHelper;
diff --git a/storage/browser/fileapi/quota/quota_backend_impl_unittest.cc b/storage/browser/fileapi/quota/quota_backend_impl_unittest.cc
index 323c789..e1e7cbb 100644
--- a/storage/browser/fileapi/quota/quota_backend_impl_unittest.cc
+++ b/storage/browser/fileapi/quota/quota_backend_impl_unittest.cc
@@ -56,12 +56,12 @@
   void NotifyOriginNoLongerInUse(const GURL& origin) override {}
   void SetUsageCacheEnabled(storage::QuotaClient::ID client_id,
                             const GURL& origin,
-                            storage::StorageType type,
+                            blink::StorageType type,
                             bool enabled) override {}
 
   void NotifyStorageModified(storage::QuotaClient::ID client_id,
                              const GURL& origin,
-                             storage::StorageType type,
+                             blink::StorageType type,
                              int64_t delta) override {
     ++storage_modified_count_;
     usage_ += delta;
@@ -70,7 +70,7 @@
 
   void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner,
                         const GURL& origin,
-                        storage::StorageType type,
+                        blink::StorageType type,
                         const UsageAndQuotaCallback& callback) override {
     callback.Run(blink::QuotaStatusCode::kOk, usage_, quota_);
   }
diff --git a/storage/browser/fileapi/sandbox_file_system_backend_delegate_unittest.cc b/storage/browser/fileapi/sandbox_file_system_backend_delegate_unittest.cc
index e3541ff..53f769a 100644
--- a/storage/browser/fileapi/sandbox_file_system_backend_delegate_unittest.cc
+++ b/storage/browser/fileapi/sandbox_file_system_backend_delegate_unittest.cc
@@ -135,7 +135,7 @@
   EXPECT_EQ(quota_manager_proxy()->notify_storage_accessed_count(), 1);
   EXPECT_EQ(quota_manager_proxy()->last_notified_origin(), origin);
   EXPECT_EQ(quota_manager_proxy()->last_notified_type(),
-            storage::kStorageTypeTemporary);
+            blink::StorageType::kTemporary);
 }
 
 }  // namespace content
diff --git a/storage/browser/quota/client_usage_tracker.cc b/storage/browser/quota/client_usage_tracker.cc
index 4dec82c..397927c 100644
--- a/storage/browser/quota/client_usage_tracker.cc
+++ b/storage/browser/quota/client_usage_tracker.cc
@@ -58,7 +58,9 @@
 }  // namespace
 
 ClientUsageTracker::ClientUsageTracker(
-    UsageTracker* tracker, QuotaClient* client, StorageType type,
+    UsageTracker* tracker,
+    QuotaClient* client,
+    blink::StorageType type,
     SpecialStoragePolicy* special_storage_policy,
     StorageMonitor* storage_monitor)
     : tracker_(tracker),
@@ -487,7 +489,7 @@
 }
 
 bool ClientUsageTracker::IsStorageUnlimited(const GURL& origin) const {
-  if (type_ == kStorageTypeSyncable)
+  if (type_ == blink::StorageType::kSyncable)
     return false;
   return special_storage_policy_.get() &&
          special_storage_policy_->IsStorageUnlimited(origin);
diff --git a/storage/browser/quota/client_usage_tracker.h b/storage/browser/quota/client_usage_tracker.h
index 872e2074..182777d 100644
--- a/storage/browser/quota/client_usage_tracker.h
+++ b/storage/browser/quota/client_usage_tracker.h
@@ -21,7 +21,7 @@
 #include "storage/browser/quota/quota_task.h"
 #include "storage/browser/quota/special_storage_policy.h"
 #include "storage/browser/storage_browser_export.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace storage {
@@ -42,7 +42,7 @@
 
   ClientUsageTracker(UsageTracker* tracker,
                      QuotaClient* client,
-                     StorageType type,
+                     blink::StorageType type,
                      SpecialStoragePolicy* special_storage_policy,
                      StorageMonitor* storage_monitor);
   ~ClientUsageTracker() override;
@@ -117,7 +117,7 @@
 
   UsageTracker* tracker_;
   QuotaClient* client_;
-  const StorageType type_;
+  const blink::StorageType type_;
   StorageMonitor* storage_monitor_;
 
   int64_t global_limited_usage_;
diff --git a/storage/browser/quota/quota_callbacks.h b/storage/browser/quota/quota_callbacks.h
index d868abe..402af55 100644
--- a/storage/browser/quota/quota_callbacks.h
+++ b/storage/browser/quota/quota_callbacks.h
@@ -16,8 +16,8 @@
 #include "base/callback.h"
 #include "base/containers/flat_map.h"
 #include "storage/browser/quota/quota_client.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 class GURL;
 
@@ -39,7 +39,8 @@
     AvailableSpaceCallback;
 typedef base::Callback<void(blink::QuotaStatusCode)> StatusCallback;
 typedef base::Callback<void(const std::set<GURL>& origins,
-                            StorageType type)> GetOriginsCallback;
+                            blink::StorageType type)>
+    GetOriginsCallback;
 typedef base::Callback<void(const UsageInfoEntries&)> GetUsageInfoCallback;
 typedef base::Callback<void(const GURL&)> GetOriginCallback;
 
diff --git a/storage/browser/quota/quota_client.h b/storage/browser/quota/quota_client.h
index 9a29ab18..57d274d 100644
--- a/storage/browser/quota/quota_client.h
+++ b/storage/browser/quota/quota_client.h
@@ -13,8 +13,8 @@
 
 #include "base/callback.h"
 #include "storage/browser/storage_browser_export.h"
-#include "storage/common/quota/quota_types.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace storage {
@@ -53,29 +53,29 @@
   // |origin_url| and |type|.
   // Note it is safe to fire the callback after the QuotaClient is destructed.
   virtual void GetOriginUsage(const GURL& origin_url,
-                              StorageType type,
+                              blink::StorageType type,
                               const GetUsageCallback& callback) = 0;
 
   // Called by the QuotaManager.
   // Returns a list of origins that has data in the |type| storage.
   // Note it is safe to fire the callback after the QuotaClient is destructed.
-  virtual void GetOriginsForType(StorageType type,
+  virtual void GetOriginsForType(blink::StorageType type,
                                  const GetOriginsCallback& callback) = 0;
 
   // Called by the QuotaManager.
   // Returns a list of origins that match the |host|.
   // Note it is safe to fire the callback after the QuotaClient is destructed.
-  virtual void GetOriginsForHost(StorageType type,
+  virtual void GetOriginsForHost(blink::StorageType type,
                                  const std::string& host,
                                  const GetOriginsCallback& callback) = 0;
 
   // Called by the QuotaManager.
   // Note it is safe to fire the callback after the QuotaClient is destructed.
   virtual void DeleteOriginData(const GURL& origin,
-                                StorageType type,
+                                blink::StorageType type,
                                 const DeletionCallback& callback) = 0;
 
-  virtual bool DoesSupport(StorageType type) const = 0;
+  virtual bool DoesSupport(blink::StorageType type) const = 0;
 };
 
 // TODO(dmikurube): Replace it to std::vector for efficiency.
diff --git a/storage/browser/quota/quota_database.cc b/storage/browser/quota/quota_database.cc
index fee6621..c1828782 100644
--- a/storage/browser/quota/quota_database.cc
+++ b/storage/browser/quota/quota_database.cc
@@ -21,6 +21,8 @@
 #include "sql/transaction.h"
 #include "storage/browser/quota/special_storage_policy.h"
 
+using blink::StorageType;
+
 namespace storage {
 namespace {
 
@@ -125,9 +127,7 @@
 
 // Clang requires explicit out-of-line constructors for them.
 QuotaDatabase::QuotaTableEntry::QuotaTableEntry()
-    : type(kStorageTypeUnknown),
-      quota(0) {
-}
+    : type(StorageType::kUnknown), quota(0) {}
 
 QuotaDatabase::QuotaTableEntry::QuotaTableEntry(const std::string& host,
                                                 StorageType type,
@@ -135,9 +135,7 @@
     : host(host), type(type), quota(quota) {}
 
 QuotaDatabase::OriginInfoTableEntry::OriginInfoTableEntry()
-    : type(kStorageTypeUnknown),
-      used_count(0) {
-}
+    : type(StorageType::kUnknown), used_count(0) {}
 
 QuotaDatabase::OriginInfoTableEntry::OriginInfoTableEntry(
     const GURL& origin,
diff --git a/storage/browser/quota/quota_database.h b/storage/browser/quota/quota_database.h
index 4eae12d9..846d5d93 100644
--- a/storage/browser/quota/quota_database.h
+++ b/storage/browser/quota/quota_database.h
@@ -18,7 +18,7 @@
 #include "base/time/time.h"
 #include "base/timer/timer.h"
 #include "storage/browser/storage_browser_export.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace content {
@@ -42,12 +42,12 @@
   struct STORAGE_EXPORT OriginInfoTableEntry {
     OriginInfoTableEntry();
     OriginInfoTableEntry(const GURL& origin,
-                         StorageType type,
+                         blink::StorageType type,
                          int used_count,
                          const base::Time& last_access_time,
                          const base::Time& last_modified_time);
     GURL origin;
-    StorageType type;
+    blink::StorageType type;
     int used_count;
     base::Time last_access_time;
     base::Time last_modified_time;
@@ -64,46 +64,51 @@
   void CloseConnection();
 
   // Returns whether the record could be found.
-  bool GetHostQuota(const std::string& host, StorageType type, int64_t* quota);
+  bool GetHostQuota(const std::string& host,
+                    blink::StorageType type,
+                    int64_t* quota);
 
   // Returns whether the operation succeeded.
-  bool SetHostQuota(const std::string& host, StorageType type, int64_t quota);
-  bool DeleteHostQuota(const std::string& host, StorageType type);
+  bool SetHostQuota(const std::string& host,
+                    blink::StorageType type,
+                    int64_t quota);
+  bool DeleteHostQuota(const std::string& host, blink::StorageType type);
 
   bool SetOriginLastAccessTime(const GURL& origin,
-                               StorageType type,
+                               blink::StorageType type,
                                base::Time last_access_time);
 
   bool SetOriginLastModifiedTime(const GURL& origin,
-                                 StorageType type,
+                                 blink::StorageType type,
                                  base::Time last_modified_time);
 
   // Gets the time |origin| was last evicted. Returns whether the record could
   // be found.
   bool GetOriginLastEvictionTime(const GURL& origin,
-                                 StorageType type,
+                                 blink::StorageType type,
                                  base::Time* last_eviction_time);
 
   // Sets the time the origin was last evicted. Returns whether the operation
   // succeeded.
   bool SetOriginLastEvictionTime(const GURL& origin,
-                                 StorageType type,
+                                 blink::StorageType type,
                                  base::Time last_eviction_time);
-  bool DeleteOriginLastEvictionTime(const GURL& origin, StorageType type);
+  bool DeleteOriginLastEvictionTime(const GURL& origin,
+                                    blink::StorageType type);
 
   // Register initial |origins| info |type| to the database.
   // This method is assumed to be called only after the installation or
   // the database schema reset.
-  bool RegisterInitialOriginInfo(
-      const std::set<GURL>& origins, StorageType type);
+  bool RegisterInitialOriginInfo(const std::set<GURL>& origins,
+                                 blink::StorageType type);
 
   // Gets the OriginInfoTableEntry for |origin|. Returns whether the record
   // could be found.
   bool GetOriginInfo(const GURL& origin,
-                     StorageType type,
+                     blink::StorageType type,
                      OriginInfoTableEntry* entry);
 
-  bool DeleteOriginInfo(const GURL& origin, StorageType type);
+  bool DeleteOriginInfo(const GURL& origin, blink::StorageType type);
 
   bool GetQuotaConfigValue(const char* key, int64_t* value);
   bool SetQuotaConfigValue(const char* key, int64_t value);
@@ -112,14 +117,14 @@
   // in |exceptions| and not granted the special unlimited storage right.
   // It returns false when it failed in accessing the database.
   // |origin| is set to empty when there is no matching origin.
-  bool GetLRUOrigin(StorageType type,
+  bool GetLRUOrigin(blink::StorageType type,
                     const std::set<GURL>& exceptions,
                     SpecialStoragePolicy* special_storage_policy,
                     GURL* origin);
 
   // Populates |origins| with the ones that have been modified since
   // the |modified_since|. Returns whether the operation succeeded.
-  bool GetOriginsModifiedSince(StorageType type,
+  bool GetOriginsModifiedSince(blink::StorageType type,
                                std::set<GURL>* origins,
                                base::Time modified_since);
 
@@ -132,9 +137,11 @@
  private:
   struct STORAGE_EXPORT QuotaTableEntry {
     QuotaTableEntry();
-    QuotaTableEntry(const std::string& host, StorageType type, int64_t quota);
+    QuotaTableEntry(const std::string& host,
+                    blink::StorageType type,
+                    int64_t quota);
     std::string host;
-    StorageType type;
+    blink::StorageType type;
     int64_t quota;
   };
   friend STORAGE_EXPORT bool operator <(
@@ -172,7 +179,7 @@
   bool ResetSchema();
   bool UpgradeSchema(int current_version);
   bool InsertOrReplaceHostQuota(const std::string& host,
-                                StorageType type,
+                                blink::StorageType type,
                                 int64_t quota);
 
   static bool CreateSchema(
diff --git a/storage/browser/quota/quota_database_unittest.cc b/storage/browser/quota/quota_database_unittest.cc
index 625c864..92b35f7 100644
--- a/storage/browser/quota/quota_database_unittest.cc
+++ b/storage/browser/quota/quota_database_unittest.cc
@@ -25,8 +25,6 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-using storage::kStorageTypePersistent;
-using storage::kStorageTypeTemporary;
 using storage::QuotaDatabase;
 
 namespace content {
@@ -38,6 +36,10 @@
 
 }  // namespace
 
+// Declared to shorten the line lengths.
+static const blink::StorageType kTemporary = blink::StorageType::kTemporary;
+static const blink::StorageType kPersistent = blink::StorageType::kPersistent;
+
 class QuotaDatabaseTest : public testing::Test {
  protected:
   typedef QuotaDatabase::QuotaTableEntry QuotaTableEntry;
@@ -62,9 +64,9 @@
 
   void UpgradeSchemaV2toV5(const base::FilePath& kDbFile) {
     const QuotaTableEntry entries[] = {
-      QuotaTableEntry("a", kStorageTypeTemporary,  1),
-      QuotaTableEntry("b", kStorageTypeTemporary,  2),
-      QuotaTableEntry("c", kStorageTypePersistent, 3),
+        QuotaTableEntry("a", kTemporary, 1),
+        QuotaTableEntry("b", kTemporary, 2),
+        QuotaTableEntry("c", kPersistent, 3),
     };
 
     CreateV2Database(kDbFile, entries, arraysize(entries));
@@ -92,25 +94,25 @@
     const int kQuota2 = kQuota1 + 1024;
 
     int64_t quota = -1;
-    EXPECT_FALSE(db.GetHostQuota(kHost, kStorageTypeTemporary, &quota));
-    EXPECT_FALSE(db.GetHostQuota(kHost, kStorageTypePersistent, &quota));
+    EXPECT_FALSE(db.GetHostQuota(kHost, kTemporary, &quota));
+    EXPECT_FALSE(db.GetHostQuota(kHost, kPersistent, &quota));
 
     // Insert quota for temporary.
-    EXPECT_TRUE(db.SetHostQuota(kHost, kStorageTypeTemporary, kQuota1));
-    EXPECT_TRUE(db.GetHostQuota(kHost, kStorageTypeTemporary, &quota));
+    EXPECT_TRUE(db.SetHostQuota(kHost, kTemporary, kQuota1));
+    EXPECT_TRUE(db.GetHostQuota(kHost, kTemporary, &quota));
     EXPECT_EQ(kQuota1, quota);
 
     // Update quota for temporary.
-    EXPECT_TRUE(db.SetHostQuota(kHost, kStorageTypeTemporary, kQuota2));
-    EXPECT_TRUE(db.GetHostQuota(kHost, kStorageTypeTemporary, &quota));
+    EXPECT_TRUE(db.SetHostQuota(kHost, kTemporary, kQuota2));
+    EXPECT_TRUE(db.GetHostQuota(kHost, kTemporary, &quota));
     EXPECT_EQ(kQuota2, quota);
 
     // Quota for persistent must not be updated.
-    EXPECT_FALSE(db.GetHostQuota(kHost, kStorageTypePersistent, &quota));
+    EXPECT_FALSE(db.GetHostQuota(kHost, kPersistent, &quota));
 
     // Delete temporary storage quota.
-    EXPECT_TRUE(db.DeleteHostQuota(kHost, kStorageTypeTemporary));
-    EXPECT_FALSE(db.GetHostQuota(kHost, kStorageTypeTemporary, &quota));
+    EXPECT_TRUE(db.DeleteHostQuota(kHost, kTemporary));
+    EXPECT_FALSE(db.GetHostQuota(kHost, kTemporary, &quota));
   }
 
   void GlobalQuota(const base::FilePath& kDbFile) {
@@ -149,8 +151,7 @@
 
     std::set<GURL> exceptions;
     GURL origin;
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_TRUE(origin.is_empty());
 
     const GURL kOrigin1("http://a/");
@@ -159,19 +160,18 @@
     const GURL kOrigin4("http://p/");
 
     // Adding three temporary storages, and
-    EXPECT_TRUE(db.SetOriginLastAccessTime(
-        kOrigin1, kStorageTypeTemporary, base::Time::FromInternalValue(10)));
-    EXPECT_TRUE(db.SetOriginLastAccessTime(
-        kOrigin2, kStorageTypeTemporary, base::Time::FromInternalValue(20)));
-    EXPECT_TRUE(db.SetOriginLastAccessTime(
-        kOrigin3, kStorageTypeTemporary, base::Time::FromInternalValue(30)));
+    EXPECT_TRUE(db.SetOriginLastAccessTime(kOrigin1, kTemporary,
+                                           base::Time::FromInternalValue(10)));
+    EXPECT_TRUE(db.SetOriginLastAccessTime(kOrigin2, kTemporary,
+                                           base::Time::FromInternalValue(20)));
+    EXPECT_TRUE(db.SetOriginLastAccessTime(kOrigin3, kTemporary,
+                                           base::Time::FromInternalValue(30)));
 
     // one persistent.
-    EXPECT_TRUE(db.SetOriginLastAccessTime(
-        kOrigin4, kStorageTypePersistent, base::Time::FromInternalValue(40)));
+    EXPECT_TRUE(db.SetOriginLastAccessTime(kOrigin4, kPersistent,
+                                           base::Time::FromInternalValue(40)));
 
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_EQ(kOrigin1.spec(), origin.spec());
 
     // Test that unlimited origins are exluded from eviction, but
@@ -180,47 +180,40 @@
         new MockSpecialStoragePolicy);
     policy->AddUnlimited(kOrigin1);
     policy->AddProtected(kOrigin2);
-    EXPECT_TRUE(db.GetLRUOrigin(
-        kStorageTypeTemporary, exceptions, policy.get(), &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, policy.get(), &origin));
     EXPECT_EQ(kOrigin2.spec(), origin.spec());
 
     // Test that durable origins are excluded from eviction.
     policy->AddDurable(kOrigin2);
-    EXPECT_TRUE(db.GetLRUOrigin(
-        kStorageTypeTemporary, exceptions, policy.get(), &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, policy.get(), &origin));
     EXPECT_EQ(kOrigin3.spec(), origin.spec());
 
     exceptions.insert(kOrigin1);
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_EQ(kOrigin2.spec(), origin.spec());
 
     exceptions.insert(kOrigin2);
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_EQ(kOrigin3.spec(), origin.spec());
 
     exceptions.insert(kOrigin3);
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_TRUE(origin.is_empty());
 
-    EXPECT_TRUE(db.SetOriginLastAccessTime(
-        kOrigin1, kStorageTypeTemporary, base::Time::Now()));
+    EXPECT_TRUE(
+        db.SetOriginLastAccessTime(kOrigin1, kTemporary, base::Time::Now()));
 
     // Delete origin/type last access time information.
-    EXPECT_TRUE(db.DeleteOriginInfo(kOrigin3, kStorageTypeTemporary));
+    EXPECT_TRUE(db.DeleteOriginInfo(kOrigin3, kTemporary));
 
     // Querying again to see if the deletion has worked.
     exceptions.clear();
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_EQ(kOrigin2.spec(), origin.spec());
 
     exceptions.insert(kOrigin1);
     exceptions.insert(kOrigin2);
-    EXPECT_TRUE(db.GetLRUOrigin(kStorageTypeTemporary, exceptions,
-                                NULL, &origin));
+    EXPECT_TRUE(db.GetLRUOrigin(kTemporary, exceptions, NULL, &origin));
     EXPECT_TRUE(origin.is_empty());
   }
 
@@ -229,8 +222,7 @@
     ASSERT_TRUE(db.LazyOpen(true));
 
     std::set<GURL> origins;
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypeTemporary, &origins, base::Time()));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kTemporary, &origins, base::Time()));
     EXPECT_TRUE(origins.empty());
 
     const GURL kOrigin1("http://a/");
@@ -238,45 +230,44 @@
     const GURL kOrigin3("http://c/");
 
     // Report last mod time for the test origins.
+    EXPECT_TRUE(db.SetOriginLastModifiedTime(kOrigin1, kTemporary,
+                                             base::Time::FromInternalValue(0)));
     EXPECT_TRUE(db.SetOriginLastModifiedTime(
-        kOrigin1, kStorageTypeTemporary, base::Time::FromInternalValue(0)));
+        kOrigin2, kTemporary, base::Time::FromInternalValue(10)));
     EXPECT_TRUE(db.SetOriginLastModifiedTime(
-        kOrigin2, kStorageTypeTemporary, base::Time::FromInternalValue(10)));
-    EXPECT_TRUE(db.SetOriginLastModifiedTime(
-        kOrigin3, kStorageTypeTemporary, base::Time::FromInternalValue(20)));
+        kOrigin3, kTemporary, base::Time::FromInternalValue(20)));
 
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypeTemporary, &origins, base::Time()));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kTemporary, &origins, base::Time()));
     EXPECT_EQ(3U, origins.size());
     EXPECT_EQ(1U, origins.count(kOrigin1));
     EXPECT_EQ(1U, origins.count(kOrigin2));
     EXPECT_EQ(1U, origins.count(kOrigin3));
 
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypeTemporary, &origins, base::Time::FromInternalValue(5)));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kTemporary, &origins,
+                                           base::Time::FromInternalValue(5)));
     EXPECT_EQ(2U, origins.size());
     EXPECT_EQ(0U, origins.count(kOrigin1));
     EXPECT_EQ(1U, origins.count(kOrigin2));
     EXPECT_EQ(1U, origins.count(kOrigin3));
 
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypeTemporary, &origins, base::Time::FromInternalValue(15)));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kTemporary, &origins,
+                                           base::Time::FromInternalValue(15)));
     EXPECT_EQ(1U, origins.size());
     EXPECT_EQ(0U, origins.count(kOrigin1));
     EXPECT_EQ(0U, origins.count(kOrigin2));
     EXPECT_EQ(1U, origins.count(kOrigin3));
 
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypeTemporary, &origins, base::Time::FromInternalValue(25)));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kTemporary, &origins,
+                                           base::Time::FromInternalValue(25)));
     EXPECT_TRUE(origins.empty());
 
     // Update origin1's mod time but for persistent storage.
     EXPECT_TRUE(db.SetOriginLastModifiedTime(
-        kOrigin1, kStorageTypePersistent, base::Time::FromInternalValue(30)));
+        kOrigin1, kPersistent, base::Time::FromInternalValue(30)));
 
     // Must have no effects on temporary origins info.
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypeTemporary, &origins, base::Time::FromInternalValue(5)));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kTemporary, &origins,
+                                           base::Time::FromInternalValue(5)));
     EXPECT_EQ(2U, origins.size());
     EXPECT_EQ(0U, origins.count(kOrigin1));
     EXPECT_EQ(1U, origins.count(kOrigin2));
@@ -284,17 +275,17 @@
 
     // One more update for persistent origin2.
     EXPECT_TRUE(db.SetOriginLastModifiedTime(
-        kOrigin2, kStorageTypePersistent, base::Time::FromInternalValue(40)));
+        kOrigin2, kPersistent, base::Time::FromInternalValue(40)));
 
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypePersistent, &origins, base::Time::FromInternalValue(25)));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kPersistent, &origins,
+                                           base::Time::FromInternalValue(25)));
     EXPECT_EQ(2U, origins.size());
     EXPECT_EQ(1U, origins.count(kOrigin1));
     EXPECT_EQ(1U, origins.count(kOrigin2));
     EXPECT_EQ(0U, origins.count(kOrigin3));
 
-    EXPECT_TRUE(db.GetOriginsModifiedSince(
-        kStorageTypePersistent, &origins, base::Time::FromInternalValue(35)));
+    EXPECT_TRUE(db.GetOriginsModifiedSince(kPersistent, &origins,
+                                           base::Time::FromInternalValue(35)));
     EXPECT_EQ(1U, origins.size());
     EXPECT_EQ(0U, origins.count(kOrigin1));
     EXPECT_EQ(1U, origins.count(kOrigin2));
@@ -310,50 +301,47 @@
     const GURL kOrigin3("http://c/");
 
     base::Time last_eviction_time;
-    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin1, kStorageTypeTemporary,
+    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin1, kTemporary,
                                               &last_eviction_time));
     EXPECT_EQ(base::Time(), last_eviction_time);
 
     // Report last eviction time for the test origins.
     EXPECT_TRUE(db.SetOriginLastEvictionTime(
-        kOrigin1, kStorageTypeTemporary, base::Time::FromInternalValue(10)));
+        kOrigin1, kTemporary, base::Time::FromInternalValue(10)));
     EXPECT_TRUE(db.SetOriginLastEvictionTime(
-        kOrigin2, kStorageTypeTemporary, base::Time::FromInternalValue(20)));
+        kOrigin2, kTemporary, base::Time::FromInternalValue(20)));
     EXPECT_TRUE(db.SetOriginLastEvictionTime(
-        kOrigin3, kStorageTypeTemporary, base::Time::FromInternalValue(30)));
+        kOrigin3, kTemporary, base::Time::FromInternalValue(30)));
 
-    EXPECT_TRUE(db.GetOriginLastEvictionTime(kOrigin1, kStorageTypeTemporary,
+    EXPECT_TRUE(db.GetOriginLastEvictionTime(kOrigin1, kTemporary,
                                              &last_eviction_time));
     EXPECT_EQ(base::Time::FromInternalValue(10), last_eviction_time);
-    EXPECT_TRUE(db.GetOriginLastEvictionTime(kOrigin2, kStorageTypeTemporary,
+    EXPECT_TRUE(db.GetOriginLastEvictionTime(kOrigin2, kTemporary,
                                              &last_eviction_time));
     EXPECT_EQ(base::Time::FromInternalValue(20), last_eviction_time);
-    EXPECT_TRUE(db.GetOriginLastEvictionTime(kOrigin3, kStorageTypeTemporary,
+    EXPECT_TRUE(db.GetOriginLastEvictionTime(kOrigin3, kTemporary,
                                              &last_eviction_time));
     EXPECT_EQ(base::Time::FromInternalValue(30), last_eviction_time);
 
     // Delete last eviction times for the test origins.
-    EXPECT_TRUE(
-        db.DeleteOriginLastEvictionTime(kOrigin1, kStorageTypeTemporary));
-    EXPECT_TRUE(
-        db.DeleteOriginLastEvictionTime(kOrigin2, kStorageTypeTemporary));
-    EXPECT_TRUE(
-        db.DeleteOriginLastEvictionTime(kOrigin3, kStorageTypeTemporary));
+    EXPECT_TRUE(db.DeleteOriginLastEvictionTime(kOrigin1, kTemporary));
+    EXPECT_TRUE(db.DeleteOriginLastEvictionTime(kOrigin2, kTemporary));
+    EXPECT_TRUE(db.DeleteOriginLastEvictionTime(kOrigin3, kTemporary));
 
     last_eviction_time = base::Time();
-    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin1, kStorageTypeTemporary,
+    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin1, kTemporary,
                                               &last_eviction_time));
     EXPECT_EQ(base::Time(), last_eviction_time);
-    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin2, kStorageTypeTemporary,
+    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin2, kTemporary,
                                               &last_eviction_time));
     EXPECT_EQ(base::Time(), last_eviction_time);
-    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin3, kStorageTypeTemporary,
+    EXPECT_FALSE(db.GetOriginLastEvictionTime(kOrigin3, kTemporary,
                                               &last_eviction_time));
     EXPECT_EQ(base::Time(), last_eviction_time);
 
     // Deleting an origin that is not present should not fail.
     EXPECT_TRUE(db.DeleteOriginLastEvictionTime(GURL("http://notpresent.com"),
-                                                kStorageTypeTemporary));
+                                                kTemporary));
   }
 
   void RegisterInitialOriginInfo(const base::FilePath& kDbFile) {
@@ -365,27 +353,23 @@
       GURL("http://c/") };
     std::set<GURL> origins(kOrigins, kOrigins + arraysize(kOrigins));
 
-    EXPECT_TRUE(db.RegisterInitialOriginInfo(origins, kStorageTypeTemporary));
+    EXPECT_TRUE(db.RegisterInitialOriginInfo(origins, kTemporary));
 
     QuotaDatabase::OriginInfoTableEntry info;
     info.used_count = -1;
-    EXPECT_TRUE(db.GetOriginInfo(
-        GURL("http://a/"), kStorageTypeTemporary, &info));
+    EXPECT_TRUE(db.GetOriginInfo(GURL("http://a/"), kTemporary, &info));
     EXPECT_EQ(0, info.used_count);
 
-    EXPECT_TRUE(db.SetOriginLastAccessTime(
-        GURL("http://a/"), kStorageTypeTemporary,
-        base::Time::FromDoubleT(1.0)));
+    EXPECT_TRUE(db.SetOriginLastAccessTime(GURL("http://a/"), kTemporary,
+                                           base::Time::FromDoubleT(1.0)));
     info.used_count = -1;
-    EXPECT_TRUE(db.GetOriginInfo(
-        GURL("http://a/"), kStorageTypeTemporary, &info));
+    EXPECT_TRUE(db.GetOriginInfo(GURL("http://a/"), kTemporary, &info));
     EXPECT_EQ(1, info.used_count);
 
-    EXPECT_TRUE(db.RegisterInitialOriginInfo(origins, kStorageTypeTemporary));
+    EXPECT_TRUE(db.RegisterInitialOriginInfo(origins, kTemporary));
 
     info.used_count = -1;
-    EXPECT_TRUE(db.GetOriginInfo(
-        GURL("http://a/"), kStorageTypeTemporary, &info));
+    EXPECT_TRUE(db.GetOriginInfo(GURL("http://a/"), kTemporary, &info));
     EXPECT_EQ(1, info.used_count);
   }
 
@@ -405,10 +389,9 @@
 
   void DumpQuotaTable(const base::FilePath& kDbFile) {
     QuotaTableEntry kTableEntries[] = {
-      QuotaTableEntry("http://go/", kStorageTypeTemporary, 1),
-      QuotaTableEntry("http://oo/", kStorageTypeTemporary, 2),
-      QuotaTableEntry("http://gle/", kStorageTypePersistent, 3)
-    };
+        QuotaTableEntry("http://go/", kTemporary, 1),
+        QuotaTableEntry("http://oo/", kTemporary, 2),
+        QuotaTableEntry("http://gle/", kPersistent, 3)};
     QuotaTableEntry* begin = kTableEntries;
     QuotaTableEntry* end = kTableEntries + arraysize(kTableEntries);
 
@@ -428,9 +411,9 @@
     base::Time now(base::Time::Now());
     typedef QuotaDatabase::OriginInfoTableEntry Entry;
     Entry kTableEntries[] = {
-      Entry(GURL("http://go/"), kStorageTypeTemporary, 2147483647, now, now),
-      Entry(GURL("http://oo/"), kStorageTypeTemporary, 0, now, now),
-      Entry(GURL("http://gle/"), kStorageTypeTemporary, 1, now, now),
+        Entry(GURL("http://go/"), kTemporary, 2147483647, now, now),
+        Entry(GURL("http://oo/"), kTemporary, 0, now, now),
+        Entry(GURL("http://gle/"), kTemporary, 1, now, now),
     };
     Entry* begin = kTableEntries;
     Entry* end = kTableEntries + arraysize(kTableEntries);
@@ -451,7 +434,7 @@
     const GURL kOrigin = GURL("http://go/");
     typedef QuotaDatabase::OriginInfoTableEntry Entry;
     Entry kTableEntries[] = {
-        Entry(kOrigin, kStorageTypeTemporary, 100, base::Time(), base::Time())};
+        Entry(kOrigin, kTemporary, 100, base::Time(), base::Time())};
     Entry* begin = kTableEntries;
     Entry* end = kTableEntries + arraysize(kTableEntries);
 
@@ -462,7 +445,7 @@
 
     {
       Entry entry;
-      EXPECT_TRUE(db.GetOriginInfo(kOrigin, kStorageTypeTemporary, &entry));
+      EXPECT_TRUE(db.GetOriginInfo(kOrigin, kTemporary, &entry));
       EXPECT_EQ(kTableEntries[0].type, entry.type);
       EXPECT_EQ(kTableEntries[0].origin, entry.origin);
       EXPECT_EQ(kTableEntries[0].used_count, entry.used_count);
@@ -472,8 +455,8 @@
 
     {
       Entry entry;
-      EXPECT_FALSE(db.GetOriginInfo(GURL("http://notpresent.org/"),
-                                    kStorageTypeTemporary, &entry));
+      EXPECT_FALSE(
+          db.GetOriginInfo(GURL("http://notpresent.org/"), kTemporary, &entry));
     }
   }
 
diff --git a/storage/browser/quota/quota_manager.cc b/storage/browser/quota/quota_manager.cc
index cdb5fc9a..9ba9ee41 100644
--- a/storage/browser/quota/quota_manager.cc
+++ b/storage/browser/quota/quota_manager.cc
@@ -37,7 +37,8 @@
 #include "storage/browser/quota/quota_temporary_storage_evictor.h"
 #include "storage/browser/quota/storage_monitor.h"
 #include "storage/browser/quota/usage_tracker.h"
-#include "storage/common/quota/quota_types.h"
+
+using blink::StorageType;
 
 namespace storage {
 
@@ -82,12 +83,12 @@
 namespace {
 
 bool IsSupportedType(StorageType type) {
-  return type == kStorageTypeTemporary || type == kStorageTypePersistent ||
-         type == kStorageTypeSyncable;
+  return type == StorageType::kTemporary || type == StorageType::kPersistent ||
+         type == StorageType::kSyncable;
 }
 
 bool IsSupportedIncognitoType(StorageType type) {
-  return type == kStorageTypeTemporary || type == kStorageTypePersistent;
+  return type == StorageType::kTemporary || type == StorageType::kPersistent;
 }
 
 void CountOriginType(const std::set<GURL>& origins,
@@ -114,7 +115,7 @@
                                       int64_t* quota,
                                       QuotaDatabase* database) {
   DCHECK(database);
-  database->GetHostQuota(host, kStorageTypePersistent, quota);
+  database->GetHostQuota(host, StorageType::kPersistent, quota);
   return true;
 }
 
@@ -122,7 +123,7 @@
                                       int64_t* new_quota,
                                       QuotaDatabase* database) {
   DCHECK(database);
-  if (database->SetHostQuota(host, kStorageTypePersistent, *new_quota))
+  if (database->SetHostQuota(host, StorageType::kPersistent, *new_quota))
     return true;
   *new_quota = 0;
   return false;
@@ -184,7 +185,7 @@
     return true;
 
   // Register existing origins with 0 last time access.
-  if (database->RegisterInitialOriginInfo(*origins, kStorageTypeTemporary)) {
+  if (database->RegisterInitialOriginInfo(*origins, StorageType::kTemporary)) {
     database->SetOriginDatabaseBootstrapped(true);
     return true;
   }
@@ -261,15 +262,15 @@
     // Determine host_quota differently depending on type.
     if (is_unlimited_) {
       SetDesiredHostQuota(barrier, blink::QuotaStatusCode::kOk, kNoLimit);
-    } else if (type_ == kStorageTypeSyncable) {
+    } else if (type_ == StorageType::kSyncable) {
       SetDesiredHostQuota(barrier, blink::QuotaStatusCode::kOk,
                           kSyncableStorageDefaultHostQuota);
-    } else if (type_ == kStorageTypePersistent) {
+    } else if (type_ == StorageType::kPersistent) {
       manager()->GetPersistentHostQuota(
           host, base::Bind(&UsageAndQuotaHelper::SetDesiredHostQuota,
                            weak_factory_.GetWeakPtr(), barrier));
     } else {
-      DCHECK_EQ(kStorageTypeTemporary, type_);
+      DCHECK_EQ(StorageType::kTemporary, type_);
       // For temporary storage,  OnGotSettings will set the host quota.
     }
   }
@@ -294,7 +295,7 @@
                                               settings_.must_remain_available));
     callback_.Run(blink::QuotaStatusCode::kOk, host_usage_, host_quota,
                   std::move(host_usage_breakdown_));
-    if (type_ == kStorageTypeTemporary && !is_incognito_ && !is_unlimited_) {
+    if (type_ == StorageType::kTemporary && !is_incognito_ && !is_unlimited_) {
       UMA_HISTOGRAM_MBYTES("Quota.QuotaForOrigin", host_quota);
       if (host_quota > 0) {
         UMA_HISTOGRAM_PERCENTAGE("Quota.PercentUsedByOrigin",
@@ -313,7 +314,7 @@
                      const QuotaSettings& settings) {
     settings_ = settings;
     barrier_closure.Run();
-    if (type_ == kStorageTypeTemporary && !is_unlimited_) {
+    if (type_ == StorageType::kTemporary && !is_unlimited_) {
       int64_t host_quota = is_session_only_
                                ? settings.session_only_per_host_quota
                                : settings.per_host_quota;
@@ -428,12 +429,12 @@
         available_space_ > settings_.should_remain_available) {
       DCHECK(!global_usage_is_complete_);
       global_usage_ =
-          manager()->GetUsageTracker(kStorageTypeTemporary)->GetCachedUsage();
+          manager()->GetUsageTracker(StorageType::kTemporary)->GetCachedUsage();
       CallCompleted();
       return;
     }
     manager()->GetGlobalUsage(
-        kStorageTypeTemporary,
+        StorageType::kTemporary,
         base::Bind(&EvictionRoundInfoHelper::OnGotGlobalUsage,
                    weak_factory_.GetWeakPtr()));
   }
@@ -476,18 +477,21 @@
 
     remaining_trackers_ = 3;
     // This will populate cached hosts and usage info.
-    manager()->GetUsageTracker(kStorageTypeTemporary)->GetGlobalUsage(
-        base::Bind(&GetUsageInfoTask::DidGetGlobalUsage,
-                   weak_factory_.GetWeakPtr(),
-                   kStorageTypeTemporary));
-    manager()->GetUsageTracker(kStorageTypePersistent)->GetGlobalUsage(
-        base::Bind(&GetUsageInfoTask::DidGetGlobalUsage,
-                   weak_factory_.GetWeakPtr(),
-                   kStorageTypePersistent));
-    manager()->GetUsageTracker(kStorageTypeSyncable)->GetGlobalUsage(
-        base::Bind(&GetUsageInfoTask::DidGetGlobalUsage,
-                   weak_factory_.GetWeakPtr(),
-                   kStorageTypeSyncable));
+    manager()
+        ->GetUsageTracker(StorageType::kTemporary)
+        ->GetGlobalUsage(base::Bind(&GetUsageInfoTask::DidGetGlobalUsage,
+                                    weak_factory_.GetWeakPtr(),
+                                    StorageType::kTemporary));
+    manager()
+        ->GetUsageTracker(StorageType::kPersistent)
+        ->GetGlobalUsage(base::Bind(&GetUsageInfoTask::DidGetGlobalUsage,
+                                    weak_factory_.GetWeakPtr(),
+                                    StorageType::kPersistent));
+    manager()
+        ->GetUsageTracker(StorageType::kSyncable)
+        ->GetGlobalUsage(base::Bind(&GetUsageInfoTask::DidGetGlobalUsage,
+                                    weak_factory_.GetWeakPtr(),
+                                    StorageType::kSyncable));
   }
 
   void Completed() override {
@@ -875,7 +879,7 @@
   }
   LazyInitialize();
 
-  bool is_session_only = type == kStorageTypeTemporary &&
+  bool is_session_only = type == StorageType::kTemporary &&
                          special_storage_policy_ &&
                          special_storage_policy_->IsStorageSessionOnly(origin);
   UsageAndQuotaHelper* helper = new UsageAndQuotaHelper(
@@ -1083,9 +1087,9 @@
                                       StorageType type) const {
   // For syncable storage we should always enforce quota (since the
   // quota must be capped by the server limit).
-  if (type == kStorageTypeSyncable)
+  if (type == StorageType::kSyncable)
     return false;
-  if (type == kStorageTypeQuotaNotManaged)
+  if (type == StorageType::kQuotaNotManaged)
     return true;
   return special_storage_policy_.get() &&
          special_storage_policy_->IsStorageUnlimited(origin);
@@ -1114,19 +1118,19 @@
   if (GetUsageTracker(type)->IsWorking())
     return false;
   switch (type) {
-    case kStorageTypeTemporary:
+    case StorageType::kTemporary:
       temporary_usage_tracker_.reset(new UsageTracker(
-          clients_, kStorageTypeTemporary, special_storage_policy_.get(),
+          clients_, StorageType::kTemporary, special_storage_policy_.get(),
           storage_monitor_.get()));
       return true;
-    case kStorageTypePersistent:
+    case StorageType::kPersistent:
       persistent_usage_tracker_.reset(new UsageTracker(
-          clients_, kStorageTypePersistent, special_storage_policy_.get(),
+          clients_, StorageType::kPersistent, special_storage_policy_.get(),
           storage_monitor_.get()));
       return true;
-    case kStorageTypeSyncable:
+    case StorageType::kSyncable:
       syncable_usage_tracker_.reset(new UsageTracker(
-          clients_, kStorageTypeSyncable, special_storage_policy_.get(),
+          clients_, StorageType::kSyncable, special_storage_policy_.get(),
           storage_monitor_.get()));
       return true;
     default:
@@ -1155,8 +1159,7 @@
 }
 
 QuotaManager::EvictionContext::EvictionContext()
-    : evicted_type(kStorageTypeUnknown) {
-}
+    : evicted_type(StorageType::kUnknown) {}
 
 QuotaManager::EvictionContext::~EvictionContext() = default;
 
@@ -1171,15 +1174,15 @@
   database_.reset(new QuotaDatabase(is_incognito_ ? base::FilePath() :
       profile_path_.AppendASCII(kDatabaseName)));
 
-  temporary_usage_tracker_.reset(new UsageTracker(
-      clients_, kStorageTypeTemporary, special_storage_policy_.get(),
-      storage_monitor_.get()));
-  persistent_usage_tracker_.reset(new UsageTracker(
-      clients_, kStorageTypePersistent, special_storage_policy_.get(),
-      storage_monitor_.get()));
-  syncable_usage_tracker_.reset(new UsageTracker(
-      clients_, kStorageTypeSyncable, special_storage_policy_.get(),
-      storage_monitor_.get()));
+  temporary_usage_tracker_.reset(
+      new UsageTracker(clients_, StorageType::kTemporary,
+                       special_storage_policy_.get(), storage_monitor_.get()));
+  persistent_usage_tracker_.reset(
+      new UsageTracker(clients_, StorageType::kPersistent,
+                       special_storage_policy_.get(), storage_monitor_.get()));
+  syncable_usage_tracker_.reset(
+      new UsageTracker(clients_, StorageType::kSyncable,
+                       special_storage_policy_.get(), storage_monitor_.get()));
 
   if (!is_incognito_) {
     histogram_timer_.Start(
@@ -1219,7 +1222,7 @@
     bool success) {
   is_database_bootstrapped_ = success;
   DidDatabaseWork(success);
-  GetLRUOrigin(kStorageTypeTemporary, did_get_origin_callback);
+  GetLRUOrigin(StorageType::kTemporary, did_get_origin_callback);
 }
 
 void QuotaManager::RegisterClient(QuotaClient* client) {
@@ -1229,15 +1232,15 @@
 
 UsageTracker* QuotaManager::GetUsageTracker(StorageType type) const {
   switch (type) {
-    case kStorageTypeTemporary:
+    case StorageType::kTemporary:
       return temporary_usage_tracker_.get();
-    case kStorageTypePersistent:
+    case StorageType::kPersistent:
       return persistent_usage_tracker_.get();
-    case kStorageTypeSyncable:
+    case StorageType::kSyncable:
       return syncable_usage_tracker_.get();
-    case kStorageTypeQuotaNotManaged:
+    case StorageType::kQuotaNotManaged:
       return NULL;
-    case kStorageTypeUnknown:
+    case StorageType::kUnknown:
       NOTREACHED();
   }
   return NULL;
@@ -1256,7 +1259,7 @@
     const GURL& origin, StorageType type,
     base::Time accessed_time) {
   LazyInitialize();
-  if (type == kStorageTypeTemporary && is_getting_eviction_origin_) {
+  if (type == StorageType::kTemporary && is_getting_eviction_origin_) {
     // Record the accessed origins while GetLRUOrigin task is runing
     // to filter out them from eviction.
     access_notified_origins_.insert(origin);
@@ -1368,10 +1371,10 @@
 
 void QuotaManager::ReportHistogram() {
   DCHECK(!is_incognito_);
-  GetGlobalUsage(kStorageTypeTemporary,
-                 base::Bind(
-                     &QuotaManager::DidGetTemporaryGlobalUsageForHistogram,
-                     weak_factory_.GetWeakPtr()));
+  GetGlobalUsage(
+      StorageType::kTemporary,
+      base::Bind(&QuotaManager::DidGetTemporaryGlobalUsageForHistogram,
+                 weak_factory_.GetWeakPtr()));
 }
 
 void QuotaManager::DidGetTemporaryGlobalUsageForHistogram(
@@ -1380,7 +1383,7 @@
   UMA_HISTOGRAM_MBYTES("Quota.GlobalUsageOfTemporaryStorage", usage);
 
   std::set<GURL> origins;
-  GetCachedOrigins(kStorageTypeTemporary, &origins);
+  GetCachedOrigins(StorageType::kTemporary, &origins);
 
   size_t num_origins = origins.size();
   size_t protected_origins = 0;
@@ -1395,10 +1398,10 @@
   UMA_HISTOGRAM_COUNTS_1M("Quota.NumberOfUnlimitedTemporaryStorageOrigins",
                           unlimited_origins);
 
-  GetGlobalUsage(kStorageTypePersistent,
-                 base::Bind(
-                     &QuotaManager::DidGetPersistentGlobalUsageForHistogram,
-                     weak_factory_.GetWeakPtr()));
+  GetGlobalUsage(
+      StorageType::kPersistent,
+      base::Bind(&QuotaManager::DidGetPersistentGlobalUsageForHistogram,
+                 weak_factory_.GetWeakPtr()));
 }
 
 void QuotaManager::DidGetPersistentGlobalUsageForHistogram(
@@ -1407,7 +1410,7 @@
   UMA_HISTOGRAM_MBYTES("Quota.GlobalUsageOfPersistentStorage", usage);
 
   std::set<GURL> origins;
-  GetCachedOrigins(kStorageTypePersistent, &origins);
+  GetCachedOrigins(StorageType::kPersistent, &origins);
 
   size_t num_origins = origins.size();
   size_t protected_origins = 0;
@@ -1433,10 +1436,10 @@
     const OriginInfoTableEntries& entries) {
   using UsageMap = std::map<GURL, int64_t>;
   UsageMap usage_map;
-  GetUsageTracker(kStorageTypeTemporary)->GetCachedOriginsUsage(&usage_map);
+  GetUsageTracker(StorageType::kTemporary)->GetCachedOriginsUsage(&usage_map);
   base::Time now = base::Time::Now();
   for (const auto& info : entries) {
-    if (info.type != kStorageTypeTemporary)
+    if (info.type != StorageType::kTemporary)
       continue;
 
     // Ignore stale database entries. If there is no map entry, the origin's
@@ -1505,7 +1508,7 @@
   if (!is_database_bootstrapped_ && !eviction_disabled_) {
     // Once bootstrapped, GetLRUOrigin will be called.
     GetGlobalUsage(
-        kStorageTypeTemporary,
+        StorageType::kTemporary,
         base::Bind(&QuotaManager::BootstrapDatabaseForEviction,
                    weak_factory_.GetWeakPtr(), did_get_origin_callback));
     return;
@@ -1518,7 +1521,7 @@
                                    StorageType type,
                                    const StatusCallback& callback) {
   DCHECK(io_thread_->BelongsToCurrentThread());
-  DCHECK_EQ(type, kStorageTypeTemporary);
+  DCHECK_EQ(type, StorageType::kTemporary);
 
   eviction_context_.evicted_origin = origin;
   eviction_context_.evicted_type = type;
@@ -1653,8 +1656,8 @@
 void QuotaManager::ContinueIncognitoGetStorageCapacity(
     const QuotaSettings& settings) {
   int64_t current_usage =
-      GetUsageTracker(kStorageTypeTemporary)->GetCachedUsage();
-  current_usage += GetUsageTracker(kStorageTypePersistent)->GetCachedUsage();
+      GetUsageTracker(StorageType::kTemporary)->GetCachedUsage();
+  current_usage += GetUsageTracker(StorageType::kPersistent)->GetCachedUsage();
   int64_t available_space =
       std::max(INT64_C(0), settings.pool_size - current_usage);
   DidGetStorageCapacity(std::make_tuple(settings.pool_size, available_space));
diff --git a/storage/browser/quota/quota_manager.h b/storage/browser/quota/quota_manager.h
index f17e9b6..f51b6e0 100644
--- a/storage/browser/quota/quota_manager.h
+++ b/storage/browser/quota/quota_manager.h
@@ -33,6 +33,7 @@
 #include "storage/browser/quota/storage_observer.h"
 #include "storage/browser/storage_browser_export.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace base {
 class FilePath;
@@ -81,14 +82,14 @@
 
   // Returns next origin to evict.  It might return an empty GURL when there are
   // no evictable origins.
-  virtual void GetEvictionOrigin(StorageType type,
+  virtual void GetEvictionOrigin(blink::StorageType type,
                                  const std::set<GURL>& extra_exceptions,
                                  int64_t global_quota,
                                  const GetOriginCallback& callback) = 0;
 
   // Called to evict an origin.
   virtual void EvictOriginData(const GURL& origin,
-                               StorageType type,
+                               blink::StorageType type,
                                const StatusCallback& callback) = 0;
 
  protected:
@@ -96,10 +97,10 @@
 };
 
 struct UsageInfo {
-  UsageInfo(const std::string& host, StorageType type, int64_t usage)
+  UsageInfo(const std::string& host, blink::StorageType type, int64_t usage)
       : host(host), type(type), usage(usage) {}
   std::string host;
-  StorageType type;
+  blink::StorageType type;
   int64_t usage;
 };
 
@@ -144,14 +145,14 @@
   // This method is declared as virtual to allow test code to override it.
   virtual void GetUsageAndQuotaForWebApps(
       const GURL& origin,
-      StorageType type,
+      blink::StorageType type,
       const UsageAndQuotaCallback& callback);
 
   // Called by DevTools.
   // This method is declared as virtual to allow test code to override it.
   virtual void GetUsageAndQuotaWithBreakdown(
       const GURL& origin,
-      StorageType type,
+      blink::StorageType type,
       const UsageAndQuotaWithBreakdownCallback& callback);
 
   // Called by StorageClients.
@@ -161,7 +162,7 @@
   // to avoid extra query cost.
   // Do not call this method for apps/user-facing code.
   virtual void GetUsageAndQuota(const GURL& origin,
-                                StorageType type,
+                                blink::StorageType type,
                                 const UsageAndQuotaCallback& callback);
 
   // Called by clients via proxy.
@@ -169,14 +170,14 @@
   // Used to maintain LRU ordering.
   void NotifyStorageAccessed(QuotaClient::ID client_id,
                              const GURL& origin,
-                             StorageType type);
+                             blink::StorageType type);
 
   // Called by clients via proxy.
   // Client storage must call this method whenever they have made any
   // modifications that change the amount of data stored in their storage.
   void NotifyStorageModified(QuotaClient::ID client_id,
                              const GURL& origin,
-                             StorageType type,
+                             blink::StorageType type,
                              int64_t delta);
 
   // Used to avoid evicting origins with open pages.
@@ -190,22 +191,22 @@
 
   void SetUsageCacheEnabled(QuotaClient::ID client_id,
                             const GURL& origin,
-                            StorageType type,
+                            blink::StorageType type,
                             bool enabled);
 
   // DeleteOriginData and DeleteHostData (surprisingly enough) delete data of a
-  // particular StorageType associated with either a specific origin or set of
-  // origins. Each method additionally requires a |quota_client_mask| which
-  // specifies the types of QuotaClients to delete from the origin. This is
-  // specified by the caller as a bitmask built from QuotaClient::IDs. Setting
-  // the mask to QuotaClient::kAllClientsMask will remove all clients from the
-  // origin, regardless of type.
+  // particular blink::StorageType associated with either a specific origin or
+  // set of origins. Each method additionally requires a |quota_client_mask|
+  // which specifies the types of QuotaClients to delete from the origin. This
+  // is specified by the caller as a bitmask built from QuotaClient::IDs.
+  // Setting the mask to QuotaClient::kAllClientsMask will remove all clients
+  // from the origin, regardless of type.
   virtual void DeleteOriginData(const GURL& origin,
-                                StorageType type,
+                                blink::StorageType type,
                                 int quota_client_mask,
                                 const StatusCallback& callback);
   void DeleteHostData(const std::string& host,
-                      StorageType type,
+                      blink::StorageType type,
                       int quota_client_mask,
                       const StatusCallback& callback);
 
@@ -215,27 +216,31 @@
   void SetPersistentHostQuota(const std::string& host,
                               int64_t new_quota,
                               const QuotaCallback& callback);
-  void GetGlobalUsage(StorageType type, const GlobalUsageCallback& callback);
-  void GetHostUsage(const std::string& host, StorageType type,
+  void GetGlobalUsage(blink::StorageType type,
+                      const GlobalUsageCallback& callback);
+  void GetHostUsage(const std::string& host,
+                    blink::StorageType type,
                     const UsageCallback& callback);
-  void GetHostUsage(const std::string& host, StorageType type,
+  void GetHostUsage(const std::string& host,
+                    blink::StorageType type,
                     QuotaClient::ID client_id,
                     const UsageCallback& callback);
   void GetHostUsageWithBreakdown(const std::string& host,
-                                 StorageType type,
+                                 blink::StorageType type,
                                  const UsageWithBreakdownCallback& callback);
 
-  bool IsTrackingHostUsage(StorageType type, QuotaClient::ID client_id) const;
+  bool IsTrackingHostUsage(blink::StorageType type,
+                           QuotaClient::ID client_id) const;
 
   void GetStatistics(std::map<std::string, std::string>* statistics);
 
-  bool IsStorageUnlimited(const GURL& origin, StorageType type) const;
+  bool IsStorageUnlimited(const GURL& origin, blink::StorageType type) const;
 
-  virtual void GetOriginsModifiedSince(StorageType type,
+  virtual void GetOriginsModifiedSince(blink::StorageType type,
                                        base::Time modified_since,
                                        const GetOriginsCallback& callback);
 
-  bool ResetUsageTracker(StorageType type);
+  bool ResetUsageTracker(blink::StorageType type);
 
   // Used to register/deregister observers that wish to monitor storage events.
   void AddStorageObserver(StorageObserver* observer,
@@ -315,7 +320,7 @@
     EvictionContext();
     ~EvictionContext();
     GURL evicted_origin;
-    StorageType evicted_type;
+    blink::StorageType evicted_type;
     StatusCallback evict_origin_data_callback;
   };
 
@@ -337,21 +342,20 @@
   // The client must remain valid until OnQuotaManagerDestored is called.
   void RegisterClient(QuotaClient* client);
 
-  UsageTracker* GetUsageTracker(StorageType type) const;
+  UsageTracker* GetUsageTracker(blink::StorageType type) const;
 
   // Extract cached origins list from the usage tracker.
   // (Might return empty list if no origin is tracked by the tracker.)
-  void GetCachedOrigins(StorageType type, std::set<GURL>* origins);
+  void GetCachedOrigins(blink::StorageType type, std::set<GURL>* origins);
 
   // These internal methods are separately defined mainly for testing.
-  void NotifyStorageAccessedInternal(
-      QuotaClient::ID client_id,
-      const GURL& origin,
-      StorageType type,
-      base::Time accessed_time);
+  void NotifyStorageAccessedInternal(QuotaClient::ID client_id,
+                                     const GURL& origin,
+                                     blink::StorageType type,
+                                     base::Time accessed_time);
   void NotifyStorageModifiedInternal(QuotaClient::ID client_id,
                                      const GURL& origin,
-                                     StorageType type,
+                                     blink::StorageType type,
                                      int64_t delta,
                                      base::Time modified_time);
 
@@ -359,7 +363,7 @@
   void DumpOriginInfoTable(const DumpOriginInfoTableCallback& callback);
 
   void DeleteOriginDataInternal(const GURL& origin,
-                                StorageType type,
+                                blink::StorageType type,
                                 int quota_client_mask,
                                 bool is_eviction,
                                 const StatusCallback& callback);
@@ -367,7 +371,7 @@
   // Methods for eviction logic.
   void StartEviction();
   void DeleteOriginFromDatabase(const GURL& origin,
-                                StorageType type,
+                                blink::StorageType type,
                                 bool is_eviction);
 
   void DidOriginDataEvicted(blink::QuotaStatusCode status);
@@ -386,16 +390,16 @@
                             const GURL& origin);
 
   // QuotaEvictionHandler.
-  void GetEvictionOrigin(StorageType type,
+  void GetEvictionOrigin(blink::StorageType type,
                          const std::set<GURL>& extra_exceptions,
                          int64_t global_quota,
                          const GetOriginCallback& callback) override;
   void EvictOriginData(const GURL& origin,
-                       StorageType type,
+                       blink::StorageType type,
                        const StatusCallback& callback) override;
   void GetEvictionRoundInfo(const EvictionRoundInfoCallback& callback) override;
 
-  void GetLRUOrigin(StorageType type, const GetOriginCallback& callback);
+  void GetLRUOrigin(blink::StorageType type, const GetOriginCallback& callback);
 
   void DidGetPersistentHostQuota(const std::string& host,
                                  const int64_t* quota,
diff --git a/storage/browser/quota/quota_manager_proxy.cc b/storage/browser/quota/quota_manager_proxy.cc
index 219709e7..ae2755c 100644
--- a/storage/browser/quota/quota_manager_proxy.cc
+++ b/storage/browser/quota/quota_manager_proxy.cc
@@ -54,10 +54,9 @@
     client->OnQuotaManagerDestroyed();
 }
 
-void QuotaManagerProxy::NotifyStorageAccessed(
-    QuotaClient::ID client_id,
-    const GURL& origin,
-    StorageType type) {
+void QuotaManagerProxy::NotifyStorageAccessed(QuotaClient::ID client_id,
+                                              const GURL& origin,
+                                              blink::StorageType type) {
   if (!io_thread_->BelongsToCurrentThread()) {
     io_thread_->PostTask(
         FROM_HERE,
@@ -72,7 +71,7 @@
 
 void QuotaManagerProxy::NotifyStorageModified(QuotaClient::ID client_id,
                                               const GURL& origin,
-                                              StorageType type,
+                                              blink::StorageType type,
                                               int64_t delta) {
   if (!io_thread_->BelongsToCurrentThread()) {
     io_thread_->PostTask(
@@ -114,7 +113,7 @@
 
 void QuotaManagerProxy::SetUsageCacheEnabled(QuotaClient::ID client_id,
                                              const GURL& origin,
-                                             StorageType type,
+                                             blink::StorageType type,
                                              bool enabled) {
   if (!io_thread_->BelongsToCurrentThread()) {
     io_thread_->PostTask(
@@ -130,7 +129,7 @@
 void QuotaManagerProxy::GetUsageAndQuota(
     base::SequencedTaskRunner* original_task_runner,
     const GURL& origin,
-    StorageType type,
+    blink::StorageType type,
     const UsageAndQuotaCallback& callback) {
   if (!io_thread_->BelongsToCurrentThread()) {
     io_thread_->PostTask(
diff --git a/storage/browser/quota/quota_manager_proxy.h b/storage/browser/quota/quota_manager_proxy.h
index 7125a6a..2d805c31 100644
--- a/storage/browser/quota/quota_manager_proxy.h
+++ b/storage/browser/quota/quota_manager_proxy.h
@@ -22,6 +22,7 @@
 #include "storage/browser/quota/quota_task.h"
 #include "storage/browser/quota/special_storage_policy.h"
 #include "storage/browser/storage_browser_export.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace base {
 class SequencedTaskRunner;
@@ -39,21 +40,21 @@
   virtual void RegisterClient(QuotaClient* client);
   virtual void NotifyStorageAccessed(QuotaClient::ID client_id,
                                      const GURL& origin,
-                                     StorageType type);
+                                     blink::StorageType type);
   virtual void NotifyStorageModified(QuotaClient::ID client_id,
                                      const GURL& origin,
-                                     StorageType type,
+                                     blink::StorageType type,
                                      int64_t delta);
   virtual void NotifyOriginInUse(const GURL& origin);
   virtual void NotifyOriginNoLongerInUse(const GURL& origin);
 
   virtual void SetUsageCacheEnabled(QuotaClient::ID client_id,
                                     const GURL& origin,
-                                    StorageType type,
+                                    blink::StorageType type,
                                     bool enabled);
   virtual void GetUsageAndQuota(base::SequencedTaskRunner* original_task_runner,
                                 const GURL& origin,
-                                StorageType type,
+                                blink::StorageType type,
                                 const UsageAndQuotaCallback& callback);
 
   // This method may only be called on the IO thread.
diff --git a/storage/browser/quota/quota_manager_unittest.cc b/storage/browser/quota/quota_manager_unittest.cc
index 6b142ced..7f0c267 100644
--- a/storage/browser/quota/quota_manager_unittest.cc
+++ b/storage/browser/quota/quota_manager_unittest.cc
@@ -33,14 +33,10 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "url/gurl.h"
 
-using storage::kStorageTypePersistent;
-using storage::kStorageTypeSyncable;
-using storage::kStorageTypeTemporary;
-using storage::kStorageTypeUnknown;
+using blink::QuotaStatusCode;
+using blink::StorageType;
 using storage::QuotaClient;
 using storage::QuotaManager;
-using blink::QuotaStatusCode;
-using storage::StorageType;
 using storage::UsageInfo;
 using storage::UsageInfoEntries;
 
@@ -49,9 +45,9 @@
 namespace {
 
 // For shorter names.
-const StorageType kTemp = kStorageTypeTemporary;
-const StorageType kPerm = kStorageTypePersistent;
-const StorageType kSync = kStorageTypeSyncable;
+const StorageType kTemp = StorageType::kTemporary;
+const StorageType kPerm = StorageType::kPersistent;
+const StorageType kSync = StorageType::kSyncable;
 
 const int kAllClients = QuotaClient::kAllClientsMask;
 
@@ -326,7 +322,7 @@
 
   void GetOriginsModifiedSince(StorageType type, base::Time modified_since) {
     modified_origins_.clear();
-    modified_origins_type_ = kStorageTypeUnknown;
+    modified_origins_type_ = StorageType::kUnknown;
     quota_manager_->GetOriginsModifiedSince(
         type, modified_since,
         base::Bind(&QuotaManagerTest::DidGetModifiedOrigins,
@@ -549,8 +545,8 @@
     } else if (info.host == "example.com" && info.type == kPerm) {
       EXPECT_EQ(40, info.usage);
     } else {
-      ADD_FAILURE()
-          << "Unexpected host, type: " << info.host << ", " << info.type;
+      ADD_FAILURE() << "Unexpected host, type: " << info.host << ", "
+                    << static_cast<int>(info.type);
     }
   }
 }
@@ -2173,7 +2169,7 @@
        itr != end; ++itr) {
     SCOPED_TRACE(testing::Message()
                  << "host = " << itr->origin << ", "
-                 << "type = " << itr->type << ", "
+                 << "type = " << static_cast<int>(itr->type) << ", "
                  << "used_count = " << itr->used_count);
     EXPECT_EQ(1u, entries.erase(
         make_pair(make_pair(itr->origin, itr->type),
diff --git a/storage/browser/quota/quota_temporary_storage_evictor.cc b/storage/browser/quota/quota_temporary_storage_evictor.cc
index c4c13fc4..3c2c4f1 100644
--- a/storage/browser/quota/quota_temporary_storage_evictor.cc
+++ b/storage/browser/quota/quota_temporary_storage_evictor.cc
@@ -12,6 +12,7 @@
 #include "base/bind.h"
 #include "base/metrics/histogram_macros.h"
 #include "storage/browser/quota/quota_manager.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 #define UMA_HISTOGRAM_MBYTES(name, sample)          \
@@ -208,7 +209,7 @@
     // TODO(michaeln): if the reason for eviction is low physical disk space,
     // make 'unlimited' origins subject to eviction too.
     quota_eviction_handler_->GetEvictionOrigin(
-        kStorageTypeTemporary, in_progress_eviction_origins_,
+        blink::StorageType::kTemporary, in_progress_eviction_origins_,
         settings.pool_size,
         base::Bind(&QuotaTemporaryStorageEvictor::OnGotEvictionOrigin,
                    weak_factory_.GetWeakPtr()));
@@ -239,10 +240,10 @@
 
   in_progress_eviction_origins_.insert(origin);
 
-  quota_eviction_handler_->EvictOriginData(origin, kStorageTypeTemporary,
-      base::Bind(
-          &QuotaTemporaryStorageEvictor::OnEvictionComplete,
-          weak_factory_.GetWeakPtr()));
+  quota_eviction_handler_->EvictOriginData(
+      origin, blink::StorageType::kTemporary,
+      base::Bind(&QuotaTemporaryStorageEvictor::OnEvictionComplete,
+                 weak_factory_.GetWeakPtr()));
 }
 
 void QuotaTemporaryStorageEvictor::OnEvictionComplete(
diff --git a/storage/browser/quota/quota_temporary_storage_evictor_unittest.cc b/storage/browser/quota/quota_temporary_storage_evictor_unittest.cc
index d7d5193..3f04f69e 100644
--- a/storage/browser/quota/quota_temporary_storage_evictor_unittest.cc
+++ b/storage/browser/quota/quota_temporary_storage_evictor_unittest.cc
@@ -21,7 +21,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 using storage::QuotaTemporaryStorageEvictor;
-using storage::StorageType;
+using blink::StorageType;
 
 namespace content {
 
diff --git a/storage/browser/quota/storage_monitor.cc b/storage/browser/quota/storage_monitor.cc
index 0e14400..0c18362 100644
--- a/storage/browser/quota/storage_monitor.cc
+++ b/storage/browser/quota/storage_monitor.cc
@@ -309,8 +309,8 @@
   DCHECK(observer);
 
   // Check preconditions.
-  if (params.filter.storage_type == kStorageTypeUnknown ||
-      params.filter.storage_type == kStorageTypeQuotaNotManaged ||
+  if (params.filter.storage_type == blink::StorageType::kUnknown ||
+      params.filter.storage_type == blink::StorageType::kQuotaNotManaged ||
       params.filter.origin.is_empty()) {
     NOTREACHED();
     return;
@@ -332,7 +332,7 @@
 }
 
 const StorageTypeObservers* StorageMonitor::GetStorageTypeObservers(
-    StorageType storage_type) const {
+    blink::StorageType storage_type) const {
   auto it = storage_type_observers_map_.find(storage_type);
   if (it != storage_type_observers_map_.end())
     return it->second.get();
@@ -343,8 +343,8 @@
 void StorageMonitor::NotifyUsageChange(const StorageObserver::Filter& filter,
                                        int64_t delta) {
   // Check preconditions.
-  if (filter.storage_type == kStorageTypeUnknown ||
-      filter.storage_type == kStorageTypeQuotaNotManaged ||
+  if (filter.storage_type == blink::StorageType::kUnknown ||
+      filter.storage_type == blink::StorageType::kQuotaNotManaged ||
       filter.origin.is_empty()) {
     NOTREACHED();
     return;
diff --git a/storage/browser/quota/storage_monitor.h b/storage/browser/quota/storage_monitor.h
index 95d447d..87a78790 100644
--- a/storage/browser/quota/storage_monitor.h
+++ b/storage/browser/quota/storage_monitor.h
@@ -16,6 +16,7 @@
 #include "base/timer/timer.h"
 #include "storage/browser/quota/storage_observer.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace content {
 class StorageMonitorTestBase;
@@ -163,14 +164,14 @@
 
   // Returns the observers of a specific storage type.
   const StorageTypeObservers* GetStorageTypeObservers(
-      StorageType storage_type) const;
+      blink::StorageType storage_type) const;
 
   // Handles a usage change.
   void NotifyUsageChange(const StorageObserver::Filter& filter, int64_t delta);
 
  private:
   QuotaManager* quota_manager_;
-  std::map<StorageType, std::unique_ptr<StorageTypeObservers>>
+  std::map<blink::StorageType, std::unique_ptr<StorageTypeObservers>>
       storage_type_observers_map_;
 
   DISALLOW_COPY_AND_ASSIGN(StorageMonitor);
diff --git a/storage/browser/quota/storage_monitor_unittest.cc b/storage/browser/quota/storage_monitor_unittest.cc
index 12f6585ce..b972584 100644
--- a/storage/browser/quota/storage_monitor_unittest.cc
+++ b/storage/browser/quota/storage_monitor_unittest.cc
@@ -21,16 +21,14 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 using blink::QuotaStatusCode;
+using blink::StorageType;
 using storage::HostStorageObservers;
-using storage::kStorageTypePersistent;
-using storage::kStorageTypeTemporary;
 using storage::QuotaClient;
 using storage::QuotaManager;
 using storage::SpecialStoragePolicy;
 using storage::StorageMonitor;
 using storage::StorageObserver;
 using storage::StorageObserverList;
-using storage::StorageType;
 using storage::StorageTypeObservers;
 
 namespace content {
@@ -187,10 +185,9 @@
 
 // Test dispatching events to one observer.
 TEST_F(StorageObserverListTest, DispatchEventToSingleObserver) {
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   MockObserver mock_observer;
   StorageObserverList observer_list;
   observer_list.AddObserver(&mock_observer, params);
@@ -240,7 +237,7 @@
   MockObserver mock_observer1;
   MockObserver mock_observer2;
   StorageObserverList observer_list;
-  StorageObserver::Filter filter(kStorageTypePersistent,
+  StorageObserver::Filter filter(StorageType::kPersistent,
                                  GURL(kDefaultOrigin));
   observer_list.AddObserver(
       &mock_observer1,
@@ -292,10 +289,9 @@
 // Ensure that the |origin| field in events match the origin specified by the
 // observer on registration.
 TEST_F(StorageObserverListTest, ReplaceEventOrigin) {
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   MockObserver mock_observer;
   StorageObserverList observer_list;
   observer_list.AddObserver(&mock_observer, params);
@@ -314,10 +310,9 @@
 
 // Verify that HostStorageObservers is initialized after the first usage change.
 TEST_F(HostStorageObserversTest, InitializeOnUsageChange) {
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   const int64_t kUsage = 324554;
   const int64_t kQuota = 234354354;
   quota_manager_->SetCallbackParams(kUsage, kQuota, QuotaStatusCode::kOk);
@@ -353,10 +348,9 @@
 
   // |host_observers| should not be initialized after the first observer is
   // added because it did not elect to receive the initial state.
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   MockObserver mock_observer1;
   host_observers.AddObserver(&mock_observer1, params);
   EXPECT_FALSE(host_observers.is_initialized());
@@ -400,10 +394,9 @@
 
 // Verify that negative usage and quota is changed to zero.
 TEST_F(HostStorageObserversTest, NegativeUsageAndQuota) {
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   const int64_t kUsage = -324554;
   const int64_t kQuota = -234354354;
   quota_manager_->SetCallbackParams(kUsage, kQuota, QuotaStatusCode::kOk);
@@ -419,10 +412,9 @@
 
 // Verify that HostStorageObservers can recover from a bad initialization.
 TEST_F(HostStorageObserversTest, RecoverFromBadUsageInit) {
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   MockObserver mock_observer;
   HostStorageObservers host_observers(quota_manager_.get());
   host_observers.AddObserver(&mock_observer, params);
@@ -453,10 +445,9 @@
 // Verify that HostStorageObservers handle initialization of the cached usage
 // and quota correctly.
 TEST_F(HostStorageObserversTest, AsyncInitialization) {
-  StorageObserver::MonitorParams params(kStorageTypePersistent,
+  StorageObserver::MonitorParams params(StorageType::kPersistent,
                                         GURL(kDefaultOrigin),
-                                        base::TimeDelta::FromHours(1),
-                                        false);
+                                        base::TimeDelta::FromHours(1), false);
   MockObserver mock_observer;
   HostStorageObservers host_observers(quota_manager_.get());
   host_observers.AddObserver(&mock_observer, params);
@@ -499,14 +490,12 @@
 TEST_F(StorageTypeObserversTest, AddRemoveObservers) {
   StorageTypeObservers type_observers(quota_manager_.get());
 
-  StorageObserver::MonitorParams params1(kStorageTypePersistent,
+  StorageObserver::MonitorParams params1(StorageType::kPersistent,
                                          GURL(kDefaultOrigin),
-                                         base::TimeDelta::FromHours(1),
-                                         false);
-  StorageObserver::MonitorParams params2(kStorageTypePersistent,
+                                         base::TimeDelta::FromHours(1), false);
+  StorageObserver::MonitorParams params2(StorageType::kPersistent,
                                          GURL(kAlternativeOrigin),
-                                         base::TimeDelta::FromHours(1),
-                                         false);
+                                         base::TimeDelta::FromHours(1), false);
   std::string host1 = net::GetHostOrSpecFromURL(params1.filter.origin);
   std::string host2 = net::GetHostOrSpecFromURL(params2.filter.origin);
 
@@ -547,15 +536,14 @@
  public:
   StorageMonitorTest()
       : storage_monitor_(NULL),
-        params1_(kStorageTypeTemporary,
+        params1_(StorageType::kTemporary,
                  GURL(kDefaultOrigin),
                  base::TimeDelta::FromHours(1),
                  false),
-        params2_(kStorageTypePersistent,
+        params2_(StorageType::kPersistent,
                  GURL(kDefaultOrigin),
                  base::TimeDelta::FromHours(1),
-                 false) {
-  }
+                 false) {}
 
  protected:
   void SetUp() override {
@@ -580,17 +568,19 @@
   }
 
   void CheckObserverCount(int expected_temporary, int expected_persistent) {
-    ASSERT_TRUE(storage_monitor_->GetStorageTypeObservers(
-                    kStorageTypeTemporary));
-    ASSERT_TRUE(storage_monitor_->GetStorageTypeObservers(
-                    kStorageTypeTemporary)->GetHostObservers(host_));
-    EXPECT_EQ(expected_temporary, GetObserverCount(kStorageTypeTemporary));
+    ASSERT_TRUE(
+        storage_monitor_->GetStorageTypeObservers(StorageType::kTemporary));
+    ASSERT_TRUE(
+        storage_monitor_->GetStorageTypeObservers(StorageType::kTemporary)
+            ->GetHostObservers(host_));
+    EXPECT_EQ(expected_temporary, GetObserverCount(StorageType::kTemporary));
 
-    ASSERT_TRUE(storage_monitor_->GetStorageTypeObservers(
-                    kStorageTypePersistent));
-    ASSERT_TRUE(storage_monitor_->GetStorageTypeObservers(
-                    kStorageTypePersistent)->GetHostObservers(host_));
-    EXPECT_EQ(expected_persistent, GetObserverCount(kStorageTypePersistent));
+    ASSERT_TRUE(
+        storage_monitor_->GetStorageTypeObservers(StorageType::kPersistent));
+    ASSERT_TRUE(
+        storage_monitor_->GetStorageTypeObservers(StorageType::kPersistent)
+            ->GetHostObservers(host_));
+    EXPECT_EQ(expected_persistent, GetObserverCount(StorageType::kPersistent));
   }
 
   StorageMonitor* storage_monitor_;
@@ -666,7 +656,7 @@
 // This test simulates a usage change in a quota client and verifies that a
 // storage observer will receive a storage event.
 TEST_F(StorageMonitorIntegrationTest, NotifyUsageEvent) {
-  const StorageType kTestStorageType = kStorageTypePersistent;
+  const StorageType kTestStorageType = StorageType::kPersistent;
   const int64_t kTestUsage = 234743;
 
   // Register the observer.
diff --git a/storage/browser/quota/storage_observer.cc b/storage/browser/quota/storage_observer.cc
index 81d33873..4a0ba3d 100644
--- a/storage/browser/quota/storage_observer.cc
+++ b/storage/browser/quota/storage_observer.cc
@@ -11,12 +11,11 @@
 // StorageObserver::Filter
 
 StorageObserver::Filter::Filter()
-    : storage_type(kStorageTypeUnknown) {
-}
+    : storage_type(blink::StorageType::kUnknown) {}
 
-StorageObserver::Filter::Filter(StorageType storage_type, const GURL& origin)
-    : storage_type(storage_type), origin(origin) {
-}
+StorageObserver::Filter::Filter(blink::StorageType storage_type,
+                                const GURL& origin)
+    : storage_type(storage_type), origin(origin) {}
 
 bool StorageObserver::Filter::operator==(const Filter& other) const {
   return storage_type == other.storage_type &&
@@ -29,15 +28,13 @@
     : dispatch_initial_state(false) {
 }
 
-StorageObserver::MonitorParams::MonitorParams(
-    StorageType storage_type,
-    const GURL& origin,
-    const base::TimeDelta& rate,
-    bool get_initial_state)
-        : filter(storage_type, origin),
-          rate(rate),
-          dispatch_initial_state(get_initial_state) {
-}
+StorageObserver::MonitorParams::MonitorParams(blink::StorageType storage_type,
+                                              const GURL& origin,
+                                              const base::TimeDelta& rate,
+                                              bool get_initial_state)
+    : filter(storage_type, origin),
+      rate(rate),
+      dispatch_initial_state(get_initial_state) {}
 
 StorageObserver::MonitorParams::MonitorParams(
     const Filter& filter,
diff --git a/storage/browser/quota/storage_observer.h b/storage/browser/quota/storage_observer.h
index 37c886a..f1d96275 100644
--- a/storage/browser/quota/storage_observer.h
+++ b/storage/browser/quota/storage_observer.h
@@ -9,7 +9,7 @@
 
 #include "base/time/time.h"
 #include "storage/browser/quota/quota_client.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace storage {
@@ -19,15 +19,15 @@
 class STORAGE_EXPORT StorageObserver {
  public:
   struct STORAGE_EXPORT Filter {
-    // The storage type to monitor. This must not be kStorageTypeUnknown or
-    // kStorageTypeQuotaNotManaged.
-    StorageType storage_type;
+    // The storage type to monitor. This must not be kUnknown or
+    // kQuotaNotManaged.
+    blink::StorageType storage_type;
 
     // The origin to monitor usage for. Must be specified.
     GURL origin;
 
     Filter();
-    Filter(StorageType storage_type, const GURL& origin);
+    Filter(blink::StorageType storage_type, const GURL& origin);
     bool operator==(const Filter& other) const;
   };
 
@@ -44,7 +44,7 @@
     bool dispatch_initial_state;
 
     MonitorParams();
-    MonitorParams(StorageType storage_type,
+    MonitorParams(blink::StorageType storage_type,
                   const GURL& origin,
                   const base::TimeDelta& rate,
                   bool get_initial_state);
diff --git a/storage/browser/quota/usage_tracker.cc b/storage/browser/quota/usage_tracker.cc
index 13844ed..ef0d22e6 100644
--- a/storage/browser/quota/usage_tracker.cc
+++ b/storage/browser/quota/usage_tracker.cc
@@ -34,12 +34,10 @@
 }  // namespace
 
 UsageTracker::UsageTracker(const QuotaClientList& clients,
-                           StorageType type,
+                           blink::StorageType type,
                            SpecialStoragePolicy* special_storage_policy,
                            StorageMonitor* storage_monitor)
-    : type_(type),
-      storage_monitor_(storage_monitor),
-      weak_factory_(this) {
+    : type_(type), storage_monitor_(storage_monitor), weak_factory_(this) {
   for (auto* client : clients) {
     if (client->DoesSupport(type)) {
       client_tracker_map_[client->id()] = base::MakeUnique<ClientUsageTracker>(
diff --git a/storage/browser/quota/usage_tracker.h b/storage/browser/quota/usage_tracker.h
index 417ebe4..74a56bd 100644
--- a/storage/browser/quota/usage_tracker.h
+++ b/storage/browser/quota/usage_tracker.h
@@ -20,7 +20,7 @@
 #include "storage/browser/quota/quota_task.h"
 #include "storage/browser/quota/special_storage_policy.h"
 #include "storage/browser/storage_browser_export.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace storage {
@@ -33,12 +33,13 @@
 // An instance of this class is created per storage type.
 class STORAGE_EXPORT UsageTracker : public QuotaTaskObserver {
  public:
-  UsageTracker(const QuotaClientList& clients, StorageType type,
+  UsageTracker(const QuotaClientList& clients,
+               blink::StorageType type,
                SpecialStoragePolicy* special_storage_policy,
                StorageMonitor* storage_monitor);
   ~UsageTracker() override;
 
-  StorageType type() const { return type_; }
+  blink::StorageType type() const { return type_; }
   ClientUsageTracker* GetClientTracker(QuotaClient::ID client_id);
 
   void GetGlobalLimitedUsage(const UsageCallback& callback);
@@ -95,7 +96,7 @@
   void FinallySendHostUsageWithBreakdown(AccumulateInfo* info,
                                          const std::string& host);
 
-  const StorageType type_;
+  const blink::StorageType type_;
   std::map<QuotaClient::ID, std::unique_ptr<ClientUsageTracker>>
       client_tracker_map_;
 
diff --git a/storage/browser/quota/usage_tracker_unittest.cc b/storage/browser/quota/usage_tracker_unittest.cc
index 0963f37..fe5559e 100644
--- a/storage/browser/quota/usage_tracker_unittest.cc
+++ b/storage/browser/quota/usage_tracker_unittest.cc
@@ -17,11 +17,10 @@
 #include "testing/gtest/include/gtest/gtest.h"
 
 using blink::QuotaStatusCode;
-using storage::kStorageTypeTemporary;
+using blink::StorageType;
 using storage::QuotaClient;
 using storage::QuotaClientList;
 using storage::SpecialStoragePolicy;
-using storage::StorageType;
 using storage::UsageTracker;
 
 namespace content {
@@ -71,7 +70,7 @@
   void GetOriginUsage(const GURL& origin,
                       StorageType type,
                       const GetUsageCallback& callback) override {
-    EXPECT_EQ(kStorageTypeTemporary, type);
+    EXPECT_EQ(StorageType::kTemporary, type);
     int64_t usage = GetUsage(origin);
     base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
                                                   base::Bind(callback, usage));
@@ -79,7 +78,7 @@
 
   void GetOriginsForType(StorageType type,
                          const GetOriginsCallback& callback) override {
-    EXPECT_EQ(kStorageTypeTemporary, type);
+    EXPECT_EQ(StorageType::kTemporary, type);
     std::set<GURL> origins;
     for (UsageMap::const_iterator itr = usage_map_.begin();
          itr != usage_map_.end(); ++itr) {
@@ -92,7 +91,7 @@
   void GetOriginsForHost(StorageType type,
                          const std::string& host,
                          const GetOriginsCallback& callback) override {
-    EXPECT_EQ(kStorageTypeTemporary, type);
+    EXPECT_EQ(StorageType::kTemporary, type);
     std::set<GURL> origins;
     for (UsageMap::const_iterator itr = usage_map_.begin();
          itr != usage_map_.end(); ++itr) {
@@ -106,14 +105,14 @@
   void DeleteOriginData(const GURL& origin,
                         StorageType type,
                         const DeletionCallback& callback) override {
-    EXPECT_EQ(kStorageTypeTemporary, type);
+    EXPECT_EQ(StorageType::kTemporary, type);
     usage_map_.erase(origin);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
         FROM_HERE, base::Bind(callback, QuotaStatusCode::kOk));
   }
 
-  bool DoesSupport(storage::StorageType type) const override {
-    return type == storage::kStorageTypeTemporary;
+  bool DoesSupport(StorageType type) const override {
+    return type == StorageType::kTemporary;
   }
 
   int64_t GetUsage(const GURL& origin) {
@@ -143,9 +142,10 @@
  public:
   UsageTrackerTest()
       : storage_policy_(new MockSpecialStoragePolicy()),
-        usage_tracker_(GetUsageTrackerList(), kStorageTypeTemporary,
-                       storage_policy_.get(), NULL) {
-  }
+        usage_tracker_(GetUsageTrackerList(),
+                       StorageType::kTemporary,
+                       storage_policy_.get(),
+                       NULL) {}
 
   ~UsageTrackerTest() override = default;
 
diff --git a/storage/browser/test/mock_quota_manager.cc b/storage/browser/test/mock_quota_manager.cc
index 0820ad73..3c73e1b8 100644
--- a/storage/browser/test/mock_quota_manager.cc
+++ b/storage/browser/test/mock_quota_manager.cc
@@ -45,7 +45,7 @@
       weak_factory_(this) {}
 
 void MockQuotaManager::GetUsageAndQuota(const GURL& origin,
-                                        storage::StorageType type,
+                                        StorageType type,
                                         const UsageAndQuotaCallback& callback) {
   StorageInfo& info = usage_and_quota_map_[std::make_pair(origin, type)];
   callback.Run(blink::QuotaStatusCode::kOk, info.usage, info.quota);
diff --git a/storage/browser/test/mock_quota_manager.h b/storage/browser/test/mock_quota_manager.h
index c373eec..db2904c 100644
--- a/storage/browser/test/mock_quota_manager.h
+++ b/storage/browser/test/mock_quota_manager.h
@@ -17,15 +17,15 @@
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "storage/browser/quota/quota_task.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
+using blink::StorageType;
 using storage::GetOriginsCallback;
 using storage::QuotaClient;
 using storage::QuotaManager;
 using storage::SpecialStoragePolicy;
 using storage::StatusCallback;
-using storage::StorageType;
 
 namespace content {
 
@@ -53,7 +53,7 @@
   // called.  The internal quota value can be updated by calling
   // a helper method MockQuotaManagerProxy::SetQuota().
   void GetUsageAndQuota(const GURL& origin,
-                        storage::StorageType type,
+                        StorageType type,
                         const UsageAndQuotaCallback& callback) override;
 
   // Overrides QuotaManager's implementation with a canned implementation that
diff --git a/storage/browser/test/mock_quota_manager_proxy.cc b/storage/browser/test/mock_quota_manager_proxy.cc
index 24f3124..65f0d94 100644
--- a/storage/browser/test/mock_quota_manager_proxy.cc
+++ b/storage/browser/test/mock_quota_manager_proxy.cc
@@ -8,8 +8,6 @@
 #include "base/single_thread_task_runner.h"
 #include "url/gurl.h"
 
-using storage::kStorageTypeUnknown;
-
 namespace content {
 
 MockQuotaManagerProxy::MockQuotaManagerProxy(
@@ -18,7 +16,7 @@
     : QuotaManagerProxy(quota_manager, task_runner),
       storage_accessed_count_(0),
       storage_modified_count_(0),
-      last_notified_type_(kStorageTypeUnknown),
+      last_notified_type_(blink::StorageType::kUnknown),
       last_notified_delta_(0),
       registered_client_(NULL) {}
 
@@ -39,15 +37,16 @@
 void MockQuotaManagerProxy::GetUsageAndQuota(
     base::SequencedTaskRunner* original_task_runner,
     const GURL& origin,
-    StorageType type,
+    blink::StorageType type,
     const QuotaManager::UsageAndQuotaCallback& callback) {
   if (mock_manager()) {
     mock_manager()->GetUsageAndQuota(origin, type, callback);
   }
 }
 
-void MockQuotaManagerProxy::NotifyStorageAccessed(
-    QuotaClient::ID client_id, const GURL& origin, StorageType type) {
+void MockQuotaManagerProxy::NotifyStorageAccessed(QuotaClient::ID client_id,
+                                                  const GURL& origin,
+                                                  blink::StorageType type) {
   ++storage_accessed_count_;
   last_notified_origin_ = origin;
   last_notified_type_ = type;
@@ -55,7 +54,7 @@
 
 void MockQuotaManagerProxy::NotifyStorageModified(QuotaClient::ID client_id,
                                                   const GURL& origin,
-                                                  StorageType type,
+                                                  blink::StorageType type,
                                                   int64_t delta) {
   ++storage_modified_count_;
   last_notified_origin_ = origin;
diff --git a/storage/browser/test/mock_quota_manager_proxy.h b/storage/browser/test/mock_quota_manager_proxy.h
index 0677d4e83..cb5acef 100644
--- a/storage/browser/test/mock_quota_manager_proxy.h
+++ b/storage/browser/test/mock_quota_manager_proxy.h
@@ -11,7 +11,7 @@
 #include "storage/browser/quota/quota_client.h"
 #include "storage/browser/quota/quota_manager_proxy.h"
 #include "storage/browser/test/mock_quota_manager.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 using storage::QuotaManagerProxy;
@@ -35,12 +35,12 @@
   void NotifyOriginNoLongerInUse(const GURL& origin) override {}
   void SetUsageCacheEnabled(QuotaClient::ID client_id,
                             const GURL& origin,
-                            StorageType type,
+                            blink::StorageType type,
                             bool enabled) override {}
   void GetUsageAndQuota(
       base::SequencedTaskRunner* original_task_runner,
       const GURL& origin,
-      StorageType type,
+      blink::StorageType type,
       const QuotaManager::UsageAndQuotaCallback& callback) override;
 
   // Validates the |client_id| and updates the internal access count
@@ -49,7 +49,7 @@
   // last_notified_type_.
   void NotifyStorageAccessed(QuotaClient::ID client_id,
                              const GURL& origin,
-                             StorageType type) override;
+                             blink::StorageType type) override;
 
   // Records the |origin|, |type| and |delta| as last_notified_origin_,
   // last_notified_type_ and last_notified_delta_ respecitvely.
@@ -57,13 +57,13 @@
   // updates the manager's internal usage information.
   void NotifyStorageModified(QuotaClient::ID client_id,
                              const GURL& origin,
-                             StorageType type,
+                             blink::StorageType type,
                              int64_t delta) override;
 
   int notify_storage_accessed_count() const { return storage_accessed_count_; }
   int notify_storage_modified_count() const { return storage_modified_count_; }
   GURL last_notified_origin() const { return last_notified_origin_; }
-  StorageType last_notified_type() const { return last_notified_type_; }
+  blink::StorageType last_notified_type() const { return last_notified_type_; }
   int64_t last_notified_delta() const { return last_notified_delta_; }
 
  protected:
@@ -77,7 +77,7 @@
   int storage_accessed_count_;
   int storage_modified_count_;
   GURL last_notified_origin_;
-  StorageType last_notified_type_;
+  blink::StorageType last_notified_type_;
   int64_t last_notified_delta_;
 
   QuotaClient* registered_client_;
diff --git a/storage/browser/test/mock_quota_manager_unittest.cc b/storage/browser/test/mock_quota_manager_unittest.cc
index 4236f45..8cd429b5 100644
--- a/storage/browser/test/mock_quota_manager_unittest.cc
+++ b/storage/browser/test/mock_quota_manager_unittest.cc
@@ -18,8 +18,7 @@
 #include "storage/browser/test/mock_storage_client.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
-using storage::kStorageTypePersistent;
-using storage::kStorageTypeTemporary;
+using blink::StorageType;
 
 namespace content {
 
@@ -31,8 +30,8 @@
 const GURL kOrigin2(kTestOrigin2);
 const GURL kOrigin3(kTestOrigin3);
 
-const StorageType kTemporary = kStorageTypeTemporary;
-const StorageType kPersistent = kStorageTypePersistent;
+const StorageType kTemporary = StorageType::kTemporary;
+const StorageType kPersistent = StorageType::kPersistent;
 
 const QuotaClient::ID kClientFile = QuotaClient::kFileSystem;
 const QuotaClient::ID kClientDB = QuotaClient::kIndexedDatabase;
diff --git a/storage/browser/test/mock_storage_client.cc b/storage/browser/test/mock_storage_client.cc
index 2013e27..d277560 100644
--- a/storage/browser/test/mock_storage_client.cc
+++ b/storage/browser/test/mock_storage_client.cc
@@ -123,7 +123,7 @@
                  weak_factory_.GetWeakPtr(), origin, type, callback));
 }
 
-bool MockStorageClient::DoesSupport(storage::StorageType type) const {
+bool MockStorageClient::DoesSupport(StorageType type) const {
   return true;
 }
 
diff --git a/storage/browser/test/mock_storage_client.h b/storage/browser/test/mock_storage_client.h
index a695027..0860050 100644
--- a/storage/browser/test/mock_storage_client.h
+++ b/storage/browser/test/mock_storage_client.h
@@ -18,6 +18,7 @@
 #include "base/memory/weak_ptr.h"
 #include "base/time/time.h"
 #include "storage/browser/quota/quota_client.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace storage {
@@ -26,7 +27,7 @@
 
 using storage::QuotaClient;
 using storage::QuotaManagerProxy;
-using storage::StorageType;
+using blink::StorageType;
 
 namespace content {
 
@@ -72,7 +73,7 @@
   void DeleteOriginData(const GURL& origin,
                         StorageType type,
                         const DeletionCallback& callback) override;
-  bool DoesSupport(storage::StorageType type) const override;
+  bool DoesSupport(StorageType type) const override;
 
  private:
   void RunGetOriginUsage(const GURL& origin_url,
diff --git a/storage/browser/test/sandbox_file_system_test_helper.h b/storage/browser/test/sandbox_file_system_test_helper.h
index 6edbf97..e65b148 100644
--- a/storage/browser/test/sandbox_file_system_test_helper.h
+++ b/storage/browser/test/sandbox_file_system_test_helper.h
@@ -16,7 +16,7 @@
 #include "storage/browser/fileapi/task_runner_bound_observer_list.h"
 #include "storage/common/fileapi/file_system_types.h"
 #include "storage/common/fileapi/file_system_util.h"
-#include "storage/common/quota/quota_types.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "url/gurl.h"
 
 namespace base {
@@ -87,7 +87,7 @@
 
   const GURL& origin() const { return origin_; }
   storage::FileSystemType type() const { return type_; }
-  storage::StorageType storage_type() const {
+  blink::StorageType storage_type() const {
     return storage::FileSystemTypeToQuotaStorageType(type_);
   }
   storage::FileSystemFileUtil* file_util() const { return file_util_; }
diff --git a/storage/common/BUILD.gn b/storage/common/BUILD.gn
index 6e4253d7..4a3449b 100644
--- a/storage/common/BUILD.gn
+++ b/storage/common/BUILD.gn
@@ -30,7 +30,6 @@
     "fileapi/file_system_util.cc",
     "fileapi/file_system_util.h",
     "quota/quota_limit_type.h",
-    "quota/quota_types.h",
     "storage_common_export.h",
     "storage_histograms.cc",
     "storage_histograms.h",
diff --git a/storage/common/fileapi/file_system_util.cc b/storage/common/fileapi/file_system_util.cc
index eac2ba0..80f2e10 100644
--- a/storage/common/fileapi/file_system_util.cc
+++ b/storage/common/fileapi/file_system_util.cc
@@ -247,34 +247,34 @@
 }
 
 FileSystemType QuotaStorageTypeToFileSystemType(
-    storage::StorageType storage_type) {
+    blink::StorageType storage_type) {
   switch (storage_type) {
-    case storage::kStorageTypeTemporary:
+    case blink::StorageType::kTemporary:
       return kFileSystemTypeTemporary;
-    case storage::kStorageTypePersistent:
+    case blink::StorageType::kPersistent:
       return kFileSystemTypePersistent;
-    case storage::kStorageTypeSyncable:
+    case blink::StorageType::kSyncable:
       return kFileSystemTypeSyncable;
-    case storage::kStorageTypeQuotaNotManaged:
-    case storage::kStorageTypeUnknown:
+    case blink::StorageType::kQuotaNotManaged:
+    case blink::StorageType::kUnknown:
       return kFileSystemTypeUnknown;
   }
   return kFileSystemTypeUnknown;
 }
 
-storage::StorageType FileSystemTypeToQuotaStorageType(FileSystemType type) {
+blink::StorageType FileSystemTypeToQuotaStorageType(FileSystemType type) {
   switch (type) {
     case kFileSystemTypeTemporary:
-      return storage::kStorageTypeTemporary;
+      return blink::StorageType::kTemporary;
     case kFileSystemTypePersistent:
-      return storage::kStorageTypePersistent;
+      return blink::StorageType::kPersistent;
     case kFileSystemTypeSyncable:
     case kFileSystemTypeSyncableForInternalSync:
-      return storage::kStorageTypeSyncable;
+      return blink::StorageType::kSyncable;
     case kFileSystemTypePluginPrivate:
-      return storage::kStorageTypeQuotaNotManaged;
+      return blink::StorageType::kQuotaNotManaged;
     default:
-      return storage::kStorageTypeUnknown;
+      return blink::StorageType::kUnknown;
   }
 }
 
diff --git a/storage/common/fileapi/file_system_util.h b/storage/common/fileapi/file_system_util.h
index 55684b6..0b9060c 100644
--- a/storage/common/fileapi/file_system_util.h
+++ b/storage/common/fileapi/file_system_util.h
@@ -12,8 +12,8 @@
 #include "base/files/file_path.h"
 #include "storage/common/fileapi/file_system_info.h"
 #include "storage/common/fileapi/file_system_types.h"
-#include "storage/common/quota/quota_types.h"
 #include "storage/common/storage_common_export.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 #include "third_party/WebKit/public/platform/WebFileError.h"
 #include "third_party/WebKit/public/platform/WebFileSystemType.h"
 
@@ -106,10 +106,10 @@
 // (Basically this naively maps TEMPORARY storage type to TEMPORARY filesystem
 // type, PERSISTENT storage type to PERSISTENT filesystem type and vice versa.)
 STORAGE_COMMON_EXPORT FileSystemType
-    QuotaStorageTypeToFileSystemType(storage::StorageType storage_type);
+QuotaStorageTypeToFileSystemType(blink::StorageType storage_type);
 
-STORAGE_COMMON_EXPORT storage::StorageType
-    FileSystemTypeToQuotaStorageType(FileSystemType type);
+STORAGE_COMMON_EXPORT blink::StorageType FileSystemTypeToQuotaStorageType(
+    FileSystemType type);
 
 // Returns the string representation of the given filesystem |type|.
 // Returns an empty string if the |type| is invalid.
diff --git a/storage/common/quota/quota_types.h b/storage/common/quota/quota_types.h
deleted file mode 100644
index 96da498..0000000
--- a/storage/common/quota/quota_types.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2013 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 STORAGE_COMMON_QUOTA_QUOTA_TYPES_H_
-#define STORAGE_COMMON_QUOTA_QUOTA_TYPES_H_
-
-namespace storage {
-
-enum StorageType {
-  kStorageTypeTemporary,
-  kStorageTypePersistent,
-  kStorageTypeSyncable,
-  kStorageTypeQuotaNotManaged,
-  kStorageTypeUnknown,
-  kStorageTypeLast = kStorageTypeUnknown
-};
-
-}  // namespace storage
-
-#endif  // STORAGE_COMMON_QUOTA_QUOTA_TYPES_H_
diff --git a/storage/common/quota/quota_types.mojom b/storage/common/quota/quota_types.mojom
index 4258de7b..8946b10 100644
--- a/storage/common/quota/quota_types.mojom
+++ b/storage/common/quota/quota_types.mojom
@@ -4,7 +4,7 @@
 
 module storage.mojom;
 
-// TODO(sashab): Remove duplicate definition storage::StorageType.
+// TODO(sashab): Remove duplicate definition blink::StorageType.
 enum StorageType {
   kTemporary,
   kPersistent,
diff --git a/storage/common/quota/quota_types.typemap b/storage/common/quota/quota_types.typemap
index f179778..97d9b15 100644
--- a/storage/common/quota/quota_types.typemap
+++ b/storage/common/quota/quota_types.typemap
@@ -5,14 +5,13 @@
 mojom = "//storage/common/quota/quota_types.mojom"
 public_headers = [
   "//third_party/WebKit/common/quota/quota_status_code.h",
-  "//storage/common/quota/quota_types.h",
+  "//third_party/WebKit/common/quota/storage_type.h",
 ]
 traits_headers = [ "//storage/common/quota/quota_types_struct_traits.h" ]
 deps = [
-  "//storage/common",
   "//third_party/WebKit/common:blink_common",
 ]
 type_mappings = [
   "storage.mojom.QuotaStatusCode=blink::QuotaStatusCode",
-  "storage.mojom.StorageType=storage::StorageType",
+  "storage.mojom.StorageType=blink::StorageType",
 ]
diff --git a/storage/common/quota/quota_types_struct_traits.h b/storage/common/quota/quota_types_struct_traits.h
index 3231850..5914fdaf 100644
--- a/storage/common/quota/quota_types_struct_traits.h
+++ b/storage/common/quota/quota_types_struct_traits.h
@@ -6,26 +6,25 @@
 #define CONTENT_COMMON_QUOTA_MESSAGES_STRUCT_TRAITS_H_
 
 #include "mojo/public/cpp/bindings/enum_traits.h"
-#include "storage/common/quota/quota_types.h"
 #include "storage/common/quota/quota_types.mojom.h"
 #include "third_party/WebKit/common/quota/quota_status_code.h"
+#include "third_party/WebKit/common/quota/storage_type.h"
 
 namespace mojo {
 
 template <>
-struct EnumTraits<storage::mojom::StorageType, storage::StorageType> {
-  static storage::mojom::StorageType ToMojom(
-      storage::StorageType storage_type) {
+struct EnumTraits<storage::mojom::StorageType, blink::StorageType> {
+  static storage::mojom::StorageType ToMojom(blink::StorageType storage_type) {
     switch (storage_type) {
-      case storage::kStorageTypeTemporary:
+      case blink::StorageType::kTemporary:
         return storage::mojom::StorageType::kTemporary;
-      case storage::kStorageTypePersistent:
+      case blink::StorageType::kPersistent:
         return storage::mojom::StorageType::kPersistent;
-      case storage::kStorageTypeSyncable:
+      case blink::StorageType::kSyncable:
         return storage::mojom::StorageType::kSyncable;
-      case storage::kStorageTypeQuotaNotManaged:
+      case blink::StorageType::kQuotaNotManaged:
         return storage::mojom::StorageType::kQuotaNotManaged;
-      case storage::kStorageTypeUnknown:
+      case blink::StorageType::kUnknown:
         return storage::mojom::StorageType::kUnknown;
     }
     NOTREACHED();
@@ -33,26 +32,26 @@
   }
 
   static bool FromMojom(storage::mojom::StorageType storage_type,
-                        storage::StorageType* out) {
+                        blink::StorageType* out) {
     switch (storage_type) {
       case storage::mojom::StorageType::kTemporary:
-        *out = storage::kStorageTypeTemporary;
+        *out = blink::StorageType::kTemporary;
         return true;
       case storage::mojom::StorageType::kPersistent:
-        *out = storage::kStorageTypePersistent;
+        *out = blink::StorageType::kPersistent;
         return true;
       case storage::mojom::StorageType::kSyncable:
-        *out = storage::kStorageTypeSyncable;
+        *out = blink::StorageType::kSyncable;
         return true;
       case storage::mojom::StorageType::kQuotaNotManaged:
-        *out = storage::kStorageTypeQuotaNotManaged;
+        *out = blink::StorageType::kQuotaNotManaged;
         return true;
       case storage::mojom::StorageType::kUnknown:
-        *out = storage::kStorageTypeUnknown;
+        *out = blink::StorageType::kUnknown;
         return true;
     }
     NOTREACHED();
-    *out = storage::kStorageTypeUnknown;
+    *out = blink::StorageType::kUnknown;
     return false;
   }
 };
diff --git a/testing/buildbot/README.md b/testing/buildbot/README.md
index 68cfcce5..5d110385 100644
--- a/testing/buildbot/README.md
+++ b/testing/buildbot/README.md
@@ -6,9 +6,24 @@
 special arguments and constraints for the tests.
 
 ## A tour of the directory
+
 * <master_name\>.json -- buildbot configuration json files. These are used to
 configure what tests are run on what builders, in addition to specifying
-builder-specific arguments and parameters.
+builder-specific arguments and parameters. They are now autogenerated, mainly
+using the generate_buildbot_json tool in this directory.
+* [generate_buildbot_json.py](./generate_buildbot_json.py) -- generates most of
+the buildbot json files in this directory, based on data contained in the
+waterfalls.pyl, test_suites.pyl, and test_suite_exceptions.pyl files.
+* [waterfalls.pyl](./waterfalls.pyl) -- describes the bots on the various
+waterfalls, and which test suites they run. By design, this file can only refer
+(by name) to test suites that are defined in test_suites.pyl.
+* [test_suites.pyl](./test_suites.pyl) -- describes the test suites that are
+referred to by waterfalls.pyl. A test suite describes groups of tests that are
+run on one or more bots.
+* [test_suite_exceptions.pyl](./test_suite_exceptions.pyl) -- describes
+exceptions to the test suites, for example excluding a particular test from
+running on one bot. The goal is to have very few or no exceptions, which is why
+this information is factored into a separate file.
 * [gn_isolate_map.pyl](./gn_isolate_map.pyl) -- maps Ninja build target names
 to GN labels. Allows for certain overrides to get certain tests targets to work
 with GN (and properly run when isolated).
@@ -37,11 +52,12 @@
 ['gtest_tests'](https://chromium.googlesource.com/chromium/src/+/5750756522296b2a9a08009d8d2cc90db3b88f56/testing/buildbot/chromium.android.json#1243)
 entry.
 
-## How to edit
-### Making the changes
-#### Buildbot configuration json
-After editing any buildbot json, run `./manage.py -w` to load and write in the
-canonical format. Then commit as normal.
+## Making changes
+
+All of the JSON files in this directory are autogenerated. The "how to use"
+section below describes the main tool, `generate_buildbot_json.py`, which
+manages most of the waterfalls. It's no longer possible to hand-edit the JSON
+files; presubmit checks forbid doing so.
 
 Note that trybots mirror regular waterfall bots, with the mapping defined in
 [trybots.py](https://chromium.googlesource.com/chromium/tools/build/+/refs/heads/master/scripts/slave/recipe_modules/chromium_tests/trybots.py).
@@ -57,11 +73,249 @@
 example, adding a test to linux_android_rel_ng should show up immediately in
 your tryjob). Non-trybot changes have to be landed manually :(.
 
-## Capacity considerations when editing the buildbot configuration json
-When adding tests or bumping timeouts in the buildbot configuration json, care
-must be taken to ensure the infrastructure has capacity to handle the extra
-load.  This is especially true for the established
+## Capacity considerations when editing the configuration files
+When adding tests or bumping timeouts, care must be taken to ensure the
+infrastructure has capacity to handle the extra load.  This is especially true
+for the established
 [Chromium CQ builders](https://chromium.googlesource.com/chromium/src/+/master/infra/config/cq.cfg),
 as they operate under strict execution requirements. Make sure to get an
 infrastructure engineer on the Crossover Team to sign off that there is both
 buildbot and swarming capacity available.
+
+## How to use the generate_buildbot_json tool
+### Test suites
+#### Basic test suites
+
+The [test_suites.pyl](./test_suites.pyl) file describes groups of tests that run
+on bots -- both waterfalls and trybots. In order to specify that a test like
+`base_unittests` runs on a bot, it must be put inside a test suite. This
+organization helps enforce sharing of test suites among multiple bots.
+
+An example of a simple test suite:
+
+    'basic_chromium_gtests': {
+      'base_unittests': {},
+    }
+
+If a bot in [waterfalls.pyl](./waterfalls.pyl) refers to the test suite
+`basic_chromium_gtests`, then that bot will run `base_unittests`.
+
+The test's name is usually both the build target as well as how the test appears
+in the steps that the bot runs. However, this can be overridden using dictionary
+arguments like `test` and `isolate_name`; see below.
+
+The dictionary following the test's name can contain multiple entries that
+affect how the test runs. Generally speaking, these are copied verbatim into the
+generated JSON file. Commonly used arguments include:
+
+* `args`: an array of command line arguments for the test.
+
+* `swarming`: a dictionary of Swarming parameters. Note that these will be
+  applied to *every* bot that refers to this test suite. It is often more useful
+  to specify the Swarming dimensions at the bot level, in waterfalls.pyl. More
+  on this below.
+
+    * `can_use_on_swarming_builders`: if set to False, disables running this
+      test on Swarming on any bot.
+
+* `android_swarming`: Swarming parameters to be applied only on Android bots.
+  (This feature was added mainly to match the original handwritten JSON files,
+  and further use is discouraged. Ideally it should be removed.)
+
+Arguments specific to GTest-based tests:
+
+* `test`: the target to build and run, if different from the test's name. This
+  allows the same test to be run multiple times on the same bot with different
+  command line arguments or Swarming dimensions, for example.
+
+Arguments specific to isolated script tests:
+
+* `isolate_name`: the target to build and run, if different than the test's
+  name.
+
+There are other arguments specific to other test types (script tests, JUnit
+tests, instrumentation tests, CTS tests); consult the generator script and
+test_suites.pyl for more details and examples.
+
+#### Composition test suites
+
+One level of grouping of test suites is supported: composition test suites. A
+composition test suite is an array whose contents must all be names of
+individual test suites. Composition test suites *may not* refer to other
+composition test suites. This restriction is by design. First, adding multiple
+levels of indirection would make it more difficult to figure out which bots run
+which tests. Second, having only one minimal grouping construct motivates
+authors to simplify the configurations of tests on the bots and reduce the
+number of test suites.
+
+An example of a composition test suite:
+
+    'common_gtests': {
+      'base_unittests': {},
+    },
+
+    'linux_specific_gtests': {
+      'x11_unittests': {},
+    },
+
+    # Composition test suite
+    'linux_gtests': [
+      'common_gtests',
+      'linux_specific_gtests',
+    ],
+
+A bot referring to `linux_gtests` will run both `base_unittests` and
+`x11_unittests`.
+
+### Waterfalls
+
+[waterfalls.pyl](./waterfalls.pyl) describes the waterfalls, the bots on those
+waterfalls, and the test suites which those bots run.
+
+A bot can specify a `swarming` dictionary including `dimension_sets`. These
+parameters are applied to all tests that are run on this bot. Since most bots
+run their tests on Swarming, this is one of the mechanisms that dramatically
+reduces redundancy compared to maintaining the JSON files by hand.
+
+A waterfall is a dictionary containing the following:
+
+* `name`: the waterfall's name, for example `'chromium.win'`.
+* `machines`: a dictionary mapping machine names to dictionaries containing bot
+  descriptions.
+
+Each bot's description is a dictionary containing the following:
+
+* `additional_compile_targets`: if specified, an array of compile targets to
+  build in addition to those for all of the tests that will run on this bot.
+
+* `test_suites`: a dictionary optionally containing any of these kinds of
+  tests. The value is a string referring either to a basic or composition test
+  suite from [test_suites.pyl](./test_suites.pyl).
+
+    * `cts_tests`: (Android-specific) conformance test suites.
+    * `gtest_tests`: GTest-based tests.
+    * `instrumentation_tests`: (Android-specific) instrumentation tests.
+    * `isolated_scripts`: Isolated script tests. These are bundled into an
+       isolate, invoke a wrapper script from src/testing/scripts as their
+       top-level entry point, and are used to adapt to multiple kinds of test
+       harnesses.
+    * `junit_tests`: (Android-specific) JUnit tests.
+    * `scripts`: Legacy script tests living in src/testing/scripts. These can
+       not be Swarmed, and further use is discouraged.
+
+* `swarming`: a dictionary specifying Swarming parameters to be applied to all
+  tests that run on the bot.
+
+* `os_type`: the type of OS this bot tests. The only useful value currently is
+  `'android'`, and enables outputting of certain Android-specific entries into
+  the JSON files.
+
+* `skip_cipd_packages`: (Android-specific) when True, disables emission of the
+  `'cipd_packages'` Swarming dictionary entry. Not commonly used; further use is
+  discouraged.
+
+* `skip_merge_script`: (Android-specific) when True, disables emission of the
+  `'merge'` script key. Not commonly used; further use is discouraged.
+
+* `skip_output_links`: (Android-specific) when True, disables emission of the
+  `'output_links'` Swarming dictionary entry. Not commonly used; further use is
+  discouraged.
+
+* `use_swarming`: can be set to False to disable Swarming on a bot.
+
+### Test suite exceptions
+
+[test_suite_exceptions.pyl](./test_suite_exceptions.pyl) contains specific
+exceptions to the general rules about which tests run on which bots described in
+[test_suites.pyl](./test_suites.pyl) and [waterfalls.pyl](./waterfalls.pyl).
+
+In general, the design should be to have no exceptions. Roughly speaking, all
+bots should be treated identically, and ideally, the same set of tests should
+run on each. In practice, of course, this is not possible.
+
+The test suite exceptions can only be used to _remove tests from a bot_, _modify
+how a test is run on a bot_, or _remove keys from a test&apos;s specification on
+a bot_. The exceptions _can not_ be used to add a test to a bot. This
+restriction is by design, and helps prevent taking shortcuts when designing test
+suites which would make the test descriptions unmaintainable. (The number of
+exceptions needed to describe Chromium's waterfalls in their previous
+hand-maintained state has already gotten out of hand, and a concerted effort
+should be made to eliminate them wherever possible.)
+
+The exceptions file supports the following options per test:
+
+* `remove_from`: a list of bot names on which this test should not run.
+  Currently, bots on different waterfalls that have the same name can be
+  disambiguated by appending the waterfall's name: for example, `Nougat Phone
+  Tester chromium.android`.
+
+* `modifications`: a dictionary mapping a bot's name to a dictionary of
+  modifications that should be merged into the test's specification on that
+  bot. This can be used to add additional command line arguments, Swarming
+  parameters, etc.
+
+* `key_removals`: a dictionary mapping a bot's name to a list of keys which
+  should be removed from the test's specification on that bot. Note that by
+  design, this feature *can not* be used to remove Swarming dictionary entries.
+  This feature was mainly used to match the previously handwritten JSON files,
+  should not be used in the future, and should ideally be removed.
+
+### Order of application of test changes
+
+A test's final JSON description comes from the following, in order:
+
+* The dictionary specified in [test_suites.pyl](./test_suites.pyl). This is
+  used as the starting point for the test's description on all bots.
+
+* The specific bot's description in [waterfalls.pyl](./waterfalls.pyl). This
+  dictionary is merged in to the test's dictionary. For example, the bot's
+  Swarming parameters will override those specified for the test.
+
+* Any exceptions specified per-bot in
+  [test_suite_exceptions.pyl](./test_suite_exceptions.pyl). For example, any
+  additional command line arguments will be merged in here. Any Swarming
+  dictionary entries specified here will override both those specified in
+  test_suites.pyl and waterfalls.pyl.
+
+### Tips when making changes to the bot and test descriptions
+
+In general, the only specialization of test suites that _should_ be necessary is
+per operating system. If you add a new test to the bots and find yourself adding
+lots of exceptions to exclude the test from bots all of one particular type
+(like Android, Chrome OS, etc.), here are options to consider:
+
+* Look for a different test suite to add it to -- such as one that runs
+  everywhere except on that OS type.
+
+* Add a new test suite that runs on all of the OS types where your new test
+  should run, and add that test suite to the composition test suites referenced
+  by the appropriate bots.
+
+* Split one of the existing test suites into two, and add the newly created test
+  suite (including your new test) to all of the bots except those which should
+  not run the new test.
+
+If adding a new waterfall, or a new bot to a waterfall, *please* avoid adding
+new test suites. Instead, refer to one of the existing ones that is most similar
+to the new bot(s) you are adding. There should be no need to continue
+over-specializing the test suites.
+
+If you see an opportunity to reduce redundancy or simplify test descriptions,
+*please* consider making a contribution to the generate_buildbot_json script or
+the data files. Some examples might include:
+
+* Automatically doubling the number of shards on Debug bots, by describing to
+  the tool which bots are debug bots. This could eliminate the need for a lot of
+  exceptions.
+
+* Specifying a single hard_timeout per bot, and eliminating all per-test
+  timeouts from test_suites.pyl and test_suite_exceptions.pyl.
+
+* Merging some test suites. When the generator tool was written, the handwritten
+  JSON files were replicated essentially exactly. There are many opportunities
+  to simplify the configuration of which tests run on which bots. For example,
+  there's no reason why the top-of-tree Clang bots should run more tests than
+  the bots on other waterfalls running the same OS.
+
+`dpranke`, `jbudorick` or `kbr` will be glad to review any improvements you make
+to the tools. Thanks in advance for contributing!
diff --git a/testing/buildbot/chromium.lkgr.json b/testing/buildbot/chromium.lkgr.json
index 5b733b1..37468f0 100644
--- a/testing/buildbot/chromium.lkgr.json
+++ b/testing/buildbot/chromium.lkgr.json
@@ -1,9 +1,99 @@
 {
   "AAAAA1 AUTOGENERATED FILE DO NOT EDIT": {},
   "AAAAA2 See generate_buildbot_json.py to make changes": {},
+  "ASAN Debug": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "ASAN Debug (32-bit x86 with V8-ARM)": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
   "ASAN Release": {
     "additional_compile_targets": [
       "chromium_builder_asan"
     ]
+  },
+  "ASAN Release (32-bit x86 with V8-ARM)": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "ASAN Release Media": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "ASAN Release Media (32-bit x86 with V8-ARM)": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "ChromiumOS ASAN Release": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "MSAN Release (chained origins)": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "MSAN Release (no origins)": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "Mac ASan Debug": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "Mac ASan Release": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "Mac ASan Release Media": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "TSAN Debug": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "TSAN Release": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "UBSan Release": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "UBSan vptr Release": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "Win ASan Release": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "Win ASan Release Media": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
+  },
+  "Win SyzyASAN LKGR": {
+    "additional_compile_targets": [
+      "chromium_builder_asan"
+    ]
   }
 }
diff --git a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
index 30195169..ff64ac4 100644
--- a/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
+++ b/testing/buildbot/filters/mojo.fyi.network_browser_tests.filter
@@ -844,6 +844,10 @@
 -ContinueWhereILeftOffTest.SessionCookies
 -RestartTest.SessionCookies
 
+# Fails because of missing support to navigate to filesystem: URLs.
+# https://crbug.com/797292
+-SBNavigationObserverBrowserTest.DownloadViaHTML5FileApi
+
 # Flakes https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.linux%2FLinux_Tests%2F65822%2F%2B%2Frecipes%2Fsteps%2Fnetwork_service_browser_tests%2F0%2Flogs%2FNoSessionRestoreTest.PRE_CookiesClearedOnExit%2F0
 -NoSessionRestoreTest.CookiesClearedOnExit
 
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl
index c40a719..53499ac3 100644
--- a/testing/buildbot/waterfalls.pyl
+++ b/testing/buildbot/waterfalls.pyl
@@ -1439,11 +1439,101 @@
   {
     'name': 'chromium.lkgr',
     'machines': {
+      'ASAN Debug': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'ASAN Debug (32-bit x86 with V8-ARM)': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
       'ASAN Release': {
         'additional_compile_targets': [
           'chromium_builder_asan',
         ],
       },
+      'ASAN Release (32-bit x86 with V8-ARM)': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'ASAN Release Media': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'ASAN Release Media (32-bit x86 with V8-ARM)': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'ChromiumOS ASAN Release': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'Mac ASan Debug': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'Mac ASan Release': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'Mac ASan Release Media': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'MSAN Release (no origins)': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'MSAN Release (chained origins)': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'TSAN Debug': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'TSAN Release': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'UBSan Release': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'UBSan vptr Release': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'Win ASan Release': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'Win ASan Release Media': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
+      'Win SyzyASAN LKGR': {
+        'additional_compile_targets': [
+          'chromium_builder_asan',
+        ],
+      },
     },
   },
   {
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
index 10785a8..6509cbc 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -11,16 +11,16 @@
 # Editing does not completely work with LayoutNG yet.
 
 ## Reverse hosting of editable block
-crbug.com/707656 editing/execCommand/format-block-crash.html [ Crash Pass ]
-crbug.com/707656 editing/input/scroll-viewport-page-up-down.html [ Failure Pass ]
-crbug.com/707656 editing/undo/undo-indent.html [ Crash Pass ]
-crbug.com/707656 external/wpt/html/editing/editing-0/spelling-and-grammar-checking/spelling-markers-001.html [ Crash Pass ]
-crbug.com/707656 external/wpt/html/editing/focus/processing-model/focus-fixup-rule-one-no-dialogs.html [ Crash Pass ]
-crbug.com/789878 fast/css/first-letter-capitalized-edit-select-crash.html [ Failure Pass ]
-crbug.com/707656 fast/css/readwrite-contenteditable-recalc.html [ Crash Pass ]
-crbug.com/789878 fast/css/readwrite-contenteditable.html [ Failure Pass ]
-crbug.com/707656 fast/inline-block/14498-positionForCoordinates.html [ Failure Pass ]
-crbug.com/789878 fast/inline/inline-focus-ring.html [ Failure Pass ]
+crbug.com/707656 editing/execCommand/format-block-crash.html [ Crash ]
+crbug.com/707656 editing/input/scroll-viewport-page-up-down.html [ Failure ]
+crbug.com/707656 editing/undo/undo-indent.html [ Crash ]
+crbug.com/707656 external/wpt/html/editing/editing-0/spelling-and-grammar-checking/spelling-markers-001.html [ Crash ]
+crbug.com/707656 external/wpt/html/editing/focus/processing-model/focus-fixup-rule-one-no-dialogs.html [ Crash ]
+crbug.com/789878 fast/css/first-letter-capitalized-edit-select-crash.html [ Failure ]
+crbug.com/707656 fast/css/readwrite-contenteditable-recalc.html [ Crash ]
+crbug.com/789878 fast/css/readwrite-contenteditable.html [ Failure ]
+crbug.com/707656 fast/inline-block/14498-positionForCoordinates.html [ Failure ]
+crbug.com/789878 fast/inline/inline-focus-ring.html [ Failure ]
 
 # Fix only in NGPaint.
 crbug.com/591099 fast/text/word-space.html [ Failure ]
@@ -45,9 +45,9 @@
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vlr-002.xht [ Pass ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vlr-005.xht [ Pass ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vlr-006.xht [ Pass ]
-crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vrl-001.xht [ Failure Pass ]
+crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vrl-001.xht [ Failure ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vrl-002.xht [ Pass ]
-crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vrl-005.xht [ Failure Pass ]
+crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vrl-005.xht [ Failure ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-htb-in-vrl-006.xht [ Pass ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-vlr-in-htb-001.xht [ Pass ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-prct-vlr-in-htb-002.xht [ Pass ]
@@ -105,7 +105,7 @@
 crbug.com/591099 accessibility/image-map1.html [ Failure ]
 crbug.com/591099 accessibility/img-fallsback-to-title.html [ Failure ]
 crbug.com/714962 accessibility/in-page-link-target.html [ Failure ]
-crbug.com/591099 accessibility/inline-text-bidi-bounds-for-range.html [ Crash Failure ]
+crbug.com/591099 accessibility/inline-text-bidi-bounds-for-range.html [ Failure ]
 crbug.com/714962 accessibility/inline-text-bounds-for-range-br.html [ Failure ]
 crbug.com/591099 accessibility/inline-text-bounds-for-range.html [ Failure ]
 crbug.com/591099 accessibility/inline-text-box-next-on-line.html [ Failure ]
@@ -132,17 +132,17 @@
 crbug.com/714962 accessibility/selection-events.html [ Failure ]
 crbug.com/714962 accessibility/set-selection-link.html [ Failure ]
 crbug.com/591099 accessibility/slider-thumb-bounds.html [ Crash ]
-crbug.com/591099 accessibility/table-cells.html [ Failure Pass ]
+crbug.com/591099 accessibility/table-cells.html [ Failure ]
 crbug.com/714962 accessibility/table-detection.html [ Failure ]
-crbug.com/591099 accessibility/table-header-column-row.html [ Failure Timeout ]
+crbug.com/591099 accessibility/table-header-column-row.html [ Failure ]
 crbug.com/591099 accessibility/table-one-cell.html [ Failure ]
 crbug.com/714962 accessibility/table-with-empty-thead-causes-crash.html [ Failure ]
 crbug.com/714962 accessibility/table-with-rules.html [ Failure ]
-crbug.com/591099 accessibility/textarea-caret-position.html [ Failure Timeout ]
+crbug.com/591099 accessibility/textarea-caret-position.html [ Failure ]
 crbug.com/591099 accessibility/textarea-selection.html [ Failure ]
 crbug.com/591099 accessibility/whitespace-in-name-calc.html [ Failure ]
 crbug.com/714962 animations/3d/matrix-transform-type-animation.html [ Failure ]
-crbug.com/591099 animations/animation-ready-reject-script-forbidden.html [ Pass Timeout ]
+crbug.com/591099 animations/animation-ready-reject-script-forbidden.html [ Timeout ]
 crbug.com/591099 animations/cross-fade-list-style-image.html [ Failure ]
 crbug.com/591099 animations/interpolation/backdrop-filter-interpolation.html [ Timeout ]
 crbug.com/591099 animations/interpolation/height-interpolation.html [ Crash ]
@@ -172,21 +172,17 @@
 crbug.com/591099 compositing/geometry/abs-position-inside-opacity.html [ Failure ]
 crbug.com/591099 compositing/geometry/bounds-ignores-hidden-dynamic.html [ Failure ]
 crbug.com/591099 compositing/geometry/bounds-ignores-hidden.html [ Failure ]
-crbug.com/591099 compositing/geometry/clipping-foreground.html [ Crash Failure ]
+crbug.com/591099 compositing/geometry/clipping-foreground.html [ Failure ]
 crbug.com/591099 compositing/geometry/composited-html-size.html [ Failure ]
 crbug.com/591099 compositing/geometry/composited-in-columns.html [ Failure ]
 crbug.com/591099 compositing/geometry/fixed-in-composited.html [ Failure ]
-crbug.com/591099 compositing/geometry/fixed-position-composited-page-scale-down.html [ Failure Pass ]
-crbug.com/591099 compositing/geometry/fixed-position-composited-page-scale.html [ Failure Pass ]
-crbug.com/591099 compositing/geometry/fixed-position-transform-composited-page-scale-down.html [ Failure Pass ]
-crbug.com/591099 compositing/geometry/fixed-position-transform-composited-page-scale.html [ Failure Pass ]
 crbug.com/591099 compositing/geometry/fixed-position.html [ Failure ]
-crbug.com/591099 compositing/geometry/foreground-layer.html [ Crash Failure ]
+crbug.com/591099 compositing/geometry/foreground-layer.html [ Failure ]
 crbug.com/591099 compositing/geometry/layer-due-to-layer-children-deep.html [ Failure ]
 crbug.com/591099 compositing/geometry/layer-due-to-layer-children.html [ Failure ]
 crbug.com/591099 compositing/geometry/outline-change.html [ Failure ]
 crbug.com/591099 compositing/geometry/partial-layout-update.html [ Failure ]
-crbug.com/591099 compositing/geometry/repaint-foreground-layer.html [ Crash Failure ]
+crbug.com/591099 compositing/geometry/repaint-foreground-layer.html [ Failure ]
 crbug.com/591099 compositing/geometry/root-layer-update.html [ Failure ]
 crbug.com/591099 compositing/geometry/transformed-abs-position-inside-composited.html [ Failure ]
 crbug.com/591099 compositing/geometry/transfrom-origin-on-zero-size-layer.html [ Failure ]
@@ -306,7 +302,7 @@
 crbug.com/591099 compositing/overflow/textarea-scroll-touch.html [ Failure ]
 crbug.com/591099 compositing/overflow/theme-affects-visual-overflow.html [ Failure ]
 crbug.com/591099 compositing/overflow/tiled-mask.html [ Failure ]
-crbug.com/591099 compositing/overflow/universal-accelerated-overflow-scroll.html [ Failure Pass Timeout ]
+crbug.com/591099 compositing/overflow/universal-accelerated-overflow-scroll.html [ Pass Timeout ]
 crbug.com/591099 compositing/overflow/update-widget-positions-on-nested-frames-and-scrollers.html [ Failure ]
 crbug.com/591099 compositing/overlap-blending/children-opacity-huge.html [ Failure ]
 crbug.com/591099 compositing/overlap-blending/children-opacity-no-overlap.html [ Failure ]
@@ -342,7 +338,7 @@
 crbug.com/591099 compositing/shadows/shadow-drawing.html [ Failure ]
 crbug.com/591099 compositing/sibling-positioning.html [ Failure ]
 crbug.com/591099 compositing/squashing/add-remove-squashed-layers.html [ Failure ]
-crbug.com/591099 compositing/squashing/selection-repaint-with-gaps.html [ Crash Failure ]
+crbug.com/591099 compositing/squashing/selection-repaint-with-gaps.html [ Crash ]
 crbug.com/591099 compositing/squashing/squash-above-fixed-1.html [ Failure ]
 crbug.com/591099 compositing/squashing/squash-above-fixed-3.html [ Failure ]
 crbug.com/591099 compositing/squashing/squash-onto-distant-relative.html [ Crash ]
@@ -450,7 +446,7 @@
 crbug.com/591099 css1/pseudo/firstline.html [ Failure ]
 crbug.com/591099 css1/pseudo/multiple_pseudo_elements.html [ Crash ]
 crbug.com/591099 css1/pseudo/pseudo_elements_in_selectors.html [ Failure ]
-crbug.com/591099 css1/text_properties/text_decoration.html [ Crash Failure ]
+crbug.com/591099 css1/text_properties/text_decoration.html [ Failure ]
 crbug.com/591099 css1/text_properties/text_transform.html [ Failure ]
 crbug.com/591099 css1/units/color_units.html [ Failure ]
 crbug.com/591099 css1/units/length_units.html [ Failure ]
@@ -606,7 +602,7 @@
 crbug.com/591099 css2.1/t0803-c5502-imrgn-r-00-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0803-c5502-imrgn-r-01-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0803-c5502-imrgn-r-02-b-a.html [ Failure ]
-crbug.com/591099 css2.1/t0803-c5502-imrgn-r-03-b-a.html [ Crash Failure ]
+crbug.com/591099 css2.1/t0803-c5502-imrgn-r-03-b-a.html [ Failure ]
 crbug.com/591099 css2.1/t0803-c5502-imrgn-r-04-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0803-c5502-imrgn-r-05-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0803-c5502-imrgn-r-06-b-ag.html [ Failure ]
@@ -640,7 +636,7 @@
 crbug.com/591099 css2.1/t0804-c5507-ipadn-r-00-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0804-c5507-ipadn-r-01-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0804-c5507-ipadn-r-02-b-ag.html [ Failure ]
-crbug.com/591099 css2.1/t0804-c5507-ipadn-r-03-b-a.html [ Crash Failure ]
+crbug.com/591099 css2.1/t0804-c5507-ipadn-r-03-b-a.html [ Failure ]
 crbug.com/591099 css2.1/t0804-c5507-ipadn-r-04-b-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0804-c5507-padn-r-00-c-ag.html [ Failure ]
 crbug.com/591099 css2.1/t0804-c5507-padn-r-01-c-a.html [ Failure ]
@@ -867,13 +863,13 @@
 crbug.com/591099 css2.1/t1508-c527-font-01-b.html [ Failure ]
 crbug.com/591099 css2.1/t1508-c527-font-02-b.html [ Failure ]
 crbug.com/591099 css2.1/t1508-c527-font-03-b.html [ Failure ]
-crbug.com/591099 css2.1/t1508-c527-font-04-b.html [ Crash Failure ]
-crbug.com/591099 css2.1/t1508-c527-font-05-b.html [ Crash Failure ]
-crbug.com/591099 css2.1/t1508-c527-font-06-b.html [ Crash Failure ]
-crbug.com/591099 css2.1/t1508-c527-font-07-b.html [ Crash Failure ]
+crbug.com/591099 css2.1/t1508-c527-font-04-b.html [ Failure ]
+crbug.com/591099 css2.1/t1508-c527-font-05-b.html [ Failure ]
+crbug.com/591099 css2.1/t1508-c527-font-06-b.html [ Failure ]
+crbug.com/591099 css2.1/t1508-c527-font-07-b.html [ Failure ]
 crbug.com/591099 css2.1/t1508-c527-font-08-b.html [ Failure ]
 crbug.com/591099 css2.1/t1508-c527-font-09-b.html [ Failure ]
-crbug.com/591099 css2.1/t1508-c527-font-10-c.html [ Crash Failure ]
+crbug.com/591099 css2.1/t1508-c527-font-10-c.html [ Failure ]
 crbug.com/591099 css2.1/t1601-c547-indent-00-b-a.html [ Failure ]
 crbug.com/591099 css2.1/t1601-c547-indent-01-d.html [ Failure ]
 crbug.com/591099 css2.1/t1602-c43-center-00-d-ag.html [ Failure ]
@@ -1040,7 +1036,7 @@
 crbug.com/591099 css3/flexbox/child-overflow.html [ Failure ]
 crbug.com/714962 css3/flexbox/content-height-with-scrollbars.html [ Failure ]
 crbug.com/591099 css3/flexbox/flex-flow-border.html [ Failure ]
-crbug.com/591099 css3/flexbox/flex-flow-margins-auto-size.html [ Failure Pass ]
+crbug.com/591099 css3/flexbox/flex-flow-margins-auto-size.html [ Failure ]
 crbug.com/591099 css3/flexbox/flex-flow-padding.html [ Failure ]
 crbug.com/591099 css3/flexbox/flex-item-contains-strict.html [ Failure ]
 crbug.com/591099 css3/flexbox/flexbox-baseline-margins.html [ Failure ]
@@ -1061,7 +1057,7 @@
 crbug.com/591099 css3/masking/clip-path-circle-overflow-hidden.html [ Failure ]
 crbug.com/591099 css3/masking/clip-path-circle-overflow.html [ Failure ]
 crbug.com/591099 css3/masking/clip-path-circle-relative-overflow.html [ Failure ]
-crbug.com/591099 css3/masking/clip-path-circle.html [ Crash Failure ]
+crbug.com/591099 css3/masking/clip-path-circle.html [ Failure ]
 crbug.com/714962 css3/masking/clip-path-columns-shape.html [ Failure ]
 crbug.com/714962 css3/masking/clip-path-columns-svg-clippath-usou.html [ Failure ]
 crbug.com/591099 css3/masking/clip-path-ellipse.html [ Failure ]
@@ -1118,13 +1114,13 @@
 crbug.com/591099 css3/selectors3/html/css3-modsel-167.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-167a.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-168.html [ Failure ]
-crbug.com/591099 css3/selectors3/html/css3-modsel-168a.html [ Crash Failure ]
+crbug.com/591099 css3/selectors3/html/css3-modsel-168a.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-169.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-169a.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-17.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-170.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-170a.html [ Failure ]
-crbug.com/591099 css3/selectors3/html/css3-modsel-170b.html [ Crash Failure ]
+crbug.com/591099 css3/selectors3/html/css3-modsel-170b.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-170c.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-170d.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-175a.html [ Failure ]
@@ -1193,7 +1189,7 @@
 crbug.com/591099 css3/selectors3/html/css3-modsel-44d.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-45.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-45b.html [ Failure ]
-crbug.com/591099 css3/selectors3/html/css3-modsel-45c.html [ Crash Failure ]
+crbug.com/591099 css3/selectors3/html/css3-modsel-45c.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-46.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-46b.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-5.html [ Failure ]
@@ -1209,7 +1205,7 @@
 crbug.com/591099 css3/selectors3/html/css3-modsel-64.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-65.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-66.html [ Failure ]
-crbug.com/591099 css3/selectors3/html/css3-modsel-66b.html [ Crash Failure ]
+crbug.com/591099 css3/selectors3/html/css3-modsel-66b.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-67.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-68.html [ Failure ]
 crbug.com/591099 css3/selectors3/html/css3-modsel-69.html [ Failure ]
@@ -1844,34 +1840,34 @@
 crbug.com/714962 css3/tab-size-complex-path.html [ Failure ]
 crbug.com/714962 css3/tab-size.html [ Failure ]
 crbug.com/591099 editing/assert_selection.html [ Failure ]
-crbug.com/591099 editing/caret/caret-color-001.html [ Failure Timeout ]
-crbug.com/591099 editing/caret/caret-color-002.html [ Crash Failure ]
-crbug.com/591099 editing/caret/caret-color-003.html [ Crash Failure Timeout ]
-crbug.com/591099 editing/caret/caret-color-004.html [ Crash Failure ]
-crbug.com/591099 editing/caret/caret-color-005.html [ Failure Timeout ]
-crbug.com/591099 editing/caret/caret-color-007.html [ Crash Failure ]
-crbug.com/591099 editing/caret/caret-color-010.html [ Crash Failure Timeout ]
+crbug.com/591099 editing/caret/caret-color-001.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-002.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-003.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-004.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-005.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-007.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-010.html [ Failure ]
 crbug.com/591099 editing/caret/caret-color-011.html [ Failure ]
-crbug.com/591099 editing/caret/caret-color-012.html [ Crash Failure ]
-crbug.com/591099 editing/caret/caret-color-014.html [ Crash Failure ]
-crbug.com/591099 editing/caret/caret-color-015.html [ Crash Failure Timeout ]
-crbug.com/591099 editing/caret/caret-color.html [ Crash Failure Timeout ]
-crbug.com/591099 editing/caret/caret-in-empty-cell.html [ Crash Failure Pass Timeout ]
-crbug.com/591099 editing/caret/caret-position.html [ Crash Failure Timeout ]
+crbug.com/591099 editing/caret/caret-color-012.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-014.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color-015.html [ Failure ]
+crbug.com/591099 editing/caret/caret-color.html [ Failure ]
+crbug.com/591099 editing/caret/caret-in-empty-cell.html [ Failure ]
+crbug.com/591099 editing/caret/caret-position.html [ Failure ]
 crbug.com/714962 editing/caret/in-multicol-child.html [ Failure ]
 crbug.com/714962 editing/deleting/4916235-1.html [ Failure ]
 crbug.com/591099 editing/deleting/4922367.html [ Failure ]
 crbug.com/591099 editing/deleting/5099303.html [ Failure ]
 crbug.com/591099 editing/deleting/5126166.html [ Failure ]
 crbug.com/591099 editing/deleting/5206311-1.html [ Failure ]
-crbug.com/591099 editing/deleting/5206311-2.html [ Failure Pass ]
+crbug.com/591099 editing/deleting/5206311-2.html [ Failure ]
 crbug.com/591099 editing/deleting/5272440.html [ Failure ]
 crbug.com/591099 editing/deleting/5369009.html [ Failure ]
-crbug.com/591099 editing/deleting/5433862-1.html [ Failure Pass ]
+crbug.com/591099 editing/deleting/5433862-1.html [ Failure ]
 crbug.com/591099 editing/deleting/5433862-2.html [ Failure ]
-crbug.com/591099 editing/deleting/5483370.html [ Crash Failure ]
+crbug.com/591099 editing/deleting/5483370.html [ Failure ]
 crbug.com/714962 editing/deleting/delete-across-editable-content-boundaries-2.html [ Crash ]
-crbug.com/591099 editing/deleting/delete-at-paragraph-boundaries-011.html [ Failure Timeout ]
+crbug.com/591099 editing/deleting/delete-at-paragraph-boundaries-011.html [ Failure ]
 crbug.com/591099 editing/deleting/delete-br-013.html [ Failure ]
 crbug.com/591099 editing/deleting/delete-empty-table.html [ Failure ]
 crbug.com/591099 editing/deleting/delete-line-015.html [ Failure ]
@@ -1879,7 +1875,7 @@
 crbug.com/591099 editing/deleting/delete-line-017.html [ Failure ]
 crbug.com/591099 editing/deleting/merge-different-styles.html [ Failure ]
 crbug.com/591099 editing/deleting/merge-endOfParagraph.html [ Failure ]
-crbug.com/591099 editing/deleting/merge-no-br.html [ Crash Failure ]
+crbug.com/591099 editing/deleting/merge-no-br.html [ Failure ]
 crbug.com/591099 editing/deleting/merge-whitespace-pre.html [ Failure ]
 crbug.com/591099 editing/deleting/move-nodes-001.html [ Failure ]
 crbug.com/591099 editing/deleting/table-cells.html [ Failure ]
@@ -1901,7 +1897,7 @@
 crbug.com/591099 editing/execCommand/format-block-multiple-paragraphs.html [ Failure ]
 crbug.com/591099 editing/execCommand/format-block-with-trailing-br.html [ Failure ]
 crbug.com/591099 editing/execCommand/insertImage.html [ Failure ]
-crbug.com/591099 editing/execCommand/outdent-collapse-table-crash-2.html [ Crash Pass ]
+crbug.com/591099 editing/execCommand/outdent-collapse-table-crash-2.html [ Crash ]
 crbug.com/591099 editing/execCommand/outdent-multiparagraph-list.html [ Failure ]
 crbug.com/591099 editing/execCommand/query-command-state.html [ Timeout ]
 crbug.com/591099 editing/execCommand/query-format-block.html [ Pass Timeout ]
@@ -1966,7 +1962,7 @@
 crbug.com/714962 editing/pasteboard/copy-element-with-conflicting-background-color-from-rule.html [ Failure ]
 crbug.com/591099 editing/pasteboard/copy-in-password-field.html [ Failure ]
 crbug.com/714962 editing/pasteboard/copy-paste-pre-line-content.html [ Failure ]
-crbug.com/591099 editing/pasteboard/copy-paste-white-space.html [ Crash Failure ]
+crbug.com/591099 editing/pasteboard/copy-paste-white-space.html [ Failure ]
 crbug.com/591099 editing/pasteboard/copy-standalone-image.html [ Failure ]
 crbug.com/591099 editing/pasteboard/copy-summary-crash.html [ Crash ]
 crbug.com/714962 editing/pasteboard/drag-drop-copy-text.html [ Failure ]
@@ -2040,15 +2036,15 @@
 crbug.com/714962 editing/selection/deleteFromDocument-undo-crash.html [ Crash ]
 crbug.com/591099 editing/selection/designmode-no-caret.html [ Failure ]
 crbug.com/591099 editing/selection/display-table-text.html [ Failure ]
-crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping-ltr-mixed.html [ Crash Failure ]
-crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping-rtl-mixed.html [ Crash Failure ]
-crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping-rtl.html [ Crash Failure ]
-crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping.html [ Crash Failure ]
-crbug.com/591099 editing/selection/doubleclick-beside-cr-span.html [ Failure Timeout ]
+crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping-ltr-mixed.html [ Crash ]
+crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping-rtl-mixed.html [ Crash ]
+crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping-rtl.html [ Crash ]
+crbug.com/591099 editing/selection/dont-select-text-overflow-ellipsis-when-wrapping.html [ Crash ]
+crbug.com/591099 editing/selection/doubleclick-beside-cr-span.html [ Timeout ]
 crbug.com/714962 editing/selection/drag-drop-events.html [ Failure ]
 crbug.com/714962 editing/selection/drag-drop-restore.html [ Failure ]
 crbug.com/591099 editing/selection/drag-in-iframe.html [ Failure ]
-crbug.com/591099 editing/selection/drag-select-1.html [ Crash Failure ]
+crbug.com/591099 editing/selection/drag-select-1.html [ Crash ]
 crbug.com/714962 editing/selection/drag-select-rapidly.html [ Failure ]
 crbug.com/714962 editing/selection/drag-text-delay.html [ Failure ]
 crbug.com/591099 editing/selection/drag-to-contenteditable-iframe.html [ Failure ]
@@ -2116,7 +2112,7 @@
 crbug.com/591099 editing/selection/paint-hyphen.html [ Failure ]
 crbug.com/591099 editing/selection/paragraph-granularity.html [ Failure ]
 crbug.com/591099 editing/selection/previous-line-position.html [ Failure ]
-crbug.com/591099 editing/selection/programmatic-selection-on-mac-is-directionless.html [ Crash Timeout ]
+crbug.com/591099 editing/selection/programmatic-selection-on-mac-is-directionless.html [ Timeout ]
 crbug.com/591099 editing/selection/range-between-block-and-inline.html [ Failure ]
 crbug.com/591099 editing/selection/readonly-disabled-hittest.html [ Failure ]
 crbug.com/591099 editing/selection/replaced-boundaries-1.html [ Failure ]
@@ -2137,11 +2133,11 @@
 crbug.com/591099 editing/selection/select-out-of-floated-input.html [ Failure ]
 crbug.com/591099 editing/selection/select-out-of-floated-non-editable.html [ Failure ]
 crbug.com/591099 editing/selection/select-out-of-floated-textarea.html [ Failure ]
-crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-ltr-2.html [ Crash Failure ]
-crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-ltr.html [ Crash Failure ]
-crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-rtl-2.html [ Crash Failure ]
-crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-rtl.html [ Crash Failure ]
-crbug.com/591099 editing/selection/select-text-overflow-ellipsis.html [ Crash Failure ]
+crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-ltr-2.html [ Crash ]
+crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-ltr.html [ Crash ]
+crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-rtl-2.html [ Crash ]
+crbug.com/591099 editing/selection/select-text-overflow-ellipsis-mixed-in-rtl.html [ Crash ]
+crbug.com/591099 editing/selection/select-text-overflow-ellipsis.html [ Crash ]
 crbug.com/591099 editing/selection/selectNode.html [ Failure ]
 crbug.com/591099 editing/selection/selectNodeContents.html [ Failure ]
 crbug.com/591099 editing/selection/selection-3748164-fix.html [ Failure ]
@@ -2167,31 +2163,31 @@
 crbug.com/591099 editing/style/5279521.html [ Failure ]
 crbug.com/591099 editing/style/block-styles-007.html [ Failure ]
 crbug.com/591099 editing/style/highlight.html [ Failure ]
-crbug.com/591099 editing/style/remove-underline-across-paragraph-in-bold.html [ Crash Failure ]
-crbug.com/591099 editing/style/remove-underline-across-paragraph.html [ Crash Failure ]
+crbug.com/591099 editing/style/remove-underline-across-paragraph-in-bold.html [ Failure ]
+crbug.com/591099 editing/style/remove-underline-across-paragraph.html [ Failure ]
 crbug.com/591099 editing/style/table-selection.html [ Failure ]
 crbug.com/591099 editing/text-iterator/findString-start-search-after-selection.html [ Failure ]
-crbug.com/591099 editing/text-iterator/findString.html [ Pass Timeout ]
+crbug.com/591099 editing/text-iterator/findString.html [ Timeout ]
 crbug.com/591099 editing/undo/crash-redo-with-iframes.html [ Failure ]
 crbug.com/591099 editing/undo/undo-deleteWord.html [ Failure ]
 crbug.com/591099 editing/undo/undo-smart-delete-reversed-selection.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/list-delete-001.html [ Failure ]
-crbug.com/591099 editing/unsupported-content/list-delete-003.html [ Crash Failure ]
+crbug.com/591099 editing/unsupported-content/list-delete-003.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/list-type-after.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/list-type-before.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/table-delete-001.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/table-delete-002.html [ Failure ]
-crbug.com/591099 editing/unsupported-content/table-delete-003.html [ Crash Failure ]
+crbug.com/591099 editing/unsupported-content/table-delete-003.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/table-type-after.html [ Failure ]
 crbug.com/591099 editing/unsupported-content/table-type-before.html [ Failure ]
 crbug.com/591099 external/wpt/2dcontext/drawing-images-to-the-canvas/drawimage_html_image_11.html [ Pass ]
 crbug.com/591099 external/wpt/WebCryptoAPI/derive_bits_keys/test_hkdf.https.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures.worker.html [ Timeout ]
-crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-CBC.https.worker.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-CBC.https.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-CBC.worker.html [ Timeout ]
-crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-CTR.https.worker.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-CTR.https.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-CTR.worker.html [ Timeout ]
-crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-GCM.https.worker.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-GCM.https.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-GCM.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_AES-KW.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_ECDH.worker.html [ Timeout ]
@@ -2202,18 +2198,18 @@
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSA-PSS.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/failures_RSASSA-PKCS1-v1_5.worker.html [ Timeout ]
 crbug.com/591099 external/wpt/WebCryptoAPI/generateKey/successes.worker.html [ Timeout ]
-crbug.com/591099 external/wpt/WebCryptoAPI/import_export/rsa_importKey.worker.html [ Failure Timeout ]
+crbug.com/591099 external/wpt/WebCryptoAPI/import_export/rsa_importKey.worker.html [ Timeout ]
 crbug.com/709227 external/wpt/WebCryptoAPI/import_export/symmetric_importKey.worker.html [ Failure ]
 crbug.com/714962 external/wpt/WebCryptoAPI/import_export/test_rsa_importKey.https.html [ Pass Timeout ]
 crbug.com/591099 external/wpt/XMLHttpRequest/send-authentication-prompt-2-manual.htm [ Failure ]
 crbug.com/591099 external/wpt/acid/acid3/test.html [ Crash ]
-crbug.com/591099 external/wpt/compat/webkit-text-fill-color-property-005.html [ Failure Pass ]
-crbug.com/591099 external/wpt/credential-management/federatedcredential-framed-get.sub.https.html [ Crash Pass ]
-crbug.com/591099 external/wpt/credential-management/passwordcredential-framed-get.sub.https.html [ Crash Pass ]
+crbug.com/591099 external/wpt/compat/webkit-text-fill-color-property-005.html [ Failure ]
+crbug.com/591099 external/wpt/credential-management/federatedcredential-framed-get.sub.https.html [ Pass ]
+crbug.com/591099 external/wpt/credential-management/passwordcredential-framed-get.sub.https.html [ Pass ]
 crbug.com/714962 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-overflow.xht [ Failure ]
-crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-table.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-left-table.xht [ Failure ]
 crbug.com/714962 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-overflow.xht [ Failure ]
-crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-table.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-003-right-table.xht [ Failure ]
 crbug.com/591099 external/wpt/css/CSS2/floats/floats-wrap-bfc-004.xht [ Failure ]
 crbug.com/591099 external/wpt/css/CSS2/floats/floats-zero-height-wrap-002.xht [ Failure ]
 crbug.com/714962 external/wpt/css/CSS2/linebox/inline-formatting-context-015.xht [ Failure ]
@@ -2230,7 +2226,6 @@
 crbug.com/714962 external/wpt/css/CSS2/normal-flow/min-height-104.xht [ Failure ]
 crbug.com/714962 external/wpt/css/CSS2/normal-flow/min-height-106.xht [ Failure ]
 crbug.com/591099 external/wpt/css/CSS2/normal-flow/root-box-001.xht [ Failure ]
-crbug.com/591099 external/wpt/css/CSS2/positioning/absolute-replaced-height-001.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/CSS2/positioning/abspos-007.xht [ Failure ]
 crbug.com/591099 external/wpt/css/CSS2/positioning/relpos-calcs-004.xht [ Failure ]
 crbug.com/591099 external/wpt/css/CSS2/positioning/relpos-calcs-005.xht [ Failure ]
@@ -2240,9 +2235,9 @@
 crbug.com/714962 external/wpt/css/CSS2/text/text-indent-overflow-004.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-color-5.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-attachment-local/attachment-local-clipping-image-5.html [ Failure ]
-crbug.com/714962 external/wpt/css/css-backgrounds/background-image-003.html [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-backgrounds/background-image-003.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-image-004.html [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-backgrounds/background-image-005.html [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-backgrounds/background-image-005.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-image-006.html [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-backgrounds/background-size/background-size-cover.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-backgrounds/css3-background-clip.html [ Failure ]
@@ -2409,16 +2404,16 @@
 crbug.com/591099 external/wpt/css/css-multicol/multicol-zero-height-001.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-paint-api/style-before-pseudo.https.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-paint-api/style-first-letter-pseudo.https.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-tbody-left-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-tbody-top-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-tfoot-left-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-tfoot-top-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-thead-left-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-thead-top-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-tr-left-absolute-child.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-position/position-relative-table-tr-top-absolute-child.html [ Crash Pass ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-tbody-left-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-tbody-top-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-tfoot-left-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-tfoot-top-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-thead-left-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-thead-top-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-tr-left-absolute-child.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-position/position-relative-table-tr-top-absolute-child.html [ Crash ]
 crbug.com/591099 external/wpt/css/css-position/position-sticky-nested-inline.html [ Crash ]
-crbug.com/591099 external/wpt/css/css-position/position-sticky-writing-modes.html [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-position/position-sticky-writing-modes.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-rhythm/line-height-step-basic-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-rhythm/line-height-step-boundary-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-rhythm/line-height-step-dynamic-001.html [ Failure ]
@@ -2452,7 +2447,7 @@
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-005.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-006.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-007.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-008.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-008.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-009.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-011.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-012.html [ Failure ]
@@ -2463,8 +2458,8 @@
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-017.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-018.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-019.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-020.html [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-021.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-020.html [ Failure ]
+crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-021.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-022.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-023.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/shape-outside/shape-image/shape-image-025.html [ Failure ]
@@ -2525,10 +2520,10 @@
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-002.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-003.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-004.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-004.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-005.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-006.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-007.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-007.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-008.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-010.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-011.html [ Failure ]
@@ -2540,23 +2535,23 @@
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-017.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-018.html [ Crash ]
 crbug.com/591099 external/wpt/css/css-shapes/spec-examples/shape-outside-019.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-style-attr/style-attr-urls-001.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-style-attr/style-attr-urls-001.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-style-attr/style-attr-urls-002.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-tables/height-distribution/percentage-sizing-of-table-cell-children.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-tables/html5-table-formatting-fixed-layout-1.html [ Crash Pass ]
+crbug.com/591099 external/wpt/css/css-tables/html5-table-formatting-fixed-layout-1.html [ Crash ]
 crbug.com/591099 external/wpt/css/css-tables/table-model-fixup-2.html [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-tables/visibility-collapse-colspan-003.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-tables/visibility-collapse-rowcol-001.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-tables/visibility-collapse-rowspan-crash.html [ Crash Pass ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-color-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-left-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-left-002.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-right-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-right-002.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-left-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-left-002.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-right-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-right-002.xht [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-tables/visibility-collapse-rowcol-001.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-tables/visibility-collapse-rowspan-crash.html [ Crash ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-color-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-left-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-left-002.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-right-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-above-right-002.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-left-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-left-002.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-right-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-position-below-right-002.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-002.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-006.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-007.html [ Failure ]
@@ -2564,10 +2559,10 @@
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-010.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-012.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-021.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-filled-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-open-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-shape-001.xht [ Crash Failure ]
-crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-string-001.xht [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-filled-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-open-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-shape-001.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-text-decor/text-emphasis-style-string-001.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-transforms/matrix/svg-matrix-036.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-transforms/matrix/svg-matrix-037.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-transforms/matrix/svg-matrix-038.html [ Failure ]
@@ -2583,24 +2578,24 @@
 crbug.com/714962 external/wpt/css/css-transforms/matrix/svg-matrix-048.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-transforms/transform-abspos-006.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-transforms/transform-abspos-007.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-transforms/transform-generated-001.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-transforms/transform-generated-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-transforms/transform-input-015.html [ Crash ]
 crbug.com/714962 external/wpt/css/css-transforms/transform-origin-006.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-ui/box-sizing-007.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-ui/box-sizing-007.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-ui/box-sizing-008.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-ui/box-sizing-009.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-ui/outline-004.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-ui/outline-011.html [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-ui/outline-019.html [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-ui/outline-011.html [ Failure ]
+crbug.com/591099 external/wpt/css/css-ui/outline-019.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-ui/text-overflow-001.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-ui/text-overflow-003.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-ui/text-overflow-006.html [ Pass ]
-crbug.com/714962 external/wpt/css/css-ui/text-overflow-008.html [ Crash Failure ]
+crbug.com/714962 external/wpt/css/css-ui/text-overflow-008.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-ui/text-overflow-009.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-ui/text-overflow-010.html [ Pass ]
 crbug.com/591099 external/wpt/css/css-ui/text-overflow-012.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-ui/text-overflow-013.html [ Failure ]
-crbug.com/591099 external/wpt/css/css-ui/text-overflow-014.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/css-ui/text-overflow-014.html [ Failure ]
 crbug.com/714962 external/wpt/css/css-ui/text-overflow-016.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-ui/text-overflow-022.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vlr-003.xht [ Pass ]
@@ -2620,122 +2615,122 @@
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-020.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-icb-vrl-030.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-003.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-005.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-005.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-007.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-009.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-011.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-013.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-015.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-017.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-017.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-019.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-021.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-023.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-025.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-027.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-029.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-031.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-027.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-029.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-031.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-033.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-035.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-035.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-037.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-039.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-041.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-039.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-041.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-043.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-045.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-047.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-049.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-051.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-051.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-053.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-055.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-057.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-057.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-059.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-061.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-063.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-063.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-065.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-067.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-069.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-071.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-073.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-073.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-075.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-077.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-079.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-077.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-079.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-081.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-083.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-085.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-083.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-085.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-087.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-089.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-091.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-089.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-091.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-093.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-095.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-097.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-103.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-105.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-107.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-109.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-111.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-113.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-105.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-107.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-109.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-111.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-113.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-115.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-117.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-119.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-117.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-119.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-121.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-123.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-125.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-125.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-127.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-129.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-131.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-131.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-133.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-135.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-137.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-139.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-141.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-143.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-135.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-137.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-139.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-141.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-143.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-145.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-147.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-149.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-149.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-151.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-153.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-155.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-157.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-159.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-155.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-157.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-159.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-161.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-163.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-163.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-165.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-167.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-169.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-171.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-173.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-173.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-175.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-177.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-179.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-177.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-179.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-181.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-183.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-185.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-187.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-189.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-191.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-193.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-185.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-187.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-189.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-191.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-193.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-195.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-197.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-197.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-199.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-201.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-203.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-201.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-203.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-205.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-207.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-207.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-209.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-211.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-213.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-213.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-215.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-217.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-219.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-221.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-223.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-227.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-219.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-221.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-223.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-225.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-227.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vlr-229.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-002.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-004.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-006.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-008.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-010.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-010.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-012.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-014.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-016.xht [ Failure Pass ]
@@ -2744,37 +2739,37 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-022.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-024.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-026.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-028.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-028.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-030.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-032.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-034.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-036.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-038.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-040.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-040.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-042.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-044.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-046.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-048.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-050.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-052.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-052.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-054.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-056.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-058.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-060.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-062.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-064.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-064.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-066.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-068.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-068.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-070.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-072.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-074.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-076.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-076.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-078.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-080.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-082.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-082.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-084.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-086.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-088.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-090.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-092.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-094.xht [ Failure ]
@@ -2782,71 +2777,71 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-102.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-104.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-106.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-108.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-108.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-110.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-112.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-114.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-116.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-116.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-118.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-120.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-120.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-122.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-124.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-124.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-126.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-128.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-128.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-130.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-132.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-134.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-136.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-138.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-140.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-140.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-142.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-144.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-144.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-146.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-148.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-150.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-152.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-152.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-154.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-156.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-156.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-158.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-160.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-160.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-162.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-164.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-166.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-166.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-168.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-170.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-172.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-174.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-176.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-172.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-174.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-176.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-178.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-180.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-180.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-182.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-184.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-186.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-188.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-190.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-188.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-190.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-192.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-194.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-196.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-196.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-198.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-200.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-200.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-202.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-204.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-204.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-206.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-208.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-208.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-210.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-212.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-214.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-216.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-216.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-218.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-220.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-220.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-222.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-224.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-224.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-226.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/abs-pos-non-replaced-vrl-228.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/block-flow-direction-vrl-002.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/block-flow-direction-vrl-005.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/block-flow-direction-vrl-006.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/block-flow-direction-vrl-009.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/block-flow-direction-vrl-009.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/block-flow-direction-vrl-011.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/block-flow-direction-vrl-012.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/block-flow-direction-vrl-013.xht [ Failure ]
@@ -2861,14 +2856,14 @@
 crbug.com/714962 external/wpt/css/css-writing-modes/direction-vlr-003.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/direction-vlr-005.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/direction-vrl-002.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/direction-vrl-004.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/direction-vrl-004.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-contiguous-vrl-002.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-contiguous-vrl-004.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-contiguous-vrl-006.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-contiguous-vrl-008.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/float-shrink-to-fit-vrl-008.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/float-vlr-005.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/float-vlr-007.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/float-vlr-007.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-vlr-013.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-vrl-004.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/float-vrl-006.xht [ Failure Pass ]
@@ -2941,34 +2936,34 @@
 crbug.com/591099 external/wpt/css/css-writing-modes/table-column-order-003.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/table-column-order-004.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/table-column-order-005.xht [ Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-003.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-005.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-003.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-005.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-007.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-009.xht [ Failure Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-align-vlr-011.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-013.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-013.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-015.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-017.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vlr-019.xht [ Failure Pass ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-002.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-004.xht [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-006.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-004.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-006.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-008.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-010.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-010.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-012.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-014.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-016.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-018.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-014.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-016.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-align-vrl-018.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-baseline-vlr-007.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-baseline-vrl-006.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-decorations-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-combine-upright-layout-rules-001.html [ Failure ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-003.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-005.xht [ Failure Pass ]
-crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-011.xht [ Failure Pass ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-003.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-005.xht [ Failure ]
+crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-011.xht [ Failure ]
 crbug.com/714962 external/wpt/css/css-writing-modes/text-indent-vlr-013.xht [ Failure ]
-crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-002.xht [ Failure Pass ]
-crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-004.xht [ Failure Pass ]
+crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-002.xht [ Failure ]
+crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-004.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-006.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-008.xht [ Failure ]
 crbug.com/591099 external/wpt/css/css-writing-modes/text-indent-vrl-010.xht [ Failure ]
@@ -3010,14 +3005,14 @@
 crbug.com/591099 external/wpt/css/cssom-view/elementFromPoint.html [ Failure ]
 crbug.com/591099 external/wpt/css/cssom-view/elementsFromPoint-svg.html [ Failure ]
 crbug.com/714962 external/wpt/css/cssom/medialist-dynamic-001.html [ Failure ]
-crbug.com/591099 external/wpt/css/geometry/interfaces.html [ Pass Timeout ]
-crbug.com/591099 external/wpt/css/geometry/interfaces.worker.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/css/geometry/interfaces.html [ Timeout ]
+crbug.com/591099 external/wpt/css/geometry/interfaces.worker.html [ Timeout ]
 crbug.com/714962 external/wpt/css/selectors/focus-within-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/selectors/focus-within-004.html [ Failure ]
 crbug.com/714962 external/wpt/css/selectors/focus-within-007.html [ Failure ]
 crbug.com/714962 external/wpt/css/selectors/focus-within-008.html [ Failure ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-align-content-vert-001a.xhtml [ Failure ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Failure Pass ]
+crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Failure ]
 crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-basic-fieldset-horiz-001.xhtml [ Failure ]
 crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-basic-img-horiz-001.xhtml [ Failure ]
 crbug.com/714962 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-basic-textarea-horiz-001.xhtml [ Failure ]
@@ -3029,7 +3024,7 @@
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-declaration-15.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-01.html [ Failure Pass ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/variables/variable-font-face-02.html [ Failure Pass ]
-crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-break-inside-001.html [ Crash Failure ]
+crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-break-inside-001.html [ Failure ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-001.html [ Crash ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-002.html [ Crash ]
 crbug.com/591099 external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/writing-modes-3/text-combine-upright-compression-003.html [ Crash ]
@@ -3057,7 +3052,7 @@
 crbug.com/591099 external/wpt/dom/ranges/Range-set.html [ Timeout ]
 crbug.com/591099 external/wpt/dom/ranges/Range-surroundContents.html [ Timeout ]
 crbug.com/591099 external/wpt/domxpath/xml_xpath_runner.html [ Pass Timeout ]
-crbug.com/591099 external/wpt/editing/run/backcolor.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/editing/run/backcolor.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/bold.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/fontname.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/fontsize.html [ Timeout ]
@@ -3065,10 +3060,10 @@
 crbug.com/591099 external/wpt/editing/run/formatblock.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/forwarddelete.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/hilitecolor.html [ Timeout ]
-crbug.com/591099 external/wpt/editing/run/indent.html [ Pass Timeout ]
-crbug.com/591099 external/wpt/editing/run/inserthorizontalrule.html [ Crash Pass Timeout ]
+crbug.com/591099 external/wpt/editing/run/indent.html [ Timeout ]
+crbug.com/591099 external/wpt/editing/run/inserthorizontalrule.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/inserthtml.html [ Timeout ]
-crbug.com/591099 external/wpt/editing/run/insertlinebreak.html [ Failure Timeout ]
+crbug.com/591099 external/wpt/editing/run/insertlinebreak.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/insertorderedlist.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/insertparagraph.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/inserttext.html [ Timeout ]
@@ -3080,9 +3075,9 @@
 crbug.com/591099 external/wpt/editing/run/justifyright.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/multitest.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/outdent.html [ Timeout ]
-crbug.com/591099 external/wpt/editing/run/removeformat.html [ Crash Timeout ]
+crbug.com/591099 external/wpt/editing/run/removeformat.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/strikethrough.html [ Timeout ]
-crbug.com/591099 external/wpt/editing/run/subscript.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/editing/run/subscript.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/superscript.html [ Timeout ]
 crbug.com/591099 external/wpt/editing/run/underline.html [ Timeout ]
 crbug.com/591099 external/wpt/encoding/api-invalid-label.html [ Timeout ]
@@ -3182,7 +3177,7 @@
 crbug.com/591099 external/wpt/feature-policy/autoplay-allowed-by-feature-policy.https.sub.html [ Failure ]
 crbug.com/591099 external/wpt/feature-policy/payment-allowed-by-feature-policy.https.sub.html [ Pass ]
 crbug.com/591099 external/wpt/feature-policy/payment-disabled-by-feature-policy.https.sub.html [ Pass ]
-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-media-capture/capture_audio_cancel-manual.html [ Failure ]
 crbug.com/591099 external/wpt/html-media-capture/capture_image_cancel-manual.html [ Failure ]
 crbug.com/591099 external/wpt/html-media-capture/capture_video_cancel-manual.html [ Failure ]
@@ -3193,18 +3188,18 @@
 crbug.com/591099 external/wpt/html/dom/documents/resource-metadata-management/document-lastModified-01.html [ Pass ]
 crbug.com/591099 external/wpt/html/dom/interfaces.html [ Timeout ]
 crbug.com/591099 external/wpt/html/editing/focus/tabindex-focus-flag.html [ Crash ]
-crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html [ Crash Timeout ]
-crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html [ Crash Timeout ]
+crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16be.html [ Timeout ]
+crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-16le.html [ Timeout ]
 crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/utf-8.html [ Crash Timeout ]
-crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html [ Crash Timeout ]
-crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html [ Crash Timeout ]
+crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/windows-1251.html [ Timeout ]
+crbug.com/591099 external/wpt/html/infrastructure/urls/resolving-urls/query-encoding/windows-1252.html [ Timeout ]
 crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/flow-content-0/dialog.html [ Crash ]
 crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/flow-content-0/div-align.html [ Failure ]
 crbug.com/591099 external/wpt/html/rendering/non-replaced-elements/the-fieldset-element-0/legend-block-formatting-context.html [ Failure ]
 crbug.com/714962 external/wpt/html/rendering/non-replaced-elements/the-fieldset-element-0/min-width-not-important.html [ Failure ]
 crbug.com/591099 external/wpt/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-auto.html [ Failure ]
 crbug.com/591099 external/wpt/html/rendering/replaced-elements/svg-embedded-sizing/svg-in-img-percentage.html [ Failure ]
-crbug.com/591099 external/wpt/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html [ Failure Timeout ]
+crbug.com/591099 external/wpt/html/rendering/replaced-elements/svg-inline-sizing/svg-inline.html [ Timeout ]
 crbug.com/714962 external/wpt/html/rendering/the-css-user-agent-style-sheet-and-presentational-hints/body-bgcolor-attribute-change.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-change-href.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/forms/the-form-element/form-elements-filter.html [ Crash ]
@@ -3216,7 +3211,7 @@
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-001.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-start-reftest-002.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-001.html [ Failure ]
-crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002.html [ Crash Failure ]
+crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-002.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol-type-reftest-003.html [ Failure ]
 crbug.com/591099 external/wpt/html/semantics/grouping-content/the-ol-element/grouping-ol.html [ Crash ]
 crbug.com/591099 external/wpt/html/semantics/interactive-elements/the-details-element/details.html [ Crash ]
@@ -3242,12 +3237,12 @@
 crbug.com/591099 external/wpt/html/semantics/text-level-semantics/the-br-element/br-bidi-in-inline-ancestors.html [ Failure ]
 crbug.com/591099 external/wpt/html/syntax/parsing/named-character-references.html [ Timeout ]
 crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-1.htm [ Pass Timeout ]
-crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-4.htm [ Timeout ]
-crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-6.htm [ Timeout ]
+crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-4.htm [ Pass Timeout ]
+crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-6.htm [ Pass Timeout ]
 crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-7.htm [ Pass Timeout ]
 crbug.com/591099 external/wpt/html/the-xhtml-syntax/parsing-xhtml-documents/xhtml-mathml-dtd-entity-8.htm [ Timeout ]
 crbug.com/591099 external/wpt/http/basic-auth-cache-test.html [ Timeout ]
-crbug.com/591099 external/wpt/innerText/getter.html [ Crash Failure ]
+crbug.com/591099 external/wpt/innerText/getter.html [ Crash ]
 crbug.com/591099 external/wpt/intersection-observer/edge-inclusive-intersection.html [ Failure ]
 crbug.com/591099 external/wpt/intersection-observer/remove-element.html [ Failure ]
 crbug.com/714962 external/wpt/intersection-observer/root-margin.html [ Failure ]
@@ -3292,7 +3287,7 @@
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-x-pan-y_touch-manual.html [ Timeout ]
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-pan-y-css_touch-manual.html [ Timeout ]
 crbug.com/591099 external/wpt/pointerevents/pointerevent_touch-action-span-test_touch-manual.html [ Timeout ]
-crbug.com/591099 external/wpt/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html [ Failure Timeout ]
+crbug.com/591099 external/wpt/pointerevents/pointerevent_touch-action-svg-test_touch-manual.html [ Timeout ]
 crbug.com/714962 external/wpt/pointerevents/pointerevent_touch-action-table-test_touch-manual.html [ Timeout ]
 crbug.com/591099 external/wpt/quirks-mode/line-height-calculation.html [ Failure ]
 crbug.com/591099 external/wpt/quirks-mode/table-cell-width-calculation.html [ Pass ]
@@ -3302,7 +3297,7 @@
 crbug.com/591099 external/wpt/selection/addRange-16.html [ Timeout ]
 crbug.com/591099 external/wpt/selection/addRange-24.html [ Pass Timeout ]
 crbug.com/591099 external/wpt/selection/addRange-28.html [ Timeout ]
-crbug.com/591099 external/wpt/selection/addRange-32.html [ Pass Timeout ]
+crbug.com/591099 external/wpt/selection/addRange-32.html [ Timeout ]
 crbug.com/591099 external/wpt/selection/addRange-36.html [ Timeout ]
 crbug.com/591099 external/wpt/selection/collapse-00.html [ Timeout ]
 crbug.com/591099 external/wpt/selection/collapse-15.html [ Timeout ]
@@ -3315,7 +3310,7 @@
 crbug.com/714962 external/wpt/shadow-dom/untriaged/styles/test-008.html [ Failure ]
 crbug.com/591099 external/wpt/svg/interfaces.html [ Timeout ]
 crbug.com/591099 external/wpt/svg/linking/reftests/href-filter-element.html [ Failure ]
-crbug.com/591099 external/wpt/uievents/order-of-events/focus-events/focus-manual.html [ Failure Timeout ]
+crbug.com/591099 external/wpt/uievents/order-of-events/focus-events/focus-manual.html [ Timeout ]
 crbug.com/714962 external/wpt/uievents/order-of-events/mouse-events/click-cancel.html [ Failure ]
 crbug.com/591099 external/wpt/url/url-setters.html [ Pass Timeout ]
 crbug.com/591099 external/wpt/wasm/wasm_local_iframe_test.html [ Failure ]
@@ -3347,7 +3342,7 @@
 crbug.com/591099 external/wpt/websockets/cookies/004.html?wss [ Pass ]
 crbug.com/591099 external/wpt/websockets/cookies/005.html [ Pass ]
 crbug.com/591099 external/wpt/websockets/cookies/005.html?wss [ Pass ]
-crbug.com/591099 external/wpt/websockets/cookies/007.html [ Failure Pass ]
+crbug.com/591099 external/wpt/websockets/cookies/007.html [ Failure ]
 crbug.com/591099 external/wpt/websockets/extended-payload-length.html?wss [ Pass ]
 crbug.com/591099 external/wpt/websockets/interfaces/CloseEvent/clean-close.html?wss [ Pass ]
 crbug.com/591099 external/wpt/websockets/interfaces/WebSocket/bufferedAmount/bufferedAmount-arraybuffer.html?wss [ Pass ]
@@ -3403,7 +3398,7 @@
 crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/track-cue-rendering-position-align-rtl-center.html [ Failure ]
 crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/track-cue-rendering-position-align-rtl-line-left.html [ Failure ]
 crbug.com/591099 external/wpt/webvtt/rendering/cues-with-video/processing-model/track-cue-rendering-position-align-rtl-line-right.html [ Failure ]
-crbug.com/591099 external/wpt/workers/Worker_terminate_event_queue.htm [ Pass Timeout ]
+crbug.com/591099 external/wpt/workers/Worker_terminate_event_queue.htm [ Timeout ]
 crbug.com/591099 fast/animation/scroll-animations/scrolltimeline-currenttime.html [ Failure ]
 crbug.com/591099 fast/autoresize/basic.html [ Failure ]
 crbug.com/591099 fast/autoresize/turn-off-autoresize.html [ Failure ]
@@ -3423,7 +3418,7 @@
 crbug.com/591099 fast/backgrounds/background-svg-scaling-zoom.html [ Failure ]
 crbug.com/591099 fast/backgrounds/background-svg-scaling.html [ Failure ]
 crbug.com/591099 fast/backgrounds/body-generated-image-propagated-to-root.html [ Failure ]
-crbug.com/591099 fast/backgrounds/border-radius-split-background-image.html [ Crash Failure ]
+crbug.com/591099 fast/backgrounds/border-radius-split-background-image.html [ Failure ]
 crbug.com/591099 fast/backgrounds/border-radius-split-background.html [ Failure ]
 crbug.com/591099 fast/backgrounds/mask-box-image.html [ Failure ]
 crbug.com/591099 fast/backgrounds/mask-composite.html [ Failure ]
@@ -3466,7 +3461,7 @@
 crbug.com/591099 fast/block/basic/020.html [ Failure ]
 crbug.com/591099 fast/block/basic/quirk-height.html [ Failure ]
 crbug.com/591099 fast/block/basic/quirk-percent-height-grandchild.html [ Failure ]
-crbug.com/591099 fast/block/basic/quirk-percent-height-table-cell.html [ Failure Pass ]
+crbug.com/591099 fast/block/basic/quirk-percent-height-table-cell.html [ Failure ]
 crbug.com/591099 fast/block/block-add-child-crash.html [ Crash ]
 crbug.com/591099 fast/block/block-remove-child-delete-line-box-crash.html [ Crash ]
 crbug.com/591099 fast/block/block-width-recalc-with-relative-height.html [ Failure ]
@@ -3489,7 +3484,6 @@
 crbug.com/591099 fast/block/float/float-forced-below-other-floats.html [ Failure ]
 crbug.com/591099 fast/block/float/float-in-float-hit-testing.html [ Failure ]
 crbug.com/591099 fast/block/float/float-in-float-painting.html [ Failure ]
-crbug.com/591099 fast/block/float/float-on-line-obeys-container-padding.html [ Failure Pass ]
 crbug.com/591099 fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks-2.html [ Failure ]
 crbug.com/591099 fast/block/float/float-should-dirty-line-when-adjacent-to-line-breaks.html [ Failure ]
 crbug.com/591099 fast/block/float/floats-offset-image-strict-line-height.html [ Failure ]
@@ -3518,7 +3512,7 @@
 crbug.com/591099 fast/block/float/selection-gap-clip-out-tiger-crash.html [ Failure ]
 crbug.com/714962 fast/block/layer-not-removed-from-parent-crash.html [ Failure ]
 crbug.com/591099 fast/block/line-layout/floats-do-not-fit-on-line.html [ Failure ]
-crbug.com/591099 fast/block/line-layout/line-break-removal-near-textarea-crash.html [ Crash Failure ]
+crbug.com/591099 fast/block/line-layout/line-break-removal-near-textarea-crash.html [ Failure ]
 crbug.com/714962 fast/block/margin-collapse/044.html [ Failure ]
 crbug.com/591099 fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away.html [ Failure ]
 crbug.com/714962 fast/block/margin-collapse/line-beside-float-complex-margin-collapsing.html [ Failure ]
@@ -3531,24 +3525,20 @@
 crbug.com/591099 fast/block/positioning/056.html [ Failure ]
 crbug.com/591099 fast/block/positioning/059.html [ Failure ]
 crbug.com/591099 fast/block/positioning/061.html [ Failure ]
-crbug.com/591099 fast/block/positioning/absolute-appended-to-inline.html [ Failure Pass ]
 crbug.com/591099 fast/block/positioning/absolute-in-inline-dynamic.html [ Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-2.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-3.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-rtl-2.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-rtl-3.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-rtl.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-short-ltr.html [ Crash Failure ]
-crbug.com/591099 fast/block/positioning/absolute-in-inline-short-rtl.html [ Crash Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-2.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr-3.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-ltr.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-rtl-2.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-rtl-3.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-rtl.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-short-ltr.html [ Failure ]
+crbug.com/591099 fast/block/positioning/absolute-in-inline-short-rtl.html [ Failure ]
 crbug.com/591099 fast/block/positioning/absolute-with-html-border-quirks.html [ Failure ]
 crbug.com/591099 fast/block/positioning/abspos-auto-left-and-width-change-parent-margin-left.html [ Failure ]
 crbug.com/591099 fast/block/positioning/abspositioned-object-under-split-relpositioned-inline-crash.html [ Crash ]
 crbug.com/591099 fast/block/positioning/auto-height-with-top-and-bottom.html [ Failure ]
-crbug.com/591099 fast/block/positioning/auto/005.html [ Failure Pass ]
-crbug.com/591099 fast/block/positioning/auto/vertical-lr/005.html [ Failure Pass ]
 crbug.com/591099 fast/block/positioning/auto/vertical-lr/007.html [ Failure ]
-crbug.com/591099 fast/block/positioning/auto/vertical-rl/005.html [ Failure Pass ]
 crbug.com/714962 fast/block/positioning/auto/vertical-rl/006.html [ Failure ]
 crbug.com/591099 fast/block/positioning/auto/vertical-rl/007.html [ Failure ]
 crbug.com/591099 fast/block/positioning/child-of-fixed-pos-after-movement.html [ Crash ]
@@ -3563,16 +3553,15 @@
 crbug.com/591099 fast/block/positioning/positioned-child-inside-relative-positioned-anonymous-block.html [ Crash ]
 crbug.com/591099 fast/block/positioning/positioned-movement-layout-when-height-changes.html [ Crash ]
 crbug.com/591099 fast/block/positioning/rel-positioned-inline-changes-width.html [ Crash ]
-crbug.com/591099 fast/block/positioning/relative-overflow-block.html [ Failure Pass ]
 crbug.com/591099 fast/block/positioning/relative-overflow-replaced.html [ Failure ]
 crbug.com/591099 fast/block/positioning/rtl-static-positioning.html [ Failure ]
-crbug.com/591099 fast/block/positioning/table-cell-static-position.html [ Failure Pass ]
-crbug.com/591099 fast/block/positioning/trailing-space-test.html [ Failure Pass ]
+crbug.com/591099 fast/block/positioning/table-cell-static-position.html [ Failure ]
+crbug.com/591099 fast/block/positioning/trailing-space-test.html [ Failure ]
 crbug.com/591099 fast/block/positioning/vertical-lr/001.html [ Failure ]
 crbug.com/591099 fast/block/positioning/vertical-rl/001.html [ Failure ]
 crbug.com/591099 fast/block/positioning/vertical-rl/002.html [ Failure ]
 crbug.com/591099 fast/block/scrollbar-wider-than-border-box.html [ Failure ]
-crbug.com/591099 fast/block/sticky-position-containing-block-crash.html [ Crash Pass ]
+crbug.com/591099 fast/block/sticky-position-containing-block-crash.html [ Crash ]
 crbug.com/591099 fast/body-propagation/background-color/001-xhtml.xhtml [ Failure ]
 crbug.com/591099 fast/body-propagation/background-color/001.html [ Failure ]
 crbug.com/591099 fast/body-propagation/background-color/002-xhtml.xhtml [ Failure ]
@@ -3610,7 +3599,7 @@
 crbug.com/591099 fast/body-propagation/background-image/006-declarative.xhtml [ Failure ]
 crbug.com/591099 fast/body-propagation/background-image/006-xhtml.xhtml [ Failure ]
 crbug.com/591099 fast/body-propagation/background-image/006.html [ Failure ]
-crbug.com/591099 fast/body-propagation/background-image/007-declarative.xhtml [ Crash Failure ]
+crbug.com/591099 fast/body-propagation/background-image/007-declarative.xhtml [ Failure ]
 crbug.com/591099 fast/body-propagation/background-image/007-xhtml.xhtml [ Failure ]
 crbug.com/591099 fast/body-propagation/background-image/007.html [ Failure ]
 crbug.com/591099 fast/body-propagation/background-image/008-xhtml.xhtml [ Failure ]
@@ -3700,7 +3689,7 @@
 crbug.com/591099 fast/box-shadow/scaled-box-shadow.html [ Failure ]
 crbug.com/591099 fast/box-shadow/spread.html [ Failure ]
 crbug.com/591099 fast/box-shadow/transform-fringing.html [ Failure ]
-crbug.com/591099 fast/box-sizing/replaced.html [ Failure Pass ]
+crbug.com/591099 fast/box-sizing/replaced.html [ Failure ]
 crbug.com/714962 fast/canvas-api/canvas-scroll-path-into-view.html [ Failure ]
 crbug.com/591099 fast/canvas-api/fallback-content.html [ Crash ]
 crbug.com/591099 fast/canvas-api/toDataURL-supportedTypes.html [ Failure ]
@@ -3715,15 +3704,7 @@
 crbug.com/591099 fast/canvas/fill-stroke-clip-reset-path.html [ Failure ]
 crbug.com/714962 fast/canvas/image-object-in-canvas.html [ Failure ]
 crbug.com/591099 fast/canvas/patternfill-repeat.html [ Failure ]
-crbug.com/714962 fast/canvas/setWidthResetAfterForcedRender.html [ Crash Failure ]
-crbug.com/591099 fast/clip/004.html [ Failure Pass ]
-crbug.com/591099 fast/clip/009.html [ Failure Pass ]
-crbug.com/591099 fast/clip/010.html [ Failure Pass ]
-crbug.com/591099 fast/clip/011.html [ Failure Pass ]
-crbug.com/591099 fast/clip/012.html [ Failure Pass ]
-crbug.com/591099 fast/clip/013.html [ Failure Pass ]
-crbug.com/591099 fast/clip/014.html [ Failure Pass ]
-crbug.com/591099 fast/clip/outline-overflowClip.html [ Failure Pass ]
+crbug.com/714962 fast/canvas/setWidthResetAfterForcedRender.html [ Failure ]
 crbug.com/591099 fast/clip/overflow-border-radius-combinations.html [ Failure ]
 crbug.com/591099 fast/clip/overflow-border-radius-composited-parent.html [ Failure ]
 crbug.com/591099 fast/clip/overflow-border-radius-composited.html [ Failure ]
@@ -3886,7 +3867,7 @@
 crbug.com/591099 fast/css-grid-layout/scrolled-grid-painting-overflow.html [ Failure ]
 crbug.com/591099 fast/css-grid-layout/scrolled-grid-painting.html [ Failure ]
 crbug.com/591099 fast/css-grid-layout/stale-grid-layout.html [ Failure ]
-crbug.com/591099 fast/css-intrinsic-dimensions/css-tables.html [ Failure Pass ]
+crbug.com/591099 fast/css-intrinsic-dimensions/css-tables.html [ Failure ]
 crbug.com/591099 fast/css-intrinsic-dimensions/fillavailable-minmax-content-inlinesize-contribution-nonreplaced-blocks.html [ Failure ]
 crbug.com/591099 fast/css-intrinsic-dimensions/fitcontent-minmax-content-inlinesize-contribution-nonreplaced-blocks.html [ Failure ]
 crbug.com/591099 fast/css-intrinsic-dimensions/fixed-height-stf-img-block-child-percent-height.html [ Failure ]
@@ -3899,7 +3880,7 @@
 crbug.com/591099 fast/css-intrinsic-dimensions/indefinite-percent-minmax-content-inlinesize-contribution-nonreplaced-blocks.html [ Failure ]
 crbug.com/591099 fast/css-intrinsic-dimensions/multicol.html [ Failure ]
 crbug.com/591099 fast/css-intrinsic-dimensions/resize-inside-percent-width-overflow-hidden.html [ Failure ]
-crbug.com/591099 fast/css-intrinsic-dimensions/tables.html [ Failure Pass ]
+crbug.com/591099 fast/css-intrinsic-dimensions/tables.html [ Failure ]
 crbug.com/591099 fast/css/001.html [ Failure ]
 crbug.com/591099 fast/css/002.html [ Failure ]
 crbug.com/591099 fast/css/003.html [ Failure ]
@@ -3911,8 +3892,8 @@
 crbug.com/591099 fast/css/MarqueeLayoutTest.html [ Failure ]
 crbug.com/591099 fast/css/ZeroOpacityLayers.html [ Failure ]
 crbug.com/591099 fast/css/ZeroOpacityLayers2.html [ Failure ]
-crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-001.html [ Crash Failure ]
-crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-offset-001.html [ Crash Failure ]
+crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-001.html [ Failure ]
+crbug.com/591099 fast/css/abs-pos-child-inside-rel-pos-inline-offset-001.html [ Failure ]
 crbug.com/591099 fast/css/absolute-child-with-percent-height-inside-relative-parent.html [ Failure ]
 crbug.com/591099 fast/css/absolute-inline-alignment-2.html [ Pass ]
 crbug.com/714962 fast/css/absolute-inline-alignment.html [ Failure ]
@@ -3980,7 +3961,7 @@
 crbug.com/714962 fast/css/disabled-form-control-elements-should-not-be-active.html [ Failure ]
 crbug.com/591099 fast/css/dynamic-class-backdrop-pseudo.html [ Crash ]
 crbug.com/591099 fast/css/dynamic-sibling-selector.html [ Failure ]
-crbug.com/591099 fast/css/empty-body-test.html [ Crash Failure ]
+crbug.com/591099 fast/css/empty-body-test.html [ Failure ]
 crbug.com/591099 fast/css/empty-generated-content.html [ Failure ]
 crbug.com/591099 fast/css/empty-inline-003-quirksmode.htm [ Failure ]
 crbug.com/591099 fast/css/empty-inline-line-height-first-line-quirksmode.htm [ Failure ]
@@ -4020,7 +4001,7 @@
 crbug.com/714962 fast/css/focus-ring-recursive-inlines.html [ Failure ]
 crbug.com/714962 fast/css/font-face-add-same-family-later.html [ Failure ]
 crbug.com/714962 fast/css/font-face-cache-version.html [ Failure ]
-crbug.com/591099 fast/css/font-face-opentype.html [ Crash Failure ]
+crbug.com/591099 fast/css/font-face-opentype.html [ Failure ]
 crbug.com/591099 fast/css/font-face-synthetic-bold-italic-for-locally-installed.html [ Failure ]
 crbug.com/591099 fast/css/font-face-synthetic-bold-italic.html [ Failure ]
 crbug.com/591099 fast/css/font-face-weight-matching.html [ Failure ]
@@ -4050,7 +4031,7 @@
 crbug.com/591099 fast/css/image-orientation/image-orientation-from-image-composited-dynamic.html [ Failure ]
 crbug.com/591099 fast/css/image-orientation/image-orientation-from-image-composited.html [ Failure ]
 crbug.com/591099 fast/css/image-orientation/image-orientation-from-image.html [ Failure ]
-crbug.com/591099 fast/css/image-set-value-not-removed-crash.html [ Failure Pass ]
+crbug.com/591099 fast/css/image-set-value-not-removed-crash.html [ Failure ]
 crbug.com/591099 fast/css/import-rule-regression-11590.html [ Failure ]
 crbug.com/591099 fast/css/import_with_baseurl.html [ Failure ]
 crbug.com/714962 fast/css/inline-block-tricky-baselines.html [ Failure ]
@@ -4072,7 +4053,7 @@
 crbug.com/714962 fast/css/invalidation/sheet-loaded-before-invalidation.html [ Failure ]
 crbug.com/714962 fast/css/invalidation/style-invalidation-before-attach.html [ Failure ]
 crbug.com/591099 fast/css/invalidation/valid-invalid-pseudo.html [ Failure ]
-crbug.com/591099 fast/css/large-numbers.html [ Timeout Pass ]
+crbug.com/591099 fast/css/large-numbers.html [ Timeout ]
 crbug.com/591099 fast/css/last-child-pseudo-class.html [ Failure ]
 crbug.com/591099 fast/css/last-child-style-sharing.html [ Failure ]
 crbug.com/591099 fast/css/last-of-type-pseudo-class.html [ Failure ]
@@ -4116,16 +4097,16 @@
 crbug.com/591099 fast/css/number-parsing-crash.html [ Failure ]
 crbug.com/591099 fast/css/object-fit-grow-landscape.html [ Failure ]
 crbug.com/591099 fast/css/object-fit-grow-portrait.html [ Failure ]
-crbug.com/591099 fast/css/object-position-svg.html [ Crash Pass ]
+crbug.com/591099 fast/css/object-position-svg.html [ Crash ]
 crbug.com/591099 fast/css/only-child-pseudo-class.html [ Failure ]
 crbug.com/591099 fast/css/only-of-type-pseudo-class.html [ Failure ]
-crbug.com/591099 fast/css/outline-auto-empty-rects.html [ Crash Failure ]
+crbug.com/591099 fast/css/outline-auto-empty-rects.html [ Failure ]
 crbug.com/591099 fast/css/outline-auto-location.html [ Failure ]
 crbug.com/591099 fast/css/outline-narrowLine.html [ Failure ]
 crbug.com/714962 fast/css/outline-small-visual-overflow.html [ Failure ]
 crbug.com/591099 fast/css/overflow-rtl-border-after.html [ Failure ]
 crbug.com/591099 fast/css/pendingStylesheetFontSize.html [ Failure ]
-crbug.com/591099 fast/css/percent-min-width-img-src-change.html [ Failure Pass ]
+crbug.com/591099 fast/css/percent-min-width-img-src-change.html [ Failure ]
 crbug.com/591099 fast/css/percent-top-relative-container-height-unspecified.html [ Failure ]
 crbug.com/591099 fast/css/percent-top-value-with-relative-position.html [ Failure ]
 crbug.com/591099 fast/css/percent-width-img-src-change.html [ Failure ]
@@ -4169,10 +4150,10 @@
 crbug.com/591099 fast/css/shadow-dom-scope.html [ Crash ]
 crbug.com/591099 fast/css/shadow-multiple.html [ Failure ]
 crbug.com/591099 fast/css/simple-selector-chain-parsing.html [ Failure ]
-crbug.com/591099 fast/css/sticky/inline-sticky-abspos-child.html [ Crash Failure ]
+crbug.com/591099 fast/css/sticky/inline-sticky-abspos-child.html [ Failure ]
 crbug.com/714962 fast/css/sticky/replaced-sticky.html [ Failure ]
 crbug.com/714962 fast/css/sticky/sticky-both-sides-bottom-right-constrained.html [ Failure ]
-crbug.com/591099 fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html [ Crash Failure ]
+crbug.com/591099 fast/css/sticky/sticky-top-overflow-scroll-by-fragment.html [ Failure ]
 crbug.com/591099 fast/css/style-outside-head.html [ Failure ]
 crbug.com/591099 fast/css/style-parsed-outside-head.html [ Failure ]
 crbug.com/591099 fast/css/table-text-align-quirk.html [ Failure ]
@@ -4262,7 +4243,6 @@
 crbug.com/714962 fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-first-letter-style.html [ Failure ]
 crbug.com/714962 fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport.html [ Failure ]
 crbug.com/714962 fast/dom/Document/CaretRangeFromPoint/replace-element.html [ Failure ]
-crbug.com/591099 fast/dom/Element/class-attribute-whitespace.html [ Failure ]
 crbug.com/714962 fast/dom/Element/client-rect-list-argument.html [ Failure ]
 crbug.com/591099 fast/dom/Element/getBoundingClientRect.html [ Failure ]
 crbug.com/714962 fast/dom/Element/getClientRects.html [ Failure ]
@@ -4404,7 +4384,7 @@
 crbug.com/591099 fast/dynamic/002.html [ Failure ]
 crbug.com/591099 fast/dynamic/004.html [ Failure ]
 crbug.com/591099 fast/dynamic/005.html [ Failure ]
-crbug.com/591099 fast/dynamic/006.html [ Crash Failure ]
+crbug.com/591099 fast/dynamic/006.html [ Failure ]
 crbug.com/591099 fast/dynamic/007.html [ Failure ]
 crbug.com/591099 fast/dynamic/009.html [ Failure ]
 crbug.com/591099 fast/dynamic/010.html [ Failure ]
@@ -4418,14 +4398,12 @@
 crbug.com/591099 fast/dynamic/anonymous-block-orphaned-lines.html [ Failure ]
 crbug.com/591099 fast/dynamic/containing-block-change.html [ Failure ]
 crbug.com/591099 fast/dynamic/continuation-detach-crash.html [ Crash ]
-crbug.com/591099 fast/dynamic/create-renderer-for-whitespace-only-text.html [ Failure ]
 crbug.com/591099 fast/dynamic/dirty-float-in-clean-line.html [ Failure ]
 crbug.com/591099 fast/dynamic/first-letter-after-list-marker.html [ Failure ]
 crbug.com/591099 fast/dynamic/first-letter-display-change.html [ Failure ]
 crbug.com/591099 fast/dynamic/float-at-line-break.html [ Failure ]
 crbug.com/591099 fast/dynamic/float-from-empty-line.html [ Failure ]
 crbug.com/591099 fast/dynamic/float-in-trailing-whitespace-after-last-line-break-2.html [ Failure ]
-crbug.com/591099 fast/dynamic/float-in-trailing-whitespace-after-last-line-break.html [ Failure ]
 crbug.com/591099 fast/dynamic/float-no-longer-overhanging.html [ Failure ]
 crbug.com/591099 fast/dynamic/float-withdrawal-2.html [ Failure ]
 crbug.com/591099 fast/dynamic/float-withdrawal.html [ Failure ]
@@ -4464,7 +4442,7 @@
 crbug.com/591099 fast/encoding/xmacroman-encoding-test.html [ Failure ]
 crbug.com/591099 fast/encoding/yentest2.html [ Failure ]
 crbug.com/591099 fast/events/anchor-empty-focus.html [ Failure ]
-crbug.com/714962 fast/events/autoscroll-disabled-in-fix.html [ Pass Timeout ]
+crbug.com/714962 fast/events/autoscroll-disabled-in-fix.html [ Timeout ]
 crbug.com/591099 fast/events/autoscroll-in-textfield.html [ Failure ]
 crbug.com/591099 fast/events/autoscroll-nonscrollable-iframe-in-scrollable-div.html [ Failure ]
 crbug.com/591099 fast/events/autoscroll-should-not-stop-on-keypress.html [ Failure ]
@@ -4476,7 +4454,7 @@
 crbug.com/591099 fast/events/check-defocus-event-order-when-triggered-by-tab.html [ Failure ]
 crbug.com/714962 fast/events/click-checkbox-blur-refocus-window.html [ Failure ]
 crbug.com/714962 fast/events/click-checkbox-refocus-window.html [ Failure ]
-crbug.com/714962 fast/events/click-over-descendant-elements.html [ Crash Failure ]
+crbug.com/714962 fast/events/click-over-descendant-elements.html [ Failure ]
 crbug.com/591099 fast/events/click-range-slider.html [ Crash ]
 crbug.com/714962 fast/events/click-with-large-negative-text-indent.html [ Failure ]
 crbug.com/714962 fast/events/content-changed-during-drop.html [ Failure ]
@@ -4533,18 +4511,18 @@
 crbug.com/714962 fast/events/pointerevents/mouse-node-remove.html [ Failure ]
 crbug.com/714962 fast/events/pointerevents/mouse-pointer-boundary-events-for-shadowdom.html [ Failure ]
 crbug.com/591099 fast/events/pointerevents/mouse-pointer-capture-transition-events.html [ Timeout ]
-crbug.com/591099 fast/events/pointerevents/mouse-pointer-capture.html [ Failure Pass Timeout ]
+crbug.com/591099 fast/events/pointerevents/mouse-pointer-capture.html [ Failure ]
 crbug.com/591099 fast/events/pointerevents/mouse-pointer-event-properties.html [ Timeout ]
-crbug.com/591099 fast/events/pointerevents/mouse-pointer-preventdefault.html [ Failure Timeout ]
+crbug.com/591099 fast/events/pointerevents/mouse-pointer-preventdefault.html [ Failure ]
 crbug.com/714962 fast/events/pointerevents/mouse-pointer-transition-events.html [ Failure ]
 crbug.com/714962 fast/events/pointerevents/mouse-pointer-updown-events.html [ Failure ]
-crbug.com/591099 fast/events/pointerevents/multi-pointer-preventdefault.html [ Failure Pass Timeout ]
+crbug.com/591099 fast/events/pointerevents/multi-pointer-preventdefault.html [ Failure ]
 crbug.com/714962 fast/events/pointerevents/pointer-use-count.html [ Failure ]
 crbug.com/591099 fast/events/pointerevents/touch-capture-in-iframe.html [ Timeout ]
 crbug.com/591099 fast/events/pointerevents/touch-capture.html [ Timeout ]
 crbug.com/714962 fast/events/pointerevents/touch-pointer-events.html [ Failure ]
 crbug.com/714962 fast/events/pointerevents/touch-pointercancel.html [ Failure ]
-crbug.com/591099 fast/events/popup-allowed-from-gesture-initiated-event.html [ Crash Failure ]
+crbug.com/591099 fast/events/popup-allowed-from-gesture-initiated-event.html [ Failure ]
 crbug.com/591099 fast/events/popup-allowed-from-gesture-only-once-iframes.html [ Timeout ]
 crbug.com/591099 fast/events/popup-blocked-from-different-frames.html [ Failure ]
 crbug.com/714962 fast/events/popup-blocked-from-untrusted-mouse-click.html [ Timeout ]
@@ -4563,7 +4541,6 @@
 crbug.com/591099 fast/events/submit-reset-nested-bubble.html [ Failure ]
 crbug.com/591099 fast/events/tab-imagemap.html [ Failure ]
 crbug.com/591099 fast/events/tabindex-focus-blur-all.html [ Crash ]
-crbug.com/591099 fast/events/touch/compositor-touch-hit-rects-non-composited-scroll.html [ Failure Pass ]
 crbug.com/591099 fast/events/touch/compositor-touch-hit-rects-scroll.html [ Failure ]
 crbug.com/591099 fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
 crbug.com/591099 fast/events/touch/gesture/gesture-click-on-inline-continations.html [ Failure ]
@@ -4571,7 +4548,7 @@
 crbug.com/714962 fast/events/touch/gesture/gesture-tap-input-after-composition.html [ Failure ]
 crbug.com/714962 fast/events/touch/gesture/gesture-tap-mouse-events.html [ Failure ]
 crbug.com/714962 fast/events/touch/gesture/gesture-tap-result.html [ Failure ]
-crbug.com/591099 fast/events/touch/gesture/touch-gesture-scroll-iframe-past-extent.html [ Failure Timeout ]
+crbug.com/591099 fast/events/touch/gesture/touch-gesture-scroll-iframe-past-extent.html [ Failure ]
 crbug.com/591099 fast/events/touch/touch-action-range-input-crash.html [ Crash ]
 crbug.com/591099 fast/events/touch/touch-action-range-input-csp.html [ Crash ]
 crbug.com/591099 fast/events/touch/touch-action-range-input.html [ Crash ]
@@ -4587,8 +4564,8 @@
 crbug.com/591099 fast/events/window-events-capture.html [ Failure ]
 crbug.com/591099 fast/events/window-onerror-11.html [ Failure ]
 crbug.com/591099 fast/events/window-onerror-12.html [ Failure ]
-crbug.com/591099 fast/files/apply-blob-url-to-img.html [ Failure Timeout ]
-crbug.com/591099 fast/files/file-in-input-display.html [ Failure Timeout ]
+crbug.com/591099 fast/files/apply-blob-url-to-img.html [ Timeout ]
+crbug.com/591099 fast/files/file-in-input-display.html [ Timeout ]
 crbug.com/591099 fast/forms/001.html [ Failure ]
 crbug.com/591099 fast/forms/006.html [ Failure ]
 crbug.com/591099 fast/forms/007.html [ Failure ]
@@ -4621,15 +4598,15 @@
 crbug.com/591099 fast/forms/button/button-white-space.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-ar.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-coarse.html [ Failure ]
-crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-minimum-date.html [ Failure Timeout ]
+crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-minimum-date.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-required-ar.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-required.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-ru.html [ Failure ]
-crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-step.html [ Failure Timeout ]
+crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-step.html [ Failure ]
 crbug.com/591099 fast/forms/calendar-picker/calendar-picker-appearance-zoom125.html [ Failure ]
-crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-zoom200.html [ Failure Timeout ]
+crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance-zoom200.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-appearance.html [ Failure ]
-crbug.com/591099 fast/forms/calendar-picker/calendar-picker-key-operations.html [ Crash Pass Timeout ]
+crbug.com/591099 fast/forms/calendar-picker/calendar-picker-key-operations.html [ Pass Timeout ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-mouse-operations.html [ Failure ]
 crbug.com/714962 fast/forms/calendar-picker/calendar-picker-type-change-onclick.html [ Timeout ]
 crbug.com/714962 fast/forms/calendar-picker/month-picker-appearance-step.html [ Failure ]
@@ -4644,8 +4621,8 @@
 crbug.com/591099 fast/forms/checkbox/checkbox-appearance-basic.html [ Failure ]
 crbug.com/714962 fast/forms/checkbox/checkbox-focus-by-mouse.html [ Failure ]
 crbug.com/591099 fast/forms/color/input-appearance-color.html [ Failure ]
-crbug.com/714962 fast/forms/color/input-color-chooser-shown-readonly.html [ Failure Pass Timeout ]
-crbug.com/714962 fast/forms/color/input-color-chooser-shown.html [ Crash Failure Pass Timeout ]
+crbug.com/714962 fast/forms/color/input-color-chooser-shown-readonly.html [ Timeout ]
+crbug.com/714962 fast/forms/color/input-color-chooser-shown.html [ Timeout ]
 crbug.com/591099 fast/forms/color/input-color-onchange-event.html [ Failure ]
 crbug.com/591099 fast/forms/control-clip-overflow.html [ Failure ]
 crbug.com/591099 fast/forms/control-clip.html [ Failure ]
@@ -4905,7 +4882,6 @@
 crbug.com/591099 fast/forms/select/option-index.html [ Failure ]
 crbug.com/591099 fast/forms/select/option-relayout-modified-text.html [ Failure ]
 crbug.com/591099 fast/forms/select/option-script.html [ Failure ]
-crbug.com/591099 fast/forms/select/option-strip-whitespace.html [ Failure ]
 crbug.com/591099 fast/forms/select/option-text-clip.html [ Failure ]
 crbug.com/591099 fast/forms/select/popup-closes-on-blur.html [ Failure ]
 crbug.com/591099 fast/forms/select/popup-with-display-none-optgroup.html [ Failure ]
@@ -4959,7 +4935,7 @@
 crbug.com/591099 fast/forms/suggestion-picker/date-suggestion-picker-appearance-zoom200.html [ Failure ]
 crbug.com/714962 fast/forms/suggestion-picker/date-suggestion-picker-appearance.html [ Failure ]
 crbug.com/714962 fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-locale-hebrew.html [ Failure ]
-crbug.com/714962 fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-rtl.html [ Failure Timeout ]
+crbug.com/714962 fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-rtl.html [ Failure ]
 crbug.com/714962 fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar.html [ Failure ]
 crbug.com/714962 fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance.html [ Failure ]
 crbug.com/714962 fast/forms/suggestion-picker/month-suggestion-picker-appearance-rtl.html [ Failure ]
@@ -5047,10 +5023,10 @@
 crbug.com/591099 fast/forms/textarea/textarea-placeholder-visibility-1.html [ Failure ]
 crbug.com/591099 fast/forms/textarea/textarea-placeholder-visibility-2.html [ Failure ]
 crbug.com/714962 fast/forms/textarea/textarea-resize-above-min-size-and-below-initial-size.html [ Failure ]
-crbug.com/714962 fast/forms/textarea/textarea-resize-below-min-intrinsic-size.html [ Failure Timeout ]
+crbug.com/714962 fast/forms/textarea/textarea-resize-below-min-intrinsic-size.html [ Failure ]
 crbug.com/714962 fast/forms/textarea/textarea-resize-below-min-size-zoomed.html [ Failure ]
-crbug.com/714962 fast/forms/textarea/textarea-resize-below-min-size.html [ Failure Timeout ]
-crbug.com/591099 fast/forms/textarea/textarea-resize-orthogonal-containing-block.html [ Failure Timeout ]
+crbug.com/714962 fast/forms/textarea/textarea-resize-below-min-size.html [ Failure ]
+crbug.com/591099 fast/forms/textarea/textarea-resize-orthogonal-containing-block.html [ Failure ]
 crbug.com/591099 fast/forms/textarea/textarea-scroll-height.html [ Failure ]
 crbug.com/591099 fast/forms/textarea/textarea-scrollbar.html [ Failure ]
 crbug.com/591099 fast/forms/textarea/textarea-scrolled-focus-ring.html [ Failure ]
@@ -5158,7 +5134,7 @@
 crbug.com/714962 fast/harness/legacy-results.html [ Failure ]
 crbug.com/591099 fast/hidpi/broken-image-icon-hidpi.html [ Failure ]
 crbug.com/714962 fast/hidpi/clip-text-in-hidpi.html [ Failure ]
-crbug.com/591099 fast/hidpi/image-set-list-style-image.html [ Crash Failure ]
+crbug.com/591099 fast/hidpi/image-set-list-style-image.html [ Failure ]
 crbug.com/591099 fast/hidpi/image-set-shape-outside.html [ Failure ]
 crbug.com/591099 fast/hidpi/image-srcset-intrinsic-size.html [ Failure ]
 crbug.com/591099 fast/history/saves-state-after-frame-nav.html [ Failure ]
@@ -5175,7 +5151,7 @@
 crbug.com/714962 fast/html/meter-user-modify.html [ Failure ]
 crbug.com/591099 fast/html/select-dropdown-consistent-background-color.html [ Failure ]
 crbug.com/591099 fast/inline-block/002.html [ Failure ]
-crbug.com/591099 fast/inline-block/baseline-vertical.html [ Crash Failure ]
+crbug.com/591099 fast/inline-block/baseline-vertical.html [ Failure ]
 crbug.com/591099 fast/inline-block/contenteditable-baseline.html [ Failure ]
 crbug.com/714962 fast/inline-block/inline-block-vertical-align-2.html [ Failure ]
 crbug.com/714962 fast/inline-block/tricky-baseline.html [ Failure ]
@@ -5193,7 +5169,7 @@
 crbug.com/591099 fast/inline/inline-box-background.html [ Failure ]
 crbug.com/591099 fast/inline/inline-focus-ring-under-absolute-enclosing-relative-div.html [ Failure ]
 crbug.com/714962 fast/inline/inline-offsetLeft-continuation.html [ Failure ]
-crbug.com/591099 fast/inline/inline-offsetLeft-relpos.html [ Crash Failure ]
+crbug.com/591099 fast/inline/inline-offsetLeft-relpos.html [ Failure ]
 crbug.com/591099 fast/inline/inline-with-empty-inline-children.html [ Failure ]
 crbug.com/591099 fast/inline/justify-emphasis-inline-box.html [ Failure ]
 crbug.com/591099 fast/inline/left-right-center-inline-alignment-in-ltr-and-rtl-blocks.html [ Failure ]
@@ -5229,7 +5205,7 @@
 crbug.com/591099 fast/invalid/missing-dl-end-tag.html [ Failure ]
 crbug.com/591099 fast/invalid/missing-dt-end-tag.html [ Failure ]
 crbug.com/591099 fast/invalid/missing-end-tag.xhtml [ Failure ]
-crbug.com/591099 fast/invalid/missing-font-end-tag.html [ Crash Failure ]
+crbug.com/591099 fast/invalid/missing-font-end-tag.html [ Failure ]
 crbug.com/591099 fast/invalid/nestedh3s.html [ Failure ]
 crbug.com/591099 fast/invalid/table-inside-stray-table-content.html [ Failure ]
 crbug.com/591099 fast/invalid/table-residual-style-crash.html [ Failure ]
@@ -5242,7 +5218,7 @@
 crbug.com/591099 fast/js/same-origin-subframe-about-blank.html [ Failure ]
 crbug.com/591099 fast/js/toString-and-valueOf-override.html [ Failure ]
 crbug.com/591099 fast/js/webidl-type-mapping.html [ Timeout ]
-crbug.com/591099 fast/layers/add-layer-with-nested-stacking.html [ Crash Failure ]
+crbug.com/591099 fast/layers/add-layer-with-nested-stacking.html [ Failure ]
 crbug.com/591099 fast/layers/inline-dirty-z-order-lists.html [ Crash Failure ]
 crbug.com/591099 fast/layers/layer-content-visibility-change.html [ Failure ]
 crbug.com/591099 fast/layers/layer-visibility-sublayer.html [ Failure ]
@@ -5297,25 +5273,25 @@
 crbug.com/591099 fast/lists/marker-before-empty-inline.html [ Failure ]
 crbug.com/591099 fast/lists/marker-image-error.html [ Failure ]
 crbug.com/591099 fast/lists/markers-in-selection.html [ Failure ]
-crbug.com/591099 fast/lists/ol-display-types.html [ Crash Failure ]
+crbug.com/591099 fast/lists/ol-display-types.html [ Failure ]
 crbug.com/591099 fast/lists/ordered-list-with-no-ol-tag.html [ Failure ]
-crbug.com/591099 fast/lists/remove-listmarker-and-make-anonblock-empty-2.html [ Failure Pass ]
+crbug.com/591099 fast/lists/remove-listmarker-and-make-anonblock-empty-2.html [ Failure ]
 crbug.com/591099 fast/lists/remove-listmarker-from-anonblock-with-continuation-crash.html [ Crash ]
 crbug.com/591099 fast/lists/scrolled-marker-paint.html [ Failure ]
-crbug.com/591099 fast/loader/child-frame-add-after-back-forward.html [ Failure Timeout ]
+crbug.com/591099 fast/loader/child-frame-add-after-back-forward.html [ Timeout ]
 crbug.com/591099 fast/loader/frame-creation-removal.html [ Failure ]
 crbug.com/591099 fast/loader/javascript-url-iframe-crash.html [ Crash ]
 crbug.com/591099 fast/loader/local-CSS-from-local.html [ Failure ]
 crbug.com/591099 fast/loader/local-JavaScript-from-local.html [ Failure ]
 crbug.com/591099 fast/loader/local-iFrame-source-from-local.html [ Failure ]
 crbug.com/591099 fast/loader/local-image-from-local.html [ Failure ]
-crbug.com/591099 fast/loader/navigation-scheduler-user-gesture.html [ Failure Timeout ]
+crbug.com/591099 fast/loader/navigation-scheduler-user-gesture.html [ Timeout ]
 crbug.com/591099 fast/loader/opaque-base-url.html [ Failure ]
 crbug.com/591099 fast/loader/text-document-wrapping.html [ Failure ]
 crbug.com/591099 fast/masking/clip-path-inset-large-radii.html [ Failure ]
 crbug.com/591099 fast/masking/clip-path-selection.html [ Failure ]
 crbug.com/591099 fast/media/mq-color-gamut-picture.html [ Failure ]
-crbug.com/591099 fast/media/mq-display-mode-fullscreen.html [ Crash Timeout ]
+crbug.com/591099 fast/media/mq-display-mode-fullscreen.html [ Crash ]
 crbug.com/591099 fast/multicol/abspos-after-break-after.html [ Failure ]
 crbug.com/591099 fast/multicol/abspos-new-width-rebalance.html [ Failure ]
 crbug.com/591099 fast/multicol/anonymous-block-split-crash.html [ Crash ]
@@ -5752,7 +5728,6 @@
 crbug.com/714962 fast/overflow/005.html [ Failure ]
 crbug.com/714962 fast/overflow/006.html [ Failure ]
 crbug.com/591099 fast/overflow/007.html [ Failure ]
-crbug.com/591099 fast/overflow/add-visual-overflow-and-change-container-position.html [ Failure Pass ]
 crbug.com/714962 fast/overflow/childFocusRingClip.html [ Failure ]
 crbug.com/714962 fast/overflow/dynamic-hidden.html [ Failure ]
 crbug.com/591099 fast/overflow/height-during-simplified-layout.html [ Failure ]
@@ -5812,13 +5787,13 @@
 crbug.com/591099 fast/parser/broken-comments-vs-parsing-mode.html [ Failure ]
 crbug.com/591099 fast/parser/comment-in-script.html [ Failure ]
 crbug.com/591099 fast/parser/document-write-option.html [ Failure ]
-crbug.com/591099 fast/parser/entities-in-html.html [ Failure Pass ]
-crbug.com/591099 fast/parser/entities-in-xhtml.xhtml [ Failure Pass ]
+crbug.com/591099 fast/parser/entities-in-html.html [ Failure ]
+crbug.com/591099 fast/parser/entities-in-xhtml.xhtml [ Failure ]
 crbug.com/591099 fast/parser/entity-comment-in-style.html [ Failure ]
 crbug.com/591099 fast/parser/entity-comment-in-textarea.html [ Failure ]
 crbug.com/591099 fast/parser/fonts.html [ Failure ]
 crbug.com/591099 fast/parser/nofoo-tags-inside-paragraph.html [ Failure ]
-crbug.com/591099 fast/parser/noscript-with-javascript-disabled.html [ Crash Failure ]
+crbug.com/591099 fast/parser/noscript-with-javascript-disabled.html [ Failure ]
 crbug.com/591099 fast/parser/open-comment-in-style.html [ Failure ]
 crbug.com/591099 fast/parser/open-comment-in-textarea.html [ Failure ]
 crbug.com/591099 fast/parser/stray-end-tags-with-attributes-002-alt-quirks.html [ Failure ]
@@ -5828,7 +5803,7 @@
 crbug.com/591099 fast/parser/title-error-test.html [ Failure ]
 crbug.com/591099 fast/parser/xhtml-alternate-entities.xml [ Failure ]
 crbug.com/591099 fast/reflections/abs-position-in-reflection.html [ Failure ]
-crbug.com/591099 fast/reflections/inline-crash.html [ Crash Failure ]
+crbug.com/591099 fast/reflections/inline-crash.html [ Crash ]
 crbug.com/591099 fast/reflections/opacity-reflection-transform.html [ Failure ]
 crbug.com/591099 fast/reflections/reflection-direction.html [ Failure ]
 crbug.com/591099 fast/reflections/reflection-masks-opacity.html [ Failure ]
@@ -5856,16 +5831,16 @@
 crbug.com/591099 fast/replaced/percent-height-in-anonymous-block.html [ Failure ]
 crbug.com/591099 fast/replaced/preferred-widths.html [ Failure ]
 crbug.com/591099 fast/replaced/replaced-element-with-percentage-height-anonymous-block-parent.html [ Failure ]
-crbug.com/591099 fast/replaced/selection-rect-in-table-cell.html [ Failure Pass ]
+crbug.com/591099 fast/replaced/selection-rect-in-table-cell.html [ Failure ]
 crbug.com/591099 fast/replaced/selection-rect-transform.html [ Failure ]
 crbug.com/591099 fast/replaced/table-percent-height.html [ Failure ]
-crbug.com/591099 fast/replaced/table-percent-width.html [ Failure Pass ]
+crbug.com/591099 fast/replaced/table-percent-width.html [ Failure ]
 crbug.com/591099 fast/replaced/table-replaced-element.html [ Failure ]
 crbug.com/591099 fast/replaced/vertical-resize-100percent-element.html [ Failure ]
 crbug.com/591099 fast/replaced/vertical-rl/absolute-position-percentage-width.html [ Failure ]
 crbug.com/714962 fast/replaced/vertical-rl/absolute-position-with-auto-height-and-top-and-bottom.html [ Failure ]
 crbug.com/714962 fast/replaced/vertical-rl/absolute-position-with-auto-width-and-left-and-right.html [ Failure ]
-crbug.com/591099 fast/replaced/width100percent-image.html [ Failure Pass ]
+crbug.com/591099 fast/replaced/width100percent-image.html [ Failure ]
 crbug.com/714962 fast/replaced/width100percent-textarea.html [ Failure ]
 crbug.com/591099 fast/ruby/add-text-to-block-ruby-with-after-pseudo-crash.html [ Crash ]
 crbug.com/591099 fast/ruby/base-shorter-than-text.html [ Failure ]
@@ -6019,15 +5994,15 @@
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-clip-path-selection.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-margin.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-dynamic-shape-overhang.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-dynamic-shape.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-dynamic-shape.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-edge-case.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-diamond-margin-polygon.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-border-box.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-border-box.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-content-box.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-direction-padding-box.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-border-box.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-content-box.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-padding-box.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes-padding-box.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-different-writing-modes.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-000.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-margin-left.html [ Failure ]
@@ -6035,7 +6010,7 @@
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-iframe-inset-negative-width-crash.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-iframe-inset-rectangle-negative-width-crash.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-image-001.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-image-002.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-image-002.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-001.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-image-margin-002.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-image-threshold-001.html [ Failure ]
@@ -6050,21 +6025,21 @@
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-inset.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-linetop-adjustment.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-margin-crash.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-not-a-layer.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-not-a-layer.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-outermost.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-000.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-001.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-001.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-polygon-002.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-shape-margin-percent.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-shape-margin-percent.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-000.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-001.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-001.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-floats-stacked-002.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-001.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-002.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-003.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-004.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-005.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-006.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-fit-006.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-image-set.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-insert-svg-shape.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html [ Failure ]
@@ -6073,11 +6048,11 @@
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-013.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-014.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-015.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-zero-vertex.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-polygon-zero-vertex.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-relative-size-svg.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-boxes-001.html [ Failure ]
 crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-boxes-002.html [ Failure ]
-crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-inset.html [ Crash Failure ]
+crbug.com/591099 fast/shapes/shape-outside-floats/shape-outside-rounded-inset.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-1st-stop.html [ Failure ]
 crbug.com/591099 fast/spatial-navigation/snav-clipped-overflowed-content.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-container-only-white-space.html [ Failure ]
@@ -6093,7 +6068,7 @@
 crbug.com/714962 fast/spatial-navigation/snav-iframe-no-focusable-content.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-iframe-no-scrollable-content.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-iframe-recursive-offset-parent.html [ Failure ]
-crbug.com/591099 fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html [ Failure Pass ]
+crbug.com/591099 fast/spatial-navigation/snav-iframe-with-offscreen-focusable-element.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-imagemap-area-not-focusable.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-imagemap-area-without-image.html [ Failure ]
 crbug.com/714962 fast/spatial-navigation/snav-imagemap-overlapped-areas.html [ Failure ]
@@ -6119,8 +6094,8 @@
 crbug.com/591099 fast/sub-pixel/should-not-repaint-subpixel-composited-layer.html [ Failure ]
 crbug.com/714962 fast/sub-pixel/size-of-span-with-different-positions.html [ Failure ]
 crbug.com/591099 fast/sub-pixel/sub-pixel-border-2.html [ Failure ]
-crbug.com/591099 fast/sub-pixel/table-cells-with-padding-do-not-wrap.html [ Failure Pass ]
-crbug.com/591099 fast/sub-pixel/table-rtl-padding.html [ Failure Pass ]
+crbug.com/591099 fast/sub-pixel/table-cells-with-padding-do-not-wrap.html [ Failure ]
+crbug.com/591099 fast/sub-pixel/table-rtl-padding.html [ Failure ]
 crbug.com/714962 fast/sub-pixel/width-of-inline-in-float.html [ Failure ]
 crbug.com/591099 fast/table/018.html [ Failure ]
 crbug.com/591099 fast/table/032.html [ Failure ]
@@ -6176,13 +6151,13 @@
 crbug.com/714962 fast/table/backgr_simple-table-row-group.html [ Failure ]
 crbug.com/714962 fast/table/backgr_simple-table-row.html [ Failure ]
 crbug.com/714962 fast/table/backgr_simple-table.html [ Failure ]
-crbug.com/591099 fast/table/border-collapsing/001-vertical.html [ Failure Pass ]
+crbug.com/591099 fast/table/border-collapsing/001-vertical.html [ Failure ]
 crbug.com/714962 fast/table/border-collapsing/001.html [ Failure ]
 crbug.com/714962 fast/table/border-collapsing/002-vertical.html [ Failure ]
 crbug.com/714962 fast/table/border-collapsing/002.html [ Failure ]
 crbug.com/591099 fast/table/border-collapsing/003-vertical.html [ Failure ]
 crbug.com/591099 fast/table/border-collapsing/004-vertical.html [ Failure ]
-crbug.com/591099 fast/table/border-collapsing/004.html [ Failure Pass ]
+crbug.com/591099 fast/table/border-collapsing/004.html [ Failure ]
 crbug.com/591099 fast/table/border-collapsing/border-collapsing-head-foot-vertical.html [ Failure ]
 crbug.com/714962 fast/table/border-collapsing/border-collapsing-head-foot.html [ Failure ]
 crbug.com/714962 fast/table/border-collapsing/rtl-border-collapsing-vertical.html [ Failure ]
@@ -6207,12 +6182,12 @@
 crbug.com/591099 fast/table/incomplete-table-in-fragment-hang.html [ Failure ]
 crbug.com/591099 fast/table/inline-table-margin-baseline.html [ Failure ]
 crbug.com/591099 fast/table/large-shrink-wrapped-width.html [ Failure ]
-crbug.com/591099 fast/table/min-max-width-preferred-size.html [ Failure Pass ]
+crbug.com/591099 fast/table/min-max-width-preferred-size.html [ Failure ]
 crbug.com/591099 fast/table/multiple-captions-crash4.html [ Crash ]
-crbug.com/591099 fast/table/padding-height-and-override-height.html [ Failure Pass ]
-crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border-on-table.html [ Failure Pass ]
-crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border.html [ Failure Pass ]
-crbug.com/591099 fast/table/percent-height-content-in-fixed-height-content-box-sized-cell.html [ Failure Pass ]
+crbug.com/591099 fast/table/padding-height-and-override-height.html [ Failure ]
+crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border-on-table.html [ Failure ]
+crbug.com/591099 fast/table/percent-height-content-in-fixed-height-border-box-sized-cell-with-collapsed-border.html [ Failure ]
+crbug.com/591099 fast/table/percent-height-content-in-fixed-height-content-box-sized-cell.html [ Failure ]
 crbug.com/591099 fast/table/percent-height-overflow-auto-content-in-cell.html [ Failure Pass ]
 crbug.com/591099 fast/table/percent-height-overflow-scroll-content-in-cell.html [ Failure Pass ]
 crbug.com/591099 fast/table/percent-widths-stretch-vertical.html [ Failure ]
@@ -6238,7 +6213,7 @@
 crbug.com/714962 fast/table/table-cell-before-child-in-table.html [ Failure ]
 crbug.com/591099 fast/table/table-display-types-vertical.html [ Failure ]
 crbug.com/591099 fast/table/table-overflow-crash.html [ Pass ]
-crbug.com/591099 fast/table/table-parts-not-ortho-writing-mode-root.html [ Failure Timeout ]
+crbug.com/591099 fast/table/table-parts-not-ortho-writing-mode-root.html [ Failure ]
 crbug.com/714962 fast/table/table-row-after-child-in-block.html [ Failure ]
 crbug.com/714962 fast/table/table-row-before-after-content-around-block.html [ Failure ]
 crbug.com/714962 fast/table/table-row-before-child-in-block.html [ Failure ]
@@ -6249,10 +6224,9 @@
 crbug.com/591099 fast/table/table-with-borderattr-set-to-null.html [ Failure ]
 crbug.com/591099 fast/table/td-bordercolor-attribute.html [ Failure ]
 crbug.com/714962 fast/table/text-field-baseline.html [ Failure ]
-crbug.com/591099 fast/table/unbreakable-images-quirk.html [ Failure Pass ]
+crbug.com/591099 fast/table/unbreakable-images-quirk.html [ Failure ]
 crbug.com/591099 fast/table/unused-percent-heights.html [ Failure ]
-crbug.com/591099 fast/table/vertical-align-baseline-readjust.html [ Failure Pass ]
-crbug.com/591099 fast/table/vertical-align-baseline.html [ Failure Pass ]
+crbug.com/591099 fast/table/vertical-align-baseline-readjust.html [ Failure ]
 crbug.com/591099 fast/text-autosizing/cluster-inline-block-or-table.html [ Failure ]
 crbug.com/591099 fast/text-autosizing/cluster-inline-grid-flex-box.html [ Failure ]
 crbug.com/591099 fast/text-autosizing/cluster-list-item.html [ Failure ]
@@ -6315,7 +6289,7 @@
 crbug.com/714962 fast/text-autosizing/tables/single-percent-width-cell-lots-of-text.html [ Failure ]
 crbug.com/714962 fast/text-autosizing/tables/table-cell-inflation.html [ Failure ]
 crbug.com/714962 fast/text-autosizing/tables/table-for-layout.html [ Failure ]
-crbug.com/591099 fast/text-autosizing/tables/table-with-inline-block.html [ Failure Pass ]
+crbug.com/591099 fast/text-autosizing/tables/table-with-inline-block.html [ Failure ]
 crbug.com/714962 fast/text-autosizing/tables/wide-percentage-width.html [ Failure ]
 crbug.com/714962 fast/text-autosizing/tables/wide-specified-width.html [ Failure ]
 crbug.com/591099 fast/text-autosizing/unwrappable-blocks.html [ Failure ]
@@ -6327,7 +6301,7 @@
 crbug.com/591099 fast/text-autosizing/wide-in-narrow-overflow-scroll.html [ Failure ]
 crbug.com/714962 fast/text/atsui-multiple-renderers.html [ Failure ]
 crbug.com/591099 fast/text/break-word-with-floats.html [ Failure ]
-crbug.com/591099 fast/text/capitalize-boundaries.html [ Failure Pass ]
+crbug.com/591099 fast/text/capitalize-boundaries.html [ Failure ]
 crbug.com/591099 fast/text/chromium-linux-fontconfig-renderstyle.html [ Failure ]
 crbug.com/591099 fast/text/complex-text-opacity.html [ Failure ]
 crbug.com/591099 fast/text/container-align-with-inlines.html [ Failure ]
@@ -6361,7 +6335,6 @@
 crbug.com/591099 fast/text/find-kana.html [ Timeout ]
 crbug.com/714962 fast/text/font-fallback-synthetic-italics.html [ Failure ]
 crbug.com/714962 fast/text/font-ligature-letter-spacing.html [ Failure ]
-crbug.com/591099 fast/text/font-smallcaps-layout.html [ Failure Pass ]
 crbug.com/714962 fast/text/font-variant-width.html [ Failure ]
 crbug.com/714962 fast/text/fractional-word-and-letter-spacing-with-kerning.html [ Failure ]
 crbug.com/714962 fast/text/get-client-rects-grapheme.html [ Failure ]
@@ -6380,7 +6353,7 @@
 crbug.com/714962 fast/text/international/bidi-override.html [ Failure ]
 crbug.com/714962 fast/text/international/cjk-segmentation.html [ Failure ]
 crbug.com/714962 fast/text/international/hindi-whitespace.html [ Failure ]
-crbug.com/591099 fast/text/international/inline-plaintext-is-isolated.html [ Failure Pass ]
+crbug.com/591099 fast/text/international/inline-plaintext-is-isolated.html [ Failure ]
 crbug.com/714962 fast/text/international/iso-8859-8.html [ Failure ]
 crbug.com/714962 fast/text/international/listbox-width-rtl.html [ Failure ]
 crbug.com/714962 fast/text/international/rtl-selection-rect-with-fallback.html [ Failure ]
@@ -6391,7 +6364,7 @@
 crbug.com/714962 fast/text/international/vertical-text-metrics-test.html [ Failure ]
 crbug.com/591099 fast/text/justify-ideograph-vertical.html [ Failure ]
 crbug.com/591099 fast/text/large-text-composed-char.html [ Timeout ]
-crbug.com/591099 fast/text/letter-spacing-leading-and-trailing.html [ Crash Failure ]
+crbug.com/591099 fast/text/letter-spacing-leading-and-trailing.html [ Failure ]
 crbug.com/714962 fast/text/line-break-after-inline-latin1.html [ Failure ]
 crbug.com/714962 fast/text/multiglyph-characters.html [ Failure ]
 crbug.com/591099 fast/text/orientation-sideways.html [ Failure ]
@@ -6423,7 +6396,7 @@
 crbug.com/714962 fast/text/selection/atsui-rtl-override-selection.html [ Failure ]
 crbug.com/714962 fast/text/selection/flexbox-selection-nested.html [ Failure ]
 crbug.com/591099 fast/text/selection/flexbox-selection.html [ Failure ]
-crbug.com/591099 fast/text/selection/hebrew-selection.html [ Crash Failure ]
+crbug.com/591099 fast/text/selection/hebrew-selection.html [ Failure ]
 crbug.com/714962 fast/text/selection/insert-text-crash.html [ Failure ]
 crbug.com/591099 fast/text/selection/khmer-selection.html [ Failure ]
 crbug.com/591099 fast/text/selection/offsetForPosition-complex-fallback.html [ Failure ]
@@ -6432,8 +6405,8 @@
 crbug.com/714962 fast/text/selection/reset-drag-on-mouse-down.html [ Failure ]
 crbug.com/591099 fast/text/selection/selection-hard-linebreak.html [ Failure ]
 crbug.com/591099 fast/text/selection/selection-rect-rounding.html [ Failure ]
-crbug.com/591099 fast/text/selection/selection-with-inline-padding.html [ Crash Failure ]
-crbug.com/714962 fast/text/selection/shaping-selection-rect.html [ Crash Failure ]
+crbug.com/591099 fast/text/selection/selection-with-inline-padding.html [ Crash ]
+crbug.com/714962 fast/text/selection/shaping-selection-rect.html [ Failure ]
 crbug.com/714962 fast/text/selection/thai-offsetForPosition-inside-character.html [ Failure ]
 crbug.com/714962 fast/text/stroking-decorations.html [ Failure ]
 crbug.com/714962 fast/text/tab-min-size.html [ Failure ]
@@ -6540,7 +6513,7 @@
 crbug.com/591099 fragmentation/block-after-float-first-child.html [ Failure ]
 crbug.com/591099 fragmentation/block-with-float-and-1-orphaned-line.html [ Failure ]
 crbug.com/591099 fragmentation/border-spacing-break-before-unbreakable-row.html [ Failure ]
-crbug.com/591099 fragmentation/break-before-first-child.html [ Failure Pass ]
+crbug.com/591099 fragmentation/break-before-first-child.html [ Failure ]
 crbug.com/591099 fragmentation/break-in-first-table-row-only.html [ Failure ]
 crbug.com/591099 fragmentation/break-in-second-table-section.html [ Failure ]
 crbug.com/591099 fragmentation/break-in-tbody-after-caption.html [ Failure ]
@@ -6624,14 +6597,15 @@
 crbug.com/591099 fragmentation/table-row-dimensions-break-freely.html [ Failure ]
 crbug.com/591099 fragmentation/table-row-dimensions-with-thead.html [ Failure ]
 crbug.com/591099 fragmentation/table-row-dimensions.html [ Failure ]
+crbug.com/591099 fragmentation/transformed-clip-before-second-column.html [ Failure ]
 crbug.com/591099 fragmentation/unbreakable-tall-float-before-block.html [ Failure ]
 crbug.com/591099 fragmentation/unbreakable-tall-float-before-line.html [ Failure ]
 crbug.com/591099 fullscreen/enter-exit-full-screen-hover.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-css.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-element-stack.html [ Crash ]
-crbug.com/591099 fullscreen/full-screen-iframe-not-allowed.html [ Failure Timeout ]
+crbug.com/591099 fullscreen/full-screen-iframe-not-allowed.html [ Failure ]
 crbug.com/591099 fullscreen/full-screen-remove-ancestor-after.html [ Crash Pass ]
-crbug.com/591099 fullscreen/full-screen-ruleset-crash.html [ Crash Pass ]
+crbug.com/591099 fullscreen/full-screen-ruleset-crash.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-twice-newapi.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-with-css-reference-filter.html [ Crash ]
 crbug.com/591099 fullscreen/full-screen-with-flex-item.html [ Crash ]
@@ -6641,7 +6615,7 @@
 crbug.com/591099 fullscreen/model/fully-exit-fullscreen-nested-iframe.html [ Crash ]
 crbug.com/591099 fullscreen/non-ancestor-iframe.html [ Crash ]
 crbug.com/591099 hittesting/border-hittest-inlineFlowBox.html [ Failure ]
-crbug.com/714962 hittesting/border-hittest-with-image-fallback.html [ Failure Pass ]
+crbug.com/714962 hittesting/border-hittest-with-image-fallback.html [ Failure ]
 crbug.com/714962 hittesting/culled-inline.html [ Failure ]
 crbug.com/591099 hittesting/image-with-border-radius.html [ Failure ]
 crbug.com/714962 hittesting/image-with-clip-path.html [ Failure ]
@@ -6786,10 +6760,10 @@
 crbug.com/591099 http/tests/devtools/audits2/audits2-successful-run.js [ Crash ]
 crbug.com/591099 http/tests/devtools/console/console-format.js [ Failure ]
 crbug.com/591099 http/tests/devtools/console/console-functions.js [ Failure ]
-crbug.com/591099 http/tests/devtools/console/console-uncaught-promise.js [ Failure Pass ]
-crbug.com/591099 http/tests/devtools/console/shadow-element.js [ Crash Timeout ]
-crbug.com/591099 http/tests/devtools/editor/text-editor-ctrl-d-1.js [ Crash Timeout ]
-crbug.com/591099 http/tests/devtools/editor/text-editor-ctrl-d-2.js [ Pass Timeout ]
+crbug.com/591099 http/tests/devtools/console/console-uncaught-promise.js [ Failure ]
+crbug.com/591099 http/tests/devtools/console/shadow-element.js [ Timeout ]
+crbug.com/591099 http/tests/devtools/editor/text-editor-ctrl-d-1.js [ Timeout ]
+crbug.com/591099 http/tests/devtools/editor/text-editor-ctrl-d-2.js [ Timeout ]
 crbug.com/714962 http/tests/devtools/editor/text-editor-enter-behaviour.js [ Timeout ]
 crbug.com/714962 http/tests/devtools/editor/text-editor-formatter.js [ Timeout ]
 crbug.com/714962 http/tests/devtools/editor/text-editor-indent-autodetection.js [ Pass Timeout ]
@@ -6825,11 +6799,11 @@
 crbug.com/591099 http/tests/devtools/elements/event-listener-sidebar-remove.js [ Crash Pass ]
 crbug.com/591099 http/tests/devtools/elements/event-listener-sidebar.js [ Crash Failure ]
 crbug.com/591099 http/tests/devtools/elements/event-listeners-about-blank.js [ Crash Pass ]
-crbug.com/714962 http/tests/devtools/elements/hide-shortcut.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/hide-shortcut.js [ Crash ]
 crbug.com/591099 http/tests/devtools/elements/highlight/highlight-css-shapes-outside-scroll.js [ Failure ]
 crbug.com/591099 http/tests/devtools/elements/highlight/highlight-css-shapes-outside.js [ Failure ]
 crbug.com/714962 http/tests/devtools/elements/highlight/highlight-dom-updates.js [ Crash ]
-crbug.com/714962 http/tests/devtools/elements/iframe-load-event.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/iframe-load-event.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/insert-node.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/inspect-pseudo-element.js [ Timeout ]
 crbug.com/714962 http/tests/devtools/elements/modify-chardata.js [ Crash ]
@@ -6847,29 +6821,29 @@
 crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-blank-property.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-invalid-property.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-3/styles-add-new-rule-colon.js [ Crash ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule-tab.js [ Crash Failure Pass ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule.js [ Crash Failure Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule-tab.js [ Crash ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-add-new-rule.js [ Crash ]
 crbug.com/591099 http/tests/devtools/elements/styles-3/styles-cancel-editing.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-change-node-while-editing.js [ Crash Failure Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-change-node-while-editing.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles-3/styles-commit-editing.js [ Crash Pass ]
-crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-inherited.js [ Failure Pass ]
+crbug.com/591099 http/tests/devtools/elements/styles-3/styles-disable-inherited.js [ Failure ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/styles-live-locations-leak.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/styles-update-from-js.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/undo-add-new-rule.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles-4/undo-add-property.js [ Crash ]
 crbug.com/591099 http/tests/devtools/elements/styles/selector-line-deprecated.js [ Crash Pass ]
-crbug.com/714962 http/tests/devtools/elements/styles/stylesheet-tracking.js [ Crash Pass ]
+crbug.com/714962 http/tests/devtools/elements/styles/stylesheet-tracking.js [ Crash ]
 crbug.com/714962 http/tests/devtools/elements/styles/undo-change-property.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles/undo-property-toggle.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/elements/styles/undo-set-selector-text.js [ Crash ]
-crbug.com/591099 http/tests/devtools/extensions/extensions-sidebar.js [ Crash Failure ]
-crbug.com/591099 http/tests/devtools/indexeddb/resources-panel.js [ Failure Timeout ]
+crbug.com/591099 http/tests/devtools/extensions/extensions-sidebar.js [ Crash ]
+crbug.com/591099 http/tests/devtools/indexeddb/resources-panel.js [ Failure ]
 crbug.com/591099 http/tests/devtools/inspect-element.js [ Crash Pass ]
 crbug.com/714962 http/tests/devtools/jump-to-previous-editing-location.js [ Failure ]
 crbug.com/714962 http/tests/devtools/layers/layer-canvas-log.js [ Failure ]
-crbug.com/591099 http/tests/devtools/network/network-columns-visible.js [ Failure Timeout ]
+crbug.com/591099 http/tests/devtools/network/network-columns-visible.js [ Failure ]
 crbug.com/591099 http/tests/devtools/network/network-datareceived.js [ Failure ]
-crbug.com/591099 http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode.js [ Failure Timeout ]
+crbug.com/591099 http/tests/devtools/persistence/persistence-tabbed-editor-opens-filesystem-uisourcecode.js [ Failure ]
 crbug.com/591099 http/tests/devtools/runtime/runtime-getProperties.js [ Failure ]
 crbug.com/714962 http/tests/devtools/service-workers/service-workers-view.js [ Failure ]
 crbug.com/591099 http/tests/devtools/sources/debugger-pause/debugger-pause-in-internal.js [ Failure ]
@@ -6878,9 +6852,9 @@
 crbug.com/591099 http/tests/devtools/sources/debugger/properties-special.js [ Failure ]
 crbug.com/591099 http/tests/devtools/text-autosizing-override.js [ Failure ]
 crbug.com/714962 http/tests/devtools/tracing/scroll-invalidations.js [ Failure ]
-crbug.com/591099 http/tests/devtools/tracing/timeline-misc/timeline-bound-function.js [ Crash Failure ]
+crbug.com/591099 http/tests/devtools/tracing/timeline-misc/timeline-bound-function.js [ Failure ]
 crbug.com/714962 http/tests/devtools/tracing/timeline-misc/timeline-grouped-invalidations.js [ Failure ]
-crbug.com/591099 http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Crash Timeout ]
+crbug.com/591099 http/tests/devtools/tracing/timeline-paint/paint-profiler-update.js [ Timeout ]
 crbug.com/714962 http/tests/devtools/tracing/timeline-paint/timeline-paint-and-multiple-style-invalidations.js [ Failure ]
 crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations-on-deleted-node.js [ Timeout ]
 crbug.com/591099 http/tests/devtools/tracing/timeline-paint/timeline-paint-with-layout-invalidations.js [ Timeout ]
@@ -6894,9 +6868,9 @@
 crbug.com/591099 http/tests/feature-policy/fullscreen-disabled.php [ Pass ]
 crbug.com/591099 http/tests/feature-policy/payment-disabled.php [ Pass ]
 crbug.com/591099 http/tests/feature-policy/payment-enabledforall.php [ Pass ]
-crbug.com/591099 http/tests/filesystem/input-display.html [ Failure Timeout ]
+crbug.com/591099 http/tests/filesystem/input-display.html [ Timeout ]
 crbug.com/591099 http/tests/images/restyle-decode-error.html [ Failure ]
-crbug.com/783102 http/tests/incremental/frame-focus-before-load.html [ Pass Timeout ]
+crbug.com/783102 http/tests/incremental/frame-focus-before-load.html [ Timeout ]
 crbug.com/591099 http/tests/incremental/slow-utf8-text.pl [ Pass Timeout ]
 crbug.com/591099 http/tests/inspector-protocol/network/response-interception-no-change-content-not-ready.js [ Pass ]
 crbug.com/591099 http/tests/inspector-protocol/network/response-interception-request-completes-network-closes.js [ Pass ]
@@ -6947,9 +6921,9 @@
 crbug.com/591099 http/tests/navigation/form-targets-cross-site-frame-post.html [ Failure ]
 crbug.com/591099 http/tests/navigation/form-with-enctype-targets-cross-site-frame.html [ Failure ]
 crbug.com/591099 http/tests/navigation/history-back-across-form-submission-to-fragment.html [ Failure ]
-crbug.com/591099 http/tests/navigation/javascriptlink-basic.html [ Failure Timeout ]
+crbug.com/591099 http/tests/navigation/javascriptlink-basic.html [ Timeout ]
 crbug.com/714962 http/tests/navigation/javascriptlink-frames.html [ Timeout ]
-crbug.com/591099 http/tests/navigation/javascriptlink-goback.html [ Failure Timeout ]
+crbug.com/591099 http/tests/navigation/javascriptlink-goback.html [ Timeout ]
 crbug.com/714962 http/tests/navigation/javascriptlink-subframeload.html [ Timeout ]
 crbug.com/591099 http/tests/navigation/metaredirect-basic.html [ Failure ]
 crbug.com/591099 http/tests/navigation/metaredirect-goback.html [ Failure ]
@@ -7011,7 +6985,7 @@
 crbug.com/591099 http/tests/security/cors-rfc1918/addressspace-document-csp-appcache.html [ Crash Failure Pass ]
 crbug.com/591099 http/tests/security/cross-origin-indexeddb-allowed.html [ Failure ]
 crbug.com/591099 http/tests/security/cross-origin-worker-indexeddb-allowed.html [ Failure ]
-crbug.com/591099 http/tests/security/dataTransfer-set-data-file-url.html [ Failure Timeout ]
+crbug.com/591099 http/tests/security/dataTransfer-set-data-file-url.html [ Failure ]
 crbug.com/591099 http/tests/security/dataURL/xss-DENIED-from-data-url-sub-frame-to-data-url-sub-frame.html [ Failure ]
 crbug.com/591099 http/tests/security/feed-urls-from-remote.html [ Failure ]
 crbug.com/591099 http/tests/security/filesystem-iframe-from-remote.html [ Failure ]
@@ -7035,7 +7009,7 @@
 crbug.com/591099 http/tests/security/local-JavaScript-from-remote.html [ Failure ]
 crbug.com/591099 http/tests/security/local-iFrame-from-remote.html [ Failure ]
 crbug.com/591099 http/tests/security/local-image-from-remote.html [ Failure ]
-crbug.com/591099 http/tests/security/setDomainRelaxationForbiddenForURLScheme.html [ Crash Pass ]
+crbug.com/591099 http/tests/security/setDomainRelaxationForbiddenForURLScheme.html [ Crash ]
 crbug.com/591099 http/tests/security/shape-image-cors-allow-origin.html [ Failure ]
 crbug.com/591099 http/tests/security/shape-image-cors-data-url.html [ Failure ]
 crbug.com/591099 http/tests/security/shape-image-cors-same-origin.html [ Failure ]
@@ -7119,7 +7093,7 @@
 crbug.com/714962 ietestcenter/css3/multicolumn/column-width-applies-to-002.htm [ Failure ]
 crbug.com/714962 ietestcenter/css3/multicolumn/column-width-applies-to-003.htm [ Failure ]
 crbug.com/714962 ietestcenter/css3/multicolumn/column-width-applies-to-004.htm [ Failure ]
-crbug.com/591099 ietestcenter/css3/multicolumn/column-width-applies-to-007.htm [ Failure Pass ]
+crbug.com/591099 ietestcenter/css3/multicolumn/column-width-applies-to-007.htm [ Failure ]
 crbug.com/591099 ietestcenter/css3/multicolumn/column-width-applies-to-009.htm [ Failure ]
 crbug.com/591099 ietestcenter/css3/multicolumn/column-width-applies-to-010.htm [ Failure ]
 crbug.com/591099 ietestcenter/css3/multicolumn/column-width-applies-to-012.htm [ Failure ]
@@ -7217,7 +7191,7 @@
 crbug.com/714962 inspector-protocol/accessibility/accessibility-ignoredNodesModal.js [ Failure ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-modal.js [ Crash ]
 crbug.com/714962 inspector-protocol/accessibility/accessibility-nameSources-buttons.js [ Failure ]
-crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-img-figure.js [ Pass Timeout ]
+crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-img-figure.js [ Timeout ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input-buttons.js [ Timeout ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-input.js [ Timeout ]
 crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-labelledby.js [ Timeout ]
@@ -7324,7 +7298,7 @@
 crbug.com/591099 paint/invalidation/box/border-radius-repaint-2.html [ Failure ]
 crbug.com/591099 paint/invalidation/box/border-radius-repaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/box/border-repaint-glitch.html [ Failure ]
-crbug.com/591099 paint/invalidation/box/box-inline-resize.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/box/box-inline-resize.html [ Crash ]
 crbug.com/591099 paint/invalidation/box/box-shadow-dynamic.html [ Failure ]
 crbug.com/591099 paint/invalidation/box/box-sizing.html [ Failure ]
 crbug.com/591099 paint/invalidation/box/hover-pseudo-borders.html [ Failure ]
@@ -7440,7 +7414,7 @@
 crbug.com/591099 paint/invalidation/flexbox/justify-content-distribution-change-grid.html [ Failure ]
 crbug.com/591099 paint/invalidation/flexbox/justify-items-change.html [ Failure ]
 crbug.com/591099 paint/invalidation/flexbox/justify-items-legacy-change.html [ Failure ]
-crbug.com/591099 paint/invalidation/flexbox/justify-self-change-keeping-geometry.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/flexbox/justify-self-change-keeping-geometry.html [ Failure ]
 crbug.com/591099 paint/invalidation/flexbox/justify-self-change.html [ Failure ]
 crbug.com/591099 paint/invalidation/flexbox/remove-inline-block-descendant-of-flex.html [ Failure ]
 crbug.com/591099 paint/invalidation/flexbox/repaint-column-reverse.html [ Failure ]
@@ -7507,11 +7481,11 @@
 crbug.com/591099 paint/invalidation/multicol/multicol-resize-with-rule.html [ Failure ]
 crbug.com/591099 paint/invalidation/multicol/multicol-rule-actual-columns-change.html [ Crash ]
 crbug.com/591099 paint/invalidation/multicol/multicol-with-abspos-in-relpos.html [ Failure ]
-crbug.com/591099 paint/invalidation/multicol/multicol-with-abspos.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/multicol/multicol-with-abspos.html [ Failure ]
 crbug.com/591099 paint/invalidation/multicol/multicol-with-block.html [ Failure ]
 crbug.com/591099 paint/invalidation/multicol/multicol-with-inline.html [ Failure ]
 crbug.com/591099 paint/invalidation/multicol/multicol-with-overflowing-block-rl.html [ Failure ]
-crbug.com/591099 paint/invalidation/multicol/multicol-with-relpos.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/multicol/multicol-with-relpos.html [ Failure ]
 crbug.com/591099 paint/invalidation/multicol/multicol-with-text.html [ Failure ]
 crbug.com/591099 paint/invalidation/non-text-link-invalidation-optimization.html [ Failure ]
 crbug.com/591099 paint/invalidation/offset-change-wrong-invalidation-with-float.html [ Failure ]
@@ -7520,7 +7494,7 @@
 crbug.com/591099 paint/invalidation/outline/continuation-after-outline.html [ Failure ]
 crbug.com/591099 paint/invalidation/outline/focus-continuations.html [ Failure ]
 crbug.com/591099 paint/invalidation/outline/focus-enable-continuations.html [ Failure ]
-crbug.com/591099 paint/invalidation/outline/focus-layers.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/outline/focus-layers.html [ Failure ]
 crbug.com/591099 paint/invalidation/outline/focus-ring-on-child-move.html [ Failure ]
 crbug.com/591099 paint/invalidation/outline/focus-ring-on-continuation-move.html [ Failure ]
 crbug.com/591099 paint/invalidation/outline/focus-ring-on-inline-continuation-move.html [ Failure ]
@@ -7553,8 +7527,8 @@
 crbug.com/591099 paint/invalidation/overflow/fixed-position-transparency-with-overflow.html [ Failure ]
 crbug.com/591099 paint/invalidation/overflow/flexible-box-overflow-horizontal.html [ Failure ]
 crbug.com/591099 paint/invalidation/overflow/flexible-box-overflow.html [ Failure ]
-crbug.com/591099 paint/invalidation/overflow/float-overflow-right.html [ Crash Failure ]
-crbug.com/591099 paint/invalidation/overflow/float-overflow.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/overflow/float-overflow-right.html [ Crash ]
+crbug.com/591099 paint/invalidation/overflow/float-overflow.html [ Crash ]
 crbug.com/714962 paint/invalidation/overflow/inline-block-overflow-repaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/overflow/inline-block-overflow.html [ Failure ]
 crbug.com/714962 paint/invalidation/overflow/inline-box-overflow-repaint.html [ Failure ]
@@ -7568,7 +7542,6 @@
 crbug.com/591099 paint/invalidation/overflow/opacity-change-on-overflow-float.html [ Failure ]
 crbug.com/591099 paint/invalidation/overflow/overflow-changed-on-child-of-composited-layer.html [ Failure ]
 crbug.com/714962 paint/invalidation/overflow/overflow-delete-line.html [ Failure ]
-crbug.com/591099 paint/invalidation/overflow/overflow-hidden-to-visible.html [ Failure Pass ]
 crbug.com/591099 paint/invalidation/overflow/overflow-hide.html [ Failure ]
 crbug.com/591099 paint/invalidation/overflow/overflow-into-content.html [ Failure ]
 crbug.com/714962 paint/invalidation/overflow/overflow-outline-repaint.html [ Failure ]
@@ -7600,21 +7573,21 @@
 crbug.com/591099 paint/invalidation/position/justify-content-position-change-grid.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/justify-content-position-change.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/layout-state-only-positioned.html [ Failure ]
-crbug.com/591099 paint/invalidation/position/layout-state-relative.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/position/layout-state-relative.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/layoutstate-invalid-invalidation-inline-relative-positioned.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/position-change-keeping-geometry.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/positioned-document-element.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/positioned-great-grandparent-change-location.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/positioned-list-offset-change-repaint.html [ Failure ]
-crbug.com/591099 paint/invalidation/position/relative-inline-positioned-movement-repaint.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/position/relative-inline-positioned-movement-repaint.html [ Crash ]
 crbug.com/591099 paint/invalidation/position/relative-margin-change-repaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/relayout-fixed-position-after-scale.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/shift-relative-positioned-container-with-image-addition.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/shift-relative-positioned-container-with-image-removal.html [ Failure ]
 crbug.com/591099 paint/invalidation/position/static-to-positioned.html [ Failure ]
-crbug.com/591099 paint/invalidation/position/text-in-relative-positioned-inline.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/position/text-in-relative-positioned-inline.html [ Crash ]
 crbug.com/591099 paint/invalidation/position/transform-absolute-child.html [ Failure ]
-crbug.com/591099 paint/invalidation/position/transform-absolute-in-positioned-container.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/position/transform-absolute-in-positioned-container.html [ Crash ]
 crbug.com/591099 paint/invalidation/position/transform-relative-position.html [ Failure ]
 crbug.com/591099 paint/invalidation/push-block-with-first-line.html [ Failure ]
 crbug.com/591099 paint/invalidation/quotes.html [ Failure ]
@@ -7663,7 +7636,7 @@
 crbug.com/591099 paint/invalidation/scroll/outline-change-in-scrollers.html [ Failure ]
 crbug.com/591099 paint/invalidation/scroll/outline-change-scrollable.html [ Failure ]
 crbug.com/591099 paint/invalidation/scroll/overflow-auto-in-overflow-auto-scrolled.html [ Failure ]
-crbug.com/591099 paint/invalidation/scroll/overflow-hidden-in-overflow-hidden-scrolled.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/scroll/overflow-hidden-in-overflow-hidden-scrolled.html [ Failure ]
 crbug.com/591099 paint/invalidation/scroll/overflow-hidden-yet-scrolled-with-custom-scrollbar.html [ Failure ]
 crbug.com/591099 paint/invalidation/scroll/overflow-hidden-yet-scrolled.html [ Failure ]
 crbug.com/591099 paint/invalidation/scroll/overflow-scroll-body-appear.html [ Failure ]
@@ -7693,11 +7666,11 @@
 crbug.com/714962 paint/invalidation/search-field-cancel.html [ Failure ]
 crbug.com/591099 paint/invalidation/selection/block-selection-gap-stale-cache-2.html [ Failure ]
 crbug.com/591099 paint/invalidation/selection/block-selection-gap-stale-cache.html [ Failure ]
-crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl.html [ Crash Failure ]
-crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr.html [ Crash Failure ]
-crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl.html [ Crash Failure ]
-crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline.html [ Crash Failure ]
-crbug.com/591099 paint/invalidation/selection/invalidation-rect-with-br-includes-newline.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline-for-rtl.html [ Crash ]
+crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-lr.html [ Crash ]
+crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline-for-vertical-rl.html [ Crash ]
+crbug.com/591099 paint/invalidation/selection/invalidation-rect-includes-newline.html [ Crash ]
+crbug.com/591099 paint/invalidation/selection/invalidation-rect-with-br-includes-newline.html [ Crash ]
 crbug.com/591099 paint/invalidation/selection/japanese-rl-selection-clear.html [ Failure ]
 crbug.com/591099 paint/invalidation/selection/japanese-rl-selection-repaint.html [ Failure ]
 crbug.com/714962 paint/invalidation/selection/repaint-rect-for-vertical-writing-mode-with-positioned-root.html [ Failure ]
@@ -7705,15 +7678,15 @@
 crbug.com/591099 paint/invalidation/selection/selection-after-delete.html [ Failure ]
 crbug.com/591099 paint/invalidation/selection/selection-after-remove.html [ Failure ]
 crbug.com/714962 paint/invalidation/selection/selection-and-text-repaint.html [ Failure ]
-crbug.com/591099 paint/invalidation/selection/selection-change-in-iframe-with-relative-parent.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/selection/selection-change-in-iframe-with-relative-parent.html [ Crash ]
 crbug.com/591099 paint/invalidation/selection/selection-clear.html [ Failure ]
 crbug.com/714962 paint/invalidation/selection/selection-in-composited-scrolling-container.html [ Failure ]
 crbug.com/714962 paint/invalidation/selection/selection-in-non-composited-scrolling-container.html [ Failure ]
-crbug.com/591099 paint/invalidation/selection/selection-partial-invalidation-between-blocks.html [ Crash Failure Pass ]
+crbug.com/591099 paint/invalidation/selection/selection-partial-invalidation-between-blocks.html [ Crash ]
 crbug.com/714962 paint/invalidation/selection/selection-repaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/selection/selection-rl.html [ Failure ]
-crbug.com/591099 paint/invalidation/selection/selection-within-composited-scroller.html [ Crash Failure ]
-crbug.com/714962 paint/invalidation/selection/text-selection-rect-in-overflow-2.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/selection/selection-within-composited-scroller.html [ Crash ]
+crbug.com/714962 paint/invalidation/selection/text-selection-rect-in-overflow-2.html [ Crash ]
 crbug.com/714962 paint/invalidation/selection/text-selection-rect-in-overflow.html [ Failure ]
 crbug.com/591099 paint/invalidation/shadow-multiple.html [ Failure ]
 crbug.com/591099 paint/invalidation/stacked-diacritics.html [ Failure ]
@@ -7725,7 +7698,7 @@
 crbug.com/714962 paint/invalidation/svg/add-border-property-on-root.html [ Failure ]
 crbug.com/591099 paint/invalidation/svg/add-outline-property-on-root.html [ Failure ]
 crbug.com/714962 paint/invalidation/svg/animate-fill.svg [ Failure ]
-crbug.com/591099 paint/invalidation/svg/animated-path-inside-transformed-html.xhtml [ Failure Pass ]
+crbug.com/591099 paint/invalidation/svg/animated-path-inside-transformed-html.xhtml [ Failure ]
 crbug.com/714962 paint/invalidation/svg/append-text-node-to-tspan.html [ Failure ]
 crbug.com/714962 paint/invalidation/svg/clip-path-child-changes.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/clip-path-href-changes.svg [ Failure ]
@@ -7779,7 +7752,7 @@
 crbug.com/714962 paint/invalidation/svg/modify-text-node-in-tspan.html [ Failure ]
 crbug.com/714962 paint/invalidation/svg/modify-transferred-listitem-different-attr.html [ Failure ]
 crbug.com/591099 paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-1.html [ Failure ]
-crbug.com/591099 paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/svg/nested-embedded-svg-size-changes-no-layout-triggers-2.html [ Failure ]
 crbug.com/591099 paint/invalidation/svg/object-sizing-no-width-height-change-content-box-size.xhtml [ Failure ]
 crbug.com/714962 paint/invalidation/svg/outline-offset-text.html [ Failure ]
 crbug.com/591099 paint/invalidation/svg/overflow-repaint.html [ Failure ]
@@ -7806,7 +7779,7 @@
 crbug.com/714962 paint/invalidation/svg/repaint-on-image-bounds-change.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/repaint-paintorder.svg [ Failure ]
 crbug.com/591099 paint/invalidation/svg/resize-svg-invalidate-children-2.html [ Failure ]
-crbug.com/591099 paint/invalidation/svg/resize-svg-invalidate-children.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/svg/resize-svg-invalidate-children.html [ Failure ]
 crbug.com/714962 paint/invalidation/svg/resource-client-removal.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/resource-invalidate-on-target-update.svg [ Failure ]
 crbug.com/591099 paint/invalidation/svg/scroll-hit-test.xhtml [ Failure ]
@@ -7836,17 +7809,17 @@
 crbug.com/714962 paint/invalidation/svg/use-detach.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/use-disappears-after-style-update.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/use-inherit-style.svg [ Failure ]
-crbug.com/591099 paint/invalidation/svg/use-instanceRoot-event-bubbling.xhtml [ Crash Pass Timeout ]
+crbug.com/591099 paint/invalidation/svg/use-instanceRoot-event-bubbling.xhtml [ Crash ]
 crbug.com/591099 paint/invalidation/svg/use-setAttribute-crash.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/window.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/zoom-coords-viewattr-01-b.svg [ Failure ]
 crbug.com/714962 paint/invalidation/svg/zoom-foreignObject.svg [ Failure ]
 crbug.com/591099 paint/invalidation/table/add-table-overpaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/block-selection-gap-in-table-cell.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/border-collapse-change-collapse-to-separate.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/border-collapse-change-separate-to-collapse.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/border-collapse-change-collapse-to-separate.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/border-collapse-change-separate-to-collapse.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/cached-cell-append.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/cached-change-cell-border-color.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/cached-change-cell-border-color.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/cached-change-cell-border-width.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/cached-change-cell-sl-border-color.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/cached-change-col-border-color.html [ Failure ]
@@ -7855,46 +7828,46 @@
 crbug.com/591099 paint/invalidation/table/cached-change-colgroup-border-width.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/cached-change-row-border-width.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/cached-change-table-border-color.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/cached-change-table-border-width.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/cached-change-table-border-width.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/cached-change-tbody-border-color.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/cached-change-tbody-border-width.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/caret-contenteditable-content-after.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/collapsed-border-cell-resize.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/collapsed-border-cell-visibility.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/collapsed-border-change-rowspan.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/collapsed-border-change-rowspan.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/collapsed-border-current-color.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-col-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-col-span-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-col-span.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-col.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-colgroup-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-colgroup.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-composited-row-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-composited-row.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-section-composited-row-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-section-composited-row.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-section-initial-empty.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background-section.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-background.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/composited-table-row.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-col-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-col-span-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-col-span.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-col.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-colgroup-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-colgroup.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-composited-row-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-composited-row.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-section-composited-row-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-section-composited-row.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-section-initial-empty.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background-section.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-background.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/composited-table-row.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/dynamic-table-vertical-alignment-change.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/fixed-table-cell.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/fixed-table-overflow-zindex.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/fixed-table-overflow.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/input-overflow-in-table.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/invalidate-cell-in-row-with-offset.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/invalidate-cell-in-row-with-offset.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/invisible-col-visible-td.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/repaint-table-row-in-composited-document.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/resize-table-repaint-percent-size-cell.html [ Failure Pass ]
-crbug.com/591099 paint/invalidation/table/resize-table-repaint-vertical-align-cell.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/resize-table-repaint-percent-size-cell.html [ Failure ]
+crbug.com/591099 paint/invalidation/table/resize-table-repaint-vertical-align-cell.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/resize-table-row-repaint.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/row-change-background-rowspan-cell.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/scroll-inside-table-cell.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/scroll-relative-table-inside-table-cell.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/single-line-cells-repeating-thead-break-inside-on-thead-only.html [ Failure ]
 crbug.com/714962 paint/invalidation/table/table-cell-become-visible-using-row-background.html [ Crash ]
-crbug.com/591099 paint/invalidation/table/table-cell-collapsed-border.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/table-cell-collapsed-border.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-cell-move.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-cell-overflow.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-cell-vertical-overflow.html [ Failure ]
@@ -7902,13 +7875,13 @@
 crbug.com/714962 paint/invalidation/table/table-col-background.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-collapsed-border.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-extra-bottom-grow.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/table-outer-border.html [ Failure Pass ]
+crbug.com/591099 paint/invalidation/table/table-outer-border.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-overflow-auto-in-overflow-auto-scrolled.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-overflow-scroll-in-overflow-scroll-scrolled.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-row.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-section-overflow.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-section-repaint.html [ Failure ]
-crbug.com/591099 paint/invalidation/table/table-shrink-row-repaint.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/table/table-shrink-row-repaint.html [ Crash ]
 crbug.com/591099 paint/invalidation/table/table-two-pass-layout-overpaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-writing-modes-h.html [ Failure ]
 crbug.com/591099 paint/invalidation/table/table-writing-modes-v.html [ Failure ]
@@ -7928,7 +7901,7 @@
 crbug.com/591099 paint/invalidation/transform/subpixel-offset-scaled-transform.html [ Failure ]
 crbug.com/591099 paint/invalidation/transform/subtree-layoutstate-transform.html [ Failure ]
 crbug.com/591099 paint/invalidation/transform/transform-disable-layoutstate.html [ Failure ]
-crbug.com/591099 paint/invalidation/transform/transform-inline-layered-child.html [ Crash Failure ]
+crbug.com/591099 paint/invalidation/transform/transform-inline-layered-child.html [ Crash ]
 crbug.com/591099 paint/invalidation/transform/transform-layout-repaint.html [ Failure ]
 crbug.com/591099 paint/invalidation/transform/transform-repaint-descendants.html [ Failure ]
 crbug.com/714962 paint/invalidation/transform/transform-replaced-shadows.html [ Failure ]
@@ -7965,7 +7938,7 @@
 crbug.com/591099 paint/markers/ellipsis-rtl-text-in-ltr-flow-with-markers.html [ Failure ]
 crbug.com/591099 paint/markers/ellipsis-rtl-text-in-rtl-flow-with-markers.html [ Failure ]
 crbug.com/591099 paint/markers/inline-spelling-markers-hidpi-composited.html [ Failure ]
-crbug.com/591099 paint/markers/inline-spelling-markers-hidpi.html [ Crash Failure ]
+crbug.com/591099 paint/markers/inline-spelling-markers-hidpi.html [ Failure ]
 crbug.com/591099 paint/markers/inline_spelling_markers.html [ Failure ]
 crbug.com/591099 paint/markers/marker-early-break-bug.html [ Failure ]
 crbug.com/591099 paint/markers/suggestion-marker-basic.html [ Failure ]
@@ -7979,17 +7952,17 @@
 crbug.com/591099 paint/printing/print-text-shadow.html [ Failure ]
 crbug.com/591099 paint/roundedrects/circle-with-shadow.html [ Failure ]
 crbug.com/714962 paint/selection/text-selection-drag.html [ Failure ]
-crbug.com/591099 paint/selection/text-selection-inline-block-rtl.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-inline-block.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-across-blocks-line-beginning-end.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-across-blocks.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-br.html [ Crash Failure ]
+crbug.com/591099 paint/selection/text-selection-inline-block-rtl.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-inline-block.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-newline-across-blocks-line-beginning-end.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-newline-across-blocks.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-newline-br.html [ Crash ]
 crbug.com/591099 paint/selection/text-selection-newline-clipped-by-overflow.html [ Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-mixed-ltr-rtl.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-rtl-double-linebreak.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-rtl.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-span-across-line.html [ Crash Failure ]
-crbug.com/591099 paint/selection/text-selection-newline-span.html [ Crash Failure ]
+crbug.com/591099 paint/selection/text-selection-newline-mixed-ltr-rtl.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-newline-rtl-double-linebreak.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-newline-rtl.html [ Failure ]
+crbug.com/591099 paint/selection/text-selection-newline-span-across-line.html [ Crash ]
+crbug.com/591099 paint/selection/text-selection-newline-span.html [ Crash ]
 crbug.com/591099 paint/selection/text-selection-newline-vertical-lr.html [ Failure ]
 crbug.com/591099 paint/selection/text-selection-newline-vertical-rl.html [ Failure ]
 crbug.com/591099 paint/selection/text-selection-newline.html [ Failure ]
@@ -8001,7 +7974,7 @@
 crbug.com/591099 payments/payment-request-in-iframe-nested-not-allowed.html [ Failure ]
 crbug.com/591099 payments/payment-request-in-iframe.html [ Failure ]
 crbug.com/591099 plugins/embed-attributes-style.html [ Failure ]
-crbug.com/591099 plugins/focus.html [ Failure Timeout ]
+crbug.com/591099 plugins/focus.html [ Failure ]
 crbug.com/591099 plugins/iframe-plugin-bgcolor.html [ Failure ]
 crbug.com/591099 plugins/mouse-click-plugin-clears-selection.html [ Failure ]
 crbug.com/591099 plugins/plugin-initiate-popup-window.html [ Timeout ]
@@ -8040,11 +8013,11 @@
 crbug.com/591099 printing/page-break-avoid.html [ Failure ]
 crbug.com/591099 printing/page-break-before-avoid.html [ Failure ]
 crbug.com/591099 printing/page-break-display-none.html [ Failure ]
-crbug.com/591099 printing/page-break-inside-avoid.html [ Crash Failure ]
+crbug.com/591099 printing/page-break-inside-avoid.html [ Failure ]
 crbug.com/591099 printing/page-break-margin-collapsed.html [ Failure ]
 crbug.com/591099 printing/page-break-orphans-and-widows.html [ Failure ]
 crbug.com/591099 printing/page-break-orphans.html [ Failure ]
-crbug.com/591099 printing/page-break-widows.html [ Crash Failure ]
+crbug.com/591099 printing/page-break-widows.html [ Failure ]
 crbug.com/714962 printing/page-count-layout-overflow.html [ Failure ]
 crbug.com/591099 printing/page-count-relayout-shrink.html [ Failure ]
 crbug.com/714962 printing/page-height-zero.html [ Failure ]
@@ -8057,7 +8030,7 @@
 crbug.com/591099 printing/subframes-percentage-height.html [ Failure ]
 crbug.com/591099 printing/tfoot-repeats-at-bottom-of-each-page-multiple-tables.html [ Failure ]
 crbug.com/591099 printing/tfoot-repeats-at-bottom-of-each-page.html [ Failure ]
-crbug.com/591099 printing/thead-repeats-at-top-of-each-page-multiple-tables.html [ Crash Failure ]
+crbug.com/591099 printing/thead-repeats-at-top-of-each-page-multiple-tables.html [ Failure ]
 crbug.com/591099 printing/thead-repeats-at-top-of-each-page.html [ Failure ]
 crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
 crbug.com/714962 scrollbars/basic-scrollbar.html [ Failure ]
@@ -8077,7 +8050,7 @@
 crbug.com/591099 scrollbars/scrollbars-on-positioned-content.html [ Failure ]
 crbug.com/591099 security/autocomplete-cleared-on-back.html [ Failure ]
 crbug.com/591099 shadow-dom/event-composed-ua.html [ Timeout ]
-crbug.com/591099 shadow-dom/focus-navigation-with-delegatesFocus.html [ Pass Timeout ]
+crbug.com/591099 shadow-dom/focus-navigation-with-delegatesFocus.html [ Timeout ]
 crbug.com/714962 shadow-dom/host-pseudo-elements.html [ Failure ]
 crbug.com/591099 shadow-dom/range-caret-range-from-point-left-of-shadow.html [ Crash ]
 crbug.com/714962 shadow-dom/slotted-pseudo-element-dynamic-attribute-change.html [ Failure ]
@@ -8097,7 +8070,7 @@
 crbug.com/591099 storage/indexeddb/mozilla/test_objectStore_openKeyCursor.html [ Timeout ]
 crbug.com/591099 storage/indexeddb/objectstore-cursor.html [ Timeout ]
 crbug.com/591099 storage/indexeddb/objectstore-keycursor.html [ Timeout ]
-crbug.com/591099 storage/indexeddb/structured-clone.html [ Failure Timeout ]
+crbug.com/591099 storage/indexeddb/structured-clone.html [ Failure ]
 crbug.com/714962 svg/W3C-SVG-1.1-SE/filters-image-03-f.svg [ Failure ]
 crbug.com/714962 svg/W3C-SVG-1.1-SE/filters-image-05-f.svg [ Failure ]
 crbug.com/714962 svg/W3C-SVG-1.1-SE/painting-marker-05-f.svg [ Failure ]
@@ -8164,7 +8137,7 @@
 crbug.com/591099 svg/as-background-image/background-image-preserveaspectRatio-support.html [ Failure ]
 crbug.com/591099 svg/as-background-image/background-repeat.html [ Failure ]
 crbug.com/591099 svg/as-background-image/svg-as-background-1.html [ Failure ]
-crbug.com/591099 svg/as-background-image/svg-as-background-2.html [ Crash Failure ]
+crbug.com/591099 svg/as-background-image/svg-as-background-2.html [ Failure ]
 crbug.com/591099 svg/as-background-image/svg-as-background-3.html [ Failure ]
 crbug.com/591099 svg/as-background-image/svg-as-background-5.html [ Failure ]
 crbug.com/591099 svg/as-background-image/svg-as-background-6.html [ Failure ]
@@ -8249,7 +8222,7 @@
 crbug.com/714962 svg/clip-path/clip-path-pixelation.svg [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-prefixed-vs-not.html [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-shape-ellipse-2.svg [ Failure ]
-crbug.com/714962 svg/clip-path/clip-path-text-and-shape.svg [ Crash Failure ]
+crbug.com/714962 svg/clip-path/clip-path-text-and-shape.svg [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-text-and-stroke.svg [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-text.svg [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-transform-1.svg [ Failure ]
@@ -8262,7 +8235,7 @@
 crbug.com/714962 svg/clip-path/clip-path-use-referencing-clipped-text.html [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-use-referencing-text.html [ Failure ]
 crbug.com/591099 svg/clip-path/clip-path-use-xy-properties.html [ Failure ]
-crbug.com/714962 svg/clip-path/clip-path-userSpaceOnUse.svg [ Crash Failure ]
+crbug.com/714962 svg/clip-path/clip-path-userSpaceOnUse.svg [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-visible-element-as-visible-shape-element.html [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-w-broken-filter-on-shape.html [ Failure ]
 crbug.com/714962 svg/clip-path/clip-path-with-different-unittypes.svg [ Failure ]
@@ -8275,10 +8248,10 @@
 crbug.com/714962 svg/clip-path/display-none-children.html [ Failure ]
 crbug.com/714962 svg/clip-path/multiple-nested-clip-paths-crash.html [ Failure ]
 crbug.com/714962 svg/clip-path/nested-clip-in-mask-image-based-clipping.svg [ Failure ]
-crbug.com/714962 svg/clip-path/nested-clip-in-mask-path-and-image-based-clipping.svg [ Crash Failure ]
+crbug.com/714962 svg/clip-path/nested-clip-in-mask-path-and-image-based-clipping.svg [ Failure ]
 crbug.com/714962 svg/clip-path/nested-clip-in-mask-path-based-clipping.svg [ Failure ]
-crbug.com/714962 svg/clip-path/nested-empty-clip.html [ Crash Failure ]
-crbug.com/714962 svg/clip-path/opacity-assertion.svg [ Crash Failure ]
+crbug.com/714962 svg/clip-path/nested-empty-clip.html [ Failure ]
+crbug.com/714962 svg/clip-path/opacity-assertion.svg [ Failure ]
 crbug.com/714962 svg/clip-path/transformed-clip.svg [ Failure ]
 crbug.com/714962 svg/clip-path/visible-clip-path-as-hidden-use-element.html [ Failure ]
 crbug.com/714962 svg/clip-path/visible-nested-clip-path-as-hidden-use-element.html [ Failure ]
@@ -8297,7 +8270,7 @@
 crbug.com/714962 svg/custom/clip-path-with-transform.svg [ Failure ]
 crbug.com/591099 svg/custom/clone-element-with-animated-svg-properties.html [ Failure ]
 crbug.com/714962 svg/custom/container-opacity-clip-viewBox.svg [ Failure ]
-crbug.com/591099 svg/custom/createImageElement2.xhtml [ Crash Failure ]
+crbug.com/591099 svg/custom/createImageElement2.xhtml [ Failure ]
 crbug.com/591099 svg/custom/dominant-baseline-hanging.svg [ Failure ]
 crbug.com/591099 svg/custom/elementTimeControl-nan-crash.html [ Failure ]
 crbug.com/591099 svg/custom/embedding-external-svgs.xhtml [ Failure ]
@@ -8320,7 +8293,7 @@
 crbug.com/591099 svg/custom/inline-svg-use-available-width-in-stf.html [ Failure ]
 crbug.com/591099 svg/custom/invisible-text-after-scrolling.xhtml [ Failure ]
 crbug.com/591099 svg/custom/junk-data.svg [ Failure ]
-crbug.com/591099 svg/custom/load-non-wellformed.svg [ Crash Failure ]
+crbug.com/591099 svg/custom/load-non-wellformed.svg [ Failure ]
 crbug.com/714962 svg/custom/local-url-references.html [ Failure ]
 crbug.com/591099 svg/custom/marker-orient-auto.html [ Failure ]
 crbug.com/714962 svg/custom/marker-zero-length-linecaps.svg [ Failure ]
@@ -8364,7 +8337,7 @@
 crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-1.svg [ Failure ]
 crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-2.svg [ Failure ]
 crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-3.svg [ Failure ]
-crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-4.svg [ Crash Failure ]
+crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-4.svg [ Failure ]
 crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-5.svg [ Failure ]
 crbug.com/591099 svg/custom/use-on-disallowed-foreign-object-6.svg [ Failure ]
 crbug.com/714962 svg/custom/use-on-g-containing-use.svg [ Failure ]
@@ -8373,7 +8346,7 @@
 crbug.com/714962 svg/custom/use-on-use.svg [ Failure ]
 crbug.com/714962 svg/custom/use-transform.svg [ Failure ]
 crbug.com/714962 svg/custom/viewbox-syntax.svg [ Failure ]
-crbug.com/714962 svg/custom/viewport-clippath-invalidation.html [ Crash Failure ]
+crbug.com/714962 svg/custom/viewport-clippath-invalidation.html [ Failure ]
 crbug.com/591099 svg/custom/viewport-em.svg [ Failure ]
 crbug.com/714962 svg/custom/visibility-override-clip.svg [ Failure ]
 crbug.com/714962 svg/custom/width-full-percentage.svg [ Failure ]
@@ -8393,7 +8366,7 @@
 crbug.com/714962 svg/dynamic-updates/SVGMaskElement-svgdom-width-prop.html [ Failure ]
 crbug.com/714962 svg/dynamic-updates/SVGMaskElement-svgdom-x-prop.html [ Failure ]
 crbug.com/714962 svg/dynamic-updates/SVGMaskElement-svgdom-y-prop.html [ Failure ]
-crbug.com/591099 svg/filters/feTurbulence-bad-seeds.html [ Crash Failure ]
+crbug.com/591099 svg/filters/feTurbulence-bad-seeds.html [ Failure ]
 crbug.com/714962 svg/filters/filter-clip.svg [ Failure ]
 crbug.com/714962 svg/filters/filter-huge-clamping.svg [ Failure ]
 crbug.com/591099 svg/foreign-object-under-shadow-root-under-hidden.html [ Failure ]
@@ -8405,9 +8378,9 @@
 crbug.com/591099 svg/foreignObject/multiple-foreign-objects.html [ Failure ]
 crbug.com/591099 svg/foreignObject/no-crash-with-svg-content-in-html-document.svg [ Failure ]
 crbug.com/591099 svg/foreignObject/svg-document-in-html-document.svg [ Failure ]
-crbug.com/714962 svg/foreignObject/vertical-foreignObject.html [ Crash Failure ]
+crbug.com/714962 svg/foreignObject/vertical-foreignObject.html [ Failure ]
 crbug.com/591099 svg/hittest/clip-path-shape.html [ Failure ]
-crbug.com/591099 svg/hittest/ellipse-hittest.html [ Crash Failure ]
+crbug.com/591099 svg/hittest/ellipse-hittest.html [ Failure ]
 crbug.com/591099 svg/hittest/empty-container.html [ Failure ]
 crbug.com/591099 svg/hittest/pointer-events-all.html [ Failure ]
 crbug.com/591099 svg/hittest/pointer-events-all2.html [ Failure ]
@@ -8446,7 +8419,7 @@
 crbug.com/591099 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-auto.xhtml [ Failure ]
 crbug.com/591099 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml [ Failure ]
 crbug.com/591099 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-hidden.xhtml [ Failure ]
-crbug.com/591099 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll.xhtml [ Crash Failure ]
+crbug.com/591099 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-scroll.xhtml [ Failure ]
 crbug.com/591099 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-visible.xhtml [ Failure ]
 crbug.com/591099 svg/parser/whitespace-length-invalid-1.html [ Pass Timeout ]
 crbug.com/591099 svg/parser/whitespace-length-invalid-2.html [ Pass Timeout ]
@@ -8457,7 +8430,7 @@
 crbug.com/591099 svg/text/bbox-with-glyph-overflow-zoomed.html [ Failure ]
 crbug.com/591099 svg/text/bbox-with-glyph-overflow.html [ Failure ]
 crbug.com/714962 svg/text/columns-do-not-apply.html [ Failure ]
-crbug.com/591099 svg/text/foreignObject-repaint.xml [ Crash Failure ]
+crbug.com/591099 svg/text/foreignObject-repaint.xml [ Failure ]
 crbug.com/591099 svg/text/foreignObject-text-clipping-bug.xml [ Failure ]
 crbug.com/714962 svg/text/layout-inline-children-assert.html [ Failure ]
 crbug.com/591099 svg/text/scaling-font-with-geometric-precision.html [ Failure ]
@@ -8479,7 +8452,7 @@
 crbug.com/591099 svg/wicd/rightsizing-grid.html [ Failure ]
 crbug.com/591099 svg/wicd/test-rightsizing-a.xhtml [ Failure ]
 crbug.com/591099 svg/wicd/test-rightsizing-b.xhtml [ Failure ]
-crbug.com/591099 svg/wicd/test-scalable-background-image1.xhtml [ Crash Failure ]
+crbug.com/591099 svg/wicd/test-scalable-background-image1.xhtml [ Crash ]
 crbug.com/591099 svg/wicd/test-scalable-background-image2.xhtml [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-background-images.html [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-clip-path.html [ Failure ]
@@ -8509,16 +8482,16 @@
 crbug.com/591099 svg/zoom/text/zoom-svg-float-border-padding.xml [ Failure ]
 crbug.com/591099 tables/layering/paint-test-layering-1.html [ Failure ]
 crbug.com/591099 tables/layering/paint-test-layering-2.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug101674.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug101674.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug106158-1.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug106158-2.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug106158-2.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug106816.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug109043.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug110566.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug113235-1.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug11384q.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug11384s.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug1188.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug1188.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug11944.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug12008.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug126742.html [ Failure ]
@@ -8528,14 +8501,14 @@
 crbug.com/591099 tables/mozilla/bugs/bug131020.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug131020_iframe.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug13118.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug1318.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug1318.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug13196.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug133948.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug137388-1.html [ Failure Pass ]
-crbug.com/591099 tables/mozilla/bugs/bug137388-2.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug137388-1.html [ Failure ]
+crbug.com/591099 tables/mozilla/bugs/bug137388-2.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug137388-3.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug139524-2.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug14159-1.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug14159-1.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug1430.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug149275-1.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug149275-2.html [ Failure ]
@@ -8546,7 +8519,7 @@
 crbug.com/591099 tables/mozilla/bugs/bug18664.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug18955.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug19599.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug20579.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug20579.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug219693-1.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug219693-2.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug221784-2.html [ Failure ]
@@ -8557,13 +8530,13 @@
 crbug.com/591099 tables/mozilla/bugs/bug2479-3.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2479-4.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2509.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug26553.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug26553.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug27038-1.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug27038-2.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2757.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2947.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug2962.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug2973.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2981-1.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2981-2.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug2997.html [ Failure ]
@@ -8587,7 +8560,7 @@
 crbug.com/714962 tables/mozilla/bugs/bug46368-2.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug46480-1.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug46480-2.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug46623-1.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug46623-1.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug46623-2.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug46924.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug48028-1.html [ Failure ]
@@ -8604,7 +8577,7 @@
 crbug.com/591099 tables/mozilla/bugs/bug57828.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug5798.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug58402-1.html [ Failure ]
-crbug.com/591099 tables/mozilla/bugs/bug59354.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/bugs/bug59354.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug6304.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug641-2.html [ Failure ]
 crbug.com/714962 tables/mozilla/bugs/bug650.html [ Failure ]
@@ -8628,7 +8601,7 @@
 crbug.com/714962 tables/mozilla/collapsing_borders/bug127040.html [ Failure ]
 crbug.com/591099 tables/mozilla/collapsing_borders/bug41262-3.html [ Failure ]
 crbug.com/714962 tables/mozilla/collapsing_borders/bug41262-4.html [ Failure ]
-crbug.com/591099 tables/mozilla/core/bloomberg.html [ Crash Failure ]
+crbug.com/591099 tables/mozilla/core/bloomberg.html [ Failure ]
 crbug.com/591099 tables/mozilla/core/captions.html [ Failure ]
 crbug.com/591099 tables/mozilla/core/cell_heights.html [ Failure ]
 crbug.com/714962 tables/mozilla/core/row_span.html [ Failure ]
@@ -8636,15 +8609,7 @@
 crbug.com/714962 tables/mozilla/core/table_rules.html [ Failure ]
 crbug.com/714962 tables/mozilla/dom/insertCellsRebuild1.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/col_span.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_align_center.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_align_justify.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_align_left.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_align_right.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/colgroup_span.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_valign_baseline.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_valign_middle.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/colgroup_valign_top.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/colgroup_width_pct.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/colgroup_width_px.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/table_rules_all.html [ Failure ]
@@ -8653,106 +8618,30 @@
 crbug.com/714962 tables/mozilla/marvin/tables_cellspacing.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_class.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_style.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tables_td_align_center.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tables_td_align_left.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tables_td_align_right.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_td_colspan.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_td_height.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_td_rowspan.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_td_width.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tables_th_align_center.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tables_th_align_left.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tables_th_align_right.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_th_colspan.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_th_height.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_th_rowspan.html [ Failure ]
-crbug.com/591099 tables/mozilla/marvin/tables_th_width.html [ Failure Pass ]
+crbug.com/591099 tables/mozilla/marvin/tables_th_width.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_width_percent.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tables_width_px.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_align_center.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_align_char.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_align_justify.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_align_left.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_align_right.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/tbody_char.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_valign_baseline.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_valign_middle.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tbody_valign_top.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/td_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/td_valign_top.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_align_center.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_align_char.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_align_justify.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_align_left.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_align_right.html [ Failure ]
 crbug.com/591099 tables/mozilla/marvin/tfoot_char.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_valign_baseline.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_valign_middle.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tfoot_valign_top.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/th_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/th_valign_top.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_align_center.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_align_char.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_align_justify.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_align_left.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_align_right.html [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/thead_char.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/thead_valign_top.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tr_valign_bottom.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/tr_valign_top.html [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_col_valign_baseline.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_col_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_col_valign_middle.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_col_valign_top.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_col_width_pct.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_col_width_px.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_col_width_rel.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_colgroup_valign_baseline.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_colgroup_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_colgroup_valign_middle.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_colgroup_valign_top.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_colgroup_width_pct.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_colgroup_width_rel.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_table.xml [ Failure ]
 crbug.com/714962 tables/mozilla/marvin/x_table_style.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_align_center.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_align_char.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_align_justify.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_align_left.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_align_right.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_valign_baseline.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_valign_middle.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tbody_valign_top.xml [ Failure ]
-crbug.com/591099 tables/mozilla/marvin/x_td_align_justify.xml [ Failure Pass ]
-crbug.com/714962 tables/mozilla/marvin/x_td_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_td_valign_top.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_align_center.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_align_char.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_align_justify.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_align_left.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_align_right.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_valign_baseline.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_valign_middle.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tfoot_valign_top.xml [ Failure ]
-crbug.com/591099 tables/mozilla/marvin/x_th_align_justify.xml [ Failure Pass ]
-crbug.com/714962 tables/mozilla/marvin/x_th_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_th_valign_top.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_thead_align_justify.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_thead_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_thead_valign_top.xml [ Failure ]
-crbug.com/591099 tables/mozilla/marvin/x_tr_align_justify.xml [ Failure Pass ]
-crbug.com/714962 tables/mozilla/marvin/x_tr_valign_bottom.xml [ Failure ]
-crbug.com/714962 tables/mozilla/marvin/x_tr_valign_top.xml [ Failure ]
 crbug.com/714962 tables/mozilla/other/cellspacing.html [ Failure ]
 crbug.com/714962 tables/mozilla/other/test3.html [ Failure ]
 crbug.com/714962 tables/mozilla/other/test6.html [ Failure ]
 crbug.com/591099 tables/mozilla/other/wa_table_thtd_rowspan.html [ Failure ]
-crbug.com/591099 tables/mozilla/other/wa_table_tr_align.html [ Failure ]
 crbug.com/591099 tables/mozilla_expected_failures/bugs/bug1010.html [ Failure ]
 crbug.com/714962 tables/mozilla_expected_failures/bugs/bug1055-2.html [ Failure ]
 crbug.com/714962 tables/mozilla_expected_failures/bugs/bug1128.html [ Failure ]
@@ -8793,7 +8682,7 @@
 crbug.com/714962 tables/mozilla_expected_failures/marvin/x_table_rules_all.xml [ Failure ]
 crbug.com/714962 tables/mozilla_expected_failures/marvin/x_table_rules_cols.xml [ Failure ]
 crbug.com/714962 tables/mozilla_expected_failures/marvin/x_table_rules_rows.xml [ Failure ]
-crbug.com/591099 tables/mozilla_expected_failures/other/test4.html [ Crash Pass ]
+crbug.com/591099 tables/mozilla_expected_failures/other/test4.html [ Crash ]
 crbug.com/714962 tables/table-transform-absolute-position-child.html [ Failure ]
 crbug.com/714962 touchadjustment/context-menu-select-text.html [ Failure ]
 crbug.com/714962 touchadjustment/context-menu-text-subtargets.html [ Failure ]
@@ -8885,7 +8774,7 @@
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-background-clip-text.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-border-image-source.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-border-radius.html [ Failure ]
-crbug.com/591099 virtual/gpu-rasterization/images/color-profile-filter.html [ Failure Timeout ]
+crbug.com/591099 virtual/gpu-rasterization/images/color-profile-filter.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-group.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-filter-all.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-object-fit.html [ Failure ]
@@ -8897,7 +8786,7 @@
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-layer.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-mask-image-svg.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-munsell-adobe-to-srgb.html [ Failure ]
-crbug.com/591099 virtual/gpu-rasterization/images/color-profile-reflection.html [ Failure Timeout ]
+crbug.com/591099 virtual/gpu-rasterization/images/color-profile-reflection.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-svg-foreign-object.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-background-size.html [ Failure ]
 crbug.com/591099 virtual/gpu-rasterization/images/cross-fade-blending.html [ Failure ]
@@ -8961,21 +8850,21 @@
 crbug.com/591099 virtual/gpu-rasterization/images/webp-flip.html [ Failure ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-createImageBitmap-colorClamping.html [ Pass ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-createImageBitmap-drawImage.html [ Timeout ]
-crbug.com/714962 virtual/gpu/fast/canvas/canvas-css-clip-path.html [ Failure Timeout ]
+crbug.com/714962 virtual/gpu/fast/canvas/canvas-css-clip-path.html [ Failure ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-drawImage-animated-images.html [ Failure ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-drawImage-video-imageSmoothingEnabled.html [ Pass ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-imageSmoothingQuality.html [ Pass ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-measure-bidi-text.html [ Failure ]
-crbug.com/591099 virtual/gpu/fast/canvas/canvas-shadow-source-in.html [ Crash Failure Timeout ]
+crbug.com/591099 virtual/gpu/fast/canvas/canvas-shadow-source-in.html [ Failure ]
 crbug.com/714962 virtual/gpu/fast/canvas/canvas-text-ideographic-space.html [ Failure ]
 crbug.com/714962 virtual/gpu/fast/canvas/canvas-textMetrics-width.html [ Failure ]
-crbug.com/591099 virtual/gpu/fast/canvas/canvas-transforms-during-path.html [ Failure Timeout ]
+crbug.com/591099 virtual/gpu/fast/canvas/canvas-transforms-during-path.html [ Failure ]
 crbug.com/591099 virtual/gpu/fast/canvas/fill-stroke-clip-reset-path.html [ Failure ]
 crbug.com/714962 virtual/gpu/fast/canvas/image-object-in-canvas.html [ Failure ]
-crbug.com/591099 virtual/gpu/fast/canvas/patternfill-repeat.html [ Failure Timeout ]
+crbug.com/591099 virtual/gpu/fast/canvas/patternfill-repeat.html [ Failure ]
 crbug.com/714962 virtual/gpu/fast/canvas/setWidthResetAfterForcedRender.html [ Failure ]
 crbug.com/591099 virtual/high-contrast-mode/paint/high-contrast-mode/image-filter-all/text-on-backgrounds.html [ Failure ]
-crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html [ Failure Pass ]
+crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/MouseEvent-prototype-offsetX-offsetY.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/shadow-trees/reprojection/reprojection-001.html [ Pass ]
 crbug.com/591099 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/shadow-trees/shadow-root-002.html [ Pass ]
 crbug.com/714962 virtual/incremental-shadow-dom/external/wpt/shadow-dom/untriaged/styles/test-008.html [ Failure ]
@@ -8990,7 +8879,7 @@
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/input-color-in-content.html [ Timeout ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/no-renderers-for-light-children.html [ Pass ]
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/scrollbar.html [ Crash ]
-crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/select-in-shadowdom.html [ Crash Failure ]
+crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/select-in-shadowdom.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/selections-in-shadow.html [ Timeout ]
 crbug.com/714962 virtual/incremental-shadow-dom/fast/dom/shadow/shadow-boundary-crossing.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/fast/dom/shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree.html [ Failure ]
@@ -9006,7 +8895,7 @@
 crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/focus-navigation-slots.html [ Pass ]
 crbug.com/714962 virtual/incremental-shadow-dom/shadow-dom/focus-navigation-with-delegatesFocus.html [ Timeout ]
 crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/focus-navigation.html [ Pass ]
-crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/host-pseudo-elements.html [ Failure Pass ]
+crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/host-pseudo-elements.html [ Failure ]
 crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/layout.html [ Pass ]
 crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/range-caret-range-from-point-left-of-shadow.html [ Crash ]
 crbug.com/591099 virtual/incremental-shadow-dom/shadow-dom/slots-1.html [ Pass ]
@@ -9018,8 +8907,8 @@
 crbug.com/591099 virtual/layout_ng/external/wpt/css/CSS2/floats-clear/float-replaced-width-002.xht [ Pass ]
 crbug.com/591099 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-static-001.xht [ Pass ]
 crbug.com/591099 virtual/layout_ng/fast/block/basic/fieldset-stretch-to-legend.html [ Pass ]
-crbug.com/591099 virtual/layout_ng/fast/block/float/026.html [ Failure Pass ]
-crbug.com/591099 virtual/layout_ng/fast/block/float/028.html [ Failure Pass ]
+crbug.com/591099 virtual/layout_ng/fast/block/float/026.html [ Failure ]
+crbug.com/591099 virtual/layout_ng/fast/block/float/028.html [ Failure ]
 crbug.com/591099 virtual/layout_ng/fast/block/float/float-not-removed-from-first-letter.html [ Pass ]
 crbug.com/591099 virtual/layout_ng/fast/block/float/float-on-zero-height-line.html [ Pass ]
 crbug.com/591099 virtual/layout_ng/fast/block/float/marquee-shrink-to-avoid-floats.html [ Pass ]
@@ -9110,17 +8999,17 @@
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-node-remove.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-boundary-events-for-shadowdom.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-capture-transition-events.html [ Timeout ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-capture.html [ Failure Pass Timeout ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-preventdefault.html [ Failure Timeout ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-capture.html [ Failure ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-preventdefault.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-transition-events.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/mouse-pointer-updown-events.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/multi-pointer-preventdefault.html [ Failure Pass Timeout ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/multi-pointer-preventdefault.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/pointer-use-count.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/touch-capture-in-iframe.html [ Timeout ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/pointerevents/touch-capture.html [ Timeout ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/touch-pointer-events.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/pointerevents/touch-pointercancel.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-allowed-from-gesture-initiated-event.html [ Crash Failure ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-allowed-from-gesture-initiated-event.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-allowed-from-gesture-only-once-iframes.html [ Timeout ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/popup-blocked-from-different-frames.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/popup-blocked-from-untrusted-mouse-click.html [ Timeout ]
@@ -9139,7 +9028,6 @@
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/submit-reset-nested-bubble.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/tab-imagemap.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/tabindex-focus-blur-all.html [ Crash ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects-non-composited-scroll.html [ Failure Pass ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects-scroll.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-click-on-inline-continations.html [ Failure ]
@@ -9147,7 +9035,7 @@
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-input-after-composition.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-mouse-events.html [ Failure ]
 crbug.com/714962 virtual/mouseevent_fractional/fast/events/touch/gesture/gesture-tap-result.html [ Failure ]
-crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/gesture/touch-gesture-scroll-iframe-past-extent.html [ Failure Timeout ]
+crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/gesture/touch-gesture-scroll-iframe-past-extent.html [ Failure ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input-crash.html [ Crash ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input-csp.html [ Crash ]
 crbug.com/591099 virtual/mouseevent_fractional/fast/events/touch/touch-action-range-input.html [ Crash ]
@@ -9204,7 +9092,7 @@
 crbug.com/591099 virtual/unified-autoplay/external/wpt/feature-policy/autoplay-disabled-by-feature-policy.https.sub.html [ Failure ]
 crbug.com/591099 virtual/wheelscrolllatching/ [ Skip ]
 crbug.com/591099 webaudio/BiquadFilter/tail-time-lowpass.html [ Timeout ]
-crbug.com/591099 webexposed/element-instance-property-listing.html [ Pass Timeout ]
+crbug.com/591099 webexposed/element-instance-property-listing.html [ Timeout ]
 crbug.com/591099 webexposed/global-interface-listing-dedicated-worker.html [ Timeout ]
 crbug.com/591099 webexposed/global-interface-listing-shared-worker.html [ Timeout ]
 crbug.com/591099 webexposed/global-interface-listing.html [ Timeout ]
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2 b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
index 70ac454b..f23b0c6 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-slimming-paint-v2
@@ -1571,3 +1571,4 @@
 crbug.com/708175 virtual/mojo-blobs/external/wpt/IndexedDB/interleaved-cursors.html [ Timeout ]
 
 crbug.com/529963 paint/invalidation/background/background-attachment-fixed-scrolled.html [ Failure ]
+Bug(none) fast/multicol/hit-test-translate-z.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index efc5ba4..57fab53 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -880,8 +880,8 @@
 crbug.com/492664 [ Win ] external/wpt/css/css-writing-modes/bidi-override-005.html [ Failure ]
 crbug.com/492664 [ Win ] external/wpt/css/css-writing-modes/bidi-plaintext-001.html [ Failure ]
 
-crbug.com/267206 [ Mac ] virtual/rootlayerscrolls/fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ]
-
+crbug.com/267206 virtual/rootlayerscrolls/fast/scrolling/scrollbar-tickmarks-hittest.html [ Timeout ]
+crbug.com/417782 virtual/rootlayerscrolls/fast/scrolling/scrollbar-prevent-default.html [ Timeout Failure ]
 crbug.com/280342 [ Linux Win ] http/tests/media/progress-events-generated-correctly.html [ Failure Pass ]
 
 crbug.com/520739 [ Mac ] http/tests/websocket/close-code-and-reason.html [ Failure Pass Timeout ]
@@ -1034,6 +1034,8 @@
 
 crbug.com/766135 fast/dom/Window/redirect-with-timer.html [ Timeout Pass ]
 
+crbug.com/798121 fast/history/history-back-twice-with-subframes-assert.html [ Timeout Pass ]
+
 # Ref tests that needs investigation.
 crbug.com/404597 [ Mac ] fast/css3-text/css3-text-justify/text-justify-crash.html [ Failure ]
 crbug.com/404597 fast/forms/long-text-in-input.html [ Skip ]
@@ -1705,8 +1707,6 @@
 
 crbug.com/240576 external/wpt/fullscreen/api/element-ready-check-containing-iframe-manual.html [ Timeout Failure Pass ]
 
-crbug.com/747758 [ Mac Win ] virtual/rootlayerscrolls/fast/scrolling/scrollbar-prevent-default.html [ Failure ]
-
 crbug.com/567419 http/tests/devtools/elements/styles-2/metrics-box-sizing.js [ Skip ]
 
 crbug.com/538717 [ Win Mac Linux ] http/tests/permissions/chromium/test-request-multiple-window.html [ Failure Pass Timeout ]
@@ -3021,6 +3021,8 @@
 crbug.com/736255 [ Mac ] external/wpt/css/vendor-imports/mozilla/mozilla-central-reftests/flexbox/flexbox-baseline-multi-item-vert-001b.html [ Skip ]
 crbug.com/736732 virtual/enable_wasm/external/wpt/wasm/wasm_local_iframe_test.html [ Timeout Pass ]
 
+crbug.com/798116 [ Linux ] fast/forms/select/listbox-in-multi-column.html [ Failure Pass ]
+
 # These imported tests exercise tens of thousands of code points and generate large results. Marked slow, but still timeout.
 crbug.com/736056 [ Mac ] external/wpt/encoding/legacy-mb-japanese [ Timeout Pass ]
 crbug.com/736056 [ Mac Win7 ] external/wpt/encoding/legacy-mb-korean [ Timeout Pass ]
@@ -3028,21 +3030,6 @@
 crbug.com/736056 external/wpt/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-csiso2022jp.html [ Timeout ]
 crbug.com/736056 external/wpt/encoding/legacy-mb-korean/euc-kr/euckr-encode-form-errors-hangul.html [ Timeout Pass ]
 
-# Known issue: module script errors are not derteministic
-# TODO(hiroshige): The tests will pass deterministically after a V8-side CL,
-# so I set [ Failure Pass ] here to allow the transitions, and once the
-# V8-side CL is landed, then I'll remove these expectations.
-
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-1.html [ Failure Pass ]
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-2.html [ Failure Pass ]
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-3.html [ Failure Pass ]
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-4.html [ Failure Pass ]
-
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/instantiation-error-5.html [ Failure Pass ]
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/dynamic-imports-script-error.html [ Failure Pass ]
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/error-type-3.html [ Failure ]
-crbug.com/763597 external/wpt/html/semantics/scripting-1/the-script-element/module/choice-of-error-2.html [ Failure ]
-
 # module script lacks XHTML support
 crbug.com/717643 external/wpt/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml [ Failure ]
 
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt b/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt
index 928f8d51..b84c480 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element-expected.txt
@@ -6,5 +6,4 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-FAIL result should be <div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>. Was .
 
diff --git a/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html b/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html
index b9b8c03..da28304e 100644
--- a/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html
+++ b/third_party/WebKit/LayoutTests/editing/pasteboard/drag-files-to-editable-element.html
@@ -17,7 +17,6 @@
     if (window.eventSender) {
         dragFilesOntoEditable(['foo', 'bar', 'baz']);
         result = editable.innerHTML.replace(/file.*?LayoutTests/g, "LayoutTests");
-        // FIXME: This test fails and got rebaselinend to expect the failure, we should fix this. See http://crbug.com/443143
         shouldBeEqualToString('result', '<div>LayoutTests/editing/pasteboard/foo</div><div>LayoutTests/editing/pasteboard/bar</div><div>LayoutTests/editing/pasteboard/baz</div>');
         editable.innerHTML = '';
         window.stop();
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
index ff2bad75..adb5daa 100644
--- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
+++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST.json
@@ -110425,6 +110425,11 @@
      {}
     ]
    ],
+   "css/css-multicol/multicol-gap-animation-003-expected.txt": [
+    [
+     {}
+    ]
+   ],
    "css/css-multicol/multicol-gap-fraction-001-ref.xht": [
     [
      {}
@@ -168387,6 +168392,24 @@
      {}
     ]
    ],
+   "css/css-multicol/multicol-gap-animation-001.html": [
+    [
+     "/css/css-multicol/multicol-gap-animation-001.html",
+     {}
+    ]
+   ],
+   "css/css-multicol/multicol-gap-animation-002.html": [
+    [
+     "/css/css-multicol/multicol-gap-animation-002.html",
+     {}
+    ]
+   ],
+   "css/css-multicol/multicol-gap-animation-003.html": [
+    [
+     "/css/css-multicol/multicol-gap-animation-003.html",
+     {}
+    ]
+   ],
    "css/css-position/position-sticky-get-bounding-client-rect.html": [
     [
      "/css/css-position/position-sticky-get-bounding-client-rect.html",
@@ -255343,7 +255366,7 @@
    "support"
   ],
   "css/css-conditional/test_group_insertRule.html": [
-   "948230661efe702e443fe7e973d7c4995144588e",
+   "c805d45e2361bd67ebf1ca0605807d7384b09a7d",
    "testharness"
   ],
   "css/css-contain/contain-style-counters-ref.html": [
@@ -268290,6 +268313,22 @@
    "16067366a3c1922e9c8415b21e513edd47c2305f",
    "reftest"
   ],
+  "css/css-multicol/multicol-gap-animation-001.html": [
+   "5f2cf6d10c4624d44e81bfa9e9c97bcaf229ca80",
+   "testharness"
+  ],
+  "css/css-multicol/multicol-gap-animation-002.html": [
+   "5e83250f2f2ff49682eae68056330aa3b4c673c7",
+   "testharness"
+  ],
+  "css/css-multicol/multicol-gap-animation-003-expected.txt": [
+   "697b921d83c68c5ec34ad0fef1de9bcf20555024",
+   "support"
+  ],
+  "css/css-multicol/multicol-gap-animation-003.html": [
+   "6d5c81b2277c34bac89e8cde247dd9aabbdd505f",
+   "testharness"
+  ],
   "css/css-multicol/multicol-gap-fraction-001-ref.xht": [
    "91139e0fa20ce6211d5199ba60312f5f7ab308d8",
    "support"
@@ -279163,7 +279202,7 @@
    "support"
   ],
   "css/css-transforms/transform-2d-getComputedStyle-001.html": [
-   "0ecbf50593b1516a04578fd0bb1c9da207eee968",
+   "b4ed47027bac6bafad816e6bf8d5b179b8c5a90d",
    "testharness"
   ],
   "css/css-transforms/transform-3d-rotateY-stair-above-001.xht": [
@@ -281947,7 +281986,7 @@
    "testharness"
   ],
   "css/css-typed-om/factory-absolute-length.html": [
-   "a0049b74fea0fc581ca9896792cbc35568e68771",
+   "2d4f84c4ad1121b5415edcbaab6918a933dfdd60",
    "testharness"
   ],
   "css/css-typed-om/factory-duration.html": [
@@ -284327,7 +284366,7 @@
    "reftest"
   ],
   "css/css-values/calc-unit-analysis.html": [
-   "995e7d094cb02f142d28ff0ca7de9d98f9a298e3",
+   "c5fd567b4fa257ce53c48ebf8c444bf382459fec",
    "testharness"
   ],
   "css/css-values/ch-unit-001.html": [
@@ -284703,7 +284742,7 @@
    "support"
   ],
   "css/css-variables/test_variable_legal_values.html": [
-   "a6ffd6e1e3479aad164dcf678e7382b365473448",
+   "fb40b2d7cf51500c180568709cedb5203c2e7ebf",
    "testharness"
   ],
   "css/css-variables/variable-animation-from-to.html": [
@@ -290999,7 +291038,7 @@
    "support"
   ],
   "css/cssom-view/elementFromPosition.html": [
-   "2bb07e21ddfbc24dabc39fa261c720a36f56a933",
+   "f033a1ec4b1f0636897c4ee16b67c1c13f0eac4e",
    "testharness"
   ],
   "css/cssom-view/elementScroll.html": [
@@ -291075,7 +291114,7 @@
    "testharness"
   ],
   "css/cssom-view/offsetParent_element_test.html": [
-   "b2261ec702116c211ab5ac6fbb53698dfe60a7be",
+   "2c3a4481d0ed7773420bf2059047d1d337c899dd",
    "testharness"
   ],
   "css/cssom-view/offsetTopLeftInScrollableParent.html": [
@@ -291111,11 +291150,11 @@
    "testharness"
   ],
   "css/cssom-view/scrollWidthHeight.xht": [
-   "06ec592720f3db3c04cdd792177179b11a097a23",
+   "503316b6ea12a881566cce0e2e78ddfc942297f0",
    "testharness"
   ],
   "css/cssom-view/scrollWidthHeightWhenNotScrollable.xht": [
-   "dfac20693a9d2bcbc74e372177b1a04472de8f8f",
+   "897d0db30122018a1b71c52d12f16c41ea845954",
    "testharness"
   ],
   "css/cssom-view/scrolling-no-browsing-context.html": [
@@ -291339,7 +291378,7 @@
    "support"
   ],
   "css/cssom-view/window-interface.xht": [
-   "4d8c4ddb997d85ca2c971602a3096f57565c01eb",
+   "b51ac4828be890736faee8ce42fd95c4bbb844ef",
    "testharness"
   ],
   "css/cssom-view/window-screen-height-immutable.html": [
@@ -291403,7 +291442,7 @@
    "testharness"
   ],
   "css/cssom/MediaList2.xhtml": [
-   "277ec40d3a64d9881e594901a6bcdcd6b70405db",
+   "c7481f3c0fe943abb6d67004d6c4aaff12180e34",
    "testharness"
   ],
   "css/cssom/OWNERS": [
@@ -291415,7 +291454,7 @@
    "testharness"
   ],
   "css/cssom/computed-style-001.html": [
-   "a940a84552ddcd716af743e0e8746c7582b5c760",
+   "0331a648e6b0d56f0e7365f1ff7d991ea77ce3e4",
    "testharness"
   ],
   "css/cssom/css-style-attribute-modifications.html": [
@@ -291499,7 +291538,7 @@
    "support"
   ],
   "css/cssom/inline-style-001.html": [
-   "377c8610bc597d47a93f70a9cf95b3c7657d8319",
+   "da50f9738f161a0bb9af5a5636634346bb683fa9",
    "testharness"
   ],
   "css/cssom/insertRule-charset-no-index.html": [
@@ -291539,7 +291578,7 @@
    "support"
   ],
   "css/cssom/medialist-interfaces-001.html": [
-   "dfaea262508d72d123006409174e3e21832a305f",
+   "32d486ecdd41418e734be028c150b0183b8d3316",
    "testharness"
   ],
   "css/cssom/medialist-interfaces-002-expected.txt": [
@@ -291547,11 +291586,11 @@
    "support"
   ],
   "css/cssom/medialist-interfaces-002.html": [
-   "114fac94342afe2e7fe432a67c4b0bbf03d24bc4",
+   "20d4d9e76e0331816aed5f70182dee6966e568e7",
    "testharness"
   ],
   "css/cssom/medialist-interfaces-003.html": [
-   "b9ddd611cc585202b1e76382666b04197af334b0",
+   "42c6fb48a67af381e09995e27dcd8795557345dd",
    "testharness"
   ],
   "css/cssom/medialist-interfaces-004-expected.txt": [
@@ -291559,7 +291598,7 @@
    "support"
   ],
   "css/cssom/medialist-interfaces-004.html": [
-   "e3cdc88670ca46b3752fd8118d94dae2cc95258d",
+   "9558544a6785ac732150b8a50bedbaf3615fa890",
    "testharness"
   ],
   "css/cssom/overflow-serialization.html": [
@@ -291623,11 +291662,11 @@
    "support"
   ],
   "css/cssom/style-sheet-interfaces-001.html": [
-   "e77ec7de74baa901cc15a3b90d2b29125c282562",
+   "6dbb52cd85cb3bbc711a3569e0f253d7086a43a0",
    "testharness"
   ],
   "css/cssom/style-sheet-interfaces-002.html": [
-   "875598ca4271d4adaa11fbb01981b290e6235019",
+   "8fc091c20efd7fc71c6c357278977ee6137fd8d4",
    "testharness"
   ],
   "css/cssom/stylesheet-same-origin.css": [
@@ -291831,7 +291870,7 @@
    "support"
   ],
   "css/cssom/ttwf-cssom-doc-ext-load-count.html": [
-   "800db5cd4f7342d8c4e5309d4035182ce42f7251",
+   "035984ef66730a2f87c08dbcba76a2620cf70775",
    "testharness"
   ],
   "css/cssom/ttwf-cssom-doc-ext-load-tree-order.html": [
@@ -292395,7 +292434,7 @@
    "support"
   ],
   "css/mediaqueries/test_media_queries.html": [
-   "a602fa95fbd50191362f0373f826b547c890c518",
+   "7b0a2c7025dd0bd6aee14935760f88cd1f09c7dc",
    "testharness"
   ],
   "css/motion/OWNERS": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match-expected.txt
deleted file mode 100644
index b46fdfa..0000000
--- a/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match-expected.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-This is a testharness.js-based test.
-PASS `document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: /
-PASS `document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: match.html
-PASS `document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: cookies
-PASS `document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: /cookies
-PASS `document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: /cookies/
-PASS `document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: /cookies/path/echo-cookie.html
-PASS `document.cookie` on /cookies/path/echo-cookie.html DOES NOT set cookie for path: /cook
-PASS `document.cookie` on /cookies/path/echo-cookie.html DOES NOT set cookie for path: /w/
-FAIL `Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: / assert_not_equals: got disallowed value null
-FAIL `Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: match.html assert_not_equals: got disallowed value null
-FAIL `Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: cookies assert_not_equals: got disallowed value null
-FAIL `Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: /cookies assert_not_equals: got disallowed value null
-FAIL `Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: /cookies/ assert_not_equals: got disallowed value null
-FAIL `Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: /cookies/path/echo-cookie.html assert_not_equals: got disallowed value null
-PASS `Set-Cookie` on /cookies/path/echo-cookie.html DOES NOT set cookie for path: /cook
-PASS `Set-Cookie` on /cookies/path/echo-cookie.html DOES NOT set cookie for path: /w/
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match.html b/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match.html
index c3f2f8e..54026ef8 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/path/match.html
@@ -16,32 +16,32 @@
 var body = document.getElementsByTagName('body')[0];
 var createIframeThen = function (callback) {
   var iframe = document.createElement('iframe');
-  iframe.src = "echo-cookie.html";
+  iframe.src = "/cookies/resources/echo-cookie.html";
   body.appendChild(iframe);
   iframe.onload = callback;
   return iframe;
 };
 var testCookiePathFromDOM = function (testCase, test) {
   var iframe = createIframeThen(test.step_func(function () {
-    iframe.contentWindow.setCookie(testCase.name, testCase.path);
-    var cookieSet = iframe.contentWindow.isCookieSet(testCase.name, testCase.path);
+    iframe.contentWindow.setCookie('dom-' + testCase.name, testCase.path);
+    var cookieSet = iframe.contentWindow.isCookieSet('dom-' + testCase.name, testCase.path);
     if (testCase.match === false) {
       assert_equals(cookieSet, null);
     } else {
       assert_not_equals(cookieSet, null);
     }
 
-    iframe.contentWindow.expireCookie(testCase.name, testCase.path);
+    iframe.contentWindow.expireCookie('dom-' + testCase.name, testCase.path);
     test.done();
   }));
 };
 var testCookiePathFromHeader = function (testCase, test) {
   var iframe = createIframeThen(test.step_func(function () {
-    iframe.contentWindow.fetchCookieThen(testCase.name, testCase.path).then(test.step_func(function (response) {
+    iframe.contentWindow.fetchCookieThen('header-' + testCase.name, testCase.path).then(test.step_func(function (response) {
       assert_true(response.ok);
 
-      var cookieSet = iframe.contentWindow.isCookieSet(testCase.name, testCase.path);
-      iframe.contentWindow.expireCookie(testCase.name, testCase.path);
+      var cookieSet = iframe.contentWindow.isCookieSet('header-' + testCase.name, testCase.path);
+      iframe.contentWindow.expireCookie('header-' + testCase.name, testCase.path);
       if (testCase.match === false) {
         assert_equals(cookieSet, null);
       } else {
@@ -70,7 +70,7 @@
   "path": "/cookies/",
 }, {
   "name": "match-exact-page",
-  "path": "/cookies/path/echo-cookie.html",
+  "path": "/cookies/resources/echo-cookie.html",
 }, {
   "name": "no-match",
   "path": "/cook",
@@ -82,9 +82,9 @@
 }];
 
 var domTests = tests.map(function (testCase) {
-  var testName = "`document.cookie` on /cookies/path/echo-cookie.html sets cookie with path: " + testCase.path;
+  var testName = "`document.cookie` on /cookies/resources/echo-cookie.html sets cookie with path: " + testCase.path;
   if (testCase.match === false) {
-    testName = "`document.cookie` on /cookies/path/echo-cookie.html DOES NOT set cookie for path: " + testCase.path;
+    testName = "`document.cookie` on /cookies/resources/echo-cookie.html DOES NOT set cookie for path: " + testCase.path;
   }
   return [
     testName,
@@ -95,9 +95,9 @@
 });
 
 var headerTests = tests.map(function (testCase) {
-  var testName = "`Set-Cookie` on /cookies/path/echo-cookie.html sets cookie with path: " + testCase.path;
+  var testName = "`Set-Cookie` on /cookies/resources/echo-cookie.html sets cookie with path: " + testCase.path;
   if (testCase.match === false) {
-    testName = "`Set-Cookie` on /cookies/path/echo-cookie.html DOES NOT set cookie for path: " + testCase.path;
+    testName = "`Set-Cookie` on /cookies/resources/echo-cookie.html DOES NOT set cookie for path: " + testCase.path;
   }
   return [
     testName,
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/path/echo-cookie.html b/third_party/WebKit/LayoutTests/external/wpt/cookies/resources/echo-cookie.html
similarity index 70%
rename from third_party/WebKit/LayoutTests/external/wpt/cookies/path/echo-cookie.html
rename to third_party/WebKit/LayoutTests/external/wpt/cookies/resources/echo-cookie.html
index dd515a8..a715b8b 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/cookies/path/echo-cookie.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/cookies/resources/echo-cookie.html
@@ -8,16 +8,16 @@
 <body>
 <script>
 window.setCookie = function (name, path) {
-  document.cookie = name + '=1; path = ' + path + ';';
+  document.cookie = name + '=1; Path=' + path + ';';
 }
 window.fetchCookieThen = function (name, path) {
-  return fetch("/cookies/resources/set-cookie.py?name=" + encodeURIComponent(name) + "&path=" + encodeURIComponent(path));
+  return fetch("/cookies/resources/set-cookie.py?name=" + encodeURIComponent(name) + "&path=" + encodeURIComponent(path), {'credentials': 'include'});
 };
 window.isCookieSet = function (name, path) {
   return document.cookie.match(name + '=1');
 };
 window.expireCookie = function (name, path) {
-  document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=' + path + ';';
+  document.cookie = name + '=0; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=' + path + ';';
 };
 </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.https.sub-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.https.sub-expected.txt
deleted file mode 100644
index 02325003..0000000
--- a/third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.https.sub-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-This is a testharness.js-based test.
-FAIL 'secure' cookie not sent in WSS request when set from WS Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.https.sub.html b/third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.sub.html
similarity index 100%
rename from third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.https.sub.html
rename to third_party/WebKit/LayoutTests/external/wpt/cookies/secure/set-from-ws.sub.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/test_group_insertRule.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/test_group_insertRule.html
index 85edc2a1..f34245ec 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/test_group_insertRule.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-conditional/test_group_insertRule.html
@@ -11,26 +11,6 @@
 <style id="style">
 @media print {}
 </style>
-<script id="metadata_cache">/*
-{
-  "rule_type": {},
-  "rule_length": {},
-  "insert_import_throws": {},
-  "insert_index_throws1": {},
-  "insert_index_throws2": {},
-  "insert_media_succeed": {},
-  "insert_style_succeed": {},
-  "insert_bad_media_throw": {},
-  "insert_empty_throw": {},
-  "insert_garbage_after_media_throw": {},
-  "insert_garbage_after_style_throw": {},
-  "insert_two_media_throw": {},
-  "insert_style_media_throw": {},
-  "insert_media_style_throw": {},
-  "insert_two_style_throw": {},
-  "insert_retval": {}
-}
-*/</script>
 </head>
 <body onload="run()">
 <div id=log></div>
@@ -240,4 +220,3 @@
 </script>
 </body>
 </html>
-
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-001.html
new file mode 100644
index 0000000..6a3a8d3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-001.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Multi-column Layout Test: column-gap test animation</title>
+<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
+<link rel="help" href="https://www.w3.org/TR/css-multicol-1/#column-gap">
+<link rel="help" href="https://www.w3.org/TR/web-animations-1/#dom-animatable-animate">
+<meta name="assert" content="Test checks that column-gap is an animatable property, and that the computed values during the animation are the expected ones.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+  #multicol {
+    column-gap: 0px;
+  }
+</style>
+<body>
+  <div id="multicol"></div>
+  <div id="log"></div>
+
+  <script>
+    test(
+      function(){
+        var multicol = document.getElementById("multicol");
+        assert_equals(getComputedStyle(multicol).columnGap, "0px");
+
+        var keyframes = [
+          { columnGap: "100px" },
+          { columnGap: "200px" }
+        ];
+        var options = {
+          duration: 10,
+          fill: "forwards",
+          easing: "linear"
+        };
+
+        var player = multicol.animate(keyframes, options);
+        player.pause();
+        player.currentTime = 0;
+        assert_equals(getComputedStyle(multicol).columnGap, "100px");
+        player.currentTime = 5;
+        assert_equals(getComputedStyle(multicol).columnGap, "150px");
+        player.currentTime = 10;
+        assert_equals(getComputedStyle(multicol).columnGap, "200px");
+      }, "column-gap property is animatable");
+  </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-002.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-002.html
new file mode 100644
index 0000000..de3756c6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-002.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Multi-column Layout Test: column-gap normal test animation</title>
+<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
+<link rel="help" href="https://www.w3.org/TR/css-multicol-1/#column-gap">
+<link rel="help" href="https://www.w3.org/TR/web-animations-1/#dom-animatable-animate">
+<meta name="assert" content="Test checks that 'normal' value for column-gap property is not interpolable.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+  @keyframes column-gap-normal-to-100 {
+    from { column-gap: normal; }
+    to { column-gap: 100px; }
+  }
+
+  #multicol {
+    animation-name: column-gap-normal-to-100;
+    animation-duration: 2s;
+    animation-delay: -1s;
+    animation-play-state: paused;
+  }
+</style>
+<body>
+  <div id="multicol"></div>
+  <div id="log"></div>
+
+  <script>
+    test(
+      function(){
+        var multicol = document.getElementById("multicol");
+        assert_equals(getComputedStyle(multicol).columnGap, "100px");
+      }, "column-gap: normal is not interpolable");
+  </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-003-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-003-expected.txt
new file mode 100644
index 0000000..479213d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-003-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Default column-gap is not interpolable assert_equals: expected "100px" but got "80.2414px"
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-003.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-003.html
new file mode 100644
index 0000000..71182faf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-multicol/multicol-gap-animation-003.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>CSS Multi-column Layout Test: Default column-gap test animation</title>
+<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
+<link rel="help" href="https://www.w3.org/TR/css-multicol-1/#column-gap">
+<link rel="help" href="https://www.w3.org/TR/web-animations-1/#dom-animatable-animate">
+<meta name="assert" content="Test checks that the default value for column-gap property, which is 'normal', is not interpolable.">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+  @keyframes column-gap-to-100 {
+    to { column-gap: 100px; }
+  }
+
+  #multicol {
+    animation-name: column-gap-to-100;
+    animation-duration: 2s;
+    animation-delay: -1s;
+    animation-play-state: paused;
+  }
+</style>
+<body>
+  <div id="multicol"></div>
+  <div id="log"></div>
+
+  <script>
+    test(
+      function(){
+        var multicol = document.getElementById("multicol");
+        assert_equals(getComputedStyle(multicol).columnGap, "100px");
+      }, "Default column-gap is not interpolable");
+  </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-2d-getComputedStyle-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-2d-getComputedStyle-001.html
index 543dd9a..a085b79 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-2d-getComputedStyle-001.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-transforms/transform-2d-getComputedStyle-001.html
@@ -45,15 +45,6 @@
     	transform: matrix(1, 2, 3, 4, 5, 6);
     }
     </style>
-    <script id="metadata_cache">/*
-	{
-	  "Matrix for translation transforms": {},
-	  "Matrix for rotate": {},
-	  "Matrix for scaling": {},
-	  "Matrix for skew": {},
-	  "Matrix for general transform": {}
-	}
-	*/</script>
     <script type="text/javascript" src="/resources/testharness.js"></script>
     <script type="text/javascript" src="/resources/testharnessreport.js"></script>
 </head>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/factory-absolute-length.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/factory-absolute-length.html
index a65cf5d..5712ca99 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/factory-absolute-length.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-typed-om/factory-absolute-length.html
@@ -26,11 +26,11 @@
           }, 'CSS.mm() produces mm length');
 
           test(function(){
-              var length = CSS.q(30);
+              var length = CSS.Q(30);
               assert_true(length instanceof CSSUnitValue);
               assert_equals(length.value, 30);
               assert_equals(length.unit, 'q');
-          }, 'CSS.q() produces q length');
+          }, 'CSS.Q() produces q length');
 
           test(function(){
               var length = CSS.in(40);
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-unit-analysis.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-unit-analysis.html
index 346a829..1520b4d 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-unit-analysis.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-values/calc-unit-analysis.html
@@ -9,19 +9,6 @@
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
 <style id="style"></style>
-<script id="metadata_cache">/*
-{
-  "unitless_zero_in_calc_is_a_numeric_type_not_length": { "assert": "invalid calc expression: unitless zero in calc() is a numeric type, not length" },
-  "0px_in_calc": { "assert": "invalid calc expression: 0px in calc()" },
-  "addition_of_length_and_number": { "assert": "invalid calc expression: addition of length and number" },
-  "addition_of_number_and_length": { "assert": "invalid calc expression: addition of number and length" },
-  "subtraction_of_length_and_number": { "assert": "invalid calc expression: subtraction of length and number" },
-  "subtraction_of_number_and_length": { "assert": "invalid calc expression: subtraction of number and length" },
-  "multiplication_of_length_and_number": { "assert": "invalid calc expression: multiplication of length and number" },
-  "multiplication_of_number_and_length": { "assert": "invalid calc expression: multiplication of number and length" },
-  "multiplication_of_length_and_length": { "assert": "invalid calc expression: multiplication of length and length" }
-}
-*/</script>
 </head>
 <body onload="run()">
 <div id=log></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-variables/test_variable_legal_values.html b/third_party/WebKit/LayoutTests/external/wpt/css/css-variables/test_variable_legal_values.html
index 0b39c24..2e07438 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-variables/test_variable_legal_values.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-variables/test_variable_legal_values.html
@@ -9,33 +9,6 @@
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
 <style id="style"></style>
-<script id="metadata_cache">/*
-{
-  "percentage": { "assert": "Value allowed within variable: percentage" },
-  "number": { "assert": "Value allowed within variable: number" },
-  "length": { "assert": "Value allowed within variable: length" },
-  "time": { "assert": "Value allowed within variable: time" },
-  "function": { "assert": "Value allowed within variable: function" },
-  "nested_function": { "assert": "Value allowed within variable: nested function" },
-  "parentheses": { "assert": "Value allowed within variable: parentheses" },
-  "braces": { "assert": "Value allowed within variable: braces" },
-  "brackets": { "assert": "Value allowed within variable: brackets" },
-  "at_keyword_unknown": { "assert": "Value allowed within variable: at-keyword (unknown)" },
-  "at_keyword_known": { "assert": "Value allowed within variable: at-keyword (known)" },
-  "at_keyword_unknown_and_block": { "assert": "Value allowed within variable: at-keyword (unknown) and block" },
-  "at_keyword_known_and_block": { "assert": "Value allowed within variable: at-keyword (known) and block" },
-  "unbalanced_close_bracket_at_toplevel": { "assert": "Value not allowed within variable: unbalanced close bracket at toplevel" },
-  "unbalanced_close_paren_at_toplevel": { "assert": "Value not allowed within variable: unbalanced close paren at toplevel" },
-  "unbalanced_close_bracket_in_something_balanced": { "assert": "Value not allowed within variable: unbalanced close bracket in something balanced" },
-  "unbalanced_close_paren_in_something_balanced": { "assert": "Value not allowed within variable: unbalanced close paren in something balanced" },
-  "unbalanced_close_brace_in_something_balanced": { "assert": "Value not allowed within variable: unbalanced close brace in something balanced" },
-  "CDO_at_top_level": { "assert": "Value allowed within variable: CDO at top level" },
-  "CDC_at_top_level": { "assert": "Value allowed within variable: CDC at top level" },
-  "semicolon_not_at_top_level_value_unused": { "assert": "Value allowed within variable: semicolon not at top level (value -> unused)" },
-  "CDO_not_at_top_level_value_unused": { "assert": "Value allowed within variable: CDO not at top level (value -> unused)" },
-  "CDC_not_at_top_level_value_unused": { "assert": "Value allowed within variable: CDC not at top level (value -> unused)" }
-}
-*/</script>
 </head>
 <body onload="run()">
 <div id=log></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/elementFromPosition.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/elementFromPosition.html
index d4da36f..ed86d16b 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/elementFromPosition.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/elementFromPosition.html
@@ -8,26 +8,6 @@
     <meta name="flags" content="dom" />
     <script src="/resources/testharness.js" type="text/javascript"></script>
     <script src="/resources/testharnessreport.js" type="text/javascript"></script>
-    <script id="metadata_cache">/*
-{
-  "document.elementFromPoint": {},
-  "document.elementFromPoint is a Function": {},
-  "test some point of the element: top left corner": {},
-  "test some point of the element: top line": {},
-  "test some point of the element: top right corner": {},
-  "test some point of the element: left line": {},
-  "test some point of the element: inside": {},
-  "test some point of the element: right line": {},
-  "test some point of the element: bottom left corner": {},
-  "test some point of the element: bottom line": {},
-  "test some point of the element: bottom right corner": {},
-  "Point (0, 0), return root element(HTML)": {},
-  " test negative x ": {},
-  " test negative y ": {},
-  "test outside of viewport": {},
-  "test the top of layer": {}
-}
-  */</script>
 </head>
 <body>
     <noscript>Test not run - JavaScript required!</noscript>
@@ -139,5 +119,3 @@
     </script>
 </body>
 </html>
-
-
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/offsetParent_element_test.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/offsetParent_element_test.html
index aa4a1e55e..bb5686d 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/offsetParent_element_test.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/offsetParent_element_test.html
@@ -8,12 +8,6 @@
 <link rel="help" href="http://www.w3.org/TR/cssom-view/#dom-htmlelement-offsetparent">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-<script id="metadata_cache">/*
-{
-  "Valid the algorithm rule of offsetParent check step 1": { "assert": "The offsetParent attribute algorithm rule checking passed!" },
-  "Valid the algorithm rule of offsetParent check step 2": { "assert": "The offsetParent attribute algorithm rule checking passed!" }
-}
-*/</script>
 <style>
 #fixed {
     position: fixed;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeight.xht b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeight.xht
index b4696e1..77b01db 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeight.xht
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeight.xht
@@ -38,21 +38,6 @@
                 height:150px;
             }
         ]]></style>
-        <script id="metadata_cache" type="text/javascript"><![CDATA[/*
-{
-  "elemSimple.clientHeight is the height of the padding edge": {},
-  "elemSimple.scrollHeight is its clientHeight": {},
-  "elemSimple.clientWidth is the width of the padding edge": {},
-  "elemSimple.scrollWidth is its clientWidth": {},
-  "elemOverflow.clientHeight is the height of the padding edge": {},
-  "elemOverflow.scrollHeight is the height of its scrolled contents (ignoring padding, since we overflowed)": {},
-  "elemOverflow.clientWidth is the width of the padding edge": {},
-  "elemOverflow.scrollHeight is the width of its scrolled contents (ignoring padding, since we overflowed)": {},
-  "elemNestedOverflow.clientHeight is the height of the padding edge": {},
-  "elemNestedOverflow.scrollHeight is the height of its scrolled contents (ignoring padding, since we overflowed)": {},
-  "elemNestedOverflow.clientWidth is the height of the padding edge": {},
-  "elemNestedOverflow.scrollWidth is the width of its scrolled contents (ignoring padding, since we overflowed)": {}
-*/      ]]></script>
     </head>
     <body>
         <noscript>Test not run - javascript required.</noscript>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeightWhenNotScrollable.xht b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeightWhenNotScrollable.xht
index e8c7f12..f0fd373b1 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeightWhenNotScrollable.xht
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/scrollWidthHeightWhenNotScrollable.xht
@@ -37,21 +37,6 @@
                 height:150px;
             }
         ]]></style>
-        <script id="metadata_cache" type="text/javascript"><![CDATA[/*
-{
-  "elemSimple.clientHeight is the height of the padding edge": {},
-  "elemSimple.scrollHeight is its clientHeight": {},
-  "elemSimple.clientWidth is the width of the padding edge": {},
-  "elemSimple.scrollWidth is its clientWidth": {},
-  "elemOverflow.clientHeight is the height of the padding edge": {},
-  "elemOverflow.scrollHeight is the height of its scrolled contents (ignoring padding, since we overflowed)": {},
-  "elemOverflow.clientWidth is the width of the padding edge": {},
-  "elemOverflow.scrollHeight is the width of its scrolled contents (ignoring padding, since we overflowed)": {},
-  "elemNestedOverflow.clientHeight is the height of the padding edge": {},
-  "elemNestedOverflow.scrollHeight is the height of its scrolled contents (ignoring padding, since we overflowed)": {},
-  "elemNestedOverflow.clientWidth is the height of the padding edge": {},
-  "elemNestedOverflow.scrollWidth is the width of its scrolled contents (ignoring padding, since we overflowed)": {}
-*/      ]]></script>
     </head>
     <body>
         <noscript>Test not run - javascript required.</noscript>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/window-interface.xht b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/window-interface.xht
index 2ed64cba..163124b6 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/window-interface.xht
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom-view/window-interface.xht
@@ -13,22 +13,6 @@
     <body>
         <noscript>Test not run - javascript required.</noscript>
         <div id="log" />
-        <script id="metadata_cache">/*
-        {
-          "window_exposed_functions": {
-            "assert": ["window functions are exposed"]
-          },
-          "window_functions": {
-            "assert": ["window functions are instances of Function"]
-          },
-          "window_properties": {
-            "assert": ["window properties are owned by window"]
-          },
-          "window_properties_readonly": {
-            "assert": ["window properties are readonly"]
-          }
-        }
-        */</script>
         <script type="text/javascript"><![CDATA[
             /*
                Window Functions
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/MediaList2.xhtml b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/MediaList2.xhtml
index fb1062c..73acbdec2 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/MediaList2.xhtml
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/MediaList2.xhtml
@@ -8,15 +8,6 @@
 <style media="screen, print" id="test-style"></style>
 <script src="/resources/testharness.js"/>
 <script src="/resources/testharnessreport.js"/>
-<script id="metadata_cache">/*
-{
-  "MediaList": {},
-  "MediaList.mediaText": {},
-  "MediaList.length": {},
-  "MediaList getter": {},
-  "MediaList.item": {}
-}
-*/</script>
 </head>
 <body>
 <div id="log"/>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/computed-style-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/computed-style-001.html
index 2cdfc9eb..80bf06c 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/computed-style-001.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/computed-style-001.html
@@ -23,14 +23,6 @@
         height: 100px;
     }
   </style>
-<script id="metadata_cache">/*
-{
-  "read_only": { "assert": "do not allow modifications to a computed CSSStyleDeclaration" },
-  "property_values": { "assert": "Directly set properties are resolved" },
-  "inherited_property_values": { "assert": "Inherited properties are resolved" },
-  "relative_property_values": { "assert": "Relative properties are resolved" }
-}
-*/</script>
  </head>
  <body>
  <noscript>Test not run - javascript required.</noscript>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/inline-style-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/inline-style-001.html
index 3a9eebf7..b8b1aaa 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/inline-style-001.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/inline-style-001.html
@@ -9,22 +9,6 @@
   <script src="/resources/testharness.js" type="text/javascript"></script>
   <script src="/resources/testharnessreport.js" type="text/javascript"></script>
  </head>
- <script id="metadata_cache">/*
-{
-  "CSSStyleDeclaration_accessible": { "assert": "Can access CSSStyleDeclaration through style property" },
-  "read": { "assert": "initial property values are correct" },
-  "csstext_write": {
-    "assert": ["setting cssText adds new properties",
-               "setting cssText removes existing properties",
-               "properties set through cssText are reflected in the computed style"]
-  },
-  "property_write": {
-    "assert": ["setProperty adds new properties",
-               "properties set through setProperty are reflected in the computed style"]
-  },
-  "shorthand_properties": { "assert": "shorthand property is expanded" }
-}
-*/</script>
  <body>
  <noscript>Test not run - javascript required.</noscript>
  <div id="log"></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-001.html
index ad95394..f5dbb56 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-001.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-001.html
@@ -9,30 +9,6 @@
   <meta name="assert" content="MediaLists are serialized according to the specification">
   <script src="/resources/testharness.js" type="text/javascript"></script>
   <script src="/resources/testharnessreport.js" type="text/javascript"></script>
-  <script id="metadata_cache">/*
-  {
-    "mediatest_medialist_serialize_element": {
-      "help": ["http://www.w3.org/TR/cssom-1/#the-medialist-interface",
-               "http://www.w3.org/TR/cssom-1/#serializing-media-queries"],
-      "assert": ["MediaList.mediaText equals the 'media' value of the initial 'style' element."]
-    },
-    "mediatest_medialist_serialize_comma": {
-      "help": ["http://www.w3.org/TR/cssom-1/#the-medialist-interface",
-               "http://www.w3.org/TR/cssom-1/#serializing-media-queries"],
-      "assert": ["To serialize a comma-separated list concatenate all items of the list in list order while separating them by \",\" (U+002C), followed by a space (U+0020)."]
-    },
-    "mediatest_medialist_serialize_empty": {
-      "help": ["http://www.w3.org/TR/cssom-1/#the-medialist-interface",
-               "http://www.w3.org/TR/cssom-1/#serializing-media-queries"],
-      "assert": ["If the media query list is empty return the empty string."]
-    },
-    "mediatest_medialist_serialize_lexicographical": {
-      "help": ["http://www.w3.org/TR/cssom-1/#the-medialist-interface",
-               "http://www.w3.org/TR/cssom-1/#serializing-media-queries"],
-      "assert": ["Each media query in the list of media queries should be sorted in lexicographical order."]
-    }
-  }
-  */</script>
  </head>
  <body>
   <noscript>Test not run - javascript required.</noscript>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-002.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-002.html
index d3dfff8..bba25a1e 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-002.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-002.html
@@ -9,15 +9,6 @@
   <meta name="assert" content="MediaList object has deleteMedium method and it functions properly.">
   <script src="/resources/testharness.js" type="text/javascript"></script>
   <script src="/resources/testharnessreport.js" type="text/javascript"></script>
-
-  <script id="metadata_cache">/*
-  {
-    "deleteMedium_called_without_argument": { "assert": "MediaList.deleteMedium called without argument throws error." },
-    "deleteMedium_removes_correct_medium": { "assert": "MediaList.deleteMedium removes correct medium and updates corresponding properties." },
-    "deleteMedium_no_matching_medium_to_remove": { "assert": "MediaList.deleteMedium doesn't modify MediaList when medium is not found." }
-  }
-*/</script>
-
 </head>
 
 <body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-003.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-003.html
index 717c39d6..649f948 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-003.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-003.html
@@ -10,16 +10,6 @@
   <script src="/resources/testharness.js" type="text/javascript"></script>
   <script src="/resources/testharnessreport.js" type="text/javascript"></script>
  </head>
- <script id="metadata_cache">/*
- {
-   "mediatest_mediaquery_serialize_1": {
-     "assert": ["First explicit example input (first column) and output (second column) in specification."]
-   },
-   "mediatest_mediaquery_serialize_2": {
-     "assert": ["Second explicit example input (first column) and output (second column) in specification."]
-   }
- }
- */</script>
  <body>
   <noscript>Test not run - javascript required.</noscript>
   <div id="log"></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-004.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-004.html
index 2fe6ff9..416addae 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-004.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/medialist-interfaces-004.html
@@ -8,14 +8,6 @@
   <meta name="assert" content="MediaList object has appendMedium method and it functions properly.">
   <script src="/resources/testharness.js" type="text/javascript"></script>
   <script src="/resources/testharnessreport.js" type="text/javascript"></script>
-
-  <script id="metadata_cache">/*
-  {
-    "appendMedium_correctly_appends_medium_to_empty_MediaList": { "assert": "MediaList.appendMedium correctly adds medium to empty MediaList." },
-    "appendMedium_correctly_appends_medium_to_nonempty_MediaList": { "assert": "MediaList.appendMedium correctly adds medium to a MediaList that already has a medium." }
-  }
-*/</script>
-
 </head>
 
 <body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-001.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-001.html
index fb1fde8..79c4850 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-001.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-001.html
@@ -13,31 +13,6 @@
     * { margin: 0; padding: 0; }
   </style>
   <link id="linkElement" rel="stylesheet" href="support/b-green.css">
-<script id="metadata_cache">/*
-{
-  "sheet_property": {
-    "help": "http://www.w3.org/TR/cssom-1/#the-linkstyle-interface",
-    "assert": ["styleElement.sheet exists",
-               "styleElement.sheet is a CSSStyleSheet",
-               "linkElement.sheet exists",
-               "linkElement.sheet is a CSSStyleSheet"]
-  },
-  "CSSStyleSheet_properties": {
-    "assert": ["ownerRule, cssRules, insertRule and deleteRule properties exist on CSSStyleSheet",
-               "ownerRule, cssRules are read only"]
-  },
-  "CSSStyleSheet_property_values": {
-    "help": ["http://www.w3.org/TR/cssom-1/#css-style-sheets",
-             "http://www.w3.org/TR/cssom-1/#cssimportrule"],
-    "assert": "CSSStyleSheet initial property values are correct"
-  },
-  "StyleSheet_properties": {
-    "assert": ["type, disabled, ownerNode, parentStyleSheet, href, title, and media properties exist on StyleSheet",
-               "type, ownerNode, parentStyleSheet, href, title, media properties are read only"]
-  },
-  "StyleSheet_property_values": { "assert": "StyleSheet initial property values are correct" }
-}
-*/</script>
  </head>
  <body>
   <noscript>Test not run - javascript required.</noscript>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-002.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-002.html
index ad5b1ac..51b0eb3 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-002.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/style-sheet-interfaces-002.html
@@ -13,15 +13,6 @@
   <style id="styleElement" type="text/css" media="all" title="internal style sheet" disabled="disabled">
     * { margin: 0; padding: 0; }
   </style>
-  <script id="metadata_cache">/*
-{
-  "add_rule": {
-    "assert": ["Initial rule list is of size 1",
-               "Can add a rule at first index"]
-  },
-  "delete_rule": { "assert": "Can delete rules until rule list is empty" }
-}
-*/</script>
  </head>
  <body>
   <noscript>Test not run - javascript required.</noscript>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/ttwf-cssom-doc-ext-load-count.html b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/ttwf-cssom-doc-ext-load-count.html
index f507a961..5296aa3a 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/cssom/ttwf-cssom-doc-ext-load-count.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/cssom/ttwf-cssom-doc-ext-load-count.html
@@ -11,13 +11,6 @@
     <meta name="assert" content="The styleSheets length attribute must reflect the number of sheets at page load and after dynamically">
     <script src="/resources/testharness.js"></script>
     <script src="/resources/testharnessreport.js"></script>
-    <script id="metadata_cache">/*
-      {
-          "stylesheet.css should be loaded and styleSheets.length === 1": {},
-            "stylesheet.css should be unloaded and styleSheets.length === 0": {},
-              "stylesheet-1.css should be loaded and styleSheets.length === 1": {}
-      }
-    */</script>
 </head>
 <body>
     <div id="log"></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/mediaqueries/test_media_queries.html b/third_party/WebKit/LayoutTests/external/wpt/css/mediaqueries/test_media_queries.html
index e5dbff4..a305d7a 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/mediaqueries/test_media_queries.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/mediaqueries/test_media_queries.html
@@ -8,373 +8,6 @@
   <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/">
   <script type="text/javascript" src="/resources/testharness.js"></script>
   <script type="text/javascript" src="/resources/testharnessreport.js"></script>
-<script id="metadata_cache">/*
-{
-  "subtest_1": { "assert": "query (orientation) should be parseable" },
-  "subtest_2": { "assert": "query not (orientation) should not be parseable" },
-  "subtest_3": { "assert": "query only (orientation) should not be parseable" },
-  "subtest_4": { "assert": "query all and (orientation) should be parseable" },
-  "subtest_5": { "assert": "query not all and (orientation) should be parseable" },
-  "subtest_6": { "assert": "query only all and (orientation) should be parseable" },
-  "subtest_7": { "assert": "expression width should be parseable" },
-  "subtest_8": { "assert": "expression width: 0 should be parseable" },
-  "subtest_9": { "assert": "expression width: 0px should be parseable" },
-  "subtest_10": { "assert": "expression width: 0em should be parseable" },
-  "subtest_11": { "assert": "expression width: -0 should be parseable" },
-  "subtest_12": { "assert": "expression min-width: -0 should be parseable" },
-  "subtest_13": { "assert": "expression max-width: -0 should be parseable" },
-  "subtest_14": { "assert": "expression width: -0cm should be parseable" },
-  "subtest_15": { "assert": "expression width: 1px should be parseable" },
-  "subtest_16": { "assert": "expression width: 0.001mm should be parseable" },
-  "subtest_17": { "assert": "expression width: 100000px should be parseable" },
-  "subtest_18": { "assert": "expression width: -1px should not be parseable" },
-  "subtest_19": { "assert": "expression min-width: -1px should not be parseable" },
-  "subtest_20": { "assert": "expression max-width: -1px should not be parseable" },
-  "subtest_21": { "assert": "expression width: -0.00001mm should not be parseable" },
-  "subtest_22": { "assert": "expression width: -100000em should not be parseable" },
-  "subtest_23": { "assert": "expression min-width should not be parseable" },
-  "subtest_24": { "assert": "expression max-width should not be parseable" },
-  "subtest_25": { "assert": "expression height should be parseable" },
-  "subtest_26": { "assert": "expression height: 0 should be parseable" },
-  "subtest_27": { "assert": "expression height: 0px should be parseable" },
-  "subtest_28": { "assert": "expression height: 0em should be parseable" },
-  "subtest_29": { "assert": "expression height: -0 should be parseable" },
-  "subtest_30": { "assert": "expression min-height: -0 should be parseable" },
-  "subtest_31": { "assert": "expression max-height: -0 should be parseable" },
-  "subtest_32": { "assert": "expression height: -0cm should be parseable" },
-  "subtest_33": { "assert": "expression height: 1px should be parseable" },
-  "subtest_34": { "assert": "expression height: 0.001mm should be parseable" },
-  "subtest_35": { "assert": "expression height: 100000px should be parseable" },
-  "subtest_36": { "assert": "expression height: -1px should not be parseable" },
-  "subtest_37": { "assert": "expression min-height: -1px should not be parseable" },
-  "subtest_38": { "assert": "expression max-height: -1px should not be parseable" },
-  "subtest_39": { "assert": "expression height: -0.00001mm should not be parseable" },
-  "subtest_40": { "assert": "expression height: -100000em should not be parseable" },
-  "subtest_41": { "assert": "expression min-height should not be parseable" },
-  "subtest_42": { "assert": "expression max-height should not be parseable" },
-  "subtest_43": { "assert": "expression device-width should be parseable" },
-  "subtest_44": { "assert": "expression device-width: 0 should be parseable" },
-  "subtest_45": { "assert": "expression device-width: 0px should be parseable" },
-  "subtest_46": { "assert": "expression device-width: 0em should be parseable" },
-  "subtest_47": { "assert": "expression device-width: -0 should be parseable" },
-  "subtest_48": { "assert": "expression min-device-width: -0 should be parseable" },
-  "subtest_49": { "assert": "expression max-device-width: -0 should be parseable" },
-  "subtest_50": { "assert": "expression device-width: -0cm should be parseable" },
-  "subtest_51": { "assert": "expression device-width: 1px should be parseable" },
-  "subtest_52": { "assert": "expression device-width: 0.001mm should be parseable" },
-  "subtest_53": { "assert": "expression device-width: 100000px should be parseable" },
-  "subtest_54": { "assert": "expression device-width: -1px should not be parseable" },
-  "subtest_55": { "assert": "expression min-device-width: -1px should not be parseable" },
-  "subtest_56": { "assert": "expression max-device-width: -1px should not be parseable" },
-  "subtest_57": { "assert": "expression device-width: -0.00001mm should not be parseable" },
-  "subtest_58": { "assert": "expression device-width: -100000em should not be parseable" },
-  "subtest_59": { "assert": "expression min-device-width should not be parseable" },
-  "subtest_60": { "assert": "expression max-device-width should not be parseable" },
-  "subtest_61": { "assert": "expression device-height should be parseable" },
-  "subtest_62": { "assert": "expression device-height: 0 should be parseable" },
-  "subtest_63": { "assert": "expression device-height: 0px should be parseable" },
-  "subtest_64": { "assert": "expression device-height: 0em should be parseable" },
-  "subtest_65": { "assert": "expression device-height: -0 should be parseable" },
-  "subtest_66": { "assert": "expression min-device-height: -0 should be parseable" },
-  "subtest_67": { "assert": "expression max-device-height: -0 should be parseable" },
-  "subtest_68": { "assert": "expression device-height: -0cm should be parseable" },
-  "subtest_69": { "assert": "expression device-height: 1px should be parseable" },
-  "subtest_70": { "assert": "expression device-height: 0.001mm should be parseable" },
-  "subtest_71": { "assert": "expression device-height: 100000px should be parseable" },
-  "subtest_72": { "assert": "expression device-height: -1px should not be parseable" },
-  "subtest_73": { "assert": "expression min-device-height: -1px should not be parseable" },
-  "subtest_74": { "assert": "expression max-device-height: -1px should not be parseable" },
-  "subtest_75": { "assert": "expression device-height: -0.00001mm should not be parseable" },
-  "subtest_76": { "assert": "expression device-height: -100000em should not be parseable" },
-  "subtest_77": { "assert": "expression min-device-height should not be parseable" },
-  "subtest_78": { "assert": "expression max-device-height should not be parseable" },
-  "subtest_79": { "assert": "all and (width: 117px) should apply" },
-  "subtest_80": { "assert": "all and (width: 118px) should not apply" },
-  "subtest_81": { "assert": "all and (width: 116px) should not apply" },
-  "subtest_82": { "assert": "all and (min-width: 117px) should apply" },
-  "subtest_83": { "assert": "all and (min-width: 118px) should not apply" },
-  "subtest_84": { "assert": "all and (min-width: 116px) should apply" },
-  "subtest_85": { "assert": "all and (max-width: 117px) should apply" },
-  "subtest_86": { "assert": "all and (max-width: 118px) should apply" },
-  "subtest_87": { "assert": "all and (max-width: 116px) should not apply" },
-  "subtest_88": { "assert": "all and (min-width: 9em) should not apply" },
-  "subtest_89": { "assert": "all and (min-width: 6em) should apply" },
-  "subtest_90": { "assert": "all and (max-width: 9em) should apply" },
-  "subtest_91": { "assert": "all and (max-width: 6em) should not apply" },
-  "subtest_92": { "assert": "all and (height: 76px) should apply" },
-  "subtest_93": { "assert": "all and (height: 77px) should not apply" },
-  "subtest_94": { "assert": "all and (height: 75px) should not apply" },
-  "subtest_95": { "assert": "all and (min-height: 76px) should apply" },
-  "subtest_96": { "assert": "all and (min-height: 77px) should not apply" },
-  "subtest_97": { "assert": "all and (min-height: 75px) should apply" },
-  "subtest_98": { "assert": "all and (max-height: 76px) should apply" },
-  "subtest_99": { "assert": "all and (max-height: 77px) should apply" },
-  "subtest_100": { "assert": "all and (max-height: 75px) should not apply" },
-  "subtest_101": { "assert": "all and (min-height: 6em) should not apply" },
-  "subtest_102": { "assert": "all and (min-height: 3em) should apply" },
-  "subtest_103": { "assert": "all and (max-height: 6em) should apply" },
-  "subtest_104": { "assert": "all and (max-height: 3em) should not apply" },
-  "subtest_105": { "assert": "all and (device-width: 1920px) should apply" },
-  "subtest_106": { "assert": "all and (device-width: 1921px) should not apply" },
-  "subtest_107": { "assert": "all and (device-width: 1919px) should not apply" },
-  "subtest_108": { "assert": "all and (min-device-width: 1920px) should apply" },
-  "subtest_109": { "assert": "all and (min-device-width: 1921px) should not apply" },
-  "subtest_110": { "assert": "all and (min-device-width: 1919px) should apply" },
-  "subtest_111": { "assert": "all and (max-device-width: 1920px) should apply" },
-  "subtest_112": { "assert": "all and (max-device-width: 1921px) should apply" },
-  "subtest_113": { "assert": "all and (max-device-width: 1919px) should not apply" },
-  "subtest_114": { "assert": "all and (min-device-width: 121em) should not apply" },
-  "subtest_115": { "assert": "all and (min-device-width: 119em) should apply" },
-  "subtest_116": { "assert": "all and (max-device-width: 121em) should apply" },
-  "subtest_117": { "assert": "all and (max-device-width: 119em) should not apply" },
-  "subtest_118": { "assert": "all and (device-height: 1200px) should apply" },
-  "subtest_119": { "assert": "all and (device-height: 1201px) should not apply" },
-  "subtest_120": { "assert": "all and (device-height: 1199px) should not apply" },
-  "subtest_121": { "assert": "all and (min-device-height: 1200px) should apply" },
-  "subtest_122": { "assert": "all and (min-device-height: 1201px) should not apply" },
-  "subtest_123": { "assert": "all and (min-device-height: 1199px) should apply" },
-  "subtest_124": { "assert": "all and (max-device-height: 1200px) should apply" },
-  "subtest_125": { "assert": "all and (max-device-height: 1201px) should apply" },
-  "subtest_126": { "assert": "all and (max-device-height: 1199px) should not apply" },
-  "subtest_127": { "assert": "all and (min-device-height: 76em) should not apply" },
-  "subtest_128": { "assert": "all and (min-device-height: 74em) should apply" },
-  "subtest_129": { "assert": "all and (max-device-height: 76em) should apply" },
-  "subtest_130": { "assert": "all and (max-device-height: 74em) should not apply" },
-  "subtest_131": { "assert": "all and (height) should apply" },
-  "subtest_132": { "assert": "all and (width) should not apply" },
-  "subtest_133": { "assert": "all and (height) should not apply" },
-  "subtest_134": { "assert": "all and (width) should not apply" },
-  "subtest_135": { "assert": "all and (device-height) should apply" },
-  "subtest_136": { "assert": "all and (device-width) should apply" },
-  "subtest_137": { "assert": "all and (height) should not apply" },
-  "subtest_138": { "assert": "all and (width) should apply" },
-  "subtest_139": { "assert": "all and (height) should apply" },
-  "subtest_140": { "assert": "all and (width) should apply" },
-  "subtest_141": { "assert": "expression orientation should be parseable" },
-  "subtest_142": { "assert": "expression orientation: portrait should be parseable" },
-  "subtest_143": { "assert": "expression orientation: landscape should be parseable" },
-  "subtest_144": { "assert": "expression min-orientation should not be parseable" },
-  "subtest_145": { "assert": "expression min-orientation: portrait should not be parseable" },
-  "subtest_146": { "assert": "expression min-orientation: landscape should not be parseable" },
-  "subtest_147": { "assert": "expression max-orientation should not be parseable" },
-  "subtest_148": { "assert": "expression max-orientation: portrait should not be parseable" },
-  "subtest_149": { "assert": "expression max-orientation: landscape should not be parseable" },
-  "subtest_150": { "assert": "(orientation) should apply" },
-  "subtest_151": { "assert": "(orientation: landscape) should apply" },
-  "subtest_152": { "assert": "(orientation: portrait) should not apply" },
-  "subtest_153": { "assert": "not all and (orientation: portrait) should apply" },
-  "subtest_154": { "assert": "(orientation) should apply" },
-  "subtest_155": { "assert": "(orientation: landscape) should not apply" },
-  "subtest_156": { "assert": "not all and (orientation: landscape) should apply" },
-  "subtest_157": { "assert": "(orientation: portrait) should apply" },
-  "subtest_158": { "assert": "(aspect-ratio: 59/80) should apply" },
-  "subtest_159": { "assert": "(aspect-ratio: 58/80) should not apply" },
-  "subtest_160": { "assert": "(aspect-ratio: 59/81) should not apply" },
-  "subtest_161": { "assert": "(aspect-ratio: 60/80) should not apply" },
-  "subtest_162": { "assert": "(aspect-ratio: 59/79) should not apply" },
-  "subtest_163": { "assert": "(aspect-ratio: 177/240) should apply" },
-  "subtest_164": { "assert": "(aspect-ratio: 413/560) should apply" },
-  "subtest_165": { "assert": "(aspect-ratio: 5900/8000) should apply" },
-  "subtest_166": { "assert": "(aspect-ratio: 5901/8000) should not apply" },
-  "subtest_167": { "assert": "(aspect-ratio: 5899/8000) should not apply" },
-  "subtest_168": { "assert": "(aspect-ratio: 5900/8001) should not apply" },
-  "subtest_169": { "assert": "(aspect-ratio: 5900/7999) should not apply" },
-  "subtest_170": { "assert": "(aspect-ratio) should apply" },
-  "subtest_171": { "assert": "(min-aspect-ratio: 59/80) should apply" },
-  "subtest_172": { "assert": "(min-aspect-ratio: 58/80) should apply" },
-  "subtest_173": { "assert": "(min-aspect-ratio: 59/81) should apply" },
-  "subtest_174": { "assert": "(min-aspect-ratio: 60/80) should not apply" },
-  "subtest_175": { "assert": "(min-aspect-ratio: 59/79) should not apply" },
-  "subtest_176": { "assert": "expression min-aspect-ratio should not be parseable" },
-  "subtest_177": { "assert": "(max-aspect-ratio: 59/80) should apply" },
-  "subtest_178": { "assert": "(max-aspect-ratio: 58/80) should not apply" },
-  "subtest_179": { "assert": "(max-aspect-ratio: 59/81) should not apply" },
-  "subtest_180": { "assert": "(max-aspect-ratio: 60/80) should apply" },
-  "subtest_181": { "assert": "(max-aspect-ratio: 59/79) should apply" },
-  "subtest_182": { "assert": "expression max-aspect-ratio should not be parseable" },
-  "subtest_183": { "assert": "(device-aspect-ratio: 1920/1200) should apply" },
-  "subtest_184": { "assert": "not all and (device-aspect-ratio: 1921/1200) should apply" },
-  "subtest_185": { "assert": "all and (device-aspect-ratio: 1920/1199) should not apply" },
-  "subtest_186": { "assert": "all and (device-aspect-ratio: 1919/1200) should not apply" },
-  "subtest_187": { "assert": "not all and (device-aspect-ratio: 1920/1201) should apply" },
-  "subtest_188": { "assert": "(device-aspect-ratio) should apply" },
-  "subtest_189": { "assert": "(min-device-aspect-ratio: 1920/1200) should apply" },
-  "subtest_190": { "assert": "all and (min-device-aspect-ratio: 1921/1200) should not apply" },
-  "subtest_191": { "assert": "not all and (min-device-aspect-ratio: 1920/1199) should apply" },
-  "subtest_192": { "assert": "not all and (min-device-aspect-ratio: 1919/1200) should not apply" },
-  "subtest_193": { "assert": "all and (min-device-aspect-ratio: 1920/1201) should apply" },
-  "subtest_194": { "assert": "expression min-device-aspect-ratio should not be parseable" },
-  "subtest_195": { "assert": "all and (max-device-aspect-ratio: 1920/1200) should apply" },
-  "subtest_196": { "assert": "(max-device-aspect-ratio: 1921/1200) should apply" },
-  "subtest_197": { "assert": "(max-device-aspect-ratio: 1920/1199) should apply" },
-  "subtest_198": { "assert": "all and (max-device-aspect-ratio: 1919/1200) should not apply" },
-  "subtest_199": { "assert": "not all and (max-device-aspect-ratio: 1920/1201) should apply" },
-  "subtest_200": { "assert": "expression max-device-aspect-ratio should not be parseable" },
-  "subtest_201": { "assert": "expression max-aspect-ratio: 1/1 should be parseable" },
-  "subtest_202": { "assert": "expression max-aspect-ratio: 1  /1 should be parseable" },
-  "subtest_203": { "assert": "expression max-aspect-ratio: 1  / \t\n1 should be parseable" },
-  "subtest_204": { "assert": "expression max-aspect-ratio: 1/\r1 should be parseable" },
-  "subtest_205": { "assert": "expression max-aspect-ratio: 1 should not be parseable" },
-  "subtest_206": { "assert": "expression max-aspect-ratio: 0.5 should not be parseable" },
-  "subtest_207": { "assert": "expression max-aspect-ratio: 1.0/1 should not be parseable" },
-  "subtest_208": { "assert": "expression max-aspect-ratio: 1/1.0 should not be parseable" },
-  "subtest_209": { "assert": "expression max-aspect-ratio: 1.0/1.0 should not be parseable" },
-  "subtest_210": { "assert": "expression max-aspect-ratio: 0/1 should not be parseable" },
-  "subtest_211": { "assert": "expression max-aspect-ratio: 1/0 should not be parseable" },
-  "subtest_212": { "assert": "expression max-aspect-ratio: 0/0 should not be parseable" },
-  "subtest_213": { "assert": "expression max-aspect-ratio: -1/1 should not be parseable" },
-  "subtest_214": { "assert": "expression max-aspect-ratio: 1/-1 should not be parseable" },
-  "subtest_215": { "assert": "expression max-aspect-ratio: -1/-1 should not be parseable" },
-  "subtest_216": { "assert": "expression device-aspect-ratio: 1/1 should be parseable" },
-  "subtest_217": { "assert": "expression device-aspect-ratio: 1  /1 should be parseable" },
-  "subtest_218": { "assert": "expression device-aspect-ratio: 1  / \t\n1 should be parseable" },
-  "subtest_219": { "assert": "expression device-aspect-ratio: 1/\r1 should be parseable" },
-  "subtest_220": { "assert": "expression device-aspect-ratio: 1 should not be parseable" },
-  "subtest_221": { "assert": "expression device-aspect-ratio: 0.5 should not be parseable" },
-  "subtest_222": { "assert": "expression device-aspect-ratio: 1.0/1 should not be parseable" },
-  "subtest_223": { "assert": "expression device-aspect-ratio: 1/1.0 should not be parseable" },
-  "subtest_224": { "assert": "expression device-aspect-ratio: 1.0/1.0 should not be parseable" },
-  "subtest_225": { "assert": "expression device-aspect-ratio: 0/1 should not be parseable" },
-  "subtest_226": { "assert": "expression device-aspect-ratio: 1/0 should not be parseable" },
-  "subtest_227": { "assert": "expression device-aspect-ratio: 0/0 should not be parseable" },
-  "subtest_228": { "assert": "expression device-aspect-ratio: -1/1 should not be parseable" },
-  "subtest_229": { "assert": "expression device-aspect-ratio: 1/-1 should not be parseable" },
-  "subtest_230": { "assert": "expression device-aspect-ratio: -1/-1 should not be parseable" },
-  "monochrome_and_color": {},
-  "find_depth": {},
-  "subtest_231": { "assert": "all and (color:8) should apply" },
-  "subtest_232": { "assert": "all and (color:7) should not apply" },
-  "subtest_233": { "assert": "all and (color:9) should not apply" },
-  "subtest_234": { "assert": "all and (max-color:8) should apply" },
-  "subtest_235": { "assert": "all and (max-color:7) should not apply" },
-  "subtest_236": { "assert": "all and (max-color:9) should apply" },
-  "subtest_237": { "assert": "all and (color) should apply" },
-  "subtest_238": { "assert": "expression max-color should not be parseable" },
-  "subtest_239": { "assert": "expression min-color should not be parseable" },
-  "subtest_240": { "assert": "all and (monochrome) should not apply" },
-  "subtest_241": { "assert": "expression max-monochrome should not be parseable" },
-  "subtest_242": { "assert": "expression min-monochrome should not be parseable" },
-  "subtest_243": { "assert": "not all and (monochrome) should apply" },
-  "subtest_244": { "assert": "not all and (color) should not apply" },
-  "subtest_245": { "assert": "only all and (color) should apply" },
-  "subtest_246": { "assert": "only all and (monochrome) should not apply" },
-  "subtest_247": { "assert": "expression color: 1 should be parseable" },
-  "subtest_248": { "assert": "expression color: 327 should be parseable" },
-  "subtest_249": { "assert": "expression color: 0 should be parseable" },
-  "subtest_250": { "assert": "expression color: 1.0 should not be parseable" },
-  "subtest_251": { "assert": "expression color: -1 should not be parseable" },
-  "subtest_252": { "assert": "expression color: 1/1 should not be parseable" },
-  "subtest_253": { "assert": "expression min-monochrome: 1 should be parseable" },
-  "subtest_254": { "assert": "expression min-monochrome: 327 should be parseable" },
-  "subtest_255": { "assert": "expression min-monochrome: 0 should be parseable" },
-  "subtest_256": { "assert": "expression min-monochrome: 1.0 should not be parseable" },
-  "subtest_257": { "assert": "expression min-monochrome: -1 should not be parseable" },
-  "subtest_258": { "assert": "expression min-monochrome: 1/1 should not be parseable" },
-  "subtest_259": { "assert": "expression max-color-index: 1 should be parseable" },
-  "subtest_260": { "assert": "expression max-color-index: 327 should be parseable" },
-  "subtest_261": { "assert": "expression max-color-index: 0 should be parseable" },
-  "subtest_262": { "assert": "expression max-color-index: 1.0 should not be parseable" },
-  "subtest_263": { "assert": "expression max-color-index: -1 should not be parseable" },
-  "subtest_264": { "assert": "expression max-color-index: 1/1 should not be parseable" },
-  "subtest_265": { "assert": "(color-index: 0) should apply" },
-  "subtest_266": { "assert": "(color-index: 1) should not apply" },
-  "subtest_267": { "assert": "(min-color-index: 0) should apply" },
-  "subtest_268": { "assert": "(min-color-index: 1) should not apply" },
-  "subtest_269": { "assert": "(max-color-index: 0) should apply" },
-  "subtest_270": { "assert": "(max-color-index: 1) should apply" },
-  "subtest_271": { "assert": "(max-color-index: 157) should apply" },
-  "subtest_272": { "assert": "expression resolution: 3dpi should be parseable" },
-  "subtest_273": { "assert": "expression resolution:3dpi should be parseable" },
-  "subtest_274": { "assert": "expression resolution: 3.0dpi should be parseable" },
-  "subtest_275": { "assert": "expression resolution: 3.4dpi should be parseable" },
-  "subtest_276": { "assert": "expression resolution\t: 120dpcm should be parseable" },
-  "subtest_277": { "assert": "expression resolution: 0dpi should not be parseable" },
-  "subtest_278": { "assert": "expression resolution: -3dpi should not be parseable" },
-  "subtest_279": { "assert": "expression min-resolution: 3dpi should be parseable" },
-  "subtest_280": { "assert": "expression min-resolution:3dpi should be parseable" },
-  "subtest_281": { "assert": "expression min-resolution: 3.0dpi should be parseable" },
-  "subtest_282": { "assert": "expression min-resolution: 3.4dpi should be parseable" },
-  "subtest_283": { "assert": "expression min-resolution\t: 120dpcm should be parseable" },
-  "subtest_284": { "assert": "expression min-resolution: 0dpi should not be parseable" },
-  "subtest_285": { "assert": "expression min-resolution: -3dpi should not be parseable" },
-  "subtest_286": { "assert": "expression max-resolution: 3dpi should be parseable" },
-  "subtest_287": { "assert": "expression max-resolution:3dpi should be parseable" },
-  "subtest_288": { "assert": "expression max-resolution: 3.0dpi should be parseable" },
-  "subtest_289": { "assert": "expression max-resolution: 3.4dpi should be parseable" },
-  "subtest_290": { "assert": "expression max-resolution\t: 120dpcm should be parseable" },
-  "subtest_291": { "assert": "expression max-resolution: 0dpi should not be parseable" },
-  "subtest_292": { "assert": "expression max-resolution: -3dpi should not be parseable" },
-  "find_resolution": {},
-  "subtest_293": { "assert": "(resolution: 133dpi) should apply" },
-  "subtest_294": { "assert": "(resolution: 134dpi) should not apply" },
-  "subtest_295": { "assert": "(resolution: 132dpi) should not apply" },
-  "subtest_296": { "assert": "(min-resolution: 132dpi) should apply" },
-  "subtest_297": { "assert": "not all and (min-resolution: 132dpi) should not apply" },
-  "subtest_298": { "assert": "not all and (min-resolution: 134dpi) should apply" },
-  "subtest_299": { "assert": "all and (min-resolution: 134dpi) should not apply" },
-  "subtest_300": { "assert": "(min-resolution: 51dpcm) should apply" },
-  "subtest_301": { "assert": "(max-resolution: 53dpcm) should apply" },
-  "subtest_302": { "assert": "(max-resolution: 51dpcm) should not apply" },
-  "subtest_303": { "assert": "not all and (min-resolution: 53dpcm) should apply" },
-  "subtest_304": { "assert": "expression scan should be parseable" },
-  "subtest_305": { "assert": "expression scan: progressive should be parseable" },
-  "subtest_306": { "assert": "expression scan:interlace should be parseable" },
-  "subtest_307": { "assert": "expression min-scan:interlace should not be parseable" },
-  "subtest_308": { "assert": "expression scan: 1 should not be parseable" },
-  "subtest_309": { "assert": "expression max-scan should not be parseable" },
-  "subtest_310": { "assert": "expression max-scan: progressive should not be parseable" },
-  "subtest_311": { "assert": "(scan) should not apply" },
-  "subtest_312": { "assert": "(scan: progressive) should not apply" },
-  "subtest_313": { "assert": "(scan: interlace) should not apply" },
-  "subtest_314": { "assert": "not all and (scan) should apply" },
-  "subtest_315": { "assert": "not all and (scan: progressive) should apply" },
-  "subtest_316": { "assert": "not all and (scan: interlace) should apply" },
-  "subtest_317": { "assert": "expression grid should be parseable" },
-  "subtest_318": { "assert": "expression grid: 0 should be parseable" },
-  "subtest_319": { "assert": "expression grid: 1 should be parseable" },
-  "subtest_320": { "assert": "expression grid: 1 should be parseable" },
-  "subtest_321": { "assert": "expression min-grid should not be parseable" },
-  "subtest_322": { "assert": "expression min-grid:0 should not be parseable" },
-  "subtest_323": { "assert": "expression max-grid: 1 should not be parseable" },
-  "subtest_324": { "assert": "expression grid: 2 should not be parseable" },
-  "subtest_325": { "assert": "expression grid: -1 should not be parseable" },
-  "subtest_326": { "assert": "(grid) should not apply" },
-  "subtest_327": { "assert": "(grid: 0) should apply" },
-  "subtest_328": { "assert": "(grid: 1) should not apply" },
-  "subtest_329": { "assert": "(grid: 2) should not apply" },
-  "subtest_330": { "assert": "(grid: -1) should not apply" },
-  "subtest_331": { "assert": "(orientation should apply" },
-  "subtest_332": { "assert": "not all and (orientation should not apply" },
-  "subtest_333": { "assert": "(orientation: should not apply" },
-  "subtest_334": { "assert": "all,(orientation: should apply" },
-  "subtest_335": { "assert": "(orientation:,all should not apply" },
-  "subtest_336": { "assert": "not all and (grid should apply" },
-  "subtest_337": { "assert": "only all and (grid should not apply" },
-  "subtest_338": { "assert": "(grid should not apply" },
-  "subtest_339": { "assert": "all,(grid should apply" },
-  "subtest_340": { "assert": "(grid,all should not apply" },
-  "subtest_341": { "assert": ",all should apply" },
-  "subtest_342": { "assert": "all, should apply" },
-  "subtest_343": { "assert": ",all, should apply" },
-  "subtest_344": { "assert": "all,badmedium should apply" },
-  "subtest_345": { "assert": "badmedium,all should apply" },
-  "subtest_346": { "assert": ",badmedium, should not apply" },
-  "subtest_347": { "assert": "all,(badexpression) should apply" },
-  "subtest_348": { "assert": "(badexpression),all should apply" },
-  "subtest_349": { "assert": "(badexpression),badmedium should not apply" },
-  "subtest_350": { "assert": "badmedium,(badexpression) should not apply" },
-  "subtest_351": { "assert": "all,[badsyntax] should apply" },
-  "subtest_352": { "assert": "[badsyntax],all should apply" },
-  "subtest_353": { "assert": "badmedium,[badsyntax] should not apply" },
-  "subtest_354": { "assert": "[badsyntax],badmedium should not apply" },
-  "subtest_355": { "assert": "query all and color : should not be parseable" },
-  "subtest_356": { "assert": "query all and color : 1 should not be parseable" },
-  "subtest_357": { "assert": "all and min-color : 1 should not apply" },
-  "subtest_358": { "assert": "(bogus) should not apply" },
-  "subtest_359": { "assert": "not all and (bogus) should not apply" },
-  "subtest_360": { "assert": "only all and (bogus) should not apply" }
-}
-*/</script>
 </head>
 <body onload="run()">
 <div id=log></div>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/feature-policy/autoplay-disabled-by-feature-policy.https.sub.html b/third_party/WebKit/LayoutTests/external/wpt/feature-policy/autoplay-disabled-by-feature-policy.https.sub.html
index 7761246e..3dd3afbf 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/feature-policy/autoplay-disabled-by-feature-policy.https.sub.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/feature-policy/autoplay-disabled-by-feature-policy.https.sub.html
@@ -17,10 +17,10 @@
   async_test(t => {
     simulateGesture(t, () => {
       isAutoplayAllowed().then(t.step_func_done((result) => {
-        assert_false(result);
+        assert_true(result);
       }));
     });
-  }, header + ' disallows the top-level document.');
+  }, header + ' has no effect on the top level document.');
 
   async_test(t => {
     simulateGesture(t, () => {
diff --git a/third_party/WebKit/LayoutTests/media/track/text-track-cue-constructor.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/constructor.html
similarity index 80%
rename from third_party/WebKit/LayoutTests/media/track/text-track-cue-constructor.html
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/constructor.html
index 70860a8..c066f60 100644
--- a/third_party/WebKit/LayoutTests/media/track/text-track-cue-constructor.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/interfaces/TextTrackCue/constructor.html
@@ -2,8 +2,8 @@
 <html>
     <head>
         <title>TextTrackCue constructor</title>
-        <script src="../../resources/testharness.js"></script>
-        <script src="../../resources/testharnessreport.js"></script>
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
     </head>
     <body>
         <script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/captions-html.vtt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/captions-html.vtt
new file mode 100644
index 0000000..0730f8b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/captions-html.vtt
@@ -0,0 +1,18 @@
+WEBVTT
+
+1
+00:00:00.000 --> 00:00:01.000
+Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,
+
+2
+00:00:03.000 --> 00:00:04.000
+consectetuer adipiscing elit,
+
+3
+00:00:05.000 --> 00:00:06.000
+sed diam nonummy nibh euismod tincidunt
+
+4
+00:00:07.000 --> 00:00:08.000
+ut laoreet dolore magna aliquam erat volutpat.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/captions.vtt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/captions.vtt
new file mode 100644
index 0000000..787c430
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/captions.vtt
@@ -0,0 +1,18 @@
+WEBVTT
+
+1
+00:00:00.000 --> 00:00:01.000
+Lorem
+
+2
+00:00:01.000 --> 00:00:02.000
+ipsum
+
+3
+00:00:02.000 --> 00:00:03.000
+dolor
+
+4
+00:00:03.000 --> 00:00:04.000
+sit
+
diff --git a/third_party/WebKit/LayoutTests/media/track/captions-webvtt/cues-overlapping.vtt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/cues-overlapping.vtt
similarity index 100%
rename from third_party/WebKit/LayoutTests/media/track/captions-webvtt/cues-overlapping.vtt
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/cues-overlapping.vtt
diff --git a/third_party/WebKit/LayoutTests/media/track/captions-webvtt/missed-cues.vtt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/missed-cues.vtt
similarity index 100%
rename from third_party/WebKit/LayoutTests/media/track/captions-webvtt/missed-cues.vtt
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/missed-cues.vtt
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/sorted-dispatch.vtt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/sorted-dispatch.vtt
new file mode 100644
index 0000000..438ea6a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/resources/sorted-dispatch.vtt
@@ -0,0 +1,34 @@
+WEBVTT
+Enter and exit events should be dispatched in a sorted order according to their times.
+
+0
+00:00:04.000 --> 00:00:04.500
+Missed cue that should not be considered because of seeking.
+
+1
+00:00:05.100 --> 00:00:05.800 align:start position:20%
+Bear is Coming!!!!!
+
+2
+00:00:05.100 --> 00:00:05.101
+Missed cue 1
+
+3
+00:00:05.100 --> 00:00:05.301
+And what kind of a bear it is - just have look.
+
+4
+00:00:05.100 --> 00:00:05.101
+Missed Cue 2
+
+5
+00:00:05.300 --> 00:00:05.800 align:start position:20%
+I said Bear is coming!!!!
+
+6
+00:00:05.990 --> 00:00:05.993 align:start position:20%
+I said Bear is coming now!!!!
+
+7
+00:00:05.994 --> 00:00:05.998 align:start position:20%
+Bear is already here
diff --git a/third_party/WebKit/LayoutTests/media/track/track-add-remove-cue.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-add-remove-cue.html
similarity index 93%
rename from third_party/WebKit/LayoutTests/media/track/track-add-remove-cue.html
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-add-remove-cue.html
index 222bfb0b..1e6c557 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-add-remove-cue.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-add-remove-cue.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
-<title>Tests TextTrack's addCue and removeCue.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
+<title>TextTrack's addCue and removeCue</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var video = document.createElement("video");
@@ -84,7 +84,7 @@
         assert_equals(cues[2].startTime, 31);
     });
 
-    trackElement.src = "captions-webvtt/tc013-settings.vtt";
+    trackElement.src = "resources/settings.vtt";
     trackElement.kind = "captions";
     trackElement.default = true;
     video.appendChild(trackElement);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-add-track.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-add-track.html
similarity index 79%
rename from third_party/WebKit/LayoutTests/media/track/track-add-track.html
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-add-track.html
index 412dcdc..7f8ee2f 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-add-track.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-add-track.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
-<title>Tests that the 'addtrack' event is fired when a TextTrack is created.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
+<title>'addtrack' event is fired when a TextTrack is created</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 async_test(function(t) {
     var video = document.createElement('video');
@@ -26,7 +26,7 @@
         }
     });
 
-    trackElement.src = 'captions-webvtt/tc004-webvtt-file.vtt';
+    trackElement.src = 'resources/webvtt-file.vtt';
     trackElement.track.mode = 'hidden';
     assert_equals(video.textTracks.length, 1);
     assert_equals(trackElement.readyState, HTMLTrackElement.NONE);
diff --git a/third_party/WebKit/LayoutTests/media/track/track-addtrack-kind.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-addtrack-kind.html
similarity index 74%
rename from third_party/WebKit/LayoutTests/media/track/track-addtrack-kind.html
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-addtrack-kind.html
index 3fc89017..4503a06b 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-addtrack-kind.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-addtrack-kind.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
-<title>Tests that the addTextTrack() only accepts known "kind" values.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
+<title>addTextTrack() only accepts known "kind" values</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 test(function() {
     var trackCount = 0;
@@ -10,7 +10,7 @@
         video.addTextTrack(type);
         assert_equals(video.textTracks.length, ++trackCount);
     }
-    
+
     var video = document.createElement("video");
     assert_equals(video.textTracks.length, 0);
     assert_throws(new TypeError(), function() { video.addTextTrack("kaptions"); });
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-empty-crash.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-empty.html
similarity index 72%
rename from third_party/WebKit/LayoutTests/media/track/track-cue-empty-crash.html
rename to third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-empty.html
index e7869cf..59f8fc6 100644
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-empty-crash.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-empty.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
-<title>Tests that having an empty cue does not crash when calling getCueAsHTML().</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
+<title>Invoke getCueAsHTML() on an empty cue</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
 <script>
 test(function() {
     var emptyCue = new VTTCue(0, 0, "");
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-inline.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-inline.html
new file mode 100644
index 0000000..3b4c354
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-inline.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>Add a track and change its mode through JS</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<video>
+    <source src="/media/test.mp4" type="video/mp4">
+    <source src="/media/test.ogv" type="video/ogg">
+</video>
+<script>
+test(function() {
+    var video = document.querySelector('video');
+    var track = video.addTextTrack('captions', 'English', 'en');
+    track.addCue(new VTTCue(0.0, 10.0, 'wow wow'));
+    track.mode = 'showing';
+});
+</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable-fragment.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable-fragment.html
new file mode 100644
index 0000000..713e781
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable-fragment.html
@@ -0,0 +1,85 @@
+<!DOCTYPE html>
+<title>Cue fragment is mutable</title>
+<script src="/common/media.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<style>
+p, div { display: none; }
+</style>
+<video>
+    <track src="resources/captions-html.vtt" kind="captions" default>
+    <script>
+        async_test(function(t) {
+            var video = document.querySelector("video");
+            var testTrack = document.querySelector("track");
+
+            video.oncanplaythrough = t.step_func(testMutability);
+            testTrack.onload = t.step_func(testMutability);
+
+            var fragment;
+            var eventCount = 0;
+            function testMutability() {
+                eventCount++;
+                if (eventCount != 2)
+                    return;
+
+                var testCue = testTrack.track.cues[0];
+
+                // Test initial cue contents.
+                assert_equals(testCue.text, "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,");
+
+                // Cue getCueAsHTML() should return a correct fragment.
+                createExpectedFragment(document.createDocumentFragment());
+                assert_true(fragment.isEqualNode(testCue.getCueAsHTML()));
+
+                // Appending getCuesAsHTML() twice to the DOM should be succesful.
+                document.getElementsByTagName("div")[0].appendChild(testCue.getCueAsHTML());
+                document.getElementsByTagName("div")[1].appendChild(testCue.getCueAsHTML());
+
+                createExpectedFragment(document.createElement("div"));
+                assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[0]));
+                assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[1]));
+
+                // The fragment returned by getCuesAsHTML() should be independently mutable.
+                document.getElementsByTagName("div")[0].firstChild.textContent = "Different text ";
+                assert_false(fragment.isEqualNode(document.getElementsByTagName("div")[0]));
+                assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[1]));
+
+                // Calling twice getCueAsHTML() should not return the same fragment.
+                assert_not_equals(testCue.getCueAsHTML(), testCue.getCueAsHTML());
+
+                t.done();
+            }
+
+            function createExpectedFragment(rootNode) {
+                fragment = rootNode;
+                fragment.appendChild(document.createTextNode("Lorem "));
+
+                var bold = document.createElement("b");
+                bold.appendChild(document.createTextNode("ipsum"));
+                fragment.appendChild(bold);
+
+                fragment.appendChild(document.createTextNode(" "));
+
+                var underline = document.createElement("u");
+                underline.appendChild(document.createTextNode("dolor"));
+                fragment.appendChild(underline);
+
+                fragment.appendChild(document.createTextNode(" "));
+
+                var italics = document.createElement("i");
+                italics.className = "sit";
+                italics.appendChild(document.createTextNode("sit"));
+                fragment.appendChild(italics);
+
+                fragment.appendChild(document.createTextNode(" amet,"));
+            }
+
+            video.src = getVideoURI("/media/counting");
+        });
+    </script>
+</video>
+<p>Fragment 1</p>
+<div></div>
+<p>Fragment 2</p>
+<div></div>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable.html
new file mode 100644
index 0000000..63c3018
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-mutable.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html>
+<title>Modifying attributes of a VTTCue</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<video>
+    <track id="captions" src="resources/captions.vtt" kind="captions" default>
+    <script>
+        async_test(function(t) {
+            var track = document.querySelector("track");
+
+            track.onload = t.step_func_done(function() {
+                var cues = track.track.cues;
+
+                // Test initial values.
+                textCue = cues.getCueById("1");
+
+                assert_equals(textCue.startTime, 0);
+                assert_equals(textCue.endTime, 1.0);
+                assert_equals(textCue.pauseOnExit, false);
+                assert_equals(textCue.vertical, "");
+                assert_equals(textCue.snapToLines, true);
+                assert_equals(textCue.line, "auto");
+                assert_equals(textCue.position, "auto");
+                assert_equals(textCue.size, 100);
+                assert_equals(textCue.align, "center");
+
+                // Modify cue values.
+                textCue.startTime = 1.1;
+                assert_equals(textCue.startTime, 1.1);
+
+                textCue.endTime = 3.9;
+                assert_equals(textCue.endTime, 3.9);
+
+                textCue.pauseOnExit = true;
+                assert_equals(textCue.pauseOnExit, true);
+
+                // http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical
+                // On setting, the text track cue writing direction must be
+                // set to the value given in the first cell of the row in
+                // the table above whose second cell is a case-sensitive
+                // match for the new value.
+                textCue.vertical = "RL";
+                assert_equals(textCue.vertical, "");
+                textCue.vertical = "rl";
+                assert_equals(textCue.vertical, "rl");
+
+                textCue.snapToLines = false;
+                assert_equals(textCue.snapToLines, false);
+
+                // http://dev.w3.org/html5/webvtt/#dfn-vttcue-line
+                // On setting, the text track cue line position must be set
+                // to the new value; if the new value is the string "auto",
+                // then it must be interpreted as the special value auto.
+                assert_equals(textCue.line, "auto");
+                assert_throws(new TypeError, function() { textCue.line = "gazonk"; });
+                assert_equals(textCue.line, "auto");
+                textCue.line = 42;
+                assert_equals(textCue.line, 42);
+                textCue.line = -2;
+                assert_equals(textCue.line, -2);
+                textCue.line = 102;
+                assert_equals(textCue.line, 102);
+                textCue.snapToLines = true;
+                textCue.line = -2;
+                assert_equals(textCue.line, -2);
+                textCue.line = 102;
+                assert_equals(textCue.line, 102);
+
+                // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line
+                // On setting, if the new value is negative or greater than 100,
+                // then throw an IndexSizeError exception.
+                // Otherwise, set the text track cue text position to the new value.
+                assert_throws("IndexSizeError", function() { textCue.position = -200; });
+                assert_throws("IndexSizeError", function() { textCue.position = 110; });
+                textCue.position = 11;
+                assert_equals(textCue.position, 11);
+
+                // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size
+                // On setting, if the new value is negative or greater than 100,
+                // then throw an IndexSizeError exception.
+                // Otherwise, set the text track cue size to the new value.
+                assert_throws("IndexSizeError", function() { textCue.size = -200 });
+                assert_throws("IndexSizeError", function() { textCue.size = 110 });
+                textCue.size = 57;
+                assert_equals(textCue.size, 57);
+
+                // http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align
+                // On setting, the text track cue text alignment must be
+                // set to the value given in the first cell of the row
+                // in the table above whose second cell is a case-sensitive
+                // match for the new value.
+                textCue.align = "End";
+                assert_equals(textCue.align, "center");
+                textCue.align = "end";
+                assert_equals(textCue.align, "end");
+            });
+        });
+    </script>
+</video>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html
new file mode 100644
index 0000000..043c941
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-missed.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Events are triggered for missed (skipped) cues during normal playback</title>
+<script src="/common/media.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<video>
+    <track src="resources/missed-cues.vtt" default>
+    <script>
+    async_test(function(t) {
+        var video = document.querySelector("video");
+        var testTrack = document.querySelector("track");
+
+        video.src = getVideoURI("/media/test");
+
+        video.onended = t.step_func_done();
+
+        video.oncanplaythrough = t.step_func(function() {
+            video.oncanplaythrough = null;
+            video.currentTime = 5.00;
+            runTests();
+        });
+
+        testTrack.onload = t.step_func(runTests);
+
+        var cueCount;
+        var eventCount = 0;
+        function runTests() {
+            eventCount++;
+
+            if(eventCount != 2)
+                return;
+
+            assert_equals(testTrack.track.cues.length, 7);
+
+            for (cueCount = 2; cueCount < testTrack.track.cues.length; cueCount++) {
+                var cue = testTrack.track.cues[cueCount];
+
+                cue.onenter = t.step_func(cueEnteredOrExited);
+                cue.onexit = t.step_func(cueEnteredOrExited);
+            }
+
+            // Test events for missed cues, which are cues with ids
+            // from 3 to 7 in the file resources/missed-cues.vtt.
+            cueCount = 3;
+            video.play();
+        }
+
+        function cueEnteredOrExited() {
+            var currentCue = event.target;
+            assert_equals(testTrack.track.cues.getCueById(cueCount).text, currentCue.text);
+            assert_equals(currentCue.id, cueCount.toString());
+
+            if (event.type == "exit")
+                cueCount++;
+        }
+
+    });
+    </script>
+</video>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-pause-on-exit.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-pause-on-exit.html
new file mode 100644
index 0000000..eaf7e2a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-pause-on-exit.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Video is paused after cues having pause-on-exit flag are processed</title>
+<script src="/common/media.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<video>
+    <track src="resources/simple-captions.vtt" default>
+    <script>
+    async_test(function(t) {
+        var video = document.querySelector("video");
+        var track = document.querySelector("track");
+        track.onload = t.step_func(function() {
+            assert_equals(track.track.cues.length, 4);
+            for (var i = 0; i < track.track.cues.length; ++i) {
+                var cue = track.track.cues[i];
+                if (i % 2 == 0) {
+                    cue.pauseOnExit = true;
+                    cue.onexit = t.step_func(function(event) {
+                        assert_true(video.paused);
+
+                        video.play();
+
+                        if (event.target.id == 2)
+                            t.done();
+                    });
+                }
+            }
+            video.src = getVideoURI("/media/test");
+            video.currentTime = 4.00;
+            video.play();
+            assert_false(video.paused);
+        });
+    });
+    </script>
+</video>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-seeking.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-seeking.html
new file mode 100644
index 0000000..99cd2d55
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-seeking.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title>TextTrack's activeCues are indexed and updated during video playback</title>
+<script src="/common/media.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<video>
+    <track src="resources/cues-overlapping.vtt" kind="subtitles" default>
+    <script>
+    async_test(function(t) {
+        var video = document.querySelector("video");
+        var track = document.querySelector("track");
+        track.onload = t.step_func(function() {
+            assert_equals(track.track.cues.length, 3);
+            video.src = getVideoURI("/media/test");
+            video.currentTime = 0.5;
+        });
+
+        var seekedCount = 0;
+        video.onseeked = t.step_func(function() {
+            ++seekedCount;
+
+            assert_equals(video.currentTime, seekedCount * 0.5);
+            assert_equals(track.track.activeCues.length, seekedCount - 1);
+            video.currentTime = (seekedCount + 1) * 0.5;
+
+            if (seekedCount == 4)
+                t.done();
+        });
+    });
+    </script>
+</video>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-sorted-before-dispatch.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-sorted-before-dispatch.html
new file mode 100644
index 0000000..edc202f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cues-sorted-before-dispatch.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>All events are triggered in chronological order</title>
+<script src="/common/media.js"></script>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<video>
+    <track src="resources/sorted-dispatch.vtt" default>
+    <script>
+    async_test(function(t) {
+        var video = document.querySelector("video");
+        video.src = getVideoURI("/media/test");
+        var track = document.querySelector("track");
+
+        track.onload = t.step_func(function() {
+            var cues = track.track.cues;
+            assert_equals(cues.length, 8);
+
+            for (var i = 0; i < cues.length; ++i) {
+                cues[i].onenter = t.step_func(cueEnteredOrExited);
+                cues[i].onexit = t.step_func(cueEnteredOrExited);
+            }
+
+            video.play();
+        });
+
+        var cueTimings = [];
+        function cueEnteredOrExited(event) {
+            var currentCue = event.target;
+
+            if (event.type == "exit")
+                cueTimings.push(currentCue.endTime);
+            else
+                cueTimings.push(currentCue.startTime);
+        }
+
+        video.onended = t.step_func_done(function() {
+            assert_equals(cueTimings.length, 14);
+            var time = 0;
+            for (var i = 0; i < cueTimings.length; ++i) {
+                assert_less_than_equal(time, cueTimings[i], "cueTimings[" + i + "]");
+                time = cueTimings[i];
+            }
+        });
+
+        video.currentTime = 5;
+    });
+    </script>
+</video>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click-expected.txt
new file mode 100644
index 0000000..03a0063
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Clicking on an <area> element with a download attribute must not throw an exception assert_unreached: Navigated instead of downloading Reached unreachable code
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click.html
index 7554c9b..8100ada 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/area-download-click.html
@@ -6,22 +6,27 @@
 <link rel="help" href="https://github.com/whatwg/html/issues/2116">
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
-
-<img src="/images/threecolors.png" usemap="#x" id="img" width="300" height="300">
-<map name="x">
-  <area id="blob-url" download="foo.html" coords="0,0,300,300">
-</map>
-
+<body>
 <script>
 "use strict";
+async_test(t => {
+    const frame = document.createElement("iframe");
 
-const string = "test";
-const blob = new Blob([string], { type: "text/html" });
+    frame.addEventListener("load", t.step_func(function () {
+        frame.contentWindow.addEventListener(
+            "beforeunload", t.unreached_func("Navigated instead of downloading"));
+        const string = "test";
+        const blob = new Blob([string], { type: "text/html" });
 
-const link = document.querySelector("#blob-url");
-link.href = URL.createObjectURL(blob);
+        const link = frame.contentDocument.querySelector("#blob-url");
+        link.href = URL.createObjectURL(blob);
 
-link.click();
+        link.click();
 
-done();
+        t.step_timeout(() => t.done(), 1000);
+    }));
+    frame.src = "resources/area-download-click.html";
+    document.body.appendChild(frame);
+}, "Clicking on an <area> element with a download attribute must not throw an exception");
 </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/resources/area-download-click.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/resources/area-download-click.html
new file mode 100644
index 0000000..c0679f8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/embedded-content/the-area-element/resources/area-download-click.html
@@ -0,0 +1,5 @@
+<!doctype html>
+<img src="/images/threecolors.png" usemap="#x" id="img" width="300" height="300">
+<map name="x">
+  <area id="blob-url" download="foo.html" coords="0,0,300,300">
+</map>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt
new file mode 100644
index 0000000..fd1a48ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Do not navigate to 404 for anchor with download assert_unreached: Navigated instead of downloading Reached unreachable code
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
index db9e1cb..3c8adc0 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html
@@ -11,15 +11,15 @@
 async_test(t => {
     const errorFrame = document.createElement("iframe");
 
-    errorFrame.addEventListener("load", function () {
+    errorFrame.addEventListener("load", t.step_func(function () {
         errorFrame.contentWindow.addEventListener(
             "beforeunload", t.unreached_func("Navigated instead of downloading"));
 
         errorFrame.contentDocument.querySelector("#error-url").click();
         t.step_timeout(() => t.done(), 1000);
-    });
+    }));
     errorFrame.src = "resources/a-download-404.html";
     document.body.appendChild(errorFrame);
 }, "Do not navigate to 404 for anchor with download");
 </script>
-</body>
\ No newline at end of file
+</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-expected.txt
new file mode 100644
index 0000000..f372e80
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-expected.txt
@@ -0,0 +1,4 @@
+This is a testharness.js-based test.
+FAIL Clicking on an <a> element with a download attribute must not throw an exception assert_unreached: Navigated instead of downloading Reached unreachable code
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click.html
index ad6a3df0..22d329f 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click.html
@@ -7,18 +7,27 @@
 <script src="/resources/testharness.js"></script>
 <script src="/resources/testharnessreport.js"></script>
 
-<a id="blob-url" download="foo.html">Click me</a>
-
+<body>
 <script>
 "use strict";
+async_test(t => {
+    const frame = document.createElement("iframe");
 
-const string = "test";
-const blob = new Blob([string], { type: "text/html" });
+    frame.addEventListener("load", t.step_func(function () {
+        frame.contentWindow.addEventListener(
+            "beforeunload", t.unreached_func("Navigated instead of downloading"));
+        const string = "test";
+        const blob = new Blob([string], { type: "text/html" });
 
-const link = document.querySelector("#blob-url");
-link.href = URL.createObjectURL(blob);
+        const link = frame.contentDocument.querySelector("#blob-url");
+        link.href = URL.createObjectURL(blob);
 
-link.click();
+        link.click();
 
-done();
+        t.step_timeout(() => t.done(), 1000);
+    }));
+    frame.src = "resources/a-download-click.html";
+    document.body.appendChild(frame);
+}, "Clicking on an <a> element with a download attribute must not throw an exception");
 </script>
+</body>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/resources/a-download-click.html b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/resources/a-download-click.html
new file mode 100644
index 0000000..7d36c21
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/html/semantics/text-level-semantics/the-a-element/resources/a-download-click.html
@@ -0,0 +1,2 @@
+<!doctype html>
+<a id="blob-url" download="foo.html">Click me</a>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webvtt/parsing/file-parsing/tests/settings-line-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/webvtt/parsing/file-parsing/tests/settings-line-expected.txt
index 3eb20ed..449a34d 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webvtt/parsing/file-parsing/tests/settings-line-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/webvtt/parsing/file-parsing/tests/settings-line-expected.txt
@@ -1,4 +1,4 @@
 This is a testharness.js-based test.
-FAIL settings, line assert_equals: Failed with cue 9 expected 1e+34 but got 9.999999790214768e+33
+FAIL settings, line assert_equals: Failed with cue 31 expected (string) "auto" but got (number) 0.5
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/avoid-floats-when-negative-margin-top-7.html b/third_party/WebKit/LayoutTests/fast/block/float/avoid-floats-when-negative-margin-top-7.html
new file mode 100644
index 0000000..bb9d393
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/block/float/avoid-floats-when-negative-margin-top-7.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<style>
+::-webkit-scrollbar { display: none; }
+body { margin: 0px; }
+.float { float: left; width: 50px; height: 100px; background: green; }
+#content { overflow: hidden; margin-top: -100px; width: 50px; height: 100px; background: green; }
+.container { width: 100px; background: red; }
+</style>
+<div class="container">
+  <div>
+    <div class="float"></div>
+    <br clear=all>
+  </div>
+  <div style="position:absolute"></div>
+  <div id="content" data-offset-x=50></div>
+</div>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+    test(() => {
+        var hr = document.getElementById("content");
+        assert_equals(hr.offsetLeft, 50);
+    }, "crbug.com/666487: There should be a green square.");
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/avoid-floats-when-negative-margin-top-8.html b/third_party/WebKit/LayoutTests/fast/block/float/avoid-floats-when-negative-margin-top-8.html
new file mode 100644
index 0000000..bffa2fc7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/block/float/avoid-floats-when-negative-margin-top-8.html
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<style>
+::-webkit-scrollbar { display: none; }
+body { margin: 0px; }
+.float { float: left; width: 50px; height: 100px; background: green; }
+#content { overflow: hidden; margin-top: -100px; width: 50px; height: 100px; background: green; }
+.container { width: 100px; background: red; }
+</style>
+<div class="container">
+  <div>
+    <div class="float"></div>
+    <br clear=all>
+  </div>
+  <div style="display:table;"></div>
+  <div id="content" data-offset-x=50></div>
+</div>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script>
+    test(() => {
+        var hr = document.getElementById("content");
+        assert_equals(hr.offsetLeft, 50);
+    }, "crbug.com/666487: There should be a green square.");
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-unused-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-unused-expected.txt
index ef77ada..39ec5ad5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-unused-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-unused-expected.txt
@@ -1,2 +1,2 @@
-CONSOLE WARNING: The resource nick.jpg?name=value was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it wasn't preloaded for nothing.
+CONSOLE WARNING: The resource nick.jpg?name=value was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it Please make sure it has an appropriate `as` value and it is preloaded intentionally.
  This test verifies that unused preload resources (and only unused ones) issue a warning.
diff --git a/third_party/WebKit/LayoutTests/fast/events/drag-file-crash.html b/third_party/WebKit/LayoutTests/fast/events/drag-file-crash.html
index 77a8500..4aa8fd1 100644
--- a/third_party/WebKit/LayoutTests/fast/events/drag-file-crash.html
+++ b/third_party/WebKit/LayoutTests/fast/events/drag-file-crash.html
@@ -4,8 +4,10 @@
     }
 </style>
 <script>
-    if (window.testRunner)
+    if (window.testRunner) {
         testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+    }
 
     function moveMouseToCenterOfElement(element)
     {
diff --git a/third_party/WebKit/LayoutTests/fast/events/resources/drag-file-crash-pass.html b/third_party/WebKit/LayoutTests/fast/events/resources/drag-file-crash-pass.html
index 7ef22e9..87f5598 100644
--- a/third_party/WebKit/LayoutTests/fast/events/resources/drag-file-crash-pass.html
+++ b/third_party/WebKit/LayoutTests/fast/events/resources/drag-file-crash-pass.html
@@ -1 +1,7 @@
+<!doctype html>
 PASS
+<script>
+    if (window.testRunner) {
+        testRunner.notifyDone();
+    }
+</script>
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png
new file mode 100644
index 0000000..9de309f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt
new file mode 100644
index 0000000..e5ebc05
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/class-attribute-whitespace-expected.txt
@@ -0,0 +1,30 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x248
+  LayoutNGBlockFlow {HTML} at (0,0) size 800x248
+    LayoutNGBlockFlow {BODY} at (8,8) size 784x232
+      LayoutNGBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 52x19
+        LayoutInline {I} at (0,0) size 0x0
+          LayoutInline {A} at (0,0) size 0x0 [color=#0000EE]
+            LayoutText {#text} at (0,0) size 349x19
+          LayoutText {#text} at (0,0) size 306x19
+        LayoutText {#text} at (0,0) size 5x19
+      LayoutNGBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 233x19
+      LayoutNGBlockFlow {DIV} at (0,72) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 56x19
+      LayoutNGBlockFlow {DIV} at (0,92) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 68x19
+      LayoutNGBlockFlow {DIV} at (0,112) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 86x19
+      LayoutNGBlockFlow {DIV} at (0,132) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 98x19
+      LayoutNGBlockFlow {DIV} at (0,152) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 76x19
+      LayoutNGBlockFlow {DIV} at (0,172) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 88x19
+      LayoutNGBlockFlow {DIV} at (0,192) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 54x19
+      LayoutNGBlockFlow {DIV} at (0,212) size 784x20 [color=#008000]
+        LayoutText {#text} at (0,0) size 66x19
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png
new file mode 100644
index 0000000..04aa61f04
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt
new file mode 100644
index 0000000..e21c6d0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/create-renderer-for-whitespace-only-text-expected.txt
@@ -0,0 +1,61 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x248
+  LayoutNGBlockFlow {HTML} at (0,0) size 800x248
+    LayoutNGBlockFlow {BODY} at (8,8) size 784x232
+      LayoutNGBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 52x19
+        LayoutInline {I} at (0,0) size 0x0
+          LayoutInline {A} at (0,0) size 0x0 [color=#0000EE]
+            LayoutText {#text} at (0,0) size 302x19
+          LayoutText {#text} at (0,0) size 782x39
+        LayoutText {#text} at (0,0) size 4x19
+      LayoutNGBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 744x19
+      LayoutNGBlockFlow {P} at (0,92) size 784x20
+        LayoutText {#text} at (0,0) size 349x19
+      LayoutTable {TABLE} at (0,128) size 197x104 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 196x103
+          LayoutTableRow {TR} at (0,0) size 196x29
+            LayoutNGTableCell {TD} at (0,0) size 98x29 [border: (1px solid #000000)] [r=0 c=0 rs=1 cs=1]
+              LayoutNGBlockFlow {DIV} at (5,5) size 89x20
+                LayoutText {#text} at (0,0) size 23x19
+                LayoutText {#text} at (0,0) size 4x19
+                LayoutText {#text} at (0,0) size 22x19
+            LayoutNGTableCell {TD} at (98,0) size 98x29 [border: (1px solid #000000)] [r=0 c=1 rs=1 cs=1]
+              LayoutNGBlockFlow {DIV} at (5,5) size 89x20
+                LayoutText {#text} at (0,0) size 49x19
+          LayoutTableRow {TR} at (0,29) size 196x45
+            LayoutNGTableCell {TD} at (0,29) size 98x45 [border: (1px solid #000000)] [r=1 c=0 rs=1 cs=1]
+              LayoutNGBlockFlow {UL} at (5,5) size 89x20
+                LayoutInline {LI} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 23x19
+                LayoutText {#text} at (0,0) size 4x19
+                LayoutInline {LI} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 22x19
+                LayoutText {#text} at (0,0) size 0x0
+            LayoutNGTableCell {TD} at (98,29) size 98x45 [border: (1px solid #000000)] [r=1 c=1 rs=1 cs=1]
+              LayoutNGBlockFlow {UL} at (5,5) size 89x20
+                LayoutInline {LI} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 23x19
+                LayoutText {#text} at (0,0) size 4x19
+                LayoutInline {LI} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 22x19
+                LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,74) size 196x29
+            LayoutNGTableCell {TD} at (0,74) size 98x29 [border: (1px solid #000000)] [r=2 c=0 rs=1 cs=1]
+              LayoutNGBlockFlow {DIV} at (5,5) size 89x20
+                LayoutInline {DIV} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 23x19
+                LayoutText {#text} at (0,0) size 4x19
+                LayoutInline {DIV} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 22x19
+                LayoutText {#text} at (0,0) size 0x0
+            LayoutNGTableCell {TD} at (98,74) size 98x29 [border: (1px solid #000000)] [r=2 c=1 rs=1 cs=1]
+              LayoutNGBlockFlow {DIV} at (5,5) size 89x20
+                LayoutInline {DIV} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 23x19
+                LayoutText {#text} at (0,0) size 4x19
+                LayoutInline {DIV} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 22x19
+                LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png
new file mode 100644
index 0000000..08f6171
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt
new file mode 100644
index 0000000..ec1f7c5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/float-in-trailing-whitespace-after-last-line-break-expected.txt
@@ -0,0 +1,20 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x204
+  LayoutNGBlockFlow {HTML} at (0,0) size 800x204
+    LayoutNGBlockFlow {BODY} at (8,8) size 784x136
+      LayoutNGBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 52x19
+        LayoutInline {I} at (0,0) size 0x0
+          LayoutInline {A} at (0,0) size 0x0 [color=#0000EE]
+            LayoutText {#text} at (0,0) size 308x19
+          LayoutText {#text} at (0,0) size 739x39
+        LayoutText {#text} at (0,0) size 5x19
+      LayoutNGBlockFlow {DIV} at (0,56) size 784x80
+        LayoutNGBlockFlow (anonymous) at (0,0) size 784x40
+          LayoutText {#text} at (0,0) size 259x19
+          LayoutBR {BR} at (0,0) size 0x0
+          LayoutBR {BR} at (0,0) size 0x0
+          LayoutNGBlockFlow (floating) {DIV} at (0,40) size 100x100 [bgcolor=#008000]
+        LayoutNGBlockFlow {DIV} at (0,40) size 150x40
+          LayoutText {#text} at (0,0) size 46x39
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png
new file mode 100644
index 0000000..2ea51b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt
new file mode 100644
index 0000000..4922823f8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/select/option-strip-whitespace-expected.txt
@@ -0,0 +1,39 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x334
+  LayoutNGBlockFlow {HTML} at (0,0) size 800x334
+    LayoutNGBlockFlow {BODY} at (8,8) size 784x318
+      LayoutNGBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 403x19
+      LayoutNGBlockFlow (anonymous) at (0,36) size 784x282
+        LayoutText {#text} at (0,0) size 70x19
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutText {#text} at (0,0) size 84x19
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutText {#text} at (0,0) size 298x19
+        LayoutMenuList {SELECT} at (298,182) size 95x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)]
+          LayoutNGBlockFlow (anonymous) at (1,1) size 93x18
+            LayoutText (anonymous) at (0,0) size 73x16
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutText {#text} at (0,0) size 284x19
+        LayoutMenuList {SELECT} at (283.59,222) size 79x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)]
+          LayoutNGBlockFlow (anonymous) at (1,1) size 77x18
+            LayoutText (anonymous) at (0,0) size 57x16
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutText {#text} at (0,0) size 126x19
+        LayoutMenuList {SELECT} at (125.72,262) size 79x20 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)]
+          LayoutNGBlockFlow (anonymous) at (1,1) size 77x18
+            LayoutText (anonymous) at (0,0) size 57x16
+        LayoutText {#text} at (0,0) size 0x0
+layer at (78,44) size 77x70 clip at (79,45) size 60x68
+  LayoutListBox {SELECT} at (69.59,0) size 77.53x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutNGBlockFlow {OPTION} at (1,1) size 60.53x17
+      LayoutText {#text} at (0,0) size 57x16
+layer at (92,135) size 78x70 clip at (93,136) size 61x68
+  LayoutListBox {SELECT} at (84,91) size 77.53x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutNGBlockFlow {OPTION} at (1,1) size 60.53x17
+      LayoutText {#text} at (0,0) size 57x16
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png
new file mode 100644
index 0000000..02431a0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png
new file mode 100644
index 0000000..e036e7b8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png
new file mode 100644
index 0000000..20b1d8f3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png
new file mode 100644
index 0000000..e1c03ad4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png
new file mode 100644
index 0000000..70b419d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png
new file mode 100644
index 0000000..af284ba
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png
new file mode 100644
index 0000000..fcb1c98
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png
new file mode 100644
index 0000000..9432152
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/colgroup_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png
new file mode 100644
index 0000000..9cafe58
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png
new file mode 100644
index 0000000..3be2d2dd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png
new file mode 100644
index 0000000..da930f96
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_td_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png
new file mode 100644
index 0000000..679429b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png
new file mode 100644
index 0000000..78ddfee
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png
new file mode 100644
index 0000000..bf6561f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tables_th_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png
new file mode 100644
index 0000000..0419fd6a5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png
new file mode 100644
index 0000000..d855188
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png
new file mode 100644
index 0000000..ccbb0e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png
new file mode 100644
index 0000000..ee690cc6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png
new file mode 100644
index 0000000..6cab134
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png
new file mode 100644
index 0000000..31ecba4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png
new file mode 100644
index 0000000..7b67775d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png
new file mode 100644
index 0000000..0951406
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png
new file mode 100644
index 0000000..4a04add6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tbody_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png
new file mode 100644
index 0000000..1f135b8b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png
new file mode 100644
index 0000000..5ea98fc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/td_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png
new file mode 100644
index 0000000..39c5b78
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png
new file mode 100644
index 0000000..510b1b1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png
new file mode 100644
index 0000000..4201864
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png
new file mode 100644
index 0000000..27340fe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png
new file mode 100644
index 0000000..f5d6804
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png
new file mode 100644
index 0000000..383e85ed
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png
new file mode 100644
index 0000000..778542dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png
new file mode 100644
index 0000000..5f91a7e7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png
new file mode 100644
index 0000000..8f2f2a1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tfoot_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png
new file mode 100644
index 0000000..29cc072d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png
new file mode 100644
index 0000000..474b93f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/th_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png
new file mode 100644
index 0000000..59391d9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png
new file mode 100644
index 0000000..1ef37ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png
new file mode 100644
index 0000000..fd4519a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png
new file mode 100644
index 0000000..f7260c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png
new file mode 100644
index 0000000..0689818
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png
new file mode 100644
index 0000000..588d84ca
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png
new file mode 100644
index 0000000..111aeaa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/thead_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png
new file mode 100644
index 0000000..7fa88a6c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png
new file mode 100644
index 0000000..43ada16
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/tr_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png
new file mode 100644
index 0000000..4585423
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png
new file mode 100644
index 0000000..2d995fb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png
new file mode 100644
index 0000000..1f68879
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png
new file mode 100644
index 0000000..0aecb1e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_col_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png
new file mode 100644
index 0000000..37449a35
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png
new file mode 100644
index 0000000..ae62453f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png
new file mode 100644
index 0000000..1787b3e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png
new file mode 100644
index 0000000..8c41de5906
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_colgroup_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png
new file mode 100644
index 0000000..2cdbd72
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png
new file mode 100644
index 0000000..2bd1c9f07845
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png
new file mode 100644
index 0000000..53f0fdc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png
new file mode 100644
index 0000000..4e58908a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png
new file mode 100644
index 0000000..7ab43ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png
new file mode 100644
index 0000000..b802e9c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png
new file mode 100644
index 0000000..f9217f8a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png
new file mode 100644
index 0000000..81c289bf8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png
new file mode 100644
index 0000000..bd29bbf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tbody_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png
new file mode 100644
index 0000000..1f2ad7f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png
new file mode 100644
index 0000000..d1ccccb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png
new file mode 100644
index 0000000..98f3c07
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_td_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png
new file mode 100644
index 0000000..fd4c37a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_center-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png
new file mode 100644
index 0000000..27b4d22
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png
new file mode 100644
index 0000000..defac0b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png
new file mode 100644
index 0000000..0981c81
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_left-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png
new file mode 100644
index 0000000..ccb5c3aa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_align_right-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png
new file mode 100644
index 0000000..902e2f2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_baseline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png
new file mode 100644
index 0000000..5affe381
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png
new file mode 100644
index 0000000..2f2f412
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_middle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png
new file mode 100644
index 0000000..4abc03a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tfoot_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_align_justify-expected.png
new file mode 100644
index 0000000..b058d75f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png
new file mode 100644
index 0000000..82fa708
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png
new file mode 100644
index 0000000..756c32c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_th_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png
new file mode 100644
index 0000000..41b34485
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png
new file mode 100644
index 0000000..c675d66
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png
new file mode 100644
index 0000000..e71d993c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_thead_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png
new file mode 100644
index 0000000..2d4fcdb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_align_justify-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png
new file mode 100644
index 0000000..e69ab38
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_bottom-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png
new file mode 100644
index 0000000..57516f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/marvin/x_tr_valign_top-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png
new file mode 100644
index 0000000..10c35d8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/tables/mozilla/other/wa_table_tr_align-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fragmentation/transformed-clip-before-second-column.html b/third_party/WebKit/LayoutTests/fragmentation/transformed-clip-before-second-column.html
new file mode 100644
index 0000000..3675c080
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fragmentation/transformed-clip-before-second-column.html
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<style>
+ .target:before {
+    content:"\e8a7"
+}
+ </style>
+<div style="column-count: 2;">
+  <div style="height: 100px"></div>
+  <div style="overflow: hidden; border-radius: 2px;">
+    There should be a black rectangle below this text.
+    <div class="target" style="transform: translate(0,1px);">
+    </div>
+  </div>
+</div>
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/https-header-top-level.html b/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/https-header-top-level.html
index aa7b313..b39f5155 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/https-header-top-level.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/upgrade-insecure-requests/https-header-top-level.html
@@ -3,6 +3,8 @@
 <body>
   <a href="resources/check-https-header.pl">Navigate!</a>
   <script>
+    if (window.testRunner)
+      testRunner.waitUntilDone();
     document.querySelector('a').click();
   </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/media/controls/modern/singletap-on-outside.html b/third_party/WebKit/LayoutTests/media/controls/modern/singletap-on-outside.html
index 999ce3c..ae07b7e5 100644
--- a/third_party/WebKit/LayoutTests/media/controls/modern/singletap-on-outside.html
+++ b/third_party/WebKit/LayoutTests/media/controls/modern/singletap-on-outside.html
@@ -12,11 +12,18 @@
   video.addEventListener('playing', t.step_func(() => {
     // Single tap in the top right hand corner
     const coordinates =
-      coordinatesOutsideElement(mediaControlsOverlayPlayButtonInternal(video));
+      coordinatesOutsideElement(mediaControlsOverlayPlayButton(video));
     singleTapAtCoordinates(coordinates[0] + 1, coordinates[1] + 1);
   }), { once: true });
 
-  video.addEventListener('pause', t.step_func_done(), { once: true });
+  video.addEventListener('pause', t.unreached_func());
+
+  video.addEventListener('webkitfullscreenchange', t.unreached_func());
+
+  video.ontimeupdate = t.step_func(() => {
+    if (video.currentTime > 0)
+      t.done();
+  });
 
   video.play();
 });
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 8f0471e2..b71733ca 100644
--- a/third_party/WebKit/LayoutTests/media/controls/modern/slow-doubletap.html
+++ b/third_party/WebKit/LayoutTests/media/controls/modern/slow-doubletap.html
@@ -8,22 +8,20 @@
 <script>
 async_test(t => {
   const video = document.querySelector('video');
-  let didPause = false;
 
   video.onplaying = t.step_func(() => {
-    if (didPause) {
-      t.done();
-    } else {
-      // Double tap in the top right hand corner
-      const coordinates =
-        coordinatesOutsideElement(mediaControlsOverlayPlayButton(video));
-      doubleTapAtCoordinates(coordinates[0] + 1, coordinates[1] + 1, 400);
-    }
+    // Double tap in the top right hand corner
+    const coordinates =
+      coordinatesOutsideElement(mediaControlsOverlayPlayButton(video));
+    doubleTapAtCoordinates(
+        coordinates[0] + 1, coordinates[1] + 1, 400, t.step_func_done(() => {
+      assert_false(video.paused);
+    }));
   });
 
-  video.addEventListener('pause', t.step_func(() => {
-    didPause = true;
-  }), { once: true });
+  video.addEventListener('pause', t.unreached_func());
+
+  video.addEventListener('webkitfullscreenchange', t.unreached_func());
 
   video.play();
 });
diff --git a/third_party/WebKit/LayoutTests/media/controls/modern/tap-to-hide-controls.html b/third_party/WebKit/LayoutTests/media/controls/modern/tap-to-hide-controls.html
new file mode 100644
index 0000000..3b50eca
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/controls/modern/tap-to-hide-controls.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<title>Test that the controls are hidden if they are tapped</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<script src="../../media-controls.js"></script>
+<video controls width=400 src="../../content/60_sec_video.webm"></video>
+<script>
+async_test(t => {
+  // This number comes from MediaControlOverlayPlayButtonElement.cpp.
+  const doubleTapTimeoutMs = 301;
+  const video = document.querySelector('video');
+
+  video.addEventListener('playing', t.step_func(() => {
+    assert_true(isControlsPanelVisible(video));
+
+    // Single tap in the top right hand corner
+    const c = coordinatesOutsideElement(mediaControlsOverlayPlayButton(video));
+    singleTapAtCoordinates(c[0] + 1, c[1] + 1, t.step_func(() => {
+      // Wait for the tap to expire.
+      setTimeout(t.step_func_done(() => {
+        assert_false(isControlsPanelVisible(video));
+      }), doubleTapTimeoutMs);
+    }));
+  }), { once: true });
+
+  video.play();
+});
+</script>
+</html>i
diff --git a/third_party/WebKit/LayoutTests/media/media-controls.js b/third_party/WebKit/LayoutTests/media/media-controls.js
index 78ce500..0725066 100644
--- a/third_party/WebKit/LayoutTests/media/media-controls.js
+++ b/third_party/WebKit/LayoutTests/media/media-controls.js
@@ -321,7 +321,7 @@
   return element;
 }
 
-function doubleTapAtCoordinates(x, y, timeout) {
+function doubleTapAtCoordinates(x, y, timeout, callback) {
   if (timeout == undefined)
     timeout = 100;
 
@@ -336,10 +336,10 @@
         { name: 'pointerUp' }
       ]
     }
-  ]);
+  ], callback);
 }
 
-function singleTapAtCoordinates(xPos, yPos) {
+function singleTapAtCoordinates(xPos, yPos, callback) {
   chrome.gpuBenchmarking.pointerActionSequence([
     {
       source: 'mouse',
@@ -348,7 +348,7 @@
         { name: 'pointerUp' }
       ]
     }
-  ]);
+  ], callback);
 }
 
 function enableDoubleTapToJumpForTest(t) {
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html b/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html
deleted file mode 100644
index 5c643b0..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-inline-assertion-crash.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<title>Tests that adding a track and changing its mode through JS doesn't crash the browser.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<video>
-    <!-- If the src is specified through JS after the body load, the test doesn't crash anymore. -->
-    <source src="../content/test.mp4" type="video/mp4">
-    <source src="../content/test.ogv" type="video/ogg">
-</video>
-<script>
-test(function() {
-    var video = document.querySelector('video');
-    var track = video.addTextTrack('captions', 'English', 'en');
-    track.addCue(new VTTCue(0.0, 10.0, 'wow wow'));
-    track.mode = 'showing';
-});
-</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
deleted file mode 100644
index e872421d4..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable-fragment.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE html>
-<title>Test that cue fragment is mutable.</title>
-<script src="../media-file.js"></script>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<style>
-p, div { display: none; }
-</style>
-<video>
-    <track src="captions-webvtt/captions-html.vtt" kind="captions" default >
-</video>
-<p>Fragment 1</p>
-<div></div>
-
-<p>Fragment 2</p>
-<div></div>
-<script>
-async_test(function(t) {
-    var video = document.querySelector("video");
-    var testTrack = document.querySelector("track");
-
-    video.oncanplaythrough = t.step_func(testMutability);
-    testTrack.onload = t.step_func(testMutability);
-
-    var fragment;
-    var eventCount = 0;
-    function testMutability() {
-        eventCount++;
-        if (eventCount != 2)
-            return;
-
-        var testCue = testTrack.track.cues[0];
-
-        // Test initial cue contents.
-        assert_equals(testCue.text, "Lorem <b>ipsum</b> <u>dolor</u> <i.sit>sit</i> amet,");
-
-        // Cue getCueAsHTML() should return a correct fragment.
-        createExpectedFragment(document.createDocumentFragment());
-        assert_true(fragment.isEqualNode(testCue.getCueAsHTML()));
-
-        // Appending getCuesAsHTML() twice to the DOM should be succesful.
-        document.getElementsByTagName("div")[0].appendChild(testCue.getCueAsHTML());
-        document.getElementsByTagName("div")[1].appendChild(testCue.getCueAsHTML());
-
-        createExpectedFragment(document.createElement("div"));
-        assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[0]));
-        assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[1]));
-
-        // The fragment returned by getCuesAsHTML() should be independently mutable.
-        document.getElementsByTagName("div")[0].firstChild.textContent = "Different text ";
-        assert_false(fragment.isEqualNode(document.getElementsByTagName("div")[0]));
-        assert_true(fragment.isEqualNode(document.getElementsByTagName("div")[1]));
-
-        // Calling twice getCueAsHTML() should not return the same fragment.
-        assert_not_equals(testCue.getCueAsHTML(), testCue.getCueAsHTML());
-
-        t.done();
-    }
-
-    function createExpectedFragment(rootNode) {
-        fragment = rootNode;
-        fragment.appendChild(document.createTextNode("Lorem "));
-
-        var bold = document.createElement("b");
-        bold.appendChild(document.createTextNode("ipsum"));
-        fragment.appendChild(bold);
-
-        fragment.appendChild(document.createTextNode(" "));
-
-        var underline = document.createElement("u");
-        underline.appendChild(document.createTextNode("dolor"));
-        fragment.appendChild(underline);
-
-        fragment.appendChild(document.createTextNode(" "));
-
-        var italics = document.createElement("i");
-        italics.className = "sit";
-        italics.appendChild(document.createTextNode("sit"));
-        fragment.appendChild(italics);
-
-        fragment.appendChild(document.createTextNode(" amet,"));
-    }
-
-    video.src = findMediaFile("video", "../content/counting");
-});
-</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html b/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html
deleted file mode 100644
index 8d22ab22..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cue-mutable.html
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE html>
-<title>Tests modifying attributes of a VTTCue</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<video>
-    <track id="captions" src="captions-webvtt/captions.vtt" kind="captions" default>
-</video>
-<script>
-async_test(function(t) {
-    var track = document.querySelector("track");
-
-    track.onload = t.step_func_done(function() {
-        var cues = track.track.cues;
-
-        // Test initial values.
-        textCue = cues.getCueById("1");
-
-        assert_equals(textCue.startTime, 0);
-        assert_equals(textCue.endTime, 1.0);
-        assert_equals(textCue.pauseOnExit, false);
-        assert_equals(textCue.vertical, "");
-        assert_equals(textCue.snapToLines, true);
-        assert_equals(textCue.line, "auto");
-        assert_equals(textCue.position, "auto");
-        assert_equals(textCue.size, 100);
-        assert_equals(textCue.align, "center");
-
-        // Modify cue values.
-        textCue.startTime = 1.1;
-        assert_equals(textCue.startTime, 1.1);
-
-        textCue.endTime = 3.9;
-        assert_equals(textCue.endTime, 3.9);
-
-        textCue.pauseOnExit = true;
-        assert_equals(textCue.pauseOnExit, true);
-
-        // http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-vertical
-        // On setting, the text track cue writing direction must be set to the value given in the first cell
-        // of the row in the table above whose second cell is a case-sensitive match for the new value.
-        textCue.vertical = "RL";
-        assert_equals(textCue.vertical, "");
-        textCue.vertical = "rl";
-        assert_equals(textCue.vertical, "rl");
-
-        textCue.snapToLines = false;
-        assert_equals(textCue.snapToLines, false);
-
-        // http://dev.w3.org/html5/webvtt/#dfn-vttcue-line
-        // On setting, the text track cue line position must be set to the new value;
-        // if the new value is the string "auto", then it must be interpreted as the special value auto.
-        assert_equals(textCue.line, "auto");
-        assert_throws(new TypeError, function() { textCue.line = "gazonk"; });
-        assert_equals(textCue.line, "auto");
-        textCue.line = 42;
-        assert_equals(textCue.line, 42);
-        textCue.line = -2;
-        assert_equals(textCue.line, -2);
-        textCue.line = 102;
-        assert_equals(textCue.line, 102);
-        textCue.snapToLines = true;
-        textCue.line = -2;
-        assert_equals(textCue.line, -2);
-        textCue.line = 102;
-        assert_equals(textCue.line, 102);
-
-        // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line
-        // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception.
-        // Otherwise, set the text track cue text position to the new value.
-        assert_throws("IndexSizeError", function() { textCue.position = -200; });
-        assert_throws("IndexSizeError", function() { textCue.position = 110; });
-        textCue.position = 11;
-        assert_equals(textCue.position, 11);
-
-        // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size
-        // On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception.
-        // Otherwise, set the text track cue size to the new value.
-        assert_throws("IndexSizeError", function() { textCue.size = -200 });
-        assert_throws("IndexSizeError", function() { textCue.size = 110 });
-        textCue.size = 57;
-        assert_equals(textCue.size, 57);
-
-        // http://dev.w3.org/html5/webvtt/#dfn-dom-vttcue-align
-        // On setting, the text track cue text alignment must be set to the value given in the first cell
-        // of the row in the table above whose second cell is a case-sensitive match for the new value.
-        textCue.align = "End";
-        assert_equals(textCue.align, "center");
-        textCue.align = "end";
-        assert_equals(textCue.align, "end");
-    });
-});
-</script>
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html b/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html
deleted file mode 100644
index 40f2f75..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-missed.html
+++ /dev/null
@@ -1,59 +0,0 @@
-<!DOCTYPE html>
-<title>Tests that events are triggered for missed (skipped) cues during normal playback.</title>
-<script src="../media-file.js"></script>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<video>
-    <track src="captions-webvtt/missed-cues.vtt" default>
-</video>
-<script>
-async_test(function(t) {
-    var video = document.querySelector("video");
-    var testTrack = document.querySelector("track");
-
-    video.src = findMediaFile("video", "../content/test");
-    
-    video.onended = t.step_func_done();
-
-    video.oncanplaythrough = t.step_func(function() {
-        video.oncanplaythrough = null;
-        video.currentTime = 5.00;
-        runTests();
-    });
-
-    testTrack.onload = t.step_func(runTests);
-
-    var cueCount;
-    var eventCount = 0;
-    function runTests() {
-        eventCount++;
-
-        if(eventCount != 2)
-            return;
-
-        assert_equals(testTrack.track.cues.length, 7);
-
-        for (cueCount = 2; cueCount < testTrack.track.cues.length; cueCount++) {
-            var cue = testTrack.track.cues[cueCount];
-
-            cue.onenter = t.step_func(cueEnteredOrExited);
-            cue.onexit = t.step_func(cueEnteredOrExited);
-        }
-
-        // Test events for missed cues, which are cues with ids
-        // from 3 to 7 in the file captions-webvtt/missed-cues.vtt.
-        cueCount = 3;
-        video.play();
-    }
-
-    function cueEnteredOrExited() {
-        var currentCue = event.target;
-        assert_equals(testTrack.track.cues.getCueById(cueCount).text, currentCue.text);
-        assert_equals(currentCue.id, cueCount.toString());
-
-        if (event.type == "exit")
-            cueCount++;
-    }
-
-});
-</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html b/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
deleted file mode 100644
index 7cea266..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-pause-on-exit.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<title>Tests that the video is paused after cues that have pause-on-exit flag are processed.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script src="../media-file.js"></script>
-<video controls>
-    <track src="captions-webvtt/simple-captions.vtt" default>
-</video>
-<script>
-async_test(function(t) {
-    var video = document.querySelector("video");
-    var track = document.querySelector("track");
-    track.onload = t.step_func(function() {
-        assert_equals(track.track.cues.length, 4);
-        for (var i = 0; i < track.track.cues.length; ++i) {
-            var cue = track.track.cues[i];
-            if (i % 2 == 0) {
-                cue.pauseOnExit = true;
-                cue.onexit = t.step_func(function(event) {
-                    assert_true(video.paused);
-
-                    video.play();
-
-                    if (event.target.id == 2)
-                        t.done();
-                });
-            }
-        }
-        video.src = findMediaFile("video", "../content/test");
-        video.currentTime = 4.00;
-        video.play();
-        assert_false(video.paused);
-    });
-});
-</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html b/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
deleted file mode 100644
index 0cc4399..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-seeking.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<title>Tests TextTrack's activeCues are indexed and updated during video playback.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script src="../media-file.js"></script>
-<video>
-    <track src="captions-webvtt/cues-overlapping.vtt" kind="subtitles" default>
-</video>
-<script>
-async_test(function(t) {
-    var video = document.querySelector("video");
-    var track = document.querySelector("track");
-    track.onload = t.step_func(function() {
-        assert_equals(track.track.cues.length, 3);
-        video.src = findMediaFile("video", "../content/test");
-        video.currentTime = 0.5;
-    });
-
-    var seekedCount = 0;
-    video.onseeked = t.step_func(function() {
-        ++seekedCount;
-
-        assert_equals(video.currentTime, seekedCount * 0.5);
-        assert_equals(track.track.activeCues.length, seekedCount - 1);
-        video.currentTime = (seekedCount + 1) * 0.5;
-
-        if (seekedCount == 4)
-            t.done();
-    });
-});
-</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html b/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
deleted file mode 100644
index e602ee1..0000000
--- a/third_party/WebKit/LayoutTests/media/track/track-cues-sorted-before-dispatch.html
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html>
-<title>Tests that all events are triggered in chronological order.</title>
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script src="../media-file.js"></script>
-<video>
-    <track src="captions-webvtt/sorted-dispatch.vtt" default>
-</video>
-<script>
-async_test(function(t) {
-    var video = document.querySelector("video");
-    video.src = findMediaFile("video", "../content/test");
-    var track = document.querySelector("track");
-
-    track.onload = t.step_func(function() {
-        var cues = track.track.cues;
-        assert_equals(cues.length, 8);
-
-        for (var i = 0; i < cues.length; ++i) {
-            cues[i].onenter = t.step_func(cueEnteredOrExited);
-            cues[i].onexit = t.step_func(cueEnteredOrExited);
-        }
-
-        video.play();
-    });
-
-    var cueTimings = [];
-    function cueEnteredOrExited(event) {
-        var currentCue = event.target;
-
-        if (event.type == "exit")
-            cueTimings.push(currentCue.endTime);
-        else
-            cueTimings.push(currentCue.startTime);
-    }
-
-    video.onended = t.step_func_done(function() {
-        assert_equals(cueTimings.length, 14);
-        var time = 0;
-        for (var i = 0; i < cueTimings.length; ++i) {
-            assert_less_than_equal(time, cueTimings[i], "cueTimings[" + i + "]");
-            time = cueTimings[i];
-        }
-    });
-
-    video.currentTime = 5;
-});
-</script>
\ No newline at end of file
diff --git a/third_party/WebKit/LayoutTests/media/track/vtt-cue-float-precision.html b/third_party/WebKit/LayoutTests/media/track/vtt-cue-float-precision.html
index 556438bc..39b4d57 100644
--- a/third_party/WebKit/LayoutTests/media/track/vtt-cue-float-precision.html
+++ b/third_party/WebKit/LayoutTests/media/track/vtt-cue-float-precision.html
@@ -10,11 +10,11 @@
     // Assign a value which is exactly representable as double but not float.
     var doubleValue = 1.000000000000004;
     cue.line = doubleValue;
-    assert_not_equals(cue.line, doubleValue);
+    assert_equals(cue.line, doubleValue);
     cue.position = doubleValue;
-    assert_not_equals(cue.position, doubleValue);
+    assert_equals(cue.position, doubleValue);
     cue.size = doubleValue;
-    assert_not_equals(cue.size, doubleValue);
+    assert_equals(cue.size, doubleValue);
 
     // Assign a value which is exactly representable as float but is non-integral.
     var floatValue = 1.5;
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fragmentation/transformed-clip-before-second-column-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fragmentation/transformed-clip-before-second-column-expected.png
new file mode 100644
index 0000000..5d7c010
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/fragmentation/transformed-clip-before-second-column-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fragmentation/transformed-clip-before-second-column-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fragmentation/transformed-clip-before-second-column-expected.txt
new file mode 100644
index 0000000..140f33c0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/fragmentation/transformed-clip-before-second-column-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x86
+  LayoutBlockFlow {HTML} at (0,0) size 800x86
+    LayoutBlockFlow {BODY} at (8,8) size 784x70
+layer at (8,8) size 784x70
+  LayoutBlockFlow {DIV} at (0,0) size 784x70
+    LayoutMultiColumnSet (anonymous) at (0,0) size 784x70
+layer at (8,8) size 384x140
+  LayoutMultiColumnFlowThread (anonymous) at (0,0) size 384x140
+    LayoutBlockFlow {DIV} at (0,0) size 384x100
+layer at (8,108) size 384x40 scrollHeight 41
+  LayoutBlockFlow {DIV} at (0,100) size 384x40
+    LayoutBlockFlow (anonymous) at (0,0) size 384x20
+      LayoutText {#text} at (0,0) size 312x19
+        text run at (0,0) width 312: "There should be a black rectangle below this text."
+layer at (8,128) size 384x20 backgroundClip at (408,38) size 384x40 clip at (408,38) size 384x40
+  LayoutBlockFlow {DIV} at (0,20) size 384x20
+    LayoutInline {<pseudo:before>} at (0,0) size 10x19
+      LayoutTextFragment (anonymous) at (0,0) size 10x19
+        text run at (0,0) width 10: "\x{E8A7}"
+    LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fragmentation/transformed-clip-before-second-column-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fragmentation/transformed-clip-before-second-column-expected.png
new file mode 100644
index 0000000..d61e03a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/fragmentation/transformed-clip-before-second-column-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fragmentation/transformed-clip-before-second-column-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fragmentation/transformed-clip-before-second-column-expected.txt
new file mode 100644
index 0000000..8c5a888d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/fragmentation/transformed-clip-before-second-column-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x84
+  LayoutBlockFlow {HTML} at (0,0) size 800x84
+    LayoutBlockFlow {BODY} at (8,8) size 784x68
+layer at (8,8) size 784x68
+  LayoutBlockFlow {DIV} at (0,0) size 784x68
+    LayoutMultiColumnSet (anonymous) at (0,0) size 784x68
+layer at (8,8) size 384x136
+  LayoutMultiColumnFlowThread (anonymous) at (0,0) size 384x136
+    LayoutBlockFlow {DIV} at (0,0) size 384x100
+layer at (8,108) size 384x36 scrollHeight 37
+  LayoutBlockFlow {DIV} at (0,100) size 384x36
+    LayoutBlockFlow (anonymous) at (0,0) size 384x18
+      LayoutText {#text} at (0,0) size 318x18
+        text run at (0,0) width 318: "There should be a black rectangle below this text."
+layer at (8,126) size 384x18 backgroundClip at (408,40) size 384x36 clip at (408,40) size 384x36
+  LayoutBlockFlow {DIV} at (0,18) size 384x18
+    LayoutInline {<pseudo:before>} at (0,0) size 12x18
+      LayoutTextFragment (anonymous) at (0,0) size 12x18
+        text run at (0,0) width 12: "\x{E8A7}"
+    LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fragmentation/transformed-clip-before-second-column-expected.png b/third_party/WebKit/LayoutTests/platform/win/fragmentation/transformed-clip-before-second-column-expected.png
new file mode 100644
index 0000000..841e1c56
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/fragmentation/transformed-clip-before-second-column-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fragmentation/transformed-clip-before-second-column-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fragmentation/transformed-clip-before-second-column-expected.txt
new file mode 100644
index 0000000..fe8243f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/fragmentation/transformed-clip-before-second-column-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x86
+  LayoutBlockFlow {HTML} at (0,0) size 800x86
+    LayoutBlockFlow {BODY} at (8,8) size 784x70
+layer at (8,8) size 784x70
+  LayoutBlockFlow {DIV} at (0,0) size 784x70
+    LayoutMultiColumnSet (anonymous) at (0,0) size 784x70
+layer at (8,8) size 384x140
+  LayoutMultiColumnFlowThread (anonymous) at (0,0) size 384x140
+    LayoutBlockFlow {DIV} at (0,0) size 384x100
+layer at (8,108) size 384x40 scrollHeight 41
+  LayoutBlockFlow {DIV} at (0,100) size 384x40
+    LayoutBlockFlow (anonymous) at (0,0) size 384x20
+      LayoutText {#text} at (0,0) size 298x19
+        text run at (0,0) width 298: "There should be a black rectangle below this text."
+layer at (8,128) size 384x20 backgroundClip at (408,38) size 384x40 clip at (408,38) size 384x40
+  LayoutBlockFlow {DIV} at (0,20) size 384x20
+    LayoutInline {<pseudo:before>} at (0,0) size 12x19
+      LayoutTextFragment (anonymous) at (0,0) size 12x19
+        text run at (0,0) width 12: "\x{E8A7}"
+    LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fragmentation/transformed-clip-before-second-column-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fragmentation/transformed-clip-before-second-column-expected.png
new file mode 100644
index 0000000..30bd211
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fragmentation/transformed-clip-before-second-column-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/typedcssom/resources/testhelper.js b/third_party/WebKit/LayoutTests/typedcssom/resources/testhelper.js
index 9919946..9ce129d 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/resources/testhelper.js
+++ b/third_party/WebKit/LayoutTests/typedcssom/resources/testhelper.js
@@ -33,6 +33,10 @@
       assert_equals(a.variable, b.variable);
       assert_style_value_equals(a.fallback, b.fallback);
       break;
+    case 'CSSPositionValue':
+      assert_style_value_equals(a.x, b.x);
+      assert_style_value_equals(a.y, b.y);
+      break;
     case 'CSSTransformValue':
       assert_style_value_array_equals(a, b);
       break;
@@ -70,19 +74,36 @@
   }
 }
 
-// Creates a new div element with specified inline style.
-function newDivWithStyle(style) {
-  let target = document.createElement('div');
-  target.style = style;
-  return target;
-}
-
 const gValidUnits = [
   'number', 'percent', 'em', 'ex', 'ch',
   'ic', 'rem', 'lh', 'rlh', 'vw',
   'vh', 'vi', 'vb', 'vmin', 'vmax',
-  'cm', 'mm', 'q', 'in', 'pt',
+  'cm', 'mm', 'Q', 'in', 'pt',
   'pc', 'px', 'deg', 'grad', 'rad',
   'turn', 's', 'ms', 'Hz', 'kHz',
   'dpi', 'dpcm', 'dppx', 'fr',
 ];
+
+// Creates a new div element with specified inline style |cssText|.
+// The created element is deleted during test cleanup.
+function createDivWithStyle(test, cssText) {
+  let element = document.createElement('div');
+  element.style = cssText || '';
+  document.body.appendChild(element);
+  test.add_cleanup(() => {
+    element.remove();
+  });
+  return element;
+}
+
+// Creates a new div element with inline style |cssText| and returns
+// its inline style property map.
+function createInlineStyleMap(test, cssText) {
+  return createDivWithStyle(test, cssText).attributeStyleMap;
+}
+
+// Creates a new div element with inline style |cssText| and returns
+// its computed style property map.
+function createComputedStyleMap(test, cssText) {
+  return createDivWithStyle(test, cssText).computedStyleMap();
+}
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-ident.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-ident.html
index fbf6e37..3b3e4c0 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-ident.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-ident.html
@@ -5,6 +5,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
@@ -13,9 +14,9 @@
       new CSSKeywordValue('auto'));
 }, 'CSS identifiers are normalized from String to CSSKeywordValues');
 
-test(() => {
+test(t => {
   assert_style_value_equals(
-      newDivWithStyle('width: auto').attributeStyleMap.get('width'),
+      createDivWithStyle(t, 'width: auto').attributeStyleMap.get('width'),
       new CSSKeywordValue('auto'));
 }, 'CSS identifiers are normalized from CSSOM to CSSKeywordValues');
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-numeric.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-numeric.html
index dbaa7ef..7817161 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-numeric.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-numeric.html
@@ -5,38 +5,39 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-function test_numeric_normalization(property, cssText, expected) {
+function test_numeric_normalization(test, property, cssText, expected) {
   assert_style_value_equals(CSSStyleValue.parse(property, cssText), expected);
   assert_style_value_equals(
-      newDivWithStyle(property + ': ' + cssText).attributeStyleMap.get(property),
+      createInlineStyleMap(test, property + ': ' + cssText).get(property),
       expected);
 }
 
-test(() => {
-  test_numeric_normalization('line-height', '3.14', CSS.number(3.14));
+test(t => {
+  test_numeric_normalization(t, 'line-height', '3.14', CSS.number(3.14));
 }, 'Normalizing a <number> returns a number CSSUnitValue');
 
-test(() => {
-  test_numeric_normalization('width', '3.14%', CSS.percent(3.14));
+test(t => {
+  test_numeric_normalization(t, 'width', '3.14%', CSS.percent(3.14));
 }, 'Normalizing a <percentage> returns a percent CSSUnitValue');
 
-test(() => {
-  test_numeric_normalization('width', '3.14px', CSS.px(3.14));
+test(t => {
+  test_numeric_normalization(t, 'width', '3.14px', CSS.px(3.14));
 }, 'Normalizing a <dimension> returns a CSSUnitValue with the correct unit');
 
-test(() => {
-  test_numeric_normalization('width', '0', CSS.px(0));
+test(t => {
+  test_numeric_normalization(t, 'width', '0', CSS.px(0));
 }, 'Normalizing a <dimension> with a unitless zero returns 0px');
 
-test(() => {
-  test_numeric_normalization('z-index', '0', CSS.number(0));
+test(t => {
+  test_numeric_normalization(t, 'z-index', '0', CSS.number(0));
 }, 'Normalizing a <number> with a unitless zero returns 0');
 
-test(() => {
-  test_numeric_normalization('width',
+test(t => {
+  test_numeric_normalization(t, 'width',
       'calc(1px + calc(1px) + calc(1px * 2) + 1%)',
       new CSSMathSum(CSS.px(4), CSS.percent(1)));
 }, 'Normalizing a <calc> returns simplified expression');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-tokens.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-tokens.html
index fb126a7..e0087741 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-tokens.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/normalize-tokens.html
@@ -5,15 +5,16 @@
 <script src="../..//resources/testharness.js"></script>
 <script src="../..//resources/testharnessreport.js"></script>
 <script src="../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-function assert_string_normalizes_to(property, str, expected) {
+function assert_string_normalizes_to(test, property, str, expected) {
   // From string
   assert_style_value_equals(CSSStyleValue.parse(property, str), expected);
   // From CSSOM
   assert_style_value_equals(
-    newDivWithStyle(property + ':' + str).attributeStyleMap.get(property),
+    createInlineStyleMap(test, property + ':' + str).get(property),
     expected
   );
 }
@@ -50,12 +51,12 @@
 ];
 
 for (const {value, expectedResult} of gTestCases) {
-  test(() => {
-    assert_string_normalizes_to('color', value, new CSSUnparsedValue(...expectedResult));
+  test(t => {
+    assert_string_normalizes_to(t, 'color', value, new CSSUnparsedValue(...expectedResult));
   }, 'Normalizing "' + value + '" on a CSS property returns correct CSSUnparsedValue');
 
-  test(() => {
-    assert_string_normalizes_to('--X', value, new CSSUnparsedValue(...expectedResult));
+  test(t => {
+    assert_string_normalizes_to(t, '--X', value, new CSSUnparsedValue(...expectedResult));
   }, 'Normalizing "' + value + '" on a custom property returns correct CSSUnparsedValue');
 }
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/positionvalue-normalization.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/positionvalue-normalization.html
new file mode 100644
index 0000000..63897a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/positionvalue-normalization.html
@@ -0,0 +1,67 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSSPositionValue normalization tests</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#positionvalue-normalization">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/testhelper.js"></script>
+<body>
+<script>
+'use strict';
+
+const gSingleTestCases = [
+  { cssText: 'left', x: CSS.percent(0), y: CSS.percent(50) },
+  { cssText: 'right', x: CSS.percent(100), y: CSS.percent(50) },
+  { cssText: 'center', x: CSS.percent(50), y: CSS.percent(50) },
+  { cssText: 'top', x: CSS.percent(50), y: CSS.percent(0) },
+  { cssText: 'bottom', x: CSS.percent(50), y: CSS.percent(100) },
+  { cssText: '3.14px', x: CSS.px(3.14), y: CSS.percent(50) },
+  { cssText: '25%', x: CSS.percent(25), y: CSS.percent(50) },
+];
+
+const gXTestCases = [
+  { cssText: 'left', x: CSS.percent(0), type: 'ident' },
+  { cssText: 'center', x: CSS.percent(50), type: 'ident' },
+  { cssText: 'right', x: CSS.percent(100), type: 'ident' },
+  { cssText: '3.14px', x: CSS.px(3.14), type: 'length' },
+  { cssText: '10%', x: CSS.percent(10), type: 'length' },
+  { cssText: 'calc(1px + 1em)', x: new CSSMathSum(CSS.px(1), CSS.em(1)), type: 'length' },
+  { cssText: 'left 3.14px', x: CSS.px(3.14), type: 'offset' },
+  { cssText: 'right 3.14px', x: CSS.percent(100).sub(CSS.px(3.14)), type: 'offset' },
+];
+
+const gYTestCases = [
+  { cssText: 'top', y: CSS.percent(0), type: 'ident' },
+  { cssText: 'center', y: CSS.percent(50), type: 'ident' },
+  { cssText: 'bottom', y: CSS.percent(100), type: 'ident' },
+  { cssText: '3.14px', y: CSS.px(3.14), type: 'length' },
+  { cssText: '10%', y: CSS.percent(10), type: 'length' },
+  { cssText: 'calc(1px + 1em)', y: new CSSMathSum(CSS.px(1), CSS.em(1)), type: 'length' },
+  { cssText: 'top 3.14px', y: CSS.px(3.14), type: 'offset' },
+  { cssText: 'bottom 3.14px', y: CSS.percent(100).sub(CSS.px(3.14)), type: 'offset' },
+];
+
+for (const {cssText, x, y} of gSingleTestCases) {
+    test(t => {
+      const styleMap = createInlineStyleMap(t, 'object-position: ' + cssText);
+      assert_style_value_equals(styleMap.get('object-position'), new CSSPositionValue(x, y));
+    }, 'CSS <position> value "' + cssText + '" normalizes to CSSPositionValue');
+}
+
+for (const {cssText: xCssText, x, type: xType} of gXTestCases) {
+  for (const {cssText: yCssText, y, type: yType} of gYTestCases) {
+    const cssText = xCssText + ' ' + yCssText;
+
+    // Can't have things like left 10px 20px
+    if ((xType == 'offset' && yType == 'length') ||
+        (xType == 'length' && yType == 'offset'))
+      continue;
+
+    test(t => {
+      const styleMap = createInlineStyleMap(t, 'object-position: ' + cssText);
+      assert_style_value_equals(styleMap.get('object-position'), new CSSPositionValue(x, y));
+    }, 'CSS <position> value "' + cssText + '" normalizes to CSSPositionValue');
+  }
+}
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization-expected.txt
deleted file mode 100644
index d63acc0..0000000
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization-expected.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-This is a testharness.js-based test.
-FAIL Normalizing a matrix() returns a CSSMatrixComponent assert_equals: expected "CSSTransformValue" but got "CSSStyleValue"
-FAIL Normalizing a matrix3d() returns a CSSMatrixComponent assert_equals: expected "CSSTransformValue" but got "CSSStyleValue"
-PASS Normalizing a translate() with X returns a CSSTranslation
-PASS Normalizing a translate() with X and Y returns a CSSTranslation
-PASS Normalizing a translateX() returns a CSSTranslation
-PASS Normalizing a translateY() returns a CSSTranslation
-PASS Normalizing a translate3d() returns a CSSTranslation
-PASS Normalizing a translateZ() returns a CSSTranslation
-PASS Normalizing a scale() with one argument returns a CSSScale
-PASS Normalizing a scale() with two arguments returns a CSSScale
-PASS Normalizing a scaleX() returns a CSSScale
-PASS Normalizing a scaleY() returns a CSSScale
-PASS Normalizing a scale3d() returns a CSSScale
-PASS Normalizing a scaleZ() returns a CSSScale
-PASS Normalizing a rotate() returns a CSSRotation
-PASS Normalizing a rotate3d() returns a CSSRotation
-PASS Normalizing a rotateX() returns a CSSRotation
-PASS Normalizing a rotateY() returns a CSSRotation
-PASS Normalizing a rotateZ() returns a CSSRotation
-PASS Normalizing a skew() with only X returns a CSSSkew
-PASS Normalizing a skew() with X and Y returns a CSSSkew
-PASS Normalizing a skewX() returns a CSSSkew
-PASS Normalizing a skewY() returns a CSSSkew
-PASS Normalizing a perspective() returns a CSSPerspective
-PASS Normalizing a <transform-list> returns a CSSTransformValue containing all the transforms
-PASS Normalizing transforms with calc values contains CSSMathValues
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization.html
index 9d66899..3edad1f 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-normalization/transformvalue-normalization.html
@@ -6,25 +6,26 @@
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../resources/comparisons.js"></script>
 <script src="../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-function test_transform_normalization(cssText, expected) {
+function test_transform_normalization(test, cssText, expected) {
   assert_style_value_equals(CSSStyleValue.parse('transform', cssText), expected);
   assert_style_value_equals(
-      newDivWithStyle('transform: ' + cssText).attributeStyleMap.get('transform'),
+      createInlineStyleMap(test, 'transform: ' + cssText).get('transform'),
       expected);
 }
 
-test(() => {
-  test_transform_normalization('matrix(1, 2, 3, 4, 5, 6)',
+test(t => {
+  test_transform_normalization(t, 'matrix(1, 2, 3, 4, 5, 6)',
       new CSSTransformValue([
         new CSSMatrixComponent(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6]))
       ]));
 }, 'Normalizing a matrix() returns a CSSMatrixComponent');
 
-test(() => {
-  test_transform_normalization(
+test(t => {
+  test_transform_normalization(t,
       'matrix3d(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)',
       new CSSTransformValue([
         new CSSMatrixComponent(new DOMMatrixReadOnly([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16]))
@@ -145,13 +146,13 @@
 ];
 
 for (const {cssText, expected, desc} of gTestCases) {
-  test(() => {
-    test_transform_normalization(cssText, new CSSTransformValue([expected]));
+  test(t => {
+    test_transform_normalization(t, cssText, new CSSTransformValue([expected]));
   }, 'Normalizing a ' + desc + ' returns a ' + expected.constructor.name);
 }
 
-test(() => {
-  test_transform_normalization(
+test(t => {
+  test_transform_normalization(t,
       'translate(1px) rotateX(90deg) perspective(1px) skew(90deg) scale3d(1, 2, 3)',
       new CSSTransformValue([
         new CSSTranslation(CSS.px(1), CSS.px(0)),
@@ -162,8 +163,8 @@
       ]));
 }, 'Normalizing a <transform-list> returns a CSSTransformValue containing all the transforms');
 
-test(() => {
-  test_transform_normalization(
+test(t => {
+  test_transform_normalization(t,
       'translate(calc(1px + 1em)) perspective(calc(1px + 1em))',
       new CSSTransformValue([
         new CSSTranslation(new CSSMathSum(CSS.px(1), CSS.em(1)), CSS.px(0)),
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-relative-url.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-relative-url.html
index b561ca9c..4cbbd70 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-relative-url.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-objects/parse-relative-url.html
@@ -11,10 +11,9 @@
 
 const gTestUrl = '../resources/1x1-green.png';
 
-function loadImageResource(imageValue) {
+function loadImageResource(test, imageValue) {
   // Set a CSSURLImageValue on an element so it can be loaded.
-  let target = newDivWithStyle('');
-  document.body.append(target);
+  let target = createDivWithStyle(test, '');
   target.attributeStyleMap.set('background-image', imageValue);
 
   // add a new Image element to know if the image resource has been loaded
@@ -25,7 +24,7 @@
 
 async_test(t => {
   const result = CSSStyleValue.parse('background-image', 'url('+gTestUrl+')');
-  let image = loadImageResource(result);
+  let image = loadImageResource(t, result);
 
   image.addEventListener('load', t.step_func_done(() => {
     assert_equals(result.state, 'loaded');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssKeywordValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssKeywordValue.html
index 10837e5..23b7c254 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssKeywordValue.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssKeywordValue.html
@@ -5,6 +5,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
@@ -25,8 +26,8 @@
   assert_equals(result.toString(), 'lemon');
 }, 'CSSKeywordValue from DOMString modified through "value" setter serializes correctly');
 
-test(() => {
-  let result = newDivWithStyle('width: auto').attributeStyleMap.get('width');
+test(t => {
+  let result = createInlineStyleMap(t, 'width: auto').get('width');
   result.value = 'lemon';
   assert_equals(result.toString(), 'lemon');
 }, 'CSSKeywordValue from CSSOM modified through "value" setter serializes correctly');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssMathValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssMathValue.html
new file mode 100644
index 0000000..db6ac54
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssMathValue.html
@@ -0,0 +1,81 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>IDL-constructed CSSMathValue serialization tests</title>
+<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#calc-serialization">
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../resources/testhelper.js"></script>
+<script>
+'use strict';
+
+const gTestCases = [
+  {
+    value: new CSSMathSum(CSS.px(1)),
+    cssText: 'calc(1px)',
+    desc: 'CSSMathSum with 1 argument'
+  },
+  {
+    value: new CSSMathSum(CSS.px(1), CSS.px(2)),
+    cssText: 'calc(1px + 2px)',
+    desc: 'CSSMathSum with 2 arguments'
+  },
+  {
+    value: new CSSMathSum(CSS.px(1), CSS.px(2), CSS.px(3)),
+    cssText: 'calc((1px + 2px) + 3px)',
+    desc: 'CSSMathSum with more than 2 arguments'
+  },
+  {
+    value: new CSSMathProduct(CSS.px(1)),
+    cssText: 'calc(1px)',
+    desc: 'CSSMathProduct with 1 argument'
+  },
+  {
+    value: new CSSMathProduct(CSS.px(1), 2),
+    cssText: 'calc(1px * 2)',
+    desc: 'CSSMathProduct with 2 arguments'
+  },
+  {
+    value: new CSSMathProduct(CSS.px(1), 2, 3),
+    cssText: 'calc((1px * 2) * 3)',
+    desc: 'CSSMathProduct with more than 2 arguments'
+  },
+];
+
+for (const {value, cssText, desc} of gTestCases) {
+  test(() => {
+    assert_equals(value.toString(), cssText);
+  }, desc + ' serializes correctly');
+}
+
+// TODO(crbug.com/782103): Convert these to actual tests once we have spec
+// for these. For now, let's just test that they don't crash.
+const gInvalidTestCases = [
+  {
+    value: new CSSMathProduct(CSS.px(1), CSS.s(1)),
+    desc: 'CSSMathProduct of two different base types'
+  },
+  {
+    value: new CSSMathMax(CSS.px(2), CSS.px(1)),
+    desc: 'CSSMathMax'
+  },
+  {
+    value: new CSSMathMin(CSS.px(1), CSS.px(2)),
+    desc: 'CSSMathMin'
+  },
+  {
+    value: new CSSMathNegate(CSS.px(1)),
+    desc: 'CSSMathNegate'
+  },
+  {
+    value: new CSSMathInvert(CSS.px(1)),
+    desc: 'CSSMathInvert'
+  },
+];
+
+for (const {value, desc} of gInvalidTestCases) {
+  test(() => {
+    value.toString();
+  }, 'Serializing ' + desc + ' does not crash');
+}
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssPositionValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssPositionValue.html
deleted file mode 100644
index 32af687..0000000
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssPositionValue.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<!doctype html>
-<meta charset="utf-8">
-<title>IDL-constructed CSSPositionValue serialization tests</title>
-<link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#positionvalue-serialization">
-<script src="../../resources/testharness.js"></script>
-<script src="../../resources/testharnessreport.js"></script>
-<script src="../resources/testhelper.js"></script>
-<script>
-'use strict';
-
-test(() => {
-  assert_equals(new CSSPositionValue(CSS.px(1), CSS.percent(-3.14)).toString(), '1px -3.14%');
-}, 'CSSPositionValue constructed from IDL serializes correctly');
-
-test(() => {
-  let result = CSSStyleValue.parse('object-position', '1px 1px');
-  result.x = CSS.percent(-3.14);
-  assert_equals(result.toString(), '-3.14% 1%');
-}, 'CSSPositionValue from DOMString modified by "x" setter serializes correctly');
-
-test(() => {
-  let result = CSSStyleValue.parse('object-position', '1px 1px');
-  result.y = CSS.percent(-3.14);
-  assert_equals(result.toString(), '1px -3.14%');
-}, 'CSSPositionValue from DOMString modified by "y" setter serializes correctly');
-
-test(() => {
-  let result = newDivWithStyle('object-position: 1px 1px').attributeStyleMap.get('object-position');
-  result.x = CSS.percent(-3.14);
-  assert_equals(result.toString(), '-3.14% 1px');
-}, 'CSSPositionValue from CSSOM modified through "x" setters serializes correctly');
-
-test(() => {
-  let result = newDivWithStyle('object-position: 1px 1px').attributeStyleMap.get('object-position');
-  result.y = CSS.percent(-3.14);
-  assert_equals(result.toString(), '1px -3.14%');
-}, 'CSSPositionValue from CSSOM modified through "y" setters serializes correctly');
-
-</script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUnitValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUnitValue.html
index b301a29..8cfa62b9 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUnitValue.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-serialization/cssUnitValue.html
@@ -5,6 +5,7 @@
 <script src="../../resources/testharness.js"></script>
 <script src="../../resources/testharnessreport.js"></script>
 <script src="../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
@@ -39,14 +40,14 @@
   assert_equals(result.toString(), '1s');
 }, 'CSSKeywordValue from DOMString modified by "unit" setter serializes correctly');
 
-test(() => {
-  let result = newDivWithStyle('width: 1px').attributeStyleMap.get('width');
+test(t => {
+  let result = createInlineStyleMap(t, 'width: 1px').get('width');
   result.value = 3.14;
   assert_equals(result.toString(), '3.14px');
 }, 'CSSKeywordValue from CSSOM modified by "value" setter serializes correctly');
 
-test(() => {
-  let result = newDivWithStyle('width: 1px').attributeStyleMap.get('width');
+test(t => {
+  let result = createInlineStyleMap(t, 'width: 1px').get('width');
   result.unit = 's';
   assert_equals(result.toString(), '1s');
 }, 'CSSKeywordValue from CSSOM modified by "unit" setter serializes correctly');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html
index 7cf2ee7..2d8a3e1f 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/cssUrlImageValue.html
@@ -9,10 +9,9 @@
 <script>
 'use strict';
 
-function loadImageResource(imageValue) {
+function loadImageResource(test, imageValue) {
   // Set a CSSURLImageValue on an element so it can be loaded.
-  let target = newDivWithStyle('');
-  document.body.append(target);
+  let target = createDivWithStyle(test);
   target.attributeStyleMap.set('background-image', imageValue);
 
   // add a new Image element to know if the image resource has been loaded
@@ -45,7 +44,7 @@
 
 async_test(t => {
   const result = new CSSURLImageValue(gTestUrl);
-  let image = loadImageResource(result);
+  let image = loadImageResource(t, result);
 
   image.addEventListener('load', t.step_func_done(() => {
     assert_equals(result.url, gTestUrl);
@@ -58,7 +57,7 @@
 
 async_test(t => {
   const result = new CSSURLImageValue(gBase64TestUrl);
-  let image = loadImageResource(result);
+  let image = loadImageResource(t, result);
 
   image.addEventListener('load', t.step_func_done(() => {
     assert_equals(result.url, gBase64TestUrl);
@@ -71,7 +70,7 @@
 
 async_test(t => {
   const result = new CSSURLImageValue(gBadTestUrl);
-  let image = loadImageResource(result);
+  let image = loadImageResource(t, result);
 
   image.addEventListener('error', t.step_func_done(() => {
       assert_equals(result.url, gBadTestUrl);
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt
index 8f01a57..86cd6a0f 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue-expected.txt
@@ -37,8 +37,8 @@
 PASS CSSUnitValue.unit can be updated to cm
 PASS CSSUnitValue can be constructed with mm
 PASS CSSUnitValue.unit can be updated to mm
-PASS CSSUnitValue can be constructed with q
-PASS CSSUnitValue.unit can be updated to q
+PASS CSSUnitValue can be constructed with Q
+PASS CSSUnitValue.unit can be updated to Q
 PASS CSSUnitValue can be constructed with in
 PASS CSSUnitValue.unit can be updated to in
 PASS CSSUnitValue can be constructed with pt
@@ -59,10 +59,10 @@
 PASS CSSUnitValue.unit can be updated to s
 PASS CSSUnitValue can be constructed with ms
 PASS CSSUnitValue.unit can be updated to ms
-FAIL CSSUnitValue can be constructed with Hz assert_equals: expected "Hz" but got "hz"
-FAIL CSSUnitValue.unit can be updated to Hz assert_equals: expected "Hz" but got "hz"
-FAIL CSSUnitValue can be constructed with kHz assert_equals: expected "kHz" but got "khz"
-FAIL CSSUnitValue.unit can be updated to kHz assert_equals: expected "kHz" but got "khz"
+PASS CSSUnitValue can be constructed with Hz
+PASS CSSUnitValue.unit can be updated to Hz
+PASS CSSUnitValue can be constructed with kHz
+PASS CSSUnitValue.unit can be updated to kHz
 PASS CSSUnitValue can be constructed with dpi
 PASS CSSUnitValue.unit can be updated to dpi
 PASS CSSUnitValue can be constructed with dpcm
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html
index 9ee1d70..bce8c21 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/cssUnitValue.html
@@ -31,13 +31,13 @@
   test(() => {
     const result = new CSSUnitValue(-3.14, unit);
     assert_equals(result.value, -3.14);
-    assert_equals(result.unit, unit);
+    assert_equals(result.unit, unit.toLowerCase());
   }, 'CSSUnitValue can be constructed with ' + unit);
 
   test(() => {
     let result = new CSSUnitValue(-3.14, 'px');
     result.unit = unit
-    assert_equals(result.unit, unit);
+    assert_equals(result.unit, unit.toLowerCase());
   }, 'CSSUnitValue.unit can be updated to ' + unit);
 }
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory-expected.txt b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory-expected.txt
index 889a25c8..c768f12 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory-expected.txt
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory-expected.txt
@@ -16,7 +16,7 @@
 PASS CSS.vmax returns a CSSUnitValue with correct value and unit
 PASS CSS.cm returns a CSSUnitValue with correct value and unit
 PASS CSS.mm returns a CSSUnitValue with correct value and unit
-PASS CSS.q returns a CSSUnitValue with correct value and unit
+PASS CSS.Q returns a CSSUnitValue with correct value and unit
 PASS CSS.in returns a CSSUnitValue with correct value and unit
 PASS CSS.pt returns a CSSUnitValue with correct value and unit
 PASS CSS.pc returns a CSSUnitValue with correct value and unit
@@ -27,8 +27,8 @@
 PASS CSS.turn returns a CSSUnitValue with correct value and unit
 PASS CSS.s returns a CSSUnitValue with correct value and unit
 PASS CSS.ms returns a CSSUnitValue with correct value and unit
-FAIL CSS.Hz returns a CSSUnitValue with correct value and unit assert_equals: expected "Hz" but got "hz"
-FAIL CSS.kHz returns a CSSUnitValue with correct value and unit assert_equals: expected "kHz" but got "khz"
+PASS CSS.Hz returns a CSSUnitValue with correct value and unit
+PASS CSS.kHz returns a CSSUnitValue with correct value and unit
 PASS CSS.dpi returns a CSSUnitValue with correct value and unit
 PASS CSS.dpcm returns a CSSUnitValue with correct value and unit
 PASS CSS.dppx returns a CSSUnitValue with correct value and unit
diff --git a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html
index 9dcb29b..1529adb15 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/stylevalue-subclasses/numeric-objects/numeric-factory.html
@@ -14,7 +14,7 @@
     assert_not_equals(result, null);
     assert_equals(result.constructor.name, CSSUnitValue.name);
     assert_equals(result.value, 12.3);
-    assert_equals(result.unit, unit);
+    assert_equals(result.unit, unit.toLowerCase());
   }, 'CSS.' + unit + ' returns a CSSUnitValue with correct value and unit');
 }
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/computed.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/computed.html
index 2fc4588..4a77ab4 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/computed.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/computed.html
@@ -57,8 +57,8 @@
   assert_style_value_equals(result, CSS.percent(50));
 }, 'Computed StylePropertyMap contains computed values and not resolved values');
 
-test(() => {
-  let target = newDivWithStyle('width: 10px');
+test(t => {
+  let target = createDivWithStyle(t, 'width: 10px');
   const styleMap = target.attributeStyleMap;
   assert_style_value_equals(styleMap.get('width'), CSS.px(10));
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/get.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/get.html
index 24d0bc8..c1b24fa 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/get.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/get.html
@@ -5,38 +5,38 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
-<div id="target" style="width: 10px; --foo: auto; transition-duration: 1s, 2s;"></div>
+<body>
 <script>
 'use strict';
 
-const styleMap = document.getElementById('target').computedStyleMap();
-
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t);
   assert_throws(new TypeError(), () => styleMap.get('lemon'));
 }, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
 
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--foo: auto');
   assert_equals(styleMap.get('--Foo'), null);
 }, 'Calling StylePropertyMap.get with a custom property not in the property model returns null');
 
-test(() => {
-  const result = styleMap.get('width');
-  assert_style_value_equals(result, CSS.px(10));
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'width: 10px; height: 20px');
+  assert_style_value_equals(styleMap.get('width'), CSS.px(10));
 }, 'Calling StylePropertyMap.get with a valid property returns the correct entry');
 
-test(() => {
-  const result = styleMap.get('wIdTh');
-  assert_style_value_equals(result, CSS.px(10));
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'height: 20px; width: 10px;');
+  assert_style_value_equals(styleMap.get('wIdTh'), CSS.px(10));
 }, 'StylePropertyMap.get with a valid property in mixed case returns the correct entry');
 
-test(() => {
-  const result = styleMap.get('--foo');
-  assert_style_value_equals(result, new CSSUnparsedValue(' auto'));
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--foo: auto; --bar: 10px');
+  assert_style_value_equals(styleMap.get('--foo'), new CSSUnparsedValue(' auto'));
 }, 'Calling StylePropertyMap.get with a valid custom property returns the correct entry');
 
-test(() => {
-  const result = styleMap.get('transition-duration');
-  assert_style_value_equals(result, CSS.s(1));
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'width: 10px; transition-duration: 1s, 2s; height: 10px;');
+  assert_style_value_equals(styleMap.get('transition-duration'), CSS.s(1));
 }, 'Calling StylePropertyMap.get with a list-valued property returns only the first value');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getAll.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getAll.html
index d30a75f..0452b8c 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getAll.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getAll.html
@@ -5,39 +5,38 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
-<div id="target" style="width: 10px; --foo: auto; transition-duration: 1s, 2s;"></div>
+<body>
 <script>
 'use strict';
 
-const styleMap = document.getElementById('target').computedStyleMap();
-
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t);
   assert_throws(new TypeError(), () => styleMap.getAll('lemon'));
 }, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
 
-test(() => {
-  const result = styleMap.getAll('--Foo');
-  assert_equals(result.length, 0);
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--foo: auto');
+  assert_style_value_array_equals(styleMap.getAll('--Foo'), []);
 }, 'Calling StylePropertyMap.getAll with a custom property not in the property model returns an empty list');
 
-test(() => {
-  const result = styleMap.getAll('width');
-  assert_style_value_array_equals(result, [CSS.px(10)]);
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'width: 10px; height: 20px');
+  assert_style_value_array_equals(styleMap.getAll('width'), [CSS.px(10)]);
 }, 'Calling StylePropertyMap.getAll with a valid property returns a single element list with the correct entry');
 
-test(() => {
-  const result = styleMap.getAll('wIdTh');
-  assert_style_value_array_equals(result, [CSS.px(10)]);
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'height: 20px; width: 10px');
+  assert_style_value_array_equals(styleMap.getAll('wIdTh'), [CSS.px(10)]);
 }, 'StylePropertyMap.getAll is case-insensitive');
 
-test(() => {
-  const result = styleMap.getAll('--foo');
-  assert_style_value_array_equals(result, [new CSSUnparsedValue(' auto')]);
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--foo: auto; --bar: 10px');
+  assert_style_value_array_equals(styleMap.getAll('--foo'), [new CSSUnparsedValue(' auto')]);
 }, 'Calling StylePropertyMap.getAll with a valid custom property returns a single element list with the correct entry');
 
-test(() => {
-  const result = styleMap.getAll('transition-duration');
-  assert_style_value_array_equals(result, [CSS.s(1), CSS.s(2)]);
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'width: 10px; transition-duration: 1s, 2s; height: 20px');
+  assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2)]);
 }, 'Calling StylePropertyMap.getAll with a list-valued property returns all the values');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getProperties.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getProperties.html
index 87e9f85c..d4e8ea2 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getProperties.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/getProperties.html
@@ -4,15 +4,14 @@
 <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties">
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<div id="target" style="--A: A; width: 0px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;"></div>
+<script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-const target = document.getElementById('target');
-
-test(() => {
-  const styleMap = target.computedStyleMap();
-  const expectedProperties = [...getComputedStyle(target)].sort().concat('--A', '--B', '--C');
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--A: A; width: 0px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;');
+  const expectedProperties = [...getComputedStyle(document.body)].sort().concat('--A', '--B', '--C');
   assert_array_equals(styleMap.getProperties(), expectedProperties);
 }, 'StylePropertyMap.getProperties returns property names in correct order');
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/has.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/has.html
index 53d6f6e..7a09bd1 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/has.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/has.html
@@ -4,13 +4,13 @@
 <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#check-if-stylepropertymap-has-a-property">
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<div id="target" style="width: 10px; --foo: auto; background-image: url('A'), url('B')"></div>
+<script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-const styleMap = document.getElementById('target').computedStyleMap();
-
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t);
   assert_throws(new TypeError(), () => styleMap.has('lemon'));
 }, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
 
@@ -19,11 +19,12 @@
   { property: 'width', expected: true, desc: 'a valid property' },
   { property: 'wIdTh', expected: true, desc: 'a valid property in mixed case' },
   { property: '--foo', expected: true, desc: 'a valid custom property' },
-  { property: 'background-image', expected: true, desc: 'a valid list-valued property' },
+  { property: 'transition-duration', expected: true, desc: 'a valid list-valued property' },
 ];
 
 for (const {property, expected, desc} of gTestCases) {
-  test(() => {
+  test(t => {
+    const styleMap = createComputedStyleMap(t, 'width: 10px; --foo: auto; transition-duration: 1s, 2s');
     assert_equals(styleMap.has(property), expected);
   }, 'Calling StylePropertyMap.has with ' + desc + ' returns ' + expected);
 }
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/iterable.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/iterable.html
index 498d2ec..5391376 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/iterable.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/computed/iterable.html
@@ -5,7 +5,7 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
-<div id="target" style="--A: A; width: 10px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;"></div>
+<body>
 <script>
 'use strict';
 
@@ -16,23 +16,24 @@
   return [...styleMap.values()][index];
 }
 
-const target = document.getElementById('target');
-const styleMap = target.computedStyleMap();
-
-test(() => {
-  const expectedKeys = [...getComputedStyle(target)].sort().concat('--A', '--B', '--C');
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--A: A; width: 10px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;');
+  const expectedKeys = [...getComputedStyle(document.body)].sort().concat('--A', '--B', '--C');
   assert_array_equals([...styleMap], expectedKeys);
 }, 'StylePropertyMap iterates properties in correct order');
 
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'width: 10px; transition-duration: 1s, 2s; height: 20px');
   assert_style_value_equals(findInStyleMap(styleMap, 'width'), CSS.px(10));
 }, 'StylePropertyMap iterator returns CSS properties with the correct CSSStyleValue');
 
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t, 'width: 10px; transition-duration: 1s, 2s; height: 20px');
   assert_style_value_array_equals(findInStyleMap(styleMap, 'transition-duration'), [CSS.s(1), CSS.s(2)]);
 }, 'StylePropertyMap iterator returns list-valued properties with the correct CSSStyleValue');
 
-test(() => {
+test(t => {
+  const styleMap = createComputedStyleMap(t, '--A: A; --C: C; color: red; --B: B;');
   assert_style_value_equals(findInStyleMap(styleMap, '--A'), new CSSUnparsedValue('--A'));
   assert_style_value_equals(findInStyleMap(styleMap, '--B'), new CSSUnparsedValue('--B'));
   assert_style_value_equals(findInStyleMap(styleMap, '--C'), new CSSUnparsedValue('--C'));
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/append.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/append.html
index aa50bcb..925dc15 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/append.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/append.html
@@ -5,6 +5,7 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
@@ -18,14 +19,14 @@
 ];
 
 for (const {property, values, desc} of gInvalidTestCases) {
-  test(() => {
-    let styleMap = newDivWithStyle('').attributeStyleMap;
+  test(t => {
+    let styleMap = createInlineStyleMap(t, '');
     assert_throws(new TypeError(), () => styleMap.append(property, ...values));
   }, 'Calling StylePropertyMap.append with ' + desc + ' throws TypeError');
 }
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.append('transition-duration', CSS.s(1), '2s');
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2)]);
@@ -34,8 +35,8 @@
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2), CSS.s(3), CSS.s(4)]);
 }, 'Appending a list-valued property with CSSStyleValue or String updates its values');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.append('transition-duration', '1s, 2s');
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2)]);
@@ -44,8 +45,8 @@
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2), CSS.s(3), CSS.s(4)]);
 }, 'Appending a list-valued property with list-valued string updates its values');
 
-test(() => {
-  let styleMap = newDivWithStyle('transition-duration: 5s, 10s').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, 'transition-duration: 5s, 10s');
 
   styleMap.append('tRaNsItIoN-dUrAtIoN', '1s', CSS.s(2));
   const result = styleMap.getAll('transition-duration');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/delete.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/delete.html
index 0f65357..401062a 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/delete.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/delete.html
@@ -5,17 +5,18 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-test(() => {
-  let styleMap = newDivWithStyle('').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
   assert_throws(new TypeError(), () => styleMap.delete('lemon'));
   assert_throws(new TypeError(), () => styleMap.delete(null));
 }, 'Calling StylePropertyMap.delete with an unsupported property name throws a TypeError');
 
-test(() => {
-  const styleMap = newDivWithStyle('').attributeStyleMap;
+test(t => {
+  const styleMap = createInlineStyleMap(t, '');
   assert_false(styleMap.has('width'));
   styleMap.delete('width');
   assert_false(styleMap.has('width'));
@@ -29,8 +30,8 @@
 ];
 
 for (const {style, property, desc} of gTestCases) {
-  test(() => {
-    const styleMap = newDivWithStyle(style).attributeStyleMap;
+  test(t => {
+    const styleMap = createInlineStyleMap(t, style);
     assert_true(styleMap.has(property));
     styleMap.delete(property);
     assert_false(styleMap.has(property));
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/get.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/get.html
index d4a23d1..8b34631b 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/get.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/get.html
@@ -5,42 +5,43 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
-<div id="target" style="width: 10px; --foo: auto; transition-duration: 1s, 2s;"></div>
+<body>
 <script>
 'use strict';
 
-const styleMap = document.getElementById('target').attributeStyleMap;
-
-test(() => {
+test(t => {
+  const styleMap = createInlineStyleMap(t);
   assert_throws(new TypeError(), () => styleMap.get('lemon'));
 }, 'Calling StylePropertyMap.get with an unsupported property throws a TypeError');
 
-test(() => {
+test(t => {
+  const styleMap = createInlineStyleMap(t);
   assert_equals(styleMap.get('height'), null);
 }, 'Calling StylePropertyMap.get with a property not in the property model returns null');
 
-test(() => {
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--foo: auto');
   assert_equals(styleMap.get('--Foo'), null);
 }, 'Calling StylePropertyMap.get with a custom property not in the property model returns null');
 
-test(() => {
-  const result = styleMap.get('width');
-  assert_style_value_equals(result, CSS.px(10));
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'width: 10px; height: 20px');
+  assert_style_value_equals(styleMap.get('width'), CSS.px(10));
 }, 'Calling StylePropertyMap.get with a valid property returns the correct entry');
 
-test(() => {
-  const result = styleMap.get('wIdTh');
-  assert_style_value_equals(result, CSS.px(10));
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'height: 20px; width: 10px;');
+  assert_style_value_equals(styleMap.get('wIdTh'), CSS.px(10));
 }, 'StylePropertyMap.get with a valid property in mixed case returns the correct entry');
 
-test(() => {
-  const result = styleMap.get('--foo');
-  assert_style_value_equals(result, new CSSUnparsedValue(' auto'));
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--foo: auto; --bar: 10px');
+  assert_style_value_equals(styleMap.get('--foo'), new CSSUnparsedValue(' auto'));
 }, 'Calling StylePropertyMap.get with a valid custom property returns the correct entry');
 
-test(() => {
-  const result = styleMap.get('transition-duration');
-  assert_style_value_equals(result, CSS.s(1));
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'width: 10px; transition-duration: 1s, 2s; height: 10px;');
+  assert_style_value_equals(styleMap.get('transition-duration'), CSS.s(1));
 }, 'Calling StylePropertyMap.get with a list-valued property returns only the first value');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getAll.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getAll.html
index 862d5be..f08aa81 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getAll.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getAll.html
@@ -5,44 +5,43 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
-<div id="target" style="width: 10px; --foo: auto; transition-duration: 1s, 2s;"></div>
+<body>
 <script>
 'use strict';
 
-const styleMap = document.getElementById('target').attributeStyleMap;
-
-test(() => {
+test(t => {
+  const styleMap = createInlineStyleMap(t);
   assert_throws(new TypeError(), () => styleMap.getAll('lemon'));
 }, 'Calling StylePropertyMap.getAll with an unsupported property throws a TypeError');
 
-test(() => {
-  const result = styleMap.getAll('height');
-  assert_equals(result.length, 0);
+test(t => {
+  const styleMap = createInlineStyleMap(t);
+  assert_style_value_array_equals(styleMap.getAll('height'), []);
 }, 'Calling StylePropertyMap.getAll with a property not in the property model returns an empty list');
 
-test(() => {
-  const result = styleMap.getAll('--Foo');
-  assert_equals(result.length, 0);
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--foo: auto');
+  assert_style_value_array_equals(styleMap.getAll('--Foo'), []);
 }, 'Calling StylePropertyMap.getAll with a custom property not in the property model returns an empty list');
 
-test(() => {
-  const result = styleMap.getAll('width');
-  assert_style_value_array_equals(result, [CSS.px(10)]);
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'width: 10px; height: 20px');
+  assert_style_value_array_equals(styleMap.getAll('width'), [CSS.px(10)]);
 }, 'Calling StylePropertyMap.getAll with a valid property returns a single element list with the correct entry');
 
-test(() => {
-  const result = styleMap.getAll('wIdTh');
-  assert_style_value_array_equals(result, [CSS.px(10)]);
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'height: 20px; width: 10px');
+  assert_style_value_array_equals(styleMap.getAll('wIdTh'), [CSS.px(10)]);
 }, 'StylePropertyMap.getAll is case-insensitive');
 
-test(() => {
-  const result = styleMap.getAll('--foo');
-  assert_style_value_array_equals(result, [new CSSUnparsedValue(' auto')]);
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--foo: auto; --bar: 10px');
+  assert_style_value_array_equals(styleMap.getAll('--foo'), [new CSSUnparsedValue(' auto')]);
 }, 'Calling StylePropertyMap.getAll with a valid custom property returns a single element list with the correct entry');
 
-test(() => {
-  const result = styleMap.getAll('transition-duration');
-  assert_style_value_array_equals(result, [CSS.s(1), CSS.s(2)]);
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'width: 10px; transition-duration: 1s, 2s; height: 20px');
+  assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2)]);
 }, 'Calling StylePropertyMap.getAll with a list-valued property returns all the values');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getProperties.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getProperties.html
index 95bde5a..a23a304bb 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getProperties.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/getProperties.html
@@ -4,21 +4,19 @@
 <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#dom-stylepropertymap-getproperties">
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<div id="target-empty"></div>
-<div id="target-multiple" style="--A: A; width: 0px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;"></div>
+<script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-test(() => {
-  const styleMap = document.getElementById('target-empty').attributeStyleMap;
-  const properties = styleMap.getProperties();
-  assert_equals(properties.length, 0);
+test(t => {
+  const styleMap = createInlineStyleMap(t, '');
+  assert_array_equals(styleMap.getProperties(), []);
 }, 'Calling StylePropertyMap.getProperties on an empty property model returns a zero-length array');
 
-test(() => {
-  const styleMap = document.getElementById('target-multiple').attributeStyleMap;
-  const properties = styleMap.getProperties();
-  assert_array_equals(properties,
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--A: A; width: 0px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;');
+  assert_array_equals(styleMap.getProperties(),
     ['color', 'transition-duration', 'width', '--A', '--B', '--C']);
 }, 'StylePropertyMap.getProperties returns property names in correct order');
 
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/has.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/has.html
index 71ee151a..21ab68b6 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/has.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/has.html
@@ -4,13 +4,13 @@
 <link rel="help" href="https://drafts.css-houdini.org/css-typed-om-1/#check-if-stylepropertymap-has-a-property">
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
-<div id="target" style="width: 10px; --foo: auto; background-image: url('A'), url('B')"></div>
+<script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
-const styleMap = document.getElementById('target').attributeStyleMap;
-
-test(() => {
+test(t => {
+  const styleMap = createInlineStyleMap(t);
   assert_throws(new TypeError(), () => styleMap.has('lemon'));
 }, 'Calling StylePropertyMap.has with an unsupported property throws a TypeError');
 
@@ -20,11 +20,12 @@
   { property: 'width', expected: true, desc: 'a valid property' },
   { property: 'wIdTh', expected: true, desc: 'a valid property in mixed case' },
   { property: '--foo', expected: true, desc: 'a valid custom property' },
-  { property: 'background-image', expected: true, desc: 'a valid list-valued property' },
+  { property: 'transition-duration', expected: true, desc: 'a valid list-valued property' },
 ];
 
 for (const {property, expected, desc} of gTestCases) {
-  test(() => {
+  test(t => {
+    const styleMap = createInlineStyleMap(t, 'width: 10px; --foo: auto; transition-duration: 1s, 2s');
     assert_equals(styleMap.has(property), expected);
   }, 'Calling StylePropertyMap.has with ' + desc + ' returns ' + expected);
 }
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/iterable.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/iterable.html
index 1029037d..5cb4a37 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/iterable.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/iterable.html
@@ -5,51 +5,47 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
-<div id="target-empty"></div>
-<div id="target-multiple" style="--A: A; width: 10px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;"></div>
+<body>
 <script>
 'use strict';
 
-test(() => {
-  const styleMap = document.getElementById('target-empty').attributeStyleMap;
-  const properties = Array.from(styleMap);
-  assert_equals(properties.length, 0);
+test(t => {
+  const styleMap = createInlineStyleMap(t, '');
+  assert_array_equals([...styleMap.entries()], []);
 }, 'Iterating over an empty StylePropertyMap gives a zero-length array');
 
-test(() => {
-  const styleMap = document.getElementById('target-multiple').attributeStyleMap;
-  const keys = Array.from(styleMap.keys());
-  assert_array_equals(keys,
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--A: A; width: 10px; --C: C; transition-duration: 1s, 2s; color: red; --B: B;');
+  assert_array_equals([...styleMap.keys()],
     ['color', 'transition-duration', 'width', '--A', '--B', '--C']);
 }, 'StylePropertyMap iterates properties in correct order');
 
-test(() => {
-  const styleMap = document.getElementById('target-multiple').attributeStyleMap;
-  const [key, result] = [...styleMap][2];
-  assert_equals(key, 'width');
-  assert_style_value_equals(result, CSS.px(10));
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'height: 5px; width: 10px;');
+  const keys = [...styleMap.keys()], values = [...styleMap.values()];
+
+  assert_array_equals(keys, ['height', 'width']);
+  assert_style_value_array_equals(values, [CSS.px(5), CSS.px(10)]);
 }, 'StylePropertyMap iterator returns CSS properties with the correct CSSStyleValue');
 
-test(() => {
-  const styleMap = document.getElementById('target-multiple').attributeStyleMap;
-  const [key, result] = [...styleMap][1];
-  assert_equals(key, 'transition-duration');
-  assert_style_value_array_equals(result, [CSS.s(1), CSS.s(2)]);
+test(t => {
+  const styleMap = createInlineStyleMap(t, 'transition-duration: 1s, 2s');
+  const keys = [...styleMap.keys()], values = [...styleMap.values()];
+
+  assert_array_equals(keys, ['transition-duration']);
+  assert_style_value_array_equals(values[0], [CSS.s(1), CSS.s(2)]);
 }, 'StylePropertyMap iterator returns list-valued properties with the correct CSSStyleValue');
 
-test(() => {
-  const styleMap = document.getElementById('target-multiple').attributeStyleMap;
-  const entries = [...styleMap];
-  assert_equals(entries.length, 6);
+test(t => {
+  const styleMap = createInlineStyleMap(t, '--A: A; --B: B; --C: C');
+  const keys = [...styleMap.keys()], values = [...styleMap.values()];
 
-  const custom_entries = entries.slice(3);
-  for (let i = 0; i < custom_entries.length; i++) {
-    const expected_var = ['A', 'B', 'C'][i];
-    const [key, result] = custom_entries[i];
-
-    assert_equals(key, '--' + expected_var);
-    assert_style_value_equals(result, new CSSUnparsedValue(' ' + expected_var));
-  }
+  assert_array_equals(keys, ['--A', '--B', '--C']);
+  assert_style_value_array_equals(values, [
+    new CSSUnparsedValue(' A'),
+    new CSSUnparsedValue(' B'),
+    new CSSUnparsedValue(' C'),
+  ])
 }, 'StylePropertyMap iterator returns custom properties with the correct CSSStyleValue');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/set.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/set.html
index cc48016..f63b76b3 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/set.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/set.html
@@ -5,6 +5,7 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
@@ -16,24 +17,24 @@
 ];
 
 for (const {property, values, desc} of gInvalidTestCases) {
-  test(() => {
-    let styleMap = newDivWithStyle('').attributeStyleMap;
+  test(t => {
+    let styleMap = createInlineStyleMap(t, '');
     assert_throws(new TypeError(), () => styleMap.set(property, ...values));
   }, 'Setting a StylePropertyMap with ' + desc + ' throws TypeError');
 }
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
   assert_throws(new TypeError(), () => styleMap.set('width', CSS.px(10), CSS.px(10)));
 }, 'Setting a non list-valued property with multiple arguments throws TypeError');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
   assert_throws(new TypeError(), () => styleMap.set('width', '1s, 2s'));
 }, 'Setting a non list-valued property with list-valued string throws TypeError');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.set('width', CSS.px(10));
   assert_style_value_array_equals(styleMap.get('width'), CSS.px(10));
@@ -42,8 +43,8 @@
   assert_style_value_array_equals(styleMap.get('width'), CSS.px(20));
 }, 'Setting a property with CSSStyleValue or String updates its value');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.set('transition-duration', CSS.s(1), '2s');
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2)]);
@@ -52,15 +53,15 @@
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(3), CSS.s(4)]);
 }, 'Setting a list-valued property with CSSStyleValue or String updates its values');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.set('transition-duration', '1s, 2s');
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1), CSS.s(2)]);
 }, 'Setting a list-valued property with a list-valued string updates its value');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.set('--foo', CSS.px(10));
   assert_style_value_array_equals(styleMap.get('--foo'), CSS.px(10));
@@ -69,8 +70,8 @@
   assert_style_value_array_equals(styleMap.get('--foo'), new CSSUnparsedValue('20px'));
 }, 'Setting a custom property with CSSStyleValue or String updates its value');
 
-test(() => {
-  let styleMap = newDivWithStyle('transition-duration: 5s, 10s').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, 'transition-duration: 5s, 10s');
 
   styleMap.set('tRaNsItIoN-dUrAtIoN', '1s', CSS.s(2));
   const result = styleMap.getAll('transition-duration');
diff --git a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/update.html b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/update.html
index 49760bc..1ad4bfc5 100644
--- a/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/update.html
+++ b/third_party/WebKit/LayoutTests/typedcssom/the-stylepropertymap/inline/update.html
@@ -5,6 +5,7 @@
 <script src="../../../resources/testharness.js"></script>
 <script src="../../../resources/testharnessreport.js"></script>
 <script src="../../resources/testhelper.js"></script>
+<body>
 <script>
 'use strict';
 
@@ -16,14 +17,14 @@
 ];
 
 for (const {property, value, desc} of gInvalidTestCases) {
-  test(() => {
-    let styleMap = newDivWithStyle('').attributeStyleMap;
+  test(t => {
+    let styleMap = createInlineStyleMap(t, '');
     assert_throws(new TypeError(), () => styleMap.update(property, () => value));
   }, 'Updating a StylePropertyMap with ' + desc + ' throws TypeError');
 }
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.update('width', () => CSS.px(10));
   assert_style_value_array_equals(styleMap.get('width'), CSS.px(10));
@@ -32,8 +33,8 @@
   assert_style_value_array_equals(styleMap.get('width'), CSS.px(20));
 }, 'Updating a property with CSSStyleValue updates its value');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.update('transition-duration', () => CSS.s(1));
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(1)]);
@@ -42,8 +43,8 @@
   assert_style_value_array_equals(styleMap.getAll('transition-duration'), [CSS.s(2)]);
 }, 'Updating a list-valued property with CSSStyleValue updates its value');
 
-test(() => {
-  let styleMap = newDivWithStyle().attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
 
   styleMap.update('--foo', () => CSS.px(10));
   assert_style_value_array_equals(styleMap.get('--foo'), CSS.px(10));
@@ -52,32 +53,32 @@
   assert_style_value_array_equals(styleMap.get('--foo'), CSS.px(20));
 }, 'Updating a custom property with CSSStyleValue updates its value');
 
-test(() => {
-  let styleMap = newDivWithStyle('').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, '');
   styleMap.update('width', oldValue => {
     assert_equals(oldValue, null);
     return CSS.px(10);
   });
 }, 'Calling StylePropertyMap.update on an empty property model calls update function with null');
 
-test(() => {
-  let styleMap = newDivWithStyle('width: 10px').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, 'width: 10px');
   styleMap.update('width', oldValue => {
     assert_style_value_equals(oldValue, CSS.px(10));
     return CSS.px(20);
   });
 }, 'Calling StylePropertyMap.update on an existing property calls update function with old value');
 
-test(() => {
-  let styleMap = newDivWithStyle('transition-duration: 1s, 2s').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, 'transition-duration: 1s, 2s');
   styleMap.update('transition-duration', oldValue => {
     assert_style_value_equals(oldValue, CSS.s(1));
     return CSS.s(2);
   });
 }, 'Calling StylePropertyMap.update on an existing list-valued property calls update function with first value');
 
-test(() => {
-  let styleMap = newDivWithStyle('width: 10px').attributeStyleMap;
+test(t => {
+  let styleMap = createInlineStyleMap(t, 'width: 10px');
 
   styleMap.update('wIdTh', () => CSS.px(20));
   const result = styleMap.get('width');
diff --git a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
index 151c453..be7ef853 100644
--- a/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
@@ -563,6 +563,7 @@
 interface CSS
     static getter paintWorklet
     static method Hz
+    static method Q
     static method ch
     static method cm
     static method deg
@@ -583,7 +584,6 @@
     static method percent
     static method pt
     static method px
-    static method q
     static method rad
     static method registerProperty
     static method rem
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
index 923cacd34..785c8ae 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModuleTest.cpp
@@ -223,12 +223,7 @@
   EXPECT_EQ("b", resolver->Specifiers()[1]);
 }
 
-// Disabled temporarily, because until a V8-side change
-// (https://bugs.chromium.org/p/v8/issues/detail?id=1569) is landed, this
-// test fails because Instantiate() fails due to the evaluation error.
-// TODO(hiroshige): Re-enable this once the V8-side change is landed.
-// crbug.com/763597
-TEST(ScriptModuleTest, DISABLED_EvaluationErrrorIsRemembered) {
+TEST(ScriptModuleTest, EvaluationErrrorIsRemembered) {
   V8TestingScope scope;
 
   auto modulator = new ScriptModuleTestModulator();
diff --git a/third_party/WebKit/Source/core/BUILD.gn b/third_party/WebKit/Source/core/BUILD.gn
index 4e2bb1d4..e97ccf70 100644
--- a/third_party/WebKit/Source/core/BUILD.gn
+++ b/third_party/WebKit/Source/core/BUILD.gn
@@ -1783,6 +1783,7 @@
     "exported/WebScopedWindowFocusAllowedIndicatorTest.cpp",
     "exported/WebSearchableFormDataTest.cpp",
     "exported/WebSelectorTest.cpp",
+    "exported/WebSurroundingTextTest.cpp",
     "exported/WebUserGestureTokenTest.cpp",
     "exported/WebViewTest.cpp",
     "fetch/BlobBytesConsumerTest.cpp",
diff --git a/third_party/WebKit/Source/core/css/AbstractPropertySetCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/AbstractPropertySetCSSStyleDeclaration.cpp
new file mode 100644
index 0000000..2d12bc0f
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/AbstractPropertySetCSSStyleDeclaration.cpp
@@ -0,0 +1,238 @@
+/*
+ * (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
+ * rights reserved.
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "core/css/AbstractPropertySetCSSStyleDeclaration.h"
+
+#include "core/css/CSSCustomPropertyDeclaration.h"
+#include "core/css/CSSPropertyValueSet.h"
+#include "core/css/StyleAttributeMutationScope.h"
+#include "core/css/StyleEngine.h"
+#include "core/dom/Document.h"
+#include "core/dom/Element.h"
+
+namespace blink {
+
+unsigned AbstractPropertySetCSSStyleDeclaration::length() const {
+  return PropertySet().PropertyCount();
+}
+
+String AbstractPropertySetCSSStyleDeclaration::item(unsigned i) const {
+  if (i >= PropertySet().PropertyCount())
+    return "";
+  CSSPropertyValueSet::PropertyReference property = PropertySet().PropertyAt(i);
+  if (property.Id() == CSSPropertyVariable)
+    return ToCSSCustomPropertyDeclaration(property.Value()).GetName();
+  return property.Property().GetPropertyName();
+}
+
+String AbstractPropertySetCSSStyleDeclaration::cssText() const {
+  return PropertySet().AsText();
+}
+
+void AbstractPropertySetCSSStyleDeclaration::setCSSText(
+    const ExecutionContext* execution_context,
+    const String& text,
+    ExceptionState&) {
+  StyleAttributeMutationScope mutation_scope(this);
+  WillMutate();
+
+  // A null execution_context may be passed in by the inspector, this shouldn't
+  // occur normally.
+  const SecureContextMode mode = execution_context
+                                     ? execution_context->GetSecureContextMode()
+                                     : SecureContextMode::kInsecureContext;
+
+  PropertySet().ParseDeclarationList(text, mode, ContextStyleSheet());
+
+  DidMutate(kPropertyChanged);
+
+  mutation_scope.EnqueueMutationRecord();
+}
+
+String AbstractPropertySetCSSStyleDeclaration::getPropertyValue(
+    const String& property_name) {
+  CSSPropertyID property_id = cssPropertyID(property_name);
+  if (!property_id)
+    return String();
+  if (property_id == CSSPropertyVariable)
+    return PropertySet().GetPropertyValue(AtomicString(property_name));
+  return PropertySet().GetPropertyValue(property_id);
+}
+
+String AbstractPropertySetCSSStyleDeclaration::getPropertyPriority(
+    const String& property_name) {
+  CSSPropertyID property_id = cssPropertyID(property_name);
+  if (!property_id)
+    return String();
+
+  bool important = false;
+  if (property_id == CSSPropertyVariable)
+    important = PropertySet().PropertyIsImportant(AtomicString(property_name));
+  else
+    important = PropertySet().PropertyIsImportant(property_id);
+  return important ? "important" : "";
+}
+
+String AbstractPropertySetCSSStyleDeclaration::GetPropertyShorthand(
+    const String& property_name) {
+  CSSPropertyID property_id = cssPropertyID(property_name);
+
+  // Custom properties don't have shorthands, so we can ignore them here.
+  if (!property_id || !CSSProperty::Get(property_id).IsLonghand())
+    return String();
+  CSSPropertyID shorthand_id = PropertySet().GetPropertyShorthand(property_id);
+  if (!shorthand_id)
+    return String();
+  return CSSProperty::Get(shorthand_id).GetPropertyNameString();
+}
+
+bool AbstractPropertySetCSSStyleDeclaration::IsPropertyImplicit(
+    const String& property_name) {
+  CSSPropertyID property_id = cssPropertyID(property_name);
+
+  // Custom properties don't have shorthands, so we can ignore them here.
+  if (!property_id || property_id == CSSPropertyVariable)
+    return false;
+  return PropertySet().IsPropertyImplicit(property_id);
+}
+
+void AbstractPropertySetCSSStyleDeclaration::setProperty(
+    const ExecutionContext* execution_context,
+    const String& property_name,
+    const String& value,
+    const String& priority,
+    ExceptionState& exception_state) {
+  CSSPropertyID property_id = unresolvedCSSPropertyID(property_name);
+  if (!property_id)
+    return;
+
+  bool important = DeprecatedEqualIgnoringCase(priority, "important");
+  if (!important && !priority.IsEmpty())
+    return;
+
+  SetPropertyInternal(property_id, property_name, value, important,
+                      execution_context->GetSecureContextMode(),
+                      exception_state);
+}
+
+String AbstractPropertySetCSSStyleDeclaration::removeProperty(
+    const String& property_name,
+    ExceptionState& exception_state) {
+  CSSPropertyID property_id = cssPropertyID(property_name);
+  if (!property_id)
+    return String();
+
+  StyleAttributeMutationScope mutation_scope(this);
+  WillMutate();
+
+  String result;
+  bool changed = false;
+  if (property_id == CSSPropertyVariable) {
+    changed =
+        PropertySet().RemoveProperty(AtomicString(property_name), &result);
+  } else {
+    changed = PropertySet().RemoveProperty(property_id, &result);
+  }
+
+  DidMutate(changed ? kPropertyChanged : kNoChanges);
+
+  if (changed)
+    mutation_scope.EnqueueMutationRecord();
+  return result;
+}
+
+const CSSValue*
+AbstractPropertySetCSSStyleDeclaration::GetPropertyCSSValueInternal(
+    CSSPropertyID property_id) {
+  return PropertySet().GetPropertyCSSValue(property_id);
+}
+
+const CSSValue*
+AbstractPropertySetCSSStyleDeclaration::GetPropertyCSSValueInternal(
+    AtomicString custom_property_name) {
+  return PropertySet().GetPropertyCSSValue(custom_property_name);
+}
+
+String AbstractPropertySetCSSStyleDeclaration::GetPropertyValueInternal(
+    CSSPropertyID property_id) {
+  return PropertySet().GetPropertyValue(property_id);
+}
+
+DISABLE_CFI_PERF
+void AbstractPropertySetCSSStyleDeclaration::SetPropertyInternal(
+    CSSPropertyID unresolved_property,
+    const String& custom_property_name,
+    const String& value,
+    bool important,
+    SecureContextMode secure_context_mode,
+    ExceptionState&) {
+  StyleAttributeMutationScope mutation_scope(this);
+  WillMutate();
+
+  bool did_change = false;
+  if (unresolved_property == CSSPropertyVariable) {
+    AtomicString atomic_name(custom_property_name);
+
+    bool is_animation_tainted = IsKeyframeStyle();
+    did_change = PropertySet()
+                     .SetProperty(atomic_name, GetPropertyRegistry(), value,
+                                  important, secure_context_mode,
+                                  ContextStyleSheet(), is_animation_tainted)
+                     .did_change;
+  } else {
+    did_change = PropertySet()
+                     .SetProperty(unresolved_property, value, important,
+                                  secure_context_mode, ContextStyleSheet())
+                     .did_change;
+  }
+
+  DidMutate(did_change ? kPropertyChanged : kNoChanges);
+
+  if (!did_change)
+    return;
+
+  Element* parent = ParentElement();
+  if (parent) {
+    parent->GetDocument().GetStyleEngine().AttributeChangedForElement(
+        HTMLNames::styleAttr, *parent);
+  }
+  mutation_scope.EnqueueMutationRecord();
+}
+
+DISABLE_CFI_PERF
+StyleSheetContents* AbstractPropertySetCSSStyleDeclaration::ContextStyleSheet()
+    const {
+  CSSStyleSheet* css_style_sheet = ParentStyleSheet();
+  return css_style_sheet ? css_style_sheet->Contents() : nullptr;
+}
+
+bool AbstractPropertySetCSSStyleDeclaration::CssPropertyMatches(
+    CSSPropertyID property_id,
+    const CSSValue* property_value) const {
+  return PropertySet().PropertyMatches(property_id, *property_value);
+}
+
+void AbstractPropertySetCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
+  CSSStyleDeclaration::Trace(visitor);
+}
+
+}  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/AbstractPropertySetCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/AbstractPropertySetCSSStyleDeclaration.h
new file mode 100644
index 0000000..25fa2717
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/AbstractPropertySetCSSStyleDeclaration.h
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef AbstractPropertySetCSSStyleDeclaration_h
+#define AbstractPropertySetCSSStyleDeclaration_h
+
+#include "core/css/CSSStyleDeclaration.h"
+
+namespace blink {
+
+class CSSRule;
+class CSSValue;
+class Element;
+class ExceptionState;
+class ExecutionContext;
+class MutableCSSPropertyValueSet;
+class PropertyRegistry;
+class StyleSheetContents;
+
+class AbstractPropertySetCSSStyleDeclaration : public CSSStyleDeclaration {
+ public:
+  virtual Element* ParentElement() const { return nullptr; }
+  StyleSheetContents* ContextStyleSheet() const;
+
+  virtual void Trace(blink::Visitor*);
+
+ private:
+  CSSRule* parentRule() const override { return nullptr; }
+  unsigned length() const final;
+  String item(unsigned index) const final;
+  String getPropertyValue(const String& property_name) final;
+  String getPropertyPriority(const String& property_name) final;
+  String GetPropertyShorthand(const String& property_name) final;
+  bool IsPropertyImplicit(const String& property_name) final;
+  void setProperty(const ExecutionContext*,
+                   const String& property_name,
+                   const String& value,
+                   const String& priority,
+                   ExceptionState&) final;
+  String removeProperty(const String& property_name, ExceptionState&) final;
+  String CssFloat() const;
+  void SetCSSFloat(const String&, ExceptionState&);
+  String cssText() const final;
+  void setCSSText(const ExecutionContext*,
+                  const String&,
+                  ExceptionState&) final;
+  const CSSValue* GetPropertyCSSValueInternal(CSSPropertyID) final;
+  const CSSValue* GetPropertyCSSValueInternal(
+      AtomicString custom_property_name) final;
+  String GetPropertyValueInternal(CSSPropertyID) final;
+  void SetPropertyInternal(CSSPropertyID,
+                           const String& custom_property_name,
+                           const String& value,
+                           bool important,
+                           SecureContextMode,
+                           ExceptionState&) final;
+
+  bool CssPropertyMatches(CSSPropertyID, const CSSValue*) const final;
+
+ protected:
+  enum MutationType { kNoChanges, kPropertyChanged };
+  virtual void WillMutate() {}
+  virtual void DidMutate(MutationType) {}
+  virtual MutableCSSPropertyValueSet& PropertySet() const = 0;
+  virtual PropertyRegistry* GetPropertyRegistry() const = 0;
+  virtual bool IsKeyframeStyle() const { return false; }
+};
+
+}  // namespace blink
+
+#endif  // AbstractPropertySetCSSStyleDeclaration_h
diff --git a/third_party/WebKit/Source/core/css/BUILD.gn b/third_party/WebKit/Source/core/css/BUILD.gn
index e4cf21f..48eedb64 100644
--- a/third_party/WebKit/Source/core/css/BUILD.gn
+++ b/third_party/WebKit/Source/core/css/BUILD.gn
@@ -7,6 +7,8 @@
 blink_core_sources("css") {
   split_count = 10
   sources = [
+    "AbstractPropertySetCSSStyleDeclaration.cpp",
+    "AbstractPropertySetCSSStyleDeclaration.h",
     "ActiveStyleSheets.cpp",
     "ActiveStyleSheets.h",
     "BasicShapeFunctions.cpp",
@@ -207,6 +209,8 @@
     "FontSizeFunctions.cpp",
     "FontSizeFunctions.h",
     "HashTools.h",
+    "InlineCSSStyleDeclaration.cpp",
+    "InlineCSSStyleDeclaration.h",
     "KeyframeStyleRuleCSSStyleDeclaration.cpp",
     "KeyframeStyleRuleCSSStyleDeclaration.h",
     "LocalFontFaceSource.cpp",
@@ -261,6 +265,8 @@
     "SelectorQuery.h",
     "ShadowTreeStyleSheetCollection.cpp",
     "ShadowTreeStyleSheetCollection.h",
+    "StyleAttributeMutationScope.cpp",
+    "StyleAttributeMutationScope.h",
     "StyleAutoColor.h",
     "StyleChangeReason.cpp",
     "StyleChangeReason.h",
@@ -279,6 +285,8 @@
     "StylePropertyShorthandCustom.cpp",
     "StyleRule.cpp",
     "StyleRule.h",
+    "StyleRuleCSSStyleDeclaration.cpp",
+    "StyleRuleCSSStyleDeclaration.h",
     "StyleRuleImport.cpp",
     "StyleRuleImport.h",
     "StyleRuleKeyframe.cpp",
@@ -311,6 +319,7 @@
     "cssom/CSSMathProduct.h",
     "cssom/CSSMathSum.cpp",
     "cssom/CSSMathSum.h",
+    "cssom/CSSMathValue.cpp",
     "cssom/CSSMathValue.h",
     "cssom/CSSMatrixComponent.cpp",
     "cssom/CSSMatrixComponent.h",
diff --git a/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp b/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp
index 1293cd1..56ad3dc 100644
--- a/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp
+++ b/third_party/WebKit/Source/core/css/CSSCalculationValueTest.cpp
@@ -33,7 +33,6 @@
 #include "core/css/CSSPrimitiveValue.h"
 #include "core/css/CSSPropertyValueSet.h"
 #include "core/css/CSSToLengthConversionData.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/style/ComputedStyle.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
diff --git a/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp b/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp
index c16fa1b..1eddf18 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp
+++ b/third_party/WebKit/Source/core/css/CSSFontFaceRule.cpp
@@ -22,8 +22,8 @@
 #include "core/css/CSSFontFaceRule.h"
 
 #include "core/css/CSSPropertyValueSet.h"
-#include "core/css/PropertySetCSSStyleDeclaration.h"
 #include "core/css/StyleRule.h"
+#include "core/css/StyleRuleCSSStyleDeclaration.h"
 #include "platform/wtf/text/StringBuilder.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
index 70804d8f..4ea74cc 100644
--- a/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSGradientValue.cpp
@@ -37,7 +37,6 @@
 #include "core/dom/NodeComputedStyle.h"
 #include "core/dom/TextLinkColors.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/graphics/ColorBlend.h"
 #include "platform/graphics/Gradient.h"
diff --git a/third_party/WebKit/Source/core/css/CSSPageRule.cpp b/third_party/WebKit/Source/core/css/CSSPageRule.cpp
index 0fb61827..24665803 100644
--- a/third_party/WebKit/Source/core/css/CSSPageRule.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPageRule.cpp
@@ -24,8 +24,8 @@
 #include "core/css/CSSPropertyValueSet.h"
 #include "core/css/CSSSelector.h"
 #include "core/css/CSSStyleSheet.h"
-#include "core/css/PropertySetCSSStyleDeclaration.h"
 #include "core/css/StyleRule.h"
+#include "core/css/StyleRuleCSSStyleDeclaration.h"
 #include "core/css/parser/CSSParser.h"
 #include "core/dom/ExecutionContext.h"
 #include "platform/wtf/text/StringBuilder.h"
diff --git a/third_party/WebKit/Source/core/css/CSSStyleRule.cpp b/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
index 46fccda..3ec9484 100644
--- a/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
+++ b/third_party/WebKit/Source/core/css/CSSStyleRule.cpp
@@ -24,8 +24,8 @@
 #include "core/css/CSSPropertyValueSet.h"
 #include "core/css/CSSSelector.h"
 #include "core/css/CSSStyleSheet.h"
-#include "core/css/PropertySetCSSStyleDeclaration.h"
 #include "core/css/StyleRule.h"
+#include "core/css/StyleRuleCSSStyleDeclaration.h"
 #include "core/css/parser/CSSParser.h"
 #include "core/dom/ExecutionContext.h"
 #include "platform/wtf/text/StringBuilder.h"
diff --git a/third_party/WebKit/Source/core/css/CSSViewportRule.cpp b/third_party/WebKit/Source/core/css/CSSViewportRule.cpp
index 0d19c86..fcc9630 100644
--- a/third_party/WebKit/Source/core/css/CSSViewportRule.cpp
+++ b/third_party/WebKit/Source/core/css/CSSViewportRule.cpp
@@ -31,8 +31,8 @@
 #include "core/css/CSSViewportRule.h"
 
 #include "core/css/CSSPropertyValueSet.h"
-#include "core/css/PropertySetCSSStyleDeclaration.h"
 #include "core/css/StyleRule.h"
+#include "core/css/StyleRuleCSSStyleDeclaration.h"
 #include "platform/wtf/text/StringBuilder.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/css/InlineCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/InlineCSSStyleDeclaration.cpp
new file mode 100644
index 0000000..2d43ae6
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/InlineCSSStyleDeclaration.cpp
@@ -0,0 +1,66 @@
+/*
+ * (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
+ * rights reserved.
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "core/css/InlineCSSStyleDeclaration.h"
+
+#include "core/css/StyleAttributeMutationScope.h"
+#include "core/css/StyleChangeReason.h"
+#include "core/dom/Document.h"
+#include "core/dom/Element.h"
+
+namespace blink {
+
+MutableCSSPropertyValueSet& InlineCSSStyleDeclaration::PropertySet() const {
+  return parent_element_->EnsureMutableInlineStyle();
+}
+
+void InlineCSSStyleDeclaration::DidMutate(MutationType type) {
+  if (type == kNoChanges)
+    return;
+
+  if (!parent_element_)
+    return;
+
+  parent_element_->ClearMutableInlineStyleIfEmpty();
+  parent_element_->SetNeedsStyleRecalc(
+      kLocalStyleChange, StyleChangeReasonForTracing::Create(
+                             StyleChangeReason::kInlineCSSStyleMutated));
+  parent_element_->InvalidateStyleAttribute();
+  StyleAttributeMutationScope(this).DidInvalidateStyleAttr();
+}
+
+CSSStyleSheet* InlineCSSStyleDeclaration::ParentStyleSheet() const {
+  return parent_element_ ? &parent_element_->GetDocument().ElementSheet()
+                         : nullptr;
+}
+
+PropertyRegistry* InlineCSSStyleDeclaration::GetPropertyRegistry() const {
+  return parent_element_ ? parent_element_->GetDocument().GetPropertyRegistry()
+                         : nullptr;
+}
+
+void InlineCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
+  visitor->Trace(parent_element_);
+  AbstractPropertySetCSSStyleDeclaration::Trace(visitor);
+}
+
+}  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/InlineCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/InlineCSSStyleDeclaration.h
new file mode 100644
index 0000000..91a70f76
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/InlineCSSStyleDeclaration.h
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef InlineCSSStyleDeclaration_h
+#define InlineCSSStyleDeclaration_h
+
+#include "core/css/AbstractPropertySetCSSStyleDeclaration.h"
+
+namespace blink {
+
+class Element;
+
+class InlineCSSStyleDeclaration final
+    : public AbstractPropertySetCSSStyleDeclaration {
+ public:
+  explicit InlineCSSStyleDeclaration(Element* parent_element)
+      : parent_element_(parent_element) {}
+
+  virtual void Trace(blink::Visitor*);
+
+ private:
+  MutableCSSPropertyValueSet& PropertySet() const override;
+  CSSStyleSheet* ParentStyleSheet() const override;
+  Element* ParentElement() const override { return parent_element_; }
+
+  void DidMutate(MutationType) override;
+  PropertyRegistry* GetPropertyRegistry() const final;
+
+  Member<Element> parent_element_;
+};
+
+}  // namespace blink
+
+#endif  // InlineCSSStyleDeclaration_h
diff --git a/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h
index 069dc2e..a1b6ce8d 100644
--- a/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h
+++ b/third_party/WebKit/Source/core/css/KeyframeStyleRuleCSSStyleDeclaration.h
@@ -5,7 +5,7 @@
 #ifndef KeyframeStyleRuleCSSStyleDeclaration_h
 #define KeyframeStyleRuleCSSStyleDeclaration_h
 
-#include "core/css/PropertySetCSSStyleDeclaration.h"
+#include "core/css/StyleRuleCSSStyleDeclaration.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/css/MediaValues.cpp b/third_party/WebKit/Source/core/css/MediaValues.cpp
index 3a489a18..88441143 100644
--- a/third_party/WebKit/Source/core/css/MediaValues.cpp
+++ b/third_party/WebKit/Source/core/css/MediaValues.cpp
@@ -13,7 +13,7 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/Settings.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 #include "core/paint/compositing/PaintLayerCompositor.h"
diff --git a/third_party/WebKit/Source/core/css/MediaValuesCached.cpp b/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
index 240c02a5..2ffa7da 100644
--- a/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
+++ b/third_party/WebKit/Source/core/css/MediaValuesCached.cpp
@@ -8,7 +8,6 @@
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "platform/graphics/ColorSpaceGamut.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp b/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp
index b2f66c8..0a5d1d0 100644
--- a/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp
+++ b/third_party/WebKit/Source/core/css/MediaValuesDynamic.cpp
@@ -10,7 +10,6 @@
 #include "core/css/MediaValuesCached.h"
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
-#include "core/layout/api/LayoutViewItem.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/css/MediaValuesInitialViewport.cpp b/third_party/WebKit/Source/core/css/MediaValuesInitialViewport.cpp
index 861328e..5cb3dbd 100644
--- a/third_party/WebKit/Source/core/css/MediaValuesInitialViewport.cpp
+++ b/third_party/WebKit/Source/core/css/MediaValuesInitialViewport.cpp
@@ -7,7 +7,6 @@
 #include "core/dom/Document.h"
 #include "core/frame/LocalFrame.h"
 #include "core/frame/LocalFrameView.h"
-#include "core/layout/api/LayoutViewItem.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp
index e6b6d7e..13b0dc5 100644
--- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp
+++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.cpp
@@ -22,423 +22,14 @@
 
 #include "core/css/PropertySetCSSStyleDeclaration.h"
 
-#include "base/macros.h"
-#include "bindings/core/v8/ExceptionState.h"
-#include "core/StylePropertyShorthand.h"
-#include "core/css/CSSCustomPropertyDeclaration.h"
-#include "core/css/CSSKeyframesRule.h"
+#include "core/css/AbstractPropertySetCSSStyleDeclaration.h"
 #include "core/css/CSSPropertyValueSet.h"
-#include "core/css/CSSStyleSheet.h"
-#include "core/css/StyleChangeReason.h"
-#include "core/css/StyleEngine.h"
-#include "core/dom/Element.h"
-#include "core/dom/MutationObserverInterestGroup.h"
-#include "core/dom/MutationRecord.h"
-#include "core/html/custom/CustomElement.h"
-#include "core/html/custom/CustomElementDefinition.h"
-#include "core/html_names.h"
-#include "core/probe/CoreProbes.h"
 
 namespace blink {
 
-namespace {
-
-static CustomElementDefinition* DefinitionIfStyleChangedCallback(
-    Element* element) {
-  CustomElementDefinition* definition =
-      CustomElement::DefinitionForElement(element);
-  return definition && definition->HasStyleAttributeChangedCallback()
-             ? definition
-             : nullptr;
-}
-
-class StyleAttributeMutationScope {
-  STACK_ALLOCATED();
-
- public:
-  DISABLE_CFI_PERF
-  StyleAttributeMutationScope(AbstractPropertySetCSSStyleDeclaration* decl) {
-    ++scope_count_;
-
-    if (scope_count_ != 1) {
-      DCHECK_EQ(current_decl_, decl);
-      return;
-    }
-
-    DCHECK(!current_decl_);
-    current_decl_ = decl;
-
-    if (!current_decl_->ParentElement())
-      return;
-
-    mutation_recipients_ =
-        MutationObserverInterestGroup::CreateForAttributesMutation(
-            *current_decl_->ParentElement(), HTMLNames::styleAttr);
-    bool should_read_old_value =
-        (mutation_recipients_ && mutation_recipients_->IsOldValueRequested()) ||
-        DefinitionIfStyleChangedCallback(current_decl_->ParentElement());
-
-    if (should_read_old_value)
-      old_value_ =
-          current_decl_->ParentElement()->getAttribute(HTMLNames::styleAttr);
-
-    if (mutation_recipients_) {
-      AtomicString requested_old_value =
-          mutation_recipients_->IsOldValueRequested() ? old_value_
-                                                      : g_null_atom;
-      mutation_ = MutationRecord::CreateAttributes(
-          current_decl_->ParentElement(), HTMLNames::styleAttr,
-          requested_old_value);
-    }
-  }
-
-  DISABLE_CFI_PERF
-  ~StyleAttributeMutationScope() {
-    --scope_count_;
-    if (scope_count_)
-      return;
-
-    if (should_deliver_) {
-      if (mutation_)
-        mutation_recipients_->EnqueueMutationRecord(mutation_);
-
-      Element* element = current_decl_->ParentElement();
-      if (CustomElementDefinition* definition =
-              DefinitionIfStyleChangedCallback(element)) {
-        definition->EnqueueAttributeChangedCallback(
-            element, HTMLNames::styleAttr, old_value_,
-            element->getAttribute(HTMLNames::styleAttr));
-      }
-
-      should_deliver_ = false;
-    }
-
-    // We have to clear internal state before calling Inspector's code.
-    AbstractPropertySetCSSStyleDeclaration* local_copy_style_decl =
-        current_decl_;
-    current_decl_ = nullptr;
-
-    if (!should_notify_inspector_)
-      return;
-
-    should_notify_inspector_ = false;
-    if (local_copy_style_decl->ParentElement())
-      probe::didInvalidateStyleAttr(local_copy_style_decl->ParentElement());
-  }
-
-  void EnqueueMutationRecord() { should_deliver_ = true; }
-
-  void DidInvalidateStyleAttr() { should_notify_inspector_ = true; }
-
- private:
-  static unsigned scope_count_;
-  static AbstractPropertySetCSSStyleDeclaration* current_decl_;
-  static bool should_notify_inspector_;
-  static bool should_deliver_;
-
-  Member<MutationObserverInterestGroup> mutation_recipients_;
-  Member<MutationRecord> mutation_;
-  AtomicString old_value_;
-  DISALLOW_COPY_AND_ASSIGN(StyleAttributeMutationScope);
-};
-
-unsigned StyleAttributeMutationScope::scope_count_ = 0;
-AbstractPropertySetCSSStyleDeclaration*
-    StyleAttributeMutationScope::current_decl_ = nullptr;
-bool StyleAttributeMutationScope::should_notify_inspector_ = false;
-bool StyleAttributeMutationScope::should_deliver_ = false;
-
-}  // namespace
-
 void PropertySetCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
   visitor->Trace(property_set_);
   AbstractPropertySetCSSStyleDeclaration::Trace(visitor);
 }
 
-unsigned AbstractPropertySetCSSStyleDeclaration::length() const {
-  return PropertySet().PropertyCount();
-}
-
-String AbstractPropertySetCSSStyleDeclaration::item(unsigned i) const {
-  if (i >= PropertySet().PropertyCount())
-    return "";
-  CSSPropertyValueSet::PropertyReference property = PropertySet().PropertyAt(i);
-  if (property.Id() == CSSPropertyVariable)
-    return ToCSSCustomPropertyDeclaration(property.Value()).GetName();
-  return property.Property().GetPropertyName();
-}
-
-String AbstractPropertySetCSSStyleDeclaration::cssText() const {
-  return PropertySet().AsText();
-}
-
-void AbstractPropertySetCSSStyleDeclaration::setCSSText(
-    const ExecutionContext* execution_context,
-    const String& text,
-    ExceptionState&) {
-  StyleAttributeMutationScope mutation_scope(this);
-  WillMutate();
-
-  // A null execution_context may be passed in by the inspector, this shouldn't
-  // occur normally.
-  const SecureContextMode mode = execution_context
-                                     ? execution_context->GetSecureContextMode()
-                                     : SecureContextMode::kInsecureContext;
-
-  PropertySet().ParseDeclarationList(text, mode, ContextStyleSheet());
-
-  DidMutate(kPropertyChanged);
-
-  mutation_scope.EnqueueMutationRecord();
-}
-
-String AbstractPropertySetCSSStyleDeclaration::getPropertyValue(
-    const String& property_name) {
-  CSSPropertyID property_id = cssPropertyID(property_name);
-  if (!property_id)
-    return String();
-  if (property_id == CSSPropertyVariable)
-    return PropertySet().GetPropertyValue(AtomicString(property_name));
-  return PropertySet().GetPropertyValue(property_id);
-}
-
-String AbstractPropertySetCSSStyleDeclaration::getPropertyPriority(
-    const String& property_name) {
-  CSSPropertyID property_id = cssPropertyID(property_name);
-  if (!property_id)
-    return String();
-
-  bool important = false;
-  if (property_id == CSSPropertyVariable)
-    important = PropertySet().PropertyIsImportant(AtomicString(property_name));
-  else
-    important = PropertySet().PropertyIsImportant(property_id);
-  return important ? "important" : "";
-}
-
-String AbstractPropertySetCSSStyleDeclaration::GetPropertyShorthand(
-    const String& property_name) {
-  CSSPropertyID property_id = cssPropertyID(property_name);
-
-  // Custom properties don't have shorthands, so we can ignore them here.
-  if (!property_id || !CSSProperty::Get(property_id).IsLonghand())
-    return String();
-  CSSPropertyID shorthand_id = PropertySet().GetPropertyShorthand(property_id);
-  if (!shorthand_id)
-    return String();
-  return CSSProperty::Get(shorthand_id).GetPropertyNameString();
-}
-
-bool AbstractPropertySetCSSStyleDeclaration::IsPropertyImplicit(
-    const String& property_name) {
-  CSSPropertyID property_id = cssPropertyID(property_name);
-
-  // Custom properties don't have shorthands, so we can ignore them here.
-  if (!property_id || property_id == CSSPropertyVariable)
-    return false;
-  return PropertySet().IsPropertyImplicit(property_id);
-}
-
-void AbstractPropertySetCSSStyleDeclaration::setProperty(
-    const ExecutionContext* execution_context,
-    const String& property_name,
-    const String& value,
-    const String& priority,
-    ExceptionState& exception_state) {
-  CSSPropertyID property_id = unresolvedCSSPropertyID(property_name);
-  if (!property_id)
-    return;
-
-  bool important = DeprecatedEqualIgnoringCase(priority, "important");
-  if (!important && !priority.IsEmpty())
-    return;
-
-  SetPropertyInternal(property_id, property_name, value, important,
-                      execution_context->GetSecureContextMode(),
-                      exception_state);
-}
-
-String AbstractPropertySetCSSStyleDeclaration::removeProperty(
-    const String& property_name,
-    ExceptionState& exception_state) {
-  CSSPropertyID property_id = cssPropertyID(property_name);
-  if (!property_id)
-    return String();
-
-  StyleAttributeMutationScope mutation_scope(this);
-  WillMutate();
-
-  String result;
-  bool changed = false;
-  if (property_id == CSSPropertyVariable)
-    changed =
-        PropertySet().RemoveProperty(AtomicString(property_name), &result);
-  else
-    changed = PropertySet().RemoveProperty(property_id, &result);
-
-  DidMutate(changed ? kPropertyChanged : kNoChanges);
-
-  if (changed)
-    mutation_scope.EnqueueMutationRecord();
-  return result;
-}
-
-const CSSValue*
-AbstractPropertySetCSSStyleDeclaration::GetPropertyCSSValueInternal(
-    CSSPropertyID property_id) {
-  return PropertySet().GetPropertyCSSValue(property_id);
-}
-
-const CSSValue*
-AbstractPropertySetCSSStyleDeclaration::GetPropertyCSSValueInternal(
-    AtomicString custom_property_name) {
-  return PropertySet().GetPropertyCSSValue(custom_property_name);
-}
-
-String AbstractPropertySetCSSStyleDeclaration::GetPropertyValueInternal(
-    CSSPropertyID property_id) {
-  return PropertySet().GetPropertyValue(property_id);
-}
-
-DISABLE_CFI_PERF
-void AbstractPropertySetCSSStyleDeclaration::SetPropertyInternal(
-    CSSPropertyID unresolved_property,
-    const String& custom_property_name,
-    const String& value,
-    bool important,
-    SecureContextMode secure_context_mode,
-    ExceptionState&) {
-  StyleAttributeMutationScope mutation_scope(this);
-  WillMutate();
-
-  bool did_change = false;
-  if (unresolved_property == CSSPropertyVariable) {
-    AtomicString atomic_name(custom_property_name);
-
-    bool is_animation_tainted = IsKeyframeStyle();
-    did_change = PropertySet()
-                     .SetProperty(atomic_name, GetPropertyRegistry(), value,
-                                  important, secure_context_mode,
-                                  ContextStyleSheet(), is_animation_tainted)
-                     .did_change;
-  } else {
-    did_change = PropertySet()
-                     .SetProperty(unresolved_property, value, important,
-                                  secure_context_mode, ContextStyleSheet())
-                     .did_change;
-  }
-
-  DidMutate(did_change ? kPropertyChanged : kNoChanges);
-
-  if (!did_change)
-    return;
-
-  Element* parent = ParentElement();
-  if (parent)
-    parent->GetDocument().GetStyleEngine().AttributeChangedForElement(
-        HTMLNames::styleAttr, *parent);
-  mutation_scope.EnqueueMutationRecord();
-}
-
-DISABLE_CFI_PERF
-StyleSheetContents* AbstractPropertySetCSSStyleDeclaration::ContextStyleSheet()
-    const {
-  CSSStyleSheet* css_style_sheet = ParentStyleSheet();
-  return css_style_sheet ? css_style_sheet->Contents() : nullptr;
-}
-
-bool AbstractPropertySetCSSStyleDeclaration::CssPropertyMatches(
-    CSSPropertyID property_id,
-    const CSSValue* property_value) const {
-  return PropertySet().PropertyMatches(property_id, *property_value);
-}
-
-void AbstractPropertySetCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
-  CSSStyleDeclaration::Trace(visitor);
-}
-
-StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(
-    MutableCSSPropertyValueSet& property_set_arg,
-    CSSRule* parent_rule)
-    : PropertySetCSSStyleDeclaration(property_set_arg),
-      parent_rule_(parent_rule) {}
-
-StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration() = default;
-
-void StyleRuleCSSStyleDeclaration::WillMutate() {
-  if (parent_rule_ && parent_rule_->parentStyleSheet())
-    parent_rule_->parentStyleSheet()->WillMutateRules();
-}
-
-void StyleRuleCSSStyleDeclaration::DidMutate(MutationType type) {
-  // Style sheet mutation needs to be signaled even if the change failed.
-  // willMutateRules/didMutateRules must pair.
-  if (parent_rule_ && parent_rule_->parentStyleSheet())
-    parent_rule_->parentStyleSheet()->DidMutateRules();
-}
-
-CSSStyleSheet* StyleRuleCSSStyleDeclaration::ParentStyleSheet() const {
-  return parent_rule_ ? parent_rule_->parentStyleSheet() : nullptr;
-}
-
-void StyleRuleCSSStyleDeclaration::Reattach(
-    MutableCSSPropertyValueSet& property_set) {
-  property_set_ = &property_set;
-}
-
-PropertyRegistry* StyleRuleCSSStyleDeclaration::GetPropertyRegistry() const {
-  CSSStyleSheet* sheet = parent_rule_->parentStyleSheet();
-  if (!sheet)
-    return nullptr;
-  Node* node = sheet->ownerNode();
-  if (!node)
-    return nullptr;
-  return node->GetDocument().GetPropertyRegistry();
-}
-
-void StyleRuleCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
-  visitor->Trace(parent_rule_);
-  PropertySetCSSStyleDeclaration::Trace(visitor);
-}
-
-void StyleRuleCSSStyleDeclaration::TraceWrappers(
-    const ScriptWrappableVisitor* visitor) const {
-  visitor->TraceWrappers(parent_rule_);
-  PropertySetCSSStyleDeclaration::TraceWrappers(visitor);
-}
-
-MutableCSSPropertyValueSet& InlineCSSStyleDeclaration::PropertySet() const {
-  return parent_element_->EnsureMutableInlineStyle();
-}
-
-void InlineCSSStyleDeclaration::DidMutate(MutationType type) {
-  if (type == kNoChanges)
-    return;
-
-  if (!parent_element_)
-    return;
-
-  parent_element_->ClearMutableInlineStyleIfEmpty();
-  parent_element_->SetNeedsStyleRecalc(
-      kLocalStyleChange, StyleChangeReasonForTracing::Create(
-                             StyleChangeReason::kInlineCSSStyleMutated));
-  parent_element_->InvalidateStyleAttribute();
-  StyleAttributeMutationScope(this).DidInvalidateStyleAttr();
-}
-
-CSSStyleSheet* InlineCSSStyleDeclaration::ParentStyleSheet() const {
-  return parent_element_ ? &parent_element_->GetDocument().ElementSheet()
-                         : nullptr;
-}
-
-PropertyRegistry* InlineCSSStyleDeclaration::GetPropertyRegistry() const {
-  return parent_element_ ? parent_element_->GetDocument().GetPropertyRegistry()
-                         : nullptr;
-}
-
-void InlineCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
-  visitor->Trace(parent_element_);
-  AbstractPropertySetCSSStyleDeclaration::Trace(visitor);
-}
-
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h
index f7156aa..a7c648e1e 100644
--- a/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h
+++ b/third_party/WebKit/Source/core/css/PropertySetCSSStyleDeclaration.h
@@ -26,69 +26,14 @@
 #ifndef PropertySetCSSStyleDeclaration_h
 #define PropertySetCSSStyleDeclaration_h
 
-#include "core/css/CSSStyleDeclaration.h"
+#include "core/css/AbstractPropertySetCSSStyleDeclaration.h"
 #include "platform/bindings/TraceWrapperMember.h"
 #include "platform/wtf/HashMap.h"
 
 namespace blink {
 
-class CSSRule;
-class CSSValue;
-class Element;
-class ExceptionState;
-class ExecutionContext;
 class MutableCSSPropertyValueSet;
 class PropertyRegistry;
-class StyleSheetContents;
-
-class AbstractPropertySetCSSStyleDeclaration : public CSSStyleDeclaration {
- public:
-  virtual Element* ParentElement() const { return nullptr; }
-  StyleSheetContents* ContextStyleSheet() const;
-
-  virtual void Trace(blink::Visitor*);
-
- private:
-  CSSRule* parentRule() const override { return nullptr; }
-  unsigned length() const final;
-  String item(unsigned index) const final;
-  String getPropertyValue(const String& property_name) final;
-  String getPropertyPriority(const String& property_name) final;
-  String GetPropertyShorthand(const String& property_name) final;
-  bool IsPropertyImplicit(const String& property_name) final;
-  void setProperty(const ExecutionContext*,
-                   const String& property_name,
-                   const String& value,
-                   const String& priority,
-                   ExceptionState&) final;
-  String removeProperty(const String& property_name, ExceptionState&) final;
-  String CssFloat() const;
-  void SetCSSFloat(const String&, ExceptionState&);
-  String cssText() const final;
-  void setCSSText(const ExecutionContext*,
-                  const String&,
-                  ExceptionState&) final;
-  const CSSValue* GetPropertyCSSValueInternal(CSSPropertyID) final;
-  const CSSValue* GetPropertyCSSValueInternal(
-      AtomicString custom_property_name) final;
-  String GetPropertyValueInternal(CSSPropertyID) final;
-  void SetPropertyInternal(CSSPropertyID,
-                           const String& custom_property_name,
-                           const String& value,
-                           bool important,
-                           SecureContextMode,
-                           ExceptionState&) final;
-
-  bool CssPropertyMatches(CSSPropertyID, const CSSValue*) const final;
-
- protected:
-  enum MutationType { kNoChanges, kPropertyChanged };
-  virtual void WillMutate() {}
-  virtual void DidMutate(MutationType) {}
-  virtual MutableCSSPropertyValueSet& PropertySet() const = 0;
-  virtual PropertyRegistry* GetPropertyRegistry() const = 0;
-  virtual bool IsKeyframeStyle() const { return false; }
-};
 
 class PropertySetCSSStyleDeclaration
     : public AbstractPropertySetCSSStyleDeclaration {
@@ -109,53 +54,6 @@
   Member<MutableCSSPropertyValueSet> property_set_;  // Cannot be null
 };
 
-class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration {
- public:
-  static StyleRuleCSSStyleDeclaration* Create(
-      MutableCSSPropertyValueSet& property_set,
-      CSSRule* parent_rule) {
-    return new StyleRuleCSSStyleDeclaration(property_set, parent_rule);
-  }
-
-  void Reattach(MutableCSSPropertyValueSet&);
-
-  virtual void Trace(blink::Visitor*);
-  virtual void TraceWrappers(const ScriptWrappableVisitor*) const;
-
- protected:
-  StyleRuleCSSStyleDeclaration(MutableCSSPropertyValueSet&, CSSRule*);
-  ~StyleRuleCSSStyleDeclaration() override;
-
-  CSSStyleSheet* ParentStyleSheet() const override;
-
-  CSSRule* parentRule() const override { return parent_rule_; }
-
-  void WillMutate() override;
-  void DidMutate(MutationType) override;
-  PropertyRegistry* GetPropertyRegistry() const final;
-
-  TraceWrapperMember<CSSRule> parent_rule_;
-};
-
-class InlineCSSStyleDeclaration final
-    : public AbstractPropertySetCSSStyleDeclaration {
- public:
-  explicit InlineCSSStyleDeclaration(Element* parent_element)
-      : parent_element_(parent_element) {}
-
-  virtual void Trace(blink::Visitor*);
-
- private:
-  MutableCSSPropertyValueSet& PropertySet() const override;
-  CSSStyleSheet* ParentStyleSheet() const override;
-  Element* ParentElement() const override { return parent_element_; }
-
-  void DidMutate(MutationType) override;
-  PropertyRegistry* GetPropertyRegistry() const final;
-
-  Member<Element> parent_element_;
-};
-
 }  // namespace blink
 
 #endif
diff --git a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
index 6f4b28d..1c0511a 100644
--- a/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
+++ b/third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp
@@ -148,9 +148,10 @@
     EXPECT_TRUE(classes.Contains(class_name));
   }
 
-  void ExpectSiblingInvalidation(unsigned max_direct_adjacent_selectors,
-                                 const AtomicString& sibling_name,
-                                 InvalidationSetVector& invalidation_sets) {
+  void ExpectSiblingClassInvalidation(
+      unsigned max_direct_adjacent_selectors,
+      const AtomicString& sibling_name,
+      InvalidationSetVector& invalidation_sets) {
     EXPECT_EQ(1u, invalidation_sets.size());
     const SiblingInvalidationSet& sibling_invalidation_set =
         ToSiblingInvalidationSet(*invalidation_sets[0]);
@@ -161,6 +162,19 @@
               sibling_invalidation_set.MaxDirectAdjacentSelectors());
   }
 
+  void ExpectSiblingIdInvalidation(unsigned max_direct_adjacent_selectors,
+                                   const AtomicString& sibling_name,
+                                   InvalidationSetVector& invalidation_sets) {
+    EXPECT_EQ(1u, invalidation_sets.size());
+    const SiblingInvalidationSet& sibling_invalidation_set =
+        ToSiblingInvalidationSet(*invalidation_sets[0]);
+    HashSet<AtomicString> ids = IdSet(*invalidation_sets[0]);
+    EXPECT_EQ(1u, ids.size());
+    EXPECT_TRUE(ids.Contains(sibling_name));
+    EXPECT_EQ(max_direct_adjacent_selectors,
+              sibling_invalidation_set.MaxDirectAdjacentSelectors());
+  }
+
   void ExpectSiblingDescendantInvalidation(
       unsigned max_direct_adjacent_selectors,
       const AtomicString& sibling_name,
@@ -260,7 +274,7 @@
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "o");
   ExpectNoInvalidation(invalidation_lists.descendants);
-  ExpectSiblingInvalidation(1, "p", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(1, "p", invalidation_lists.siblings);
 }
 
 TEST_F(RuleFeatureSetTest, interleavedDescendantSibling3) {
@@ -454,7 +468,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(1, "a", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(1, "a", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -464,7 +478,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(2, "b", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(2, "b", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -485,7 +499,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(UINT_MAX, "a", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(UINT_MAX, "a", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -496,7 +510,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(UINT_MAX, "b", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(UINT_MAX, "b", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -519,7 +533,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(1, "b", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(1, "b", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -540,7 +554,18 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(1, "b", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(1, "b", invalidation_lists.siblings);
+  ExpectSelfInvalidation(invalidation_lists.siblings);
+}
+
+TEST_F(RuleFeatureSetTest, universalSiblingIdInvalidationAny) {
+  EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
+            CollectFeatures(":-webkit-any(.a) + #b"));
+
+  InvalidationLists invalidation_lists;
+  CollectUniversalSiblingInvalidationSet(invalidation_lists);
+
+  ExpectSiblingIdInvalidation(1, "b", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -560,7 +585,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(1, "a", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(1, "a", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
@@ -579,7 +604,7 @@
   InvalidationLists invalidation_lists;
   CollectUniversalSiblingInvalidationSet(invalidation_lists);
 
-  ExpectSiblingInvalidation(1, "a", invalidation_lists.siblings);
+  ExpectSiblingClassInvalidation(1, "a", invalidation_lists.siblings);
   ExpectSelfInvalidation(invalidation_lists.siblings);
 }
 
diff --git a/third_party/WebKit/Source/core/css/StyleAttributeMutationScope.cpp b/third_party/WebKit/Source/core/css/StyleAttributeMutationScope.cpp
new file mode 100644
index 0000000..c111ba8
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/StyleAttributeMutationScope.cpp
@@ -0,0 +1,123 @@
+/*
+ * (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
+ * rights reserved.
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "core/css/StyleAttributeMutationScope.h"
+
+#include "core/css/AbstractPropertySetCSSStyleDeclaration.h"
+#include "core/dom/MutationObserverInterestGroup.h"
+#include "core/dom/MutationRecord.h"
+#include "core/html/custom/CustomElement.h"
+#include "core/html/custom/CustomElementDefinition.h"
+#include "core/probe/CoreProbes.h"
+
+namespace blink {
+
+namespace {
+
+static CustomElementDefinition* DefinitionIfStyleChangedCallback(
+    Element* element) {
+  CustomElementDefinition* definition =
+      CustomElement::DefinitionForElement(element);
+  return definition && definition->HasStyleAttributeChangedCallback()
+             ? definition
+             : nullptr;
+}
+
+}  // namespace
+
+unsigned StyleAttributeMutationScope::scope_count_ = 0;
+AbstractPropertySetCSSStyleDeclaration*
+    StyleAttributeMutationScope::current_decl_ = nullptr;
+bool StyleAttributeMutationScope::should_notify_inspector_ = false;
+bool StyleAttributeMutationScope::should_deliver_ = false;
+
+DISABLE_CFI_PERF
+StyleAttributeMutationScope::StyleAttributeMutationScope(
+    AbstractPropertySetCSSStyleDeclaration* decl) {
+  ++scope_count_;
+
+  if (scope_count_ != 1) {
+    DCHECK_EQ(current_decl_, decl);
+    return;
+  }
+
+  DCHECK(!current_decl_);
+  current_decl_ = decl;
+
+  if (!current_decl_->ParentElement())
+    return;
+
+  mutation_recipients_ =
+      MutationObserverInterestGroup::CreateForAttributesMutation(
+          *current_decl_->ParentElement(), HTMLNames::styleAttr);
+  bool should_read_old_value =
+      (mutation_recipients_ && mutation_recipients_->IsOldValueRequested()) ||
+      DefinitionIfStyleChangedCallback(current_decl_->ParentElement());
+
+  if (should_read_old_value) {
+    old_value_ =
+        current_decl_->ParentElement()->getAttribute(HTMLNames::styleAttr);
+  }
+
+  if (mutation_recipients_) {
+    AtomicString requested_old_value =
+        mutation_recipients_->IsOldValueRequested() ? old_value_ : g_null_atom;
+    mutation_ = MutationRecord::CreateAttributes(current_decl_->ParentElement(),
+                                                 HTMLNames::styleAttr,
+                                                 requested_old_value);
+  }
+}
+
+DISABLE_CFI_PERF
+StyleAttributeMutationScope::~StyleAttributeMutationScope() {
+  --scope_count_;
+  if (scope_count_)
+    return;
+
+  if (should_deliver_) {
+    if (mutation_)
+      mutation_recipients_->EnqueueMutationRecord(mutation_);
+
+    Element* element = current_decl_->ParentElement();
+    if (CustomElementDefinition* definition =
+            DefinitionIfStyleChangedCallback(element)) {
+      definition->EnqueueAttributeChangedCallback(
+          element, HTMLNames::styleAttr, old_value_,
+          element->getAttribute(HTMLNames::styleAttr));
+    }
+
+    should_deliver_ = false;
+  }
+
+  // We have to clear internal state before calling Inspector's code.
+  AbstractPropertySetCSSStyleDeclaration* local_copy_style_decl = current_decl_;
+  current_decl_ = nullptr;
+
+  if (!should_notify_inspector_)
+    return;
+
+  should_notify_inspector_ = false;
+  if (local_copy_style_decl->ParentElement())
+    probe::didInvalidateStyleAttr(local_copy_style_decl->ParentElement());
+}
+
+}  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/StyleAttributeMutationScope.h b/third_party/WebKit/Source/core/css/StyleAttributeMutationScope.h
new file mode 100644
index 0000000..7e0a3d3
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/StyleAttributeMutationScope.h
@@ -0,0 +1,62 @@
+/*
+ * (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
+ * rights reserved.
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef StyleAttributeMutationScope_h
+#define StyleAttributeMutationScope_h
+
+#include "platform/heap/Member.h"
+#include "platform/wtf/Allocator.h"
+#include "platform/wtf/text/AtomicString.h"
+
+namespace blink {
+
+class AbstractPropertySetCSSStyleDeclaration;
+class MutationObserverInterestGroup;
+class MutationRecord;
+
+class StyleAttributeMutationScope {
+  STACK_ALLOCATED();
+
+ public:
+  StyleAttributeMutationScope(AbstractPropertySetCSSStyleDeclaration*);
+
+  ~StyleAttributeMutationScope();
+
+  void EnqueueMutationRecord() { should_deliver_ = true; }
+
+  void DidInvalidateStyleAttr() { should_notify_inspector_ = true; }
+
+ private:
+  static unsigned scope_count_;
+  static AbstractPropertySetCSSStyleDeclaration* current_decl_;
+  static bool should_notify_inspector_;
+  static bool should_deliver_;
+
+  Member<MutationObserverInterestGroup> mutation_recipients_;
+  Member<MutationRecord> mutation_;
+  AtomicString old_value_;
+  DISALLOW_COPY_AND_ASSIGN(StyleAttributeMutationScope);
+};
+
+}  // namespace blink
+
+#endif
diff --git a/third_party/WebKit/Source/core/css/StyleEngine.cpp b/third_party/WebKit/Source/core/css/StyleEngine.cpp
index e1b0e52..fca0d074 100644
--- a/third_party/WebKit/Source/core/css/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/css/StyleEngine.cpp
@@ -52,9 +52,10 @@
 #include "core/html/HTMLSlotElement.h"
 #include "core/html/imports/HTMLImportsController.h"
 #include "core/html_names.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutObject.h"
 #include "core/page/Page.h"
 #include "core/probe/CoreProbes.h"
+#include "core/style/ComputedStyle.h"
 #include "core/svg/SVGStyleElement.h"
 #include "platform/fonts/FontCache.h"
 #include "platform/fonts/FontSelector.h"
diff --git a/third_party/WebKit/Source/core/css/StyleRuleCSSStyleDeclaration.cpp b/third_party/WebKit/Source/core/css/StyleRuleCSSStyleDeclaration.cpp
new file mode 100644
index 0000000..b7f2743
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/StyleRuleCSSStyleDeclaration.cpp
@@ -0,0 +1,81 @@
+/*
+ * (C) 1999-2003 Lars Knoll (knoll@kde.org)
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
+ * rights reserved.
+ * Copyright (C) 2011 Research In Motion Limited. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "core/css/StyleRuleCSSStyleDeclaration.h"
+#include "core/css/CSSRule.h"
+#include "core/css/CSSStyleSheet.h"
+#include "core/dom/Document.h"
+#include "core/dom/Node.h"
+
+namespace blink {
+
+StyleRuleCSSStyleDeclaration::StyleRuleCSSStyleDeclaration(
+    MutableCSSPropertyValueSet& property_set_arg,
+    CSSRule* parent_rule)
+    : PropertySetCSSStyleDeclaration(property_set_arg),
+      parent_rule_(parent_rule) {}
+
+StyleRuleCSSStyleDeclaration::~StyleRuleCSSStyleDeclaration() = default;
+
+void StyleRuleCSSStyleDeclaration::WillMutate() {
+  if (parent_rule_ && parent_rule_->parentStyleSheet())
+    parent_rule_->parentStyleSheet()->WillMutateRules();
+}
+
+void StyleRuleCSSStyleDeclaration::DidMutate(MutationType type) {
+  // Style sheet mutation needs to be signaled even if the change failed.
+  // willMutateRules/didMutateRules must pair.
+  if (parent_rule_ && parent_rule_->parentStyleSheet())
+    parent_rule_->parentStyleSheet()->DidMutateRules();
+}
+
+CSSStyleSheet* StyleRuleCSSStyleDeclaration::ParentStyleSheet() const {
+  return parent_rule_ ? parent_rule_->parentStyleSheet() : nullptr;
+}
+
+void StyleRuleCSSStyleDeclaration::Reattach(
+    MutableCSSPropertyValueSet& property_set) {
+  property_set_ = &property_set;
+}
+
+PropertyRegistry* StyleRuleCSSStyleDeclaration::GetPropertyRegistry() const {
+  CSSStyleSheet* sheet = parent_rule_->parentStyleSheet();
+  if (!sheet)
+    return nullptr;
+  Node* node = sheet->ownerNode();
+  if (!node)
+    return nullptr;
+  return node->GetDocument().GetPropertyRegistry();
+}
+
+void StyleRuleCSSStyleDeclaration::Trace(blink::Visitor* visitor) {
+  visitor->Trace(parent_rule_);
+  PropertySetCSSStyleDeclaration::Trace(visitor);
+}
+
+void StyleRuleCSSStyleDeclaration::TraceWrappers(
+    const ScriptWrappableVisitor* visitor) const {
+  visitor->TraceWrappers(parent_rule_);
+  PropertySetCSSStyleDeclaration::TraceWrappers(visitor);
+}
+
+}  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/StyleRuleCSSStyleDeclaration.h b/third_party/WebKit/Source/core/css/StyleRuleCSSStyleDeclaration.h
new file mode 100644
index 0000000..7a5b6d37
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/StyleRuleCSSStyleDeclaration.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef StyleRuleCSSStyleDeclaration_h
+#define StyleRuleCSSStyleDeclaration_h
+
+#include "core/css/PropertySetCSSStyleDeclaration.h"
+#include "platform/bindings/TraceWrapperMember.h"
+
+namespace blink {
+
+class CSSRule;
+class MutableCSSPropertyValueSet;
+
+class StyleRuleCSSStyleDeclaration : public PropertySetCSSStyleDeclaration {
+ public:
+  static StyleRuleCSSStyleDeclaration* Create(
+      MutableCSSPropertyValueSet& property_set,
+      CSSRule* parent_rule) {
+    return new StyleRuleCSSStyleDeclaration(property_set, parent_rule);
+  }
+
+  void Reattach(MutableCSSPropertyValueSet&);
+
+  virtual void Trace(blink::Visitor*);
+  virtual void TraceWrappers(const ScriptWrappableVisitor*) const;
+
+ protected:
+  StyleRuleCSSStyleDeclaration(MutableCSSPropertyValueSet&, CSSRule*);
+  ~StyleRuleCSSStyleDeclaration() override;
+
+  CSSStyleSheet* ParentStyleSheet() const override;
+
+  CSSRule* parentRule() const override { return parent_rule_; }
+
+  void WillMutate() override;
+  void DidMutate(MutationType) override;
+  PropertyRegistry* GetPropertyRegistry() const final;
+
+  TraceWrapperMember<CSSRule> parent_rule_;
+};
+
+}  // namespace blink
+
+#endif  // StyleRuleCSSStyleDeclaration_h
diff --git a/third_party/WebKit/Source/core/css/css.dict b/third_party/WebKit/Source/core/css/css.dict
index d763127..15971cc 100644
--- a/third_party/WebKit/Source/core/css/css.dict
+++ b/third_party/WebKit/Source/core/css/css.dict
@@ -44,7 +44,7 @@
 "vh"
 "vmin"
 "vmax"
-"q"
+"Q"
 "in"
 "mm"
 "cm"
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h b/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
index 53b79a86c..1206ea57 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathInvert.h
@@ -50,6 +50,11 @@
     return value_->Equals(*other_invert.value_);
   }
 
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final {
+    // TODO(crbug.com/782103): Implement.
+    return nullptr;
+  }
+
  private:
   CSSMathInvert(CSSNumericValue* value, const CSSNumericValueType& type)
       : CSSMathValue(type), value_(value) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h b/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
index 6c91c64..4436f34 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathMax.h
@@ -27,6 +27,11 @@
   // From CSSStyleValue.
   StyleValueType GetType() const final { return CSSStyleValue::kMaxType; }
 
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final {
+    // TODO(crbug.com/): Implement
+    return nullptr;
+  }
+
  private:
   CSSMathMax(CSSNumericArray* values, const CSSNumericValueType& type)
       : CSSMathVariadic(values, type) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h b/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
index d78f7459..b6f2675 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathMin.h
@@ -29,6 +29,11 @@
   // From CSSStyleValue.
   StyleValueType GetType() const final { return CSSStyleValue::kMinType; }
 
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final {
+    // TODO(crbug.com/): Implement
+    return nullptr;
+  }
+
  private:
   CSSMathMin(CSSNumericArray* values, const CSSNumericValueType& type)
       : CSSMathVariadic(values, type) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h b/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
index 7d54647..d7ca783f 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathNegate.h
@@ -49,6 +49,11 @@
     return value_->Equals(*other_negate.value_);
   }
 
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final {
+    // TODO(crbug.com/xxx): Implement
+    return nullptr;
+  }
+
  private:
   CSSMathNegate(CSSNumericValue* value, const CSSNumericValueType& type)
       : CSSMathValue(type), value_(value) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp b/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp
index 05412a42..892b6e85 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.cpp
@@ -4,7 +4,7 @@
 
 #include "core/css/cssom/CSSMathProduct.h"
 
-#include "core/css/cssom/CSSUnitValue.h"
+#include "core/css/CSSCalculationValue.h"
 
 namespace blink {
 
@@ -77,4 +77,21 @@
   return sum;
 }
 
+CSSCalcExpressionNode* CSSMathProduct::ToCalcExpressionNode() const {
+  // TODO(crbug.com/782103): Handle the single value case correctly.
+  if (NumericValues().size() == 1)
+    return NumericValues()[0]->ToCalcExpressionNode();
+
+  CSSCalcExpressionNode* node = CSSCalcValue::CreateExpressionNode(
+      NumericValues()[0]->ToCalcExpressionNode(),
+      NumericValues()[1]->ToCalcExpressionNode(), kCalcMultiply);
+
+  for (size_t i = 2; i < NumericValues().size(); i++) {
+    node = CSSCalcValue::CreateExpressionNode(
+        node, NumericValues()[i]->ToCalcExpressionNode(), kCalcMultiply);
+  }
+
+  return node;
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h b/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
index d49ce480..c6498ca 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathProduct.h
@@ -27,6 +27,8 @@
   // From CSSStyleValue.
   StyleValueType GetType() const final { return CSSStyleValue::kProductType; }
 
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final;
+
  private:
   CSSMathProduct(CSSNumericArray* values, const CSSNumericValueType& type)
       : CSSMathVariadic(values, type) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp b/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp
index e264b230..497d86c 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathSum.cpp
@@ -4,6 +4,8 @@
 
 #include "core/css/cssom/CSSMathSum.h"
 
+#include "core/css/CSSCalculationValue.h"
+
 namespace blink {
 
 namespace {
@@ -93,4 +95,21 @@
   return sum;
 }
 
+CSSCalcExpressionNode* CSSMathSum::ToCalcExpressionNode() const {
+  // TODO(crbug.com/782103): Handle the single value case correctly.
+  if (NumericValues().size() == 1)
+    return NumericValues()[0]->ToCalcExpressionNode();
+
+  CSSCalcExpressionNode* node = CSSCalcValue::CreateExpressionNode(
+      NumericValues()[0]->ToCalcExpressionNode(),
+      NumericValues()[1]->ToCalcExpressionNode(), kCalcAdd);
+
+  for (size_t i = 2; i < NumericValues().size(); i++) {
+    node = CSSCalcValue::CreateExpressionNode(
+        node, NumericValues()[i]->ToCalcExpressionNode(), kCalcAdd);
+  }
+
+  return node;
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h b/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
index c538b22..8395421 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathSum.h
@@ -27,6 +27,8 @@
   // From CSSStyleValue.
   StyleValueType GetType() const final { return CSSStyleValue::kSumType; }
 
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final;
+
  private:
   CSSMathSum(CSSNumericArray* values, const CSSNumericValueType& type)
       : CSSMathVariadic(values, type) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSMathValue.cpp
new file mode 100644
index 0000000..2d5b9b3
--- /dev/null
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathValue.cpp
@@ -0,0 +1,18 @@
+// 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 "core/css/cssom/CSSMathValue.h"
+
+#include "core/css/CSSCalculationValue.h"
+
+namespace blink {
+
+const CSSValue* CSSMathValue::ToCSSValue(SecureContextMode) const {
+  CSSCalcExpressionNode* node = ToCalcExpressionNode();
+  if (!node)
+    return nullptr;
+  return CSSPrimitiveValue::Create(CSSCalcValue::Create(node));
+}
+
+}  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h b/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
index a98307c6..f479d5e2 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMathValue.h
@@ -6,7 +6,6 @@
 #define CSSMathValue_h
 
 #include "base/macros.h"
-#include "core/css/CSSPrimitiveValue.h"
 #include "core/css/cssom/CSSNumericValue.h"
 
 namespace blink {
@@ -27,10 +26,8 @@
     // TODO(776173): Implement
     return false;
   }
-  const CSSValue* ToCSSValue(SecureContextMode) const final {
-    // TODO(776173): Implement
-    return nullptr;
-  }
+
+  const CSSValue* ToCSSValue(SecureContextMode) const final;
 
  protected:
   CSSMathValue(const CSSNumericValueType& type) : CSSNumericValue(type) {}
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp
index 28e238c0..90810702 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.cpp
@@ -40,6 +40,17 @@
   return matrix_.Get();
 }
 
+CSSMatrixComponent* CSSMatrixComponent::FromCSSValue(
+    const CSSFunctionValue& value) {
+  WTF::Vector<double> entries;
+  for (const auto& item : value)
+    entries.push_back(ToCSSPrimitiveValue(*item).GetDoubleValue());
+
+  return CSSMatrixComponent::Create(
+      DOMMatrixReadOnly::CreateForSerialization(entries.data(), entries.size()),
+      CSSMatrixComponentOptions());
+}
+
 const CSSFunctionValue* CSSMatrixComponent::ToCSSValue(
     SecureContextMode) const {
   CSSFunctionValue* result =
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
index 702c9fd..4e76024 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSMatrixComponent.h
@@ -26,10 +26,7 @@
                                     const CSSMatrixComponentOptions&);
 
   // Blink-internal ways of creating CSSMatrixComponents.
-  static CSSMatrixComponent* FromCSSValue(const CSSFunctionValue& value) {
-    // TODO(meade): Implement.
-    return nullptr;
-  }
+  static CSSMatrixComponent* FromCSSValue(const CSSFunctionValue&);
 
   // Getters and setters for attributes defined in the IDL.
   DOMMatrix* matrix() { return matrix_.Get(); }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h b/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
index ccd0a18..8129ce91 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSNumericValue.h
@@ -19,6 +19,7 @@
 
 class CSSUnitValue;
 class ExceptionState;
+class CSSCalcExpressionNode;
 
 class CSSNumericValue;
 class CSSMathSum;
@@ -49,6 +50,10 @@
   CSSMathSum* toSum(const Vector<String>&, ExceptionState&);
 
   // Internal methods.
+  // Arithmetic
+  virtual CSSNumericValue* Negate();
+  virtual CSSNumericValue* Invert();
+
   // Converts between compatible types.
   CSSUnitValue* to(CSSPrimitiveValue::UnitType) const;
   virtual bool IsUnitValue() const = 0;
@@ -57,6 +62,8 @@
   virtual bool Equals(const CSSNumericValue&) const = 0;
   const CSSNumericValueType& Type() const { return type_; }
 
+  virtual CSSCalcExpressionNode* ToCalcExpressionNode() const = 0;
+
  protected:
   static bool IsValidUnit(CSSPrimitiveValue::UnitType);
   static CSSPrimitiveValue::UnitType UnitFromName(const String& name);
@@ -64,9 +71,6 @@
   CSSNumericValue(const CSSNumericValueType& type) : type_(type) {}
 
  private:
-  virtual CSSNumericValue* Negate();
-  virtual CSSNumericValue* Invert();
-
   CSSNumericValueType type_;
   DISALLOW_COPY_AND_ASSIGN(CSSNumericValue);
 };
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
index 1c9d0567..cfcc9925 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSPerspective.cpp
@@ -70,8 +70,12 @@
     // https://github.com/w3c/css-houdini-drafts/issues/420
     return nullptr;
   }
+  const CSSValue* length = length_->ToCSSValue(secure_context_mode);
+  if (!length)
+    return nullptr;
+
   CSSFunctionValue* result = CSSFunctionValue::Create(CSSValuePerspective);
-  result->Append(*length_->ToCSSValue(secure_context_mode));
+  result->Append(*length);
   return result;
 }
 
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp
index d4fe808..d5a72060 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.cpp
@@ -5,20 +5,83 @@
 #include "core/css/cssom/CSSPositionValue.h"
 
 #include "bindings/core/v8/ExceptionState.h"
+#include "core/css/CSSIdentifierValue.h"
 #include "core/css/CSSValuePair.h"
+#include "core/css/cssom/CSSMathSum.h"
 #include "core/css/cssom/CSSNumericValue.h"
+#include "core/css/cssom/CSSUnitValue.h"
 
 namespace blink {
 
+namespace {
+
+bool IsValidPositionCoord(CSSNumericValue* v) {
+  return v && v->Type().MatchesBaseTypePercentage(
+                  CSSNumericValueType::BaseType::kLength);
+}
+
+CSSNumericValue* FromSingleValue(const CSSValue& value) {
+  if (value.IsIdentifierValue()) {
+    const auto& ident = ToCSSIdentifierValue(value);
+    switch (ident.GetValueID()) {
+      case CSSValueLeft:
+      case CSSValueTop:
+        return CSSUnitValue::Create(0,
+                                    CSSPrimitiveValue::UnitType::kPercentage);
+      case CSSValueCenter:
+        return CSSUnitValue::Create(50,
+                                    CSSPrimitiveValue::UnitType::kPercentage);
+      case CSSValueRight:
+      case CSSValueBottom:
+        return CSSUnitValue::Create(100,
+                                    CSSPrimitiveValue::UnitType::kPercentage);
+      default:
+        NOTREACHED();
+        return nullptr;
+    }
+  }
+
+  if (value.IsPrimitiveValue())
+    return CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(value));
+
+  DCHECK(value.IsValuePair());
+  const auto& pair = ToCSSValuePair(value);
+  DCHECK(pair.First().IsIdentifierValue());
+  DCHECK(pair.Second().IsPrimitiveValue());
+
+  CSSNumericValue* offset =
+      CSSNumericValue::FromCSSValue(ToCSSPrimitiveValue(pair.Second()));
+  DCHECK(offset);
+
+  switch (ToCSSIdentifierValue(pair.First()).GetValueID()) {
+    case CSSValueLeft:
+    case CSSValueTop:
+      return offset;
+    case CSSValueRight:
+    case CSSValueBottom: {
+      CSSNumericValueVector args;
+      args.push_back(
+          CSSUnitValue::Create(100, CSSPrimitiveValue::UnitType::kPercentage));
+      args.push_back(offset->Negate());
+      return CSSMathSum::Create(std::move(args));
+    }
+    default:
+      NOTREACHED();
+      return nullptr;
+  }
+}
+
+}  // namespace
+
 CSSPositionValue* CSSPositionValue::Create(CSSNumericValue* x,
                                            CSSNumericValue* y,
                                            ExceptionState& exception_state) {
-  if (!IsValidCoordinate(x)) {
+  if (!IsValidPositionCoord(x)) {
     exception_state.ThrowTypeError(
         "Must pass length or percentage to x in CSSPositionValue");
     return nullptr;
   }
-  if (!IsValidCoordinate(y)) {
+  if (!IsValidPositionCoord(y)) {
     exception_state.ThrowTypeError(
         "Must pass length or percentage to y in CSSPositionValue");
     return nullptr;
@@ -26,9 +89,28 @@
   return new CSSPositionValue(x, y);
 }
 
+CSSPositionValue* CSSPositionValue::Create(CSSNumericValue* x,
+                                           CSSNumericValue* y) {
+  if (!IsValidPositionCoord(x) || !IsValidPositionCoord(y))
+    return nullptr;
+  return new CSSPositionValue(x, y);
+}
+
+CSSPositionValue* CSSPositionValue::FromCSSValue(const CSSValue& value) {
+  DCHECK(value.IsValuePair());
+  const auto& pair = ToCSSValuePair(value);
+
+  CSSNumericValue* x = FromSingleValue(pair.First());
+  CSSNumericValue* y = FromSingleValue(pair.Second());
+  DCHECK(x);
+  DCHECK(y);
+
+  return CSSPositionValue::Create(x, y);
+}
+
 void CSSPositionValue::setX(CSSNumericValue* x,
                             ExceptionState& exception_state) {
-  if (!IsValidCoordinate(x)) {
+  if (!IsValidPositionCoord(x)) {
     exception_state.ThrowTypeError(
         "Must pass length or percentage to x in CSSPositionValue");
     return;
@@ -38,7 +120,7 @@
 
 void CSSPositionValue::setY(CSSNumericValue* y,
                             ExceptionState& exception_state) {
-  if (!IsValidCoordinate(y)) {
+  if (!IsValidPositionCoord(y)) {
     exception_state.ThrowTypeError(
         "Must pass length or percentage to y in CSSPositionValue");
     return;
@@ -48,15 +130,11 @@
 
 const CSSValue* CSSPositionValue::ToCSSValue(
     SecureContextMode secure_context_mode) const {
-  return CSSValuePair::Create(x_->ToCSSValue(secure_context_mode),
-                              y_->ToCSSValue(secure_context_mode),
-                              CSSValuePair::kKeepIdenticalValues);
-}
-
-// static
-bool CSSPositionValue::IsValidCoordinate(CSSNumericValue* coord) {
-  return coord->Type().MatchesBaseTypePercentage(
-      CSSNumericValueType::BaseType::kLength);
+  const CSSValue* x = x_->ToCSSValue(secure_context_mode);
+  const CSSValue* y = y_->ToCSSValue(secure_context_mode);
+  if (!x || !y)
+    return nullptr;
+  return CSSValuePair::Create(x, y, CSSValuePair::kKeepIdenticalValues);
 }
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.h b/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.h
index bd061f8a..e97e377 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSPositionValue.h
@@ -24,6 +24,11 @@
                                   CSSNumericValue* y,
                                   ExceptionState&);
 
+  // Blink-internal constructor
+  static CSSPositionValue* Create(CSSNumericValue* x, CSSNumericValue* y);
+
+  static CSSPositionValue* FromCSSValue(const CSSValue&);
+
   // Getters and setters defined in the IDL.
   CSSNumericValue* x() { return x_.Get(); }
   CSSNumericValue* y() { return y_.Get(); }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
index 5583431a..dfa4886 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSRotation.cpp
@@ -163,19 +163,23 @@
 
 const CSSFunctionValue* CSSRotation::ToCSSValue(
     SecureContextMode secure_context_mode) const {
-  CSSUnitValue* x = x_->to(CSSPrimitiveValue::UnitType::kNumber);
-  CSSUnitValue* y = y_->to(CSSPrimitiveValue::UnitType::kNumber);
-  CSSUnitValue* z = z_->to(CSSPrimitiveValue::UnitType::kNumber);
-  if (!x || !y || !z) {
-    return nullptr;
-  }
+  DCHECK(x_->to(CSSPrimitiveValue::UnitType::kNumber));
+  DCHECK(y_->to(CSSPrimitiveValue::UnitType::kNumber));
+  DCHECK(z_->to(CSSPrimitiveValue::UnitType::kNumber));
+
   CSSUnitValue* angle = ToCSSUnitValue(angle_);
   CSSFunctionValue* result =
       CSSFunctionValue::Create(is2D() ? CSSValueRotate : CSSValueRotate3d);
   if (!is2D()) {
-    result->Append(*x->ToCSSValue(secure_context_mode));
-    result->Append(*y->ToCSSValue(secure_context_mode));
-    result->Append(*z->ToCSSValue(secure_context_mode));
+    const CSSValue* x = x_->ToCSSValue(secure_context_mode);
+    const CSSValue* y = y_->ToCSSValue(secure_context_mode);
+    const CSSValue* z = z_->ToCSSValue(secure_context_mode);
+    if (!x || !y || !z)
+      return nullptr;
+
+    result->Append(*x);
+    result->Append(*y);
+    result->Append(*z);
   }
   result->Append(
       *CSSPrimitiveValue::Create(angle->value(), angle->GetInternalUnit()));
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp b/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp
index 8e519185..c52f6efe 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSScale.cpp
@@ -159,12 +159,20 @@
 
 const CSSFunctionValue* CSSScale::ToCSSValue(
     SecureContextMode secure_context_mode) const {
+  const CSSValue* x = x_->ToCSSValue(secure_context_mode);
+  const CSSValue* y = y_->ToCSSValue(secure_context_mode);
+  if (!x || !y)
+    return nullptr;
+
   CSSFunctionValue* result =
       CSSFunctionValue::Create(is2D() ? CSSValueScale : CSSValueScale3d);
-  result->Append(*x_->ToCSSValue(secure_context_mode));
-  result->Append(*y_->ToCSSValue(secure_context_mode));
+  result->Append(*x);
+  result->Append(*y);
   if (!is2D()) {
-    result->Append(*z_->ToCSSValue(secure_context_mode));
+    const CSSValue* z = z_->ToCSSValue(secure_context_mode);
+    if (!z)
+      return nullptr;
+    result->Append(*z);
   }
   return result;
 }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp
index dd2d548..3b3049eca 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleValue.cpp
@@ -78,8 +78,8 @@
     const ExecutionContext* execution_context) const {
   const CSSValue* result =
       ToCSSValue(execution_context->GetSecureContextMode());
-  // TODO(meade): Remove this once all the number and length types are
-  // rewritten.
+  // TODO(crbug.com/782103): Remove this once all CSSStyleValues
+  // support toCSSValue().
   return result ? result->CssText() : "";
 }
 
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp
index 5aeb080..8d0f95f 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSTranslation.cpp
@@ -182,12 +182,17 @@
 
 const CSSFunctionValue* CSSTranslation::ToCSSValue(
     SecureContextMode secure_context_mode) const {
+  const CSSValue* x = x_->ToCSSValue(secure_context_mode);
+  const CSSValue* y = y_->ToCSSValue(secure_context_mode);
+
   CSSFunctionValue* result = CSSFunctionValue::Create(
       is2D() ? CSSValueTranslate : CSSValueTranslate3d);
-  result->Append(*x_->ToCSSValue(secure_context_mode));
-  result->Append(*y_->ToCSSValue(secure_context_mode));
-  if (!is2D())
-    result->Append(*z_->ToCSSValue(secure_context_mode));
+  result->Append(*x);
+  result->Append(*y);
+  if (!is2D()) {
+    const CSSValue* z = z_->ToCSSValue(secure_context_mode);
+    result->Append(*z);
+  }
   return result;
 }
 
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp b/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
index 7edc2a192..5bb88b5 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.cpp
@@ -5,6 +5,7 @@
 #include "core/css/cssom/CSSUnitValue.h"
 
 #include "bindings/core/v8/ExceptionState.h"
+#include "core/css/CSSCalculationValue.h"
 #include "core/css/CSSResolutionUnits.h"
 #include "core/css/cssom/CSSMathMax.h"
 #include "core/css/cssom/CSSMathMin.h"
@@ -99,10 +100,6 @@
   return StyleValueType::kUnknownType;
 }
 
-const CSSValue* CSSUnitValue::ToCSSValue(SecureContextMode) const {
-  return CSSPrimitiveValue::Create(value_, unit_);
-}
-
 CSSUnitValue* CSSUnitValue::ConvertTo(
     CSSPrimitiveValue::UnitType target_unit) const {
   if (unit_ == target_unit)
@@ -143,4 +140,13 @@
   return value_ == other_unit_value.value_ && unit_ == other_unit_value.unit_;
 }
 
+const CSSPrimitiveValue* CSSUnitValue::ToCSSValue(SecureContextMode) const {
+  return CSSPrimitiveValue::Create(value_, unit_);
+}
+
+CSSCalcExpressionNode* CSSUnitValue::ToCalcExpressionNode() const {
+  return CSSCalcValue::CreateExpressionNode(
+      CSSPrimitiveValue::Create(value_, unit_));
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h b/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h
index 18eac26..e46617d 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSUnitValue.h
@@ -49,7 +49,9 @@
   bool ContainsPercent() const final {
     return unit_ == CSSPrimitiveValue::UnitType::kPercentage;
   }
-  const CSSValue* ToCSSValue(SecureContextMode) const final;
+
+  const CSSPrimitiveValue* ToCSSValue(SecureContextMode) const final;
+  CSSCalcExpressionNode* ToCalcExpressionNode() const final;
 
  private:
   CSSUnitValue(double value, CSSPrimitiveValue::UnitType unit)
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.h b/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.h
index 735c9f7..4b86a84 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.h
@@ -69,7 +69,7 @@
                                 CSSPrimitiveValue::UnitType::kMillimeters);
   }
 
-  static CSSUnitValue* q(double value) {
+  static CSSUnitValue* Q(double value) {
     return CSSUnitValue::Create(
         value, CSSPrimitiveValue::UnitType::kQuarterMillimeters);
   }
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.idl b/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.idl
index 9284ef0..54e661b 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.idl
+++ b/third_party/WebKit/Source/core/css/cssom/CSSUnitValues.idl
@@ -26,7 +26,7 @@
   [NewObject] static CSSUnitValue pt(double value);
   [NewObject] static CSSUnitValue pc(double value);
   [NewObject] static CSSUnitValue px(double value);
-  [NewObject] static CSSUnitValue q(double value);
+  [NewObject] static CSSUnitValue Q(double value);
   // Currently unsupported length units that are specified
   // [NewObject] static CSSUnitValue ic(double value);
   // [NewObject] static CSSUnitValue lh(double value);
diff --git a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
index e705bc9..51ed4a2f 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.cpp
@@ -21,8 +21,8 @@
 }
 
 void InlineStylePropertyMap::SetProperty(CSSPropertyID property_id,
-                                         const CSSValue* value) {
-  owner_element_->SetInlineStyleProperty(property_id, *value);
+                                         const CSSValue& value) {
+  owner_element_->SetInlineStyleProperty(property_id, value);
 }
 
 void InlineStylePropertyMap::RemoveProperty(CSSPropertyID property_id) {
diff --git a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
index fc897c1..b8ec0c25f 100644
--- a/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
+++ b/third_party/WebKit/Source/core/css/cssom/InlineStylePropertyMap.h
@@ -25,7 +25,7 @@
   const CSSValue* GetProperty(CSSPropertyID) override;
   const CSSValue* GetCustomProperty(AtomicString) override;
   void ForEachProperty(const IterationCallback&) override;
-  void SetProperty(CSSPropertyID, const CSSValue*) override;
+  void SetProperty(CSSPropertyID, const CSSValue&) override;
   void RemoveProperty(CSSPropertyID) override;
   void RemoveCustomProperty(const AtomicString&);
 
diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
index 83873f1..2c882e23 100644
--- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.cpp
@@ -122,7 +122,7 @@
     return;
   }
 
-  SetProperty(property_id, result);
+  SetProperty(property_id, *result);
 }
 
 void StylePropertyMap::append(const ExecutionContext* execution_context,
@@ -165,7 +165,7 @@
     current_value->Append(*value);
   }
 
-  SetProperty(property_id, current_value);
+  SetProperty(property_id, *current_value);
 }
 
 void StylePropertyMap::remove(const String& property_name,
diff --git a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h
index 9860d5a..52992f5c 100644
--- a/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h
+++ b/third_party/WebKit/Source/core/css/cssom/StylePropertyMap.h
@@ -34,7 +34,7 @@
               ExceptionState&);
 
  protected:
-  virtual void SetProperty(CSSPropertyID, const CSSValue*) = 0;
+  virtual void SetProperty(CSSPropertyID, const CSSValue&) = 0;
   virtual void RemoveProperty(CSSPropertyID) = 0;
   virtual void RemoveCustomProperty(const AtomicString&) = 0;
 
diff --git a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
index 30d38a0..19014b9 100644
--- a/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/StyleValueFactory.cpp
@@ -11,6 +11,7 @@
 #include "core/css/cssom/CSSKeywordValue.h"
 #include "core/css/cssom/CSSNumericValue.h"
 #include "core/css/cssom/CSSOMTypes.h"
+#include "core/css/cssom/CSSPositionValue.h"
 #include "core/css/cssom/CSSStyleValue.h"
 #include "core/css/cssom/CSSStyleVariableReferenceValue.h"
 #include "core/css/cssom/CSSTransformValue.h"
@@ -31,6 +32,8 @@
   switch (property_id) {
     case CSSPropertyTransform:
       return CSSTransformValue::FromCSSValue(value);
+    case CSSPropertyObjectPosition:
+      return CSSPositionValue::FromCSSValue(value);
     default:
       // TODO(meade): Implement other properties.
       break;
diff --git a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
index af3bde6..8fa878d0 100644
--- a/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ScopedStyleResolver.cpp
@@ -60,8 +60,8 @@
 void ScopedStyleResolver::AddKeyframeRules(const RuleSet& rule_set) {
   const HeapVector<Member<StyleRuleKeyframes>> keyframes_rules =
       rule_set.KeyframesRules();
-  for (unsigned i = 0; i < keyframes_rules.size(); ++i)
-    AddKeyframeStyle(keyframes_rules[i]);
+  for (auto rule : keyframes_rules)
+    AddKeyframeStyle(rule);
 }
 
 void ScopedStyleResolver::AddFontFaceRules(const RuleSet& rule_set) {
@@ -113,9 +113,9 @@
   features.DeviceDependentMediaQueryResults().AppendVector(
       device_dependent_media_query_results_);
 
-  for (size_t i = 0; i < author_style_sheets_.size(); ++i) {
-    DCHECK(author_style_sheets_[i]->ownerNode());
-    StyleSheetContents* contents = author_style_sheets_[i]->Contents();
+  for (auto sheet : author_style_sheets_) {
+    DCHECK(sheet->ownerNode());
+    StyleSheetContents* contents = sheet->Contents();
     if (contents->HasOneClient() ||
         visited_shared_style_sheet_contents.insert(contents).is_new_entry)
       features.Add(contents->GetRuleSet().Features());
@@ -216,11 +216,11 @@
 void ScopedStyleResolver::CollectMatchingAuthorRules(
     ElementRuleCollector& collector,
     CascadeOrder cascade_order) {
-  for (size_t i = 0; i < author_style_sheets_.size(); ++i) {
-    DCHECK(author_style_sheets_[i]->ownerNode());
-    MatchRequest match_request(
-        &author_style_sheets_[i]->Contents()->GetRuleSet(), &scope_->RootNode(),
-        author_style_sheets_[i], i);
+  size_t sheet_index = 0;
+  for (auto sheet : author_style_sheets_) {
+    DCHECK(sheet->ownerNode());
+    MatchRequest match_request(&sheet->Contents()->GetRuleSet(),
+                               &scope_->RootNode(), sheet, sheet_index++);
     collector.CollectMatchingRules(match_request, cascade_order);
   }
 }
@@ -228,11 +228,11 @@
 void ScopedStyleResolver::CollectMatchingShadowHostRules(
     ElementRuleCollector& collector,
     CascadeOrder cascade_order) {
-  for (size_t i = 0; i < author_style_sheets_.size(); ++i) {
-    DCHECK(author_style_sheets_[i]->ownerNode());
-    MatchRequest match_request(
-        &author_style_sheets_[i]->Contents()->GetRuleSet(), &scope_->RootNode(),
-        author_style_sheets_[i], i);
+  size_t sheet_index = 0;
+  for (auto sheet : author_style_sheets_) {
+    DCHECK(sheet->ownerNode());
+    MatchRequest match_request(&sheet->Contents()->GetRuleSet(),
+                               &scope_->RootNode(), sheet, sheet_index++);
     collector.CollectMatchingShadowHostRules(match_request, cascade_order);
   }
 }
@@ -267,9 +267,8 @@
   // Only consider the global author RuleSet for @page rules, as per the HTML5
   // spec.
   DCHECK(scope_->RootNode().IsDocumentNode());
-  for (size_t i = 0; i < author_style_sheets_.size(); ++i)
-    collector.MatchPageRules(
-        &author_style_sheets_[i]->Contents()->GetRuleSet());
+  for (auto sheet : author_style_sheets_)
+    collector.MatchPageRules(&sheet->Contents()->GetRuleSet());
 }
 
 void ScopedStyleResolver::Trace(blink::Visitor* visitor) {
@@ -282,10 +281,8 @@
 
 static void AddRules(RuleSet* rule_set,
                      const HeapVector<MinimalRuleData>& rules) {
-  for (unsigned i = 0; i < rules.size(); ++i) {
-    const MinimalRuleData& info = rules[i];
+  for (const auto& info : rules)
     rule_set->AddRule(info.rule_, info.selector_index_, info.flags_);
-  }
 }
 
 void ScopedStyleResolver::AddTreeBoundaryCrossingRules(
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index 7c72279b..c3d3f308 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -658,11 +658,11 @@
 
     // TODO(dominicc): Remove this counter when Issue 590014 is fixed.
     if (element->HasTagName(HTMLNames::summaryTag)) {
-      MatchedPropertiesRange properties =
+      MatchedPropertiesRange matched_range =
           collector.MatchedResult().AuthorRules();
-      for (auto it = properties.begin(); it != properties.end(); ++it) {
+      for (const auto& matched : matched_range) {
         const CSSValue* value =
-            it->properties->GetPropertyCSSValue(CSSPropertyDisplay);
+            matched.properties->GetPropertyCSSValue(CSSPropertyDisplay);
         if (value && value->IsIdentifierValue() &&
             ToCSSIdentifierValue(*value).GetValueID() == CSSValueBlock) {
           UseCounter::Count(
@@ -1944,9 +1944,8 @@
   StyleRuleList* rules = collector.MatchedStyleRuleList();
   if (!rules)
     return;
-  for (size_t i = 0; i < rules->size(); i++)
-    state.Style()->AddCallbackSelector(
-        rules->at(i)->SelectorList().SelectorsText());
+  for (auto rule : *rules)
+    state.Style()->AddCallbackSelector(rule->SelectorList().SelectorsText());
 }
 
 // Font properties are also handled by FontStyleResolver outside the main
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp
index 69b9b4c..8be7ab8 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolverState.cpp
@@ -26,7 +26,6 @@
 #include "core/css/CSSPropertyValueSet.h"
 #include "core/dom/Node.h"
 #include "core/dom/NodeComputedStyle.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/style/ComputedStyle.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp
index 35546601..13d8961 100644
--- a/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/ViewportStyleResolver.cpp
@@ -46,7 +46,6 @@
 #include "core/frame/LocalFrame.h"
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/Settings.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index b282a93c..b2883a8e6739 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -179,7 +179,6 @@
 #include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/TextAutosizer.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/loader/CookieJar.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameFetchContext.h"
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 38f979a..69e25c2 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -123,8 +123,8 @@
 #include "core/intersection_observer/ElementIntersectionObserverData.h"
 #include "core/layout/AdjustForAbsoluteZoom.h"
 #include "core/layout/LayoutTextFragment.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutBoxItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/dom/ElementRareData.h b/third_party/WebKit/Source/core/dom/ElementRareData.h
index 6339fe0ea..59476a1 100644
--- a/third_party/WebKit/Source/core/dom/ElementRareData.h
+++ b/third_party/WebKit/Source/core/dom/ElementRareData.h
@@ -24,6 +24,7 @@
 
 #include <memory>
 #include "core/animation/ElementAnimations.h"
+#include "core/css/InlineCSSStyleDeclaration.h"
 #include "core/css/cssom/InlineStylePropertyMap.h"
 #include "core/dom/AccessibleNode.h"
 #include "core/dom/Attr.h"
diff --git a/third_party/WebKit/Source/core/dom/TreeScope.cpp b/third_party/WebKit/Source/core/dom/TreeScope.cpp
index 7694011c..724c768c 100644
--- a/third_party/WebKit/Source/core/dom/TreeScope.cpp
+++ b/third_party/WebKit/Source/core/dom/TreeScope.cpp
@@ -46,7 +46,7 @@
 #include "core/html/HTMLMapElement.h"
 #include "core/html_names.h"
 #include "core/layout/HitTestResult.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
 #include "core/svg/SVGTreeScopeResources.h"
diff --git a/third_party/WebKit/Source/core/editing/BUILD.gn b/third_party/WebKit/Source/core/editing/BUILD.gn
index 46b988e..e5568f99 100644
--- a/third_party/WebKit/Source/core/editing/BUILD.gn
+++ b/third_party/WebKit/Source/core/editing/BUILD.gn
@@ -331,7 +331,6 @@
     "SelectionModifierTest.cpp",
     "SelectionTemplateTest.cpp",
     "SetSelectionOptionsTest.cpp",
-    "SurroundingTextTest.cpp",
     "VisiblePositionTest.cpp",
     "VisibleSelectionTest.cpp",
     "VisibleUnitsTest.cpp",
diff --git a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
index 62600a06..5c658f0 100644
--- a/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
+++ b/third_party/WebKit/Source/core/editing/CaretDisplayItemClient.cpp
@@ -34,7 +34,6 @@
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutBlockItem.h"
 #include "core/layout/api/LayoutItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/paint/FindPaintOffsetAndVisualRectNeedingUpdate.h"
 #include "core/paint/ObjectPaintInvalidator.h"
 #include "core/paint/PaintInfo.h"
diff --git a/third_party/WebKit/Source/core/editing/DragCaret.cpp b/third_party/WebKit/Source/core/editing/DragCaret.cpp
index 3b487b00..c695605c 100644
--- a/third_party/WebKit/Source/core/editing/DragCaret.cpp
+++ b/third_party/WebKit/Source/core/editing/DragCaret.cpp
@@ -29,7 +29,7 @@
 #include "core/editing/EditingUtilities.h"
 #include "core/editing/VisiblePosition.h"
 #include "core/frame/Settings.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/editing/FrameCaret.cpp b/third_party/WebKit/Source/core/editing/FrameCaret.cpp
index 8dfc0b05..cc37b76 100644
--- a/third_party/WebKit/Source/core/editing/FrameCaret.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameCaret.cpp
@@ -37,8 +37,8 @@
 #include "core/frame/Settings.h"
 #include "core/html/forms/TextControlElement.h"
 #include "core/layout/LayoutBlock.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutTheme.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/page/Page.h"
 #include "public/platform/TaskType.h"
 
diff --git a/third_party/WebKit/Source/core/editing/FrameSelection.cpp b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
index ecd8c5f0..c657588e 100644
--- a/third_party/WebKit/Source/core/editing/FrameSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/FrameSelection.cpp
@@ -71,7 +71,7 @@
 #include "core/layout/HitTestRequest.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/page/EditorClient.h"
 #include "core/page/FocusController.h"
diff --git a/third_party/WebKit/Source/core/editing/SelectionController.cpp b/third_party/WebKit/Source/core/editing/SelectionController.cpp
index f407d77..bb73084 100644
--- a/third_party/WebKit/Source/core/editing/SelectionController.cpp
+++ b/third_party/WebKit/Source/core/editing/SelectionController.cpp
@@ -49,7 +49,6 @@
 #include "core/html_names.h"
 #include "core/input/EventHandler.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
 #include "platform/wtf/Assertions.h"
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 6a95cd7..2a655cd7 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -59,7 +59,6 @@
 #include "core/layout/LayoutTextFragment.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/layout/api/LineLayoutAPIShim.h"
 #include "core/layout/api/LineLayoutItem.h"
 #include "core/layout/line/InlineIterator.h"
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 4c246ce..61c5e679 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -1143,10 +1143,11 @@
 void ReplaceSelectionCommand::DoApply(EditingState* editing_state) {
   TRACE_EVENT0("blink", "ReplaceSelectionCommand::doApply");
   const VisibleSelection& selection = EndingVisibleSelection();
-  if (selection.IsNone() || !selection.IsValidFor(GetDocument())) {
-    NOTREACHED();
-    return;
-  }
+
+  // ReplaceSelectionCommandTest.CrashWithNoSelection hits below abort
+  // condition.
+  ABORT_EDITING_COMMAND_IF(selection.IsNone());
+  ABORT_EDITING_COMMAND_IF(!selection.IsValidFor(GetDocument()));
 
   if (!selection.RootEditableElement())
     return;
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
index 7b685e9e..7e9d3e9e 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommandTest.cpp
@@ -17,7 +17,7 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/Settings.h"
 #include "core/html_names.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/testing/DummyPageHolder.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -171,4 +171,18 @@
             GetSelectionTextFromBody(Selection().GetSelectionInDOMTree()));
 }
 
+// This is a regression test for https://crbug.com/796840
+TEST_F(ReplaceSelectionCommandTest, CrashWithNoSelection) {
+  GetDocument().setDesignMode("on");
+  SetBodyContent("<div></div>");
+  ReplaceSelectionCommand::CommandOptions options = 0;
+  ReplaceSelectionCommand* command =
+      ReplaceSelectionCommand::Create(GetDocument(), 0, options);
+
+  // Crash should not occur on applying ReplaceSelectionCommand
+  EXPECT_FALSE(command->Apply());
+  EXPECT_EQ("<div></div>",
+            GetSelectionTextFromBody(Selection().GetSelectionInDOMTree()));
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/events/MouseEvent.cpp b/third_party/WebKit/Source/core/events/MouseEvent.cpp
index 9080e77..cbf2d02e7 100644
--- a/third_party/WebKit/Source/core/events/MouseEvent.cpp
+++ b/third_party/WebKit/Source/core/events/MouseEvent.cpp
@@ -29,7 +29,7 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/input/InputDeviceCapabilities.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 #include "core/svg/SVGElement.h"
 #include "platform/bindings/DOMWrapperWorld.h"
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp b/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp
index d5e0d45..f32b22f 100644
--- a/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/core/events/WebInputEventConversion.cpp
@@ -76,15 +76,15 @@
 
 FloatPoint ConvertAbsoluteLocationForLayoutObjectFloat(
     const DoublePoint& location,
-    const LayoutItem layout_item) {
-  return layout_item.AbsoluteToLocal(FloatPoint(location), kUseTransforms);
+    const LayoutObject* layout_object) {
+  return layout_object->AbsoluteToLocal(FloatPoint(location), kUseTransforms);
 }
 
 // FIXME: Change |LocalFrameView| to const FrameView& after RemoteFrames get
 // RemoteFrameViews.
 void UpdateWebMouseEventFromCoreMouseEvent(const MouseEvent& event,
                                            const LocalFrameView* plugin_parent,
-                                           const LayoutItem layout_item,
+                                           const LayoutObject* layout_object,
                                            WebMouseEvent& web_event) {
   web_event.SetTimeStampSeconds(event.PlatformTimeStamp().InSeconds());
   web_event.SetModifiers(event.GetModifiers());
@@ -100,7 +100,7 @@
   }
   web_event.SetPositionInScreen(event.screenX(), event.screenY());
   FloatPoint local_point = ConvertAbsoluteLocationForLayoutObjectFloat(
-      event.AbsoluteLocation(), layout_item);
+      event.AbsoluteLocation(), layout_object);
   web_event.SetPositionInWidget(local_point.X(), local_point.Y());
 }
 
@@ -170,7 +170,7 @@
 }
 
 WebMouseEventBuilder::WebMouseEventBuilder(const LocalFrameView* plugin_parent,
-                                           const LayoutItem layout_item,
+                                           const LayoutObject* layout_object,
                                            const MouseEvent& event) {
   if (event.NativeEvent()) {
     *static_cast<WebMouseEvent*>(this) =
@@ -185,7 +185,7 @@
     }
 
     FloatPoint local_point =
-        layout_item.AbsoluteToLocal(absolute_location, kUseTransforms);
+        layout_object->AbsoluteToLocal(absolute_location, kUseTransforms);
     SetPositionInWidget(local_point.X(), local_point.Y());
     return;
   }
@@ -211,7 +211,7 @@
 
   time_stamp_seconds_ = event.PlatformTimeStamp().InSeconds();
   modifiers_ = event.GetModifiers();
-  UpdateWebMouseEventFromCoreMouseEvent(event, plugin_parent, layout_item,
+  UpdateWebMouseEventFromCoreMouseEvent(event, plugin_parent, layout_object,
                                         *this);
 
   switch (event.button()) {
@@ -262,7 +262,7 @@
 // Generate a synthetic WebMouseEvent given a TouchEvent (eg. for emulating a
 // mouse with touch input for plugins that don't support touch input).
 WebMouseEventBuilder::WebMouseEventBuilder(const LocalFrameView* plugin_parent,
-                                           const LayoutItem layout_item,
+                                           const LayoutObject* layout_object,
                                            const TouchEvent& event) {
   if (!event.touches())
     return;
@@ -309,7 +309,7 @@
   click_count = (type_ == kMouseDown || type_ == kMouseUp);
 
   FloatPoint local_point = ConvertAbsoluteLocationForLayoutObjectFloat(
-      DoublePoint(touch->AbsoluteLocation()), layout_item);
+      DoublePoint(touch->AbsoluteLocation()), layout_object);
   SetPositionInWidget(local_point.X(), local_point.Y());
 
   pointer_type = WebPointerProperties::PointerType::kTouch;
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversion.h b/third_party/WebKit/Source/core/events/WebInputEventConversion.h
index 10ff46a..d8d91cb3 100644
--- a/third_party/WebKit/Source/core/events/WebInputEventConversion.h
+++ b/third_party/WebKit/Source/core/events/WebInputEventConversion.h
@@ -43,7 +43,7 @@
 namespace blink {
 
 class KeyboardEvent;
-class LayoutItem;
+class LayoutObject;
 class LocalFrameView;
 class MouseEvent;
 class TouchEvent;
@@ -60,10 +60,10 @@
   // mousedown and mouseup. If the event mapping fails, the event type will
   // be set to Undefined.
   WebMouseEventBuilder(const LocalFrameView*,
-                       const LayoutItem,
+                       const LayoutObject*,
                        const MouseEvent&);
   WebMouseEventBuilder(const LocalFrameView*,
-                       const LayoutItem,
+                       const LayoutObject*,
                        const TouchEvent&);
 };
 
@@ -81,7 +81,7 @@
 // exceeding that cap will be dropped.
 class CORE_EXPORT WebTouchEventBuilder : public WebTouchEvent {
  public:
-  WebTouchEventBuilder(const LayoutItem, const TouchEvent&);
+  WebTouchEventBuilder(const LayoutObject*, const TouchEvent&);
 };
 
 // Return a new transformed WebGestureEvent by applying the Widget's scale
diff --git a/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp b/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp
index e469564..7e2d725 100644
--- a/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp
+++ b/third_party/WebKit/Source/core/events/WebInputEventConversionTest.cpp
@@ -43,7 +43,6 @@
 #include "core/frame/WebLocalFrameImpl.h"
 #include "core/input/Touch.h"
 #include "core/input/TouchList.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/Page.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/testing/URLTestHelpers.h"
diff --git a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
index 06ddada..e2b608d 100644
--- a/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
+++ b/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
@@ -69,7 +69,7 @@
 #include "core/inspector/InspectorTracingAgent.h"
 #include "core/inspector/InspectorWorkerAgent.h"
 #include "core/inspector/MainThreadDebugger.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
 #include "core/probe/CoreProbes.h"
diff --git a/third_party/WebKit/Source/core/exported/WebDocument.cpp b/third_party/WebKit/Source/core/exported/WebDocument.cpp
index af7b806c..4d4f3d1 100644
--- a/third_party/WebKit/Source/core/exported/WebDocument.cpp
+++ b/third_party/WebKit/Source/core/exported/WebDocument.cpp
@@ -51,8 +51,8 @@
 #include "core/html/HTMLLinkElement.h"
 #include "core/html/forms/HTMLFormElement.h"
 #include "core/layout/LayoutObject.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/DocumentLoader.h"
 #include "platform/bindings/ScriptState.h"
 #include "platform/weborigin/SecurityOrigin.h"
diff --git a/third_party/WebKit/Source/core/exported/WebFrameContentDumper.cpp b/third_party/WebKit/Source/core/exported/WebFrameContentDumper.cpp
index 17825f9e..ac26584 100644
--- a/third_party/WebKit/Source/core/exported/WebFrameContentDumper.cpp
+++ b/third_party/WebKit/Source/core/exported/WebFrameContentDumper.cpp
@@ -11,12 +11,12 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/WebLocalFrameImpl.h"
 #include "core/html_element_type_helpers.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutTableCell.h"
 #include "core/layout/LayoutTableRow.h"
 #include "core/layout/LayoutTextFragment.h"
 #include "core/layout/LayoutTreeAsText.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "platform/wtf/text/WTFString.h"
 #include "public/web/WebDocument.h"
 #include "public/web/WebLocalFrame.h"
diff --git a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
index 924bb76..be189b3 100644
--- a/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/core/exported/WebFrameTest.cpp
@@ -81,7 +81,7 @@
 #include "core/inspector/DevToolsEmulator.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutFullScreen.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/DocumentThreadableLoader.h"
 #include "core/loader/DocumentThreadableLoaderClient.h"
diff --git a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp
index bd22ce2..e20b1672 100644
--- a/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp
+++ b/third_party/WebKit/Source/core/exported/WebPagePopupImpl.cpp
@@ -44,8 +44,8 @@
 #include "core/frame/VisualViewport.h"
 #include "core/frame/WebLocalFrameImpl.h"
 #include "core/input/EventHandler.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/EmptyClients.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/page/FocusController.h"
diff --git a/third_party/WebKit/Source/core/exported/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/core/exported/WebPluginContainerImpl.cpp
index 400da7c..13bf2fee 100644
--- a/third_party/WebKit/Source/core/exported/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/core/exported/WebPluginContainerImpl.cpp
@@ -64,9 +64,8 @@
 #include "core/input/EventHandler.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutBox.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/FocusController.h"
@@ -758,8 +757,8 @@
 
   // TODO(dtapuska): Move WebMouseEventBuilder into the anonymous namespace
   // in this class.
-  WebMouseEventBuilder transformed_event(
-      &parent, LayoutItem(element_->GetLayoutObject()), *event);
+  WebMouseEventBuilder transformed_event(&parent, element_->GetLayoutObject(),
+                                         *event);
   if (transformed_event.GetType() == WebInputEvent::kUndefined)
     return;
 
@@ -992,8 +991,8 @@
 }
 
 void WebPluginContainerImpl::SynthesizeMouseEventIfPossible(TouchEvent* event) {
-  WebMouseEventBuilder web_event(
-      &ParentFrameView(), LayoutItem(element_->GetLayoutObject()), *event);
+  WebMouseEventBuilder web_event(&ParentFrameView(),
+                                 element_->GetLayoutObject(), *event);
   if (web_event.GetType() == WebInputEvent::kUndefined)
     return;
 
diff --git a/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp b/third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp
similarity index 99%
rename from third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
rename to third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp
index cfe1c534..b1270f5 100644
--- a/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
+++ b/third_party/WebKit/Source/core/exported/WebSurroundingTextTest.cpp
@@ -4,8 +4,6 @@
 
 #include "public/web/WebSurroundingText.h"
 
-// TODO(xiaochengh): Rename this file as core/exported/WebSurroundingText.cpp
-
 #include <memory>
 #include "core/dom/Document.h"
 #include "core/dom/Range.h"
diff --git a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
index 1c5a4de9..5b5bb83 100644
--- a/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -85,8 +85,8 @@
 #include "core/input/TouchActionUtil.h"
 #include "core/inspector/DevToolsEmulator.h"
 #include "core/layout/LayoutEmbeddedContent.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/TextAutosizer.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
diff --git a/third_party/WebKit/Source/core/exported/WebViewTest.cpp b/third_party/WebKit/Source/core/exported/WebViewTest.cpp
index 4ca843c..2ccc2e8 100644
--- a/third_party/WebKit/Source/core/exported/WebViewTest.cpp
+++ b/third_party/WebKit/Source/core/exported/WebViewTest.cpp
@@ -59,7 +59,7 @@
 #include "core/html/forms/HTMLInputElement.h"
 #include "core/html/forms/HTMLTextAreaElement.h"
 #include "core/inspector/DevToolsEmulator.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/page/ChromeClient.h"
diff --git a/third_party/WebKit/Source/core/frame/DocumentLoadingRenderingTest.cpp b/third_party/WebKit/Source/core/frame/DocumentLoadingRenderingTest.cpp
index 9e4a9ea..933170b 100644
--- a/third_party/WebKit/Source/core/frame/DocumentLoadingRenderingTest.cpp
+++ b/third_party/WebKit/Source/core/frame/DocumentLoadingRenderingTest.cpp
@@ -8,7 +8,7 @@
 #include "core/dom/NodeComputedStyle.h"
 #include "core/geometry/DOMRect.h"
 #include "core/html/HTMLIFrameElement.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 #include "core/testing/sim/SimCompositor.h"
 #include "core/testing/sim/SimDisplayItemList.h"
diff --git a/third_party/WebKit/Source/core/frame/Frame.cpp b/third_party/WebKit/Source/core/frame/Frame.cpp
index 23557dda..c8358fb 100644
--- a/third_party/WebKit/Source/core/frame/Frame.cpp
+++ b/third_party/WebKit/Source/core/frame/Frame.cpp
@@ -42,7 +42,6 @@
 #include "core/html/HTMLFrameElementBase.h"
 #include "core/input/EventHandler.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/loader/EmptyClients.h"
 #include "core/loader/NavigationScheduler.h"
 #include "core/page/FocusController.h"
diff --git a/third_party/WebKit/Source/core/frame/LocalFrame.cpp b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 8bc21d5..c2be132 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -65,9 +65,8 @@
 #include "core/inspector/ConsoleMessage.h"
 #include "core/inspector/InspectorTraceEvents.h"
 #include "core/layout/HitTestResult.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/IdlenessDetector.h"
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
index 3ced3d6..6cfc7f34 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -74,9 +74,7 @@
 #include "core/layout/TextAutosizer.h"
 #include "core/layout/TracedLayoutObject.h"
 #include "core/layout/api/LayoutBoxModel.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/layout/api/LayoutItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/layout/svg/LayoutSVGRoot.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
@@ -3026,6 +3024,15 @@
       DocumentLifecycle::kPaintClean);
 }
 
+void LocalFrameView::UpdateLifecycleToPrePaintClean() {
+  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
+    UpdateAllLifecyclePhasesExceptPaint();
+  } else {
+    GetFrame().LocalFrameRoot().View()->UpdateLifecyclePhasesInternal(
+        DocumentLifecycle::kPrePaintClean);
+  }
+}
+
 // TODO(chrishtr): add a scrolling update lifecycle phase.
 void LocalFrameView::UpdateLifecycleToCompositingCleanPlusScrolling() {
   if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled()) {
diff --git a/third_party/WebKit/Source/core/frame/LocalFrameView.h b/third_party/WebKit/Source/core/frame/LocalFrameView.h
index 48f0387..3feae7e 100644
--- a/third_party/WebKit/Source/core/frame/LocalFrameView.h
+++ b/third_party/WebKit/Source/core/frame/LocalFrameView.h
@@ -312,7 +312,12 @@
   // detached frame and need special handling of the frame.
   void UpdateLifecyclePhasesForPrinting();
 
-  // Computes the style, layout and compositing lifecycle stages if needed.
+  // Computes the style, layout, compositing and pre-paint lifecycle stages
+  // if needed.
+  // After calling this method, all frames will be in a lifecycle
+  // state >= PrePaintClean
+  void UpdateLifecycleToPrePaintClean();
+
   // After calling this method, all frames will be in a lifecycle
   // state >= CompositingClean, and scrolling has been updated (unless
   // throttling is allowed).
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
index 7bd4fc3..1808e1f 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrame.cpp
@@ -12,7 +12,7 @@
 #include "core/frame/RemoteFrameClient.h"
 #include "core/frame/RemoteFrameView.h"
 #include "core/html/HTMLFrameOwnerElement.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
 #include "core/paint/PaintLayer.h"
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
index 2e74eff8..eb975fb0 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
@@ -13,7 +13,7 @@
 #include "core/frame/RemoteFrame.h"
 #include "core/frame/RemoteFrameView.h"
 #include "core/frame/WebLocalFrameImpl.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/api/LayoutItem.h"
 #include "platform/exported/WrappedResourceRequest.h"
 #include "platform/geometry/IntRect.h"
diff --git a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
index 6984c5ea..d55fbda1 100644
--- a/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
@@ -11,8 +11,8 @@
 #include "core/frame/RemoteFrameClient.h"
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/intersection_observer/IntersectionObserverEntry.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp b/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp
index d9404b5..3c98a415 100644
--- a/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp
+++ b/third_party/WebKit/Source/core/frame/VisualViewportTest.cpp
@@ -17,7 +17,7 @@
 #include "core/html/HTMLHtmlElement.h"
 #include "core/input/EventHandler.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/page/Page.h"
 #include "core/paint/PaintLayer.h"
diff --git a/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
index ed48ac55..b1ab93e 100644
--- a/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
@@ -59,7 +59,6 @@
 #include "core/input/ContextMenuAllowedScope.h"
 #include "core/input/EventHandler.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/ContextMenuController.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
index 753e3e3..4dc5fc5f 100644
--- a/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
@@ -162,9 +162,9 @@
 #include "core/input/EventHandler.h"
 #include "core/inspector/ConsoleMessage.h"
 #include "core/layout/HitTestResult.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
diff --git a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
index 48fae1c..8e9b561 100644
--- a/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
+++ b/third_party/WebKit/Source/core/geometry/DOMMatrixReadOnly.cpp
@@ -14,7 +14,7 @@
 #include "core/geometry/DOMMatrixInit.h"
 #include "core/geometry/DOMPoint.h"
 #include "core/geometry/DOMPointInit.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/style/ComputedStyle.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
index 85973ddd..67f3ab0 100644
--- a/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp
@@ -386,24 +386,22 @@
               : WebFeature::
                     kHTMLAnchorElementDownloadInSandboxWithoutUserGesture);
     }
-    request.SetRequestContext(WebURLRequest::kRequestContextDownload);
-    request.SetRequestorOrigin(SecurityOrigin::Create(GetDocument().Url()));
-    frame->Client()->DownloadURL(request, FastGetAttribute(downloadAttr));
-  } else {
-    request.SetRequestContext(WebURLRequest::kRequestContextHyperlink);
-    FrameLoadRequest frame_request(&GetDocument(), request,
-                                   getAttribute(targetAttr));
-    frame_request.SetTriggeringEvent(event);
-    if (HasRel(kRelationNoReferrer)) {
-      frame_request.SetShouldSendReferrer(kNeverSendReferrer);
-      frame_request.SetShouldSetOpener(kNeverSetOpener);
-    }
-    if (HasRel(kRelationNoOpener))
-      frame_request.SetShouldSetOpener(kNeverSetOpener);
-    // TODO(japhet): Link clicks can be emulated via JS without a user gesture.
-    // Why doesn't this go through NavigationScheduler?
-    frame->Loader().Load(frame_request);
+    request.SetSuggestedFilename(
+        static_cast<String>(FastGetAttribute(downloadAttr)));
   }
+  request.SetRequestContext(WebURLRequest::kRequestContextHyperlink);
+  FrameLoadRequest frame_request(&GetDocument(), request,
+                                 getAttribute(targetAttr));
+  frame_request.SetTriggeringEvent(event);
+  if (HasRel(kRelationNoReferrer)) {
+    frame_request.SetShouldSendReferrer(kNeverSendReferrer);
+    frame_request.SetShouldSetOpener(kNeverSetOpener);
+  }
+  if (HasRel(kRelationNoOpener))
+    frame_request.SetShouldSetOpener(kNeverSetOpener);
+  // TODO(japhet): Link clicks can be emulated via JS without a user gesture.
+  // Why doesn't this go through NavigationScheduler?
+  frame->Loader().Load(frame_request);
 }
 
 bool IsEnterKeyKeydownEvent(Event* event) {
diff --git a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
index 4c7a8319..57ca614 100644
--- a/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp
@@ -63,7 +63,7 @@
 #include "core/input_type_names.h"
 #include "core/layout/HitTestCanvasResult.h"
 #include "core/layout/LayoutHTMLCanvas.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/ChromeClient.h"
 #include "core/paint/PaintLayer.h"
 #include "core/paint/PaintTiming.h"
diff --git a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp b/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
index 6465eee..d0c130e0 100644
--- a/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLEmbedElement.cpp
@@ -35,7 +35,7 @@
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html_names.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutEmbeddedItem.h"
+#include "core/layout/LayoutEmbeddedObject.h"
 
 namespace blink {
 
@@ -144,7 +144,7 @@
 // FIXME: This should be unified with HTMLObjectElement::updatePlugin and
 // moved down into HTMLPluginElement.cpp
 void HTMLEmbedElement::UpdatePluginInternal() {
-  DCHECK(!GetLayoutEmbeddedItem().ShowsUnavailablePluginIndicator());
+  DCHECK(!GetLayoutEmbeddedObject()->ShowsUnavailablePluginIndicator());
   DCHECK(NeedsPluginUpdate());
   SetNeedsPluginUpdate(false);
 
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index a9aa8bdb..b2c410cb 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -31,7 +31,6 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/RemoteFrameView.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
@@ -244,9 +243,7 @@
 
   LayoutEmbeddedContent* layout_embedded_content =
       ToLayoutEmbeddedContent(GetLayoutObject());
-  LayoutEmbeddedContentItem layout_embedded_content_item =
-      LayoutEmbeddedContentItem(layout_embedded_content);
-  if (layout_embedded_content_item.IsNull())
+  if (!layout_embedded_content)
     return;
 
   if (embedded_content_view_) {
@@ -256,11 +253,10 @@
     if (doc) {
       CHECK_NE(doc->Lifecycle().GetState(), DocumentLifecycle::kStopping);
     }
-    layout_embedded_content_item.UpdateOnEmbeddedContentViewChange();
+    layout_embedded_content->UpdateOnEmbeddedContentViewChange();
 
-    DCHECK_EQ(GetDocument().View(),
-              layout_embedded_content_item.GetFrameView());
-    DCHECK(layout_embedded_content_item.GetFrameView());
+    DCHECK_EQ(GetDocument().View(), layout_embedded_content->GetFrameView());
+    DCHECK(layout_embedded_content->GetFrameView());
     embedded_content_view_->AttachToLayout();
   }
 
diff --git a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
index 94e8423..bf82ab03 100644
--- a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
@@ -41,7 +41,7 @@
 #include "core/html/HTMLParamElement.h"
 #include "core/html/parser/HTMLParserIdioms.h"
 #include "core/html_names.h"
-#include "core/layout/api/LayoutEmbeddedItem.h"
+#include "core/layout/LayoutEmbeddedObject.h"
 #include "platform/network/mime/MIMETypeRegistry.h"
 
 namespace blink {
@@ -250,7 +250,7 @@
 // TODO(schenney): crbug.com/572908 This should be unified with
 // HTMLEmbedElement::updatePlugin and moved down into HTMLPluginElement.cpp
 void HTMLObjectElement::UpdatePluginInternal() {
-  DCHECK(!GetLayoutEmbeddedItem().ShowsUnavailablePluginIndicator());
+  DCHECK(!GetLayoutEmbeddedObject()->ShowsUnavailablePluginIndicator());
   DCHECK(NeedsPluginUpdate());
   SetNeedsPluginUpdate(false);
   // TODO(schenney): crbug.com/572908 This should ASSERT
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
index 435d158..88e97c7 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.cpp
@@ -41,8 +41,8 @@
 #include "core/input/EventHandler.h"
 #include "core/inspector/ConsoleMessage.h"
 #include "core/layout/LayoutEmbeddedContent.h"
+#include "core/layout/LayoutEmbeddedObject.h"
 #include "core/layout/LayoutImage.h"
-#include "core/layout/api/LayoutEmbeddedItem.h"
 #include "core/loader/MixedContentChecker.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
@@ -196,8 +196,8 @@
     if (!image_loader_)
       image_loader_ = HTMLImageLoader::Create(this);
     image_loader_->UpdateFromElement();
-  } else if (NeedsPluginUpdate() && !GetLayoutEmbeddedItem().IsNull() &&
-             !GetLayoutEmbeddedItem().ShowsUnavailablePluginIndicator() &&
+  } else if (NeedsPluginUpdate() && GetLayoutEmbeddedObject() &&
+             !GetLayoutEmbeddedObject()->ShowsUnavailablePluginIndicator() &&
              GetObjectContentType() != ObjectContentType::kPlugin &&
              !is_delaying_load_event_) {
     is_delaying_load_event_ = true;
@@ -424,8 +424,7 @@
   if (!r || !r->IsLayoutEmbeddedContent())
     return;
   if (r->IsEmbeddedObject()) {
-    if (LayoutEmbeddedItem(ToLayoutEmbeddedObject(r))
-            .ShowsUnavailablePluginIndicator())
+    if (ToLayoutEmbeddedObject(r)->ShowsUnavailablePluginIndicator())
       return;
   }
   WebPluginContainerImpl* plugin = OwnedPlugin();
@@ -527,12 +526,12 @@
   return Image::SupportsType(service_type_);
 }
 
-LayoutEmbeddedItem HTMLPlugInElement::GetLayoutEmbeddedItem() const {
+LayoutEmbeddedObject* HTMLPlugInElement::GetLayoutEmbeddedObject() const {
   // HTMLObjectElement and HTMLEmbedElement may return arbitrary layoutObjects
   // when using fallback content.
   if (!GetLayoutObject() || !GetLayoutObject()->IsEmbeddedObject())
-    return LayoutEmbeddedItem(nullptr);
-  return LayoutEmbeddedItem(ToLayoutEmbeddedObject(GetLayoutObject()));
+    return nullptr;
+  return ToLayoutEmbeddedObject(GetLayoutObject());
 }
 
 // We don't use m_url, as it may not be the final URL that the object loads,
@@ -570,9 +569,9 @@
   if (!frame->Loader().AllowPlugins(kAboutToInstantiatePlugin))
     return false;
 
-  LayoutEmbeddedItem layout_item = GetLayoutEmbeddedItem();
+  auto* layout_object = GetLayoutEmbeddedObject();
   // FIXME: This code should not depend on layoutObject!
-  if ((layout_item.IsNull() && require_layout_object) || use_fallback)
+  if ((!layout_object && require_layout_object) || use_fallback)
     return false;
 
   VLOG(1) << this << " Plugin URL: " << url_;
@@ -591,17 +590,17 @@
         frame->Client()->CreatePlugin(*this, url, param_names, param_values,
                                       mime_type, load_manually, policy);
     if (!plugin) {
-      if (!layout_item.IsNull() &&
-          !layout_item.ShowsUnavailablePluginIndicator()) {
+      if (layout_object && !layout_object->ShowsUnavailablePluginIndicator()) {
         plugin_is_available_ = false;
-        layout_item.SetPluginAvailability(LayoutEmbeddedObject::kPluginMissing);
+        layout_object->SetPluginAvailability(
+            LayoutEmbeddedObject::kPluginMissing);
       }
       return false;
     }
 
-    if (!layout_item.IsNull()) {
+    if (layout_object) {
       SetEmbeddedContentView(plugin);
-      layout_item.GetFrameView()->AddPlugin(plugin);
+      layout_object->GetFrameView()->AddPlugin(plugin);
     } else {
       SetPersistedPlugin(plugin);
     }
@@ -648,9 +647,9 @@
   if (!GetDocument().GetContentSecurityPolicy()->AllowObjectFromSource(url) ||
       !GetDocument().GetContentSecurityPolicy()->AllowPluginTypeForDocument(
           GetDocument(), mime_type, declared_mime_type, url)) {
-    if (LayoutEmbeddedItem layout_item = GetLayoutEmbeddedItem()) {
+    if (auto* layout_object = GetLayoutEmbeddedObject()) {
       plugin_is_available_ = false;
-      layout_item.SetPluginAvailability(
+      layout_object->SetPluginAvailability(
           LayoutEmbeddedObject::kPluginBlockedByContentSecurityPolicy);
     }
     return false;
diff --git a/third_party/WebKit/Source/core/html/HTMLPlugInElement.h b/third_party/WebKit/Source/core/html/HTMLPlugInElement.h
index 8c7e42a..af2de76 100644
--- a/third_party/WebKit/Source/core/html/HTMLPlugInElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLPlugInElement.h
@@ -34,7 +34,7 @@
 
 class HTMLImageLoader;
 class LayoutEmbeddedContent;
-class LayoutEmbeddedItem;
+class LayoutEmbeddedObject;
 class WebPluginContainerImpl;
 
 enum PreferPlugInsForImagesOption {
@@ -112,7 +112,7 @@
   virtual LayoutEmbeddedContent* LayoutEmbeddedContentForJSBindings() const;
 
   bool IsImageType();
-  LayoutEmbeddedItem GetLayoutEmbeddedItem() const;
+  LayoutEmbeddedObject* GetLayoutEmbeddedObject() const;
   bool AllowedToLoadFrameURL(const String& url);
   bool RequestObject(const Vector<String>& param_names,
                      const Vector<String>& param_values);
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
index 0853388..123110d92 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasAsyncBlobCreator.cpp
@@ -272,16 +272,6 @@
   }
 }
 
-SkImageInfo GetImageInfo(scoped_refptr<StaticBitmapImage> image) {
-  sk_sp<SkImage> skia_image = image->PaintImageForCurrentFrame().GetSkImage();
-  SkColorType color_type = kN32_SkColorType;
-  if (skia_image->colorSpace() && skia_image->colorSpace()->gammaIsLinear())
-    color_type = kRGBA_F16_SkColorType;
-  return SkImageInfo::Make(skia_image->width(), skia_image->height(),
-                           color_type, skia_image->alphaType(),
-                           skia_image->refColorSpace());
-}
-
 void CanvasAsyncBlobCreator::LoadStaticBitmapImage() {
   DCHECK(image_ && !static_bitmap_image_loaded_);
   if (image_->IsTextureBacked()) {
diff --git a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp
index b2883c6..0efc999d 100644
--- a/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp
+++ b/third_party/WebKit/Source/core/html/media/AutoplayPolicy.cpp
@@ -73,9 +73,11 @@
     return true;
   }
 
-  // If feature policy is disabled then do not traverse the tree.
-  if (!RuntimeEnabledFeatures::FeaturePolicyAutoplayFeatureEnabled())
+  // Check feature policy before traversing the tree.
+  if (!RuntimeEnabledFeatures::FeaturePolicyAutoplayFeatureEnabled() ||
+      !frame.IsFeatureEnabled(FeaturePolicyFeature::kAutoplay)) {
     return false;
+  }
 
   // If there is a parent check if the parent has received a
   // user gesture.
@@ -107,12 +109,6 @@
   if (!document.GetFrame())
     return false;
 
-  // Check feature policy to see if autoplay is enabled.
-  if (RuntimeEnabledFeatures::FeaturePolicyAutoplayFeatureEnabled() &&
-      !document.GetFrame()->IsFeatureEnabled(FeaturePolicyFeature::kAutoplay)) {
-    return false;
-  }
-
   return HasBeenActivated(*document.GetFrame());
 }
 
diff --git a/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp b/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp
index 5623a6a..a1c73dbf 100644
--- a/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp
+++ b/third_party/WebKit/Source/core/html/media/HTMLMediaElement.cpp
@@ -67,7 +67,7 @@
 #include "core/inspector/ConsoleMessage.h"
 #include "core/layout/IntersectionGeometry.h"
 #include "core/layout/LayoutMedia.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 #include "core/paint/compositing/PaintLayerCompositor.h"
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
index 0f0f12ae..d0b9cd2 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.cpp
@@ -228,8 +228,8 @@
                const String& text)
     : TextTrackCue(start_time, end_time),
       text_(text),
-      line_position_(std::numeric_limits<float>::quiet_NaN()),
-      text_position_(std::numeric_limits<float>::quiet_NaN()),
+      line_position_(std::numeric_limits<double>::quiet_NaN()),
+      text_position_(std::numeric_limits<double>::quiet_NaN()),
       cue_size_(100),
       writing_direction_(kHorizontal),
       text_alignment_(TextAlignment::kCenter),
@@ -316,20 +316,19 @@
   // On setting, the WebVTT cue line must be set to the new value; if the new
   // value is the string "auto", then it must be interpreted as the special
   // value auto.  ("auto" is translated to NaN.)
-  float float_position;
+  double line_position;
   if (position.IsAutoKeyword()) {
     if (LineIsAuto())
       return;
-    float_position = std::numeric_limits<float>::quiet_NaN();
+    line_position = std::numeric_limits<double>::quiet_NaN();
   } else {
     DCHECK(position.IsDouble());
-    float_position = clampTo<float>(position.GetAsDouble());
-    if (line_position_ == float_position)
+    line_position = position.GetAsDouble();
+    if (line_position_ == line_position)
       return;
   }
-
   CueWillChange();
-  line_position_ = float_position;
+  line_position_ = line_position;
   CueDidChange();
 }
 
@@ -384,22 +383,22 @@
   // IndexSizeError exception must be thrown. Otherwise, the WebVTT cue
   // position must be set to the new value; if the new value is the string
   // "auto", then it must be interpreted as the special value auto.
-  float float_position;
+  double text_position;
   if (position.IsAutoKeyword()) {
     if (TextPositionIsAuto())
       return;
-    float_position = std::numeric_limits<float>::quiet_NaN();
+    text_position = std::numeric_limits<double>::quiet_NaN();
   } else {
     DCHECK(position.IsDouble());
     if (IsInvalidPercentage(position.GetAsDouble(), exception_state))
       return;
-    float_position = clampTo<float>(position.GetAsDouble());
-    if (text_position_ == float_position)
+    text_position = position.GetAsDouble();
+    if (text_position_ == text_position)
       return;
   }
 
   CueWillChange();
-  text_position_ = float_position;
+  text_position_ = text_position;
   CueDidChange();
 }
 
@@ -448,12 +447,11 @@
     return;
 
   // Otherwise, WebVTT cue size must be set to the new value.
-  float float_size = clampTo<float>(size);
-  if (cue_size_ == float_size)
+  if (cue_size_ == size)
     return;
 
   CueWillChange();
-  cue_size_ = float_size;
+  cue_size_ = size;
   CueDidChange();
 }
 
@@ -546,7 +544,7 @@
   CueDidChange();
 }
 
-float VTTCue::CalculateComputedLine() const {
+double VTTCue::CalculateComputedLine() const {
   // https://w3c.github.io/webvtt/#cue-computed-line
   // A WebVTT cue has a computed line whose value is that returned by the
   // following algorithm, which is defined in terms of the other aspects of
@@ -646,7 +644,7 @@
   return IsLtr(text_direction) ? CSSValueLtr : CSSValueRtl;
 }
 
-float VTTCue::CalculateComputedPosition() const {
+double VTTCue::CalculateComputedPosition() const {
   // https://w3c.github.io/webvtt/#cue-computed-position
 
   // 1. If the position is numeric, then return the value of the position and
@@ -723,8 +721,8 @@
 
   // 4. Determine the value of maximum size for cue as per the appropriate
   // rules from the following list:
-  float computed_position = CalculateComputedPosition();
-  float maximum_size = computed_position;
+  double computed_position = CalculateComputedPosition();
+  double maximum_size = computed_position;
   if (computed_position_alignment == PositionAlignment::kLineLeft) {
     maximum_size = 100 - computed_position;
   } else if (computed_position_alignment == PositionAlignment::kLineRight) {
@@ -786,7 +784,7 @@
 
   // A cue has a computed line whose value is defined in terms of
   // the other aspects of the cue.
-  float computed_line = CalculateComputedLine();
+  double computed_line = CalculateComputedLine();
 
   // 8. Determine the value of whichever of x-position or y-position is not
   // yet calculated for cue as per the appropriate rules from the following
@@ -976,7 +974,7 @@
   return kNone;
 }
 
-static bool ScanPercentage(VTTScanner& input, float& number) {
+static bool ScanPercentage(VTTScanner& input, double& number) {
   // https://w3c.github.io/webvtt/#parse-a-percentage-string
 
   // 1. Let input be the string being parsed.
@@ -1051,7 +1049,7 @@
       case kLine: {
         // If name is a case-sensitive match for "line"
         // Steps 1 - 2 Handled below.
-        float number;
+        double number;
         // 3. If linepos does not contain at least one ASCII digit, then
         //    jump to the step labeled next setting.
         // 4. If the last character in linepos is a U+0025 PERCENT SIGN
@@ -1086,7 +1084,7 @@
           // 5. Interpret linepos as a (potentially signed) real number, and
           //    let number be that number.
           bool is_negative = input.Scan('-');
-          if (!input.ScanFloat(number))
+          if (!input.ScanDouble(number))
             break;
           // Negate number if it was preceded by a hyphen-minus - unless it's
           // zero.
@@ -1126,7 +1124,7 @@
       }
       case kPosition: {
         // If name is a case-sensitive match for "position".
-        float number;
+        double number;
         // Steps 1 - 2 Handled below.
         // 3. If parse a percentage string from colpos doesn't fail, let
         //    number be the returned percentage, otherwise jump to the step
@@ -1165,7 +1163,7 @@
       }
       case kSize: {
         // If name is a case-sensitive match for "size"
-        float number;
+        double number;
         // 1. If parse a percentage string from value doesn't fail, let
         //    number be the returned percentage, otherwise jump to the step
         //    labeled next setting.
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h
index ce7cf53..0ed8df9 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTCue.h
@@ -50,11 +50,11 @@
   VTTDisplayParameters();
 
   FloatPoint position;
-  float size;
+  double size;
   CSSValueID direction;
   CSSValueID text_align;
   CSSValueID writing_mode;
-  float snap_to_lines_position;
+  double snap_to_lines_position;
   int line_align;
 };
 
@@ -134,7 +134,7 @@
 
   void RemoveDisplayTree(RemovalNotification) override;
 
-  float CalculateComputedLine() const;
+  double CalculateComputedLine() const;
 
   enum WritingDirection {
     kHorizontal = 0,
@@ -185,7 +185,7 @@
   bool TextPositionIsAuto() const;
 
   VTTDisplayParameters CalculateDisplayParameters() const;
-  float CalculateComputedPosition() const;
+  double CalculateComputedPosition() const;
   LineAlignment CalculateComputedLineAlignment() const;
   PositionAlignment CalculateComputedPositionAlignment() const;
 
@@ -201,9 +201,9 @@
   CueSetting SettingName(VTTScanner&) const;
 
   String text_;
-  float line_position_;
-  float text_position_;
-  float cue_size_;
+  double line_position_;
+  double text_position_;
+  double cue_size_;
   WritingDirection writing_direction_;
   TextAlignment text_alignment_;
   PositionAlignment position_alignment_;
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
index e671f7ab..9a2cea3 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.cpp
@@ -50,10 +50,10 @@
 const unsigned kFileIdentifierLength = 6;
 const unsigned kRegionIdentifierLength = 6;
 
-bool VTTParser::ParseFloatPercentageValue(VTTScanner& value_scanner,
-                                          float& percentage) {
-  float number;
-  if (!value_scanner.ScanFloat(number))
+bool VTTParser::ParsePercentageValue(VTTScanner& value_scanner,
+                                     double& percentage) {
+  double number;
+  if (!value_scanner.ScanDouble(number))
     return false;
   // '%' must be present and at the end of the setting value.
   if (!value_scanner.Scan('%'))
@@ -64,21 +64,21 @@
   return true;
 }
 
-bool VTTParser::ParseFloatPercentageValuePair(VTTScanner& value_scanner,
-                                              char delimiter,
-                                              FloatPoint& value_pair) {
-  float first_coord;
-  if (!ParseFloatPercentageValue(value_scanner, first_coord))
+bool VTTParser::ParsePercentageValuePair(VTTScanner& value_scanner,
+                                         char delimiter,
+                                         DoublePoint& value_pair) {
+  double first_coord;
+  if (!ParsePercentageValue(value_scanner, first_coord))
     return false;
 
   if (!value_scanner.Scan(delimiter))
     return false;
 
-  float second_coord;
-  if (!ParseFloatPercentageValue(value_scanner, second_coord))
+  double second_coord;
+  if (!ParsePercentageValue(value_scanner, second_coord))
     return false;
 
-  value_pair = FloatPoint(first_coord, second_coord);
+  value_pair = DoublePoint(first_coord, second_coord);
   return true;
 }
 
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.h b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.h
index 72e3b7fc..9b24c76 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTParser.h
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTParser.h
@@ -95,9 +95,9 @@
   static bool CollectTimeStamp(const String&, double& time_stamp);
 
   // Useful functions for parsing percentage settings.
-  static bool ParseFloatPercentageValue(VTTScanner& value_scanner,
-                                        float& percentage);
-  static bool ParseFloatPercentageValuePair(VTTScanner&, char, FloatPoint&);
+  static bool ParsePercentageValue(VTTScanner& value_scanner,
+                                   double& percentage);
+  static bool ParsePercentageValuePair(VTTScanner&, char, DoublePoint&);
 
   // Create the DocumentFragment representation of the WebVTT cue text.
   static DocumentFragment* CreateDocumentFragmentFromCueText(Document&,
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
index 6e80550..5aad17b 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.cpp
@@ -51,14 +51,14 @@
 // https://dvcs.w3.org/hg/text-tracks/raw-file/default/608toVTT/region.html
 
 // The region occupies by default 100% of the width of the video viewport.
-static const float kDefaultWidth = 100;
+static const double kDefaultWidth = 100;
 
 // The region has, by default, 3 lines of text.
 static const int kDefaultHeightInLines = 3;
 
 // The region and viewport are anchored in the bottom left corner.
-static const float kDefaultAnchorPointX = 0;
-static const float kDefaultAnchorPointY = 100;
+static const double kDefaultAnchorPointX = 0;
+static const double kDefaultAnchorPointY = 100;
 
 // The region doesn't have scrolling text, by default.
 static const bool kDefaultScroll = false;
@@ -87,8 +87,8 @@
     : id_(g_empty_string),
       width_(kDefaultWidth),
       lines_(kDefaultHeightInLines),
-      region_anchor_(FloatPoint(kDefaultAnchorPointX, kDefaultAnchorPointY)),
-      viewport_anchor_(FloatPoint(kDefaultAnchorPointX, kDefaultAnchorPointY)),
+      region_anchor_(DoublePoint(kDefaultAnchorPointX, kDefaultAnchorPointY)),
+      viewport_anchor_(DoublePoint(kDefaultAnchorPointX, kDefaultAnchorPointY)),
       scroll_(kDefaultScroll),
       current_top_(0),
       scroll_timer_(Platform::Current()->CurrentThread()->GetWebTaskRunner(),
@@ -218,10 +218,10 @@
       break;
     }
     case kWidth: {
-      float float_width;
-      if (VTTParser::ParseFloatPercentageValue(input, float_width) &&
+      double width;
+      if (VTTParser::ParsePercentageValue(input, width) &&
           ParsedEntireRun(input, value_run))
-        width_ = float_width;
+        width_ = width;
       else
         DVLOG(VTT_LOG_LEVEL) << "parseSettingValue, invalid Width";
       break;
@@ -235,8 +235,8 @@
       break;
     }
     case kRegionAnchor: {
-      FloatPoint anchor;
-      if (VTTParser::ParseFloatPercentageValuePair(input, ',', anchor) &&
+      DoublePoint anchor;
+      if (VTTParser::ParsePercentageValuePair(input, ',', anchor) &&
           ParsedEntireRun(input, value_run))
         region_anchor_ = anchor;
       else
@@ -244,8 +244,8 @@
       break;
     }
     case kViewportAnchor: {
-      FloatPoint anchor;
-      if (VTTParser::ParseFloatPercentageValuePair(input, ',', anchor) &&
+      DoublePoint anchor;
+      if (VTTParser::ParsePercentageValuePair(input, ',', anchor) &&
           ParsedEntireRun(input, value_run))
         viewport_anchor_ = anchor;
       else
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h
index b79eeba..064a162 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTRegion.h
@@ -33,7 +33,7 @@
 
 #include "platform/Timer.h"
 #include "platform/bindings/ScriptWrappable.h"
-#include "platform/geometry/FloatPoint.h"
+#include "platform/geometry/DoublePoint.h"
 #include "platform/heap/Handle.h"
 #include "platform/wtf/text/WTFString.h"
 
@@ -116,8 +116,8 @@
   String id_;
   double width_;
   unsigned lines_;
-  FloatPoint region_anchor_;
-  FloatPoint viewport_anchor_;
+  DoublePoint region_anchor_;
+  DoublePoint viewport_anchor_;
   bool scroll_;
 
   // The cue container is the container that is scrolled up to obtain the
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp
index 304d0f4..b50fa04 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.cpp
@@ -136,7 +136,7 @@
   return num_digits;
 }
 
-bool VTTScanner::ScanFloat(float& number) {
+bool VTTScanner::ScanDouble(double& number) {
   Run integer_run = CollectWhile<IsASCIIDigit>();
   SeekTo(integer_run.end());
   Run decimal_run(GetPosition(), GetPosition(), is8_bit_);
@@ -152,25 +152,29 @@
     return false;
   }
 
-  size_t length_of_float =
+  size_t length_of_double =
       Run(integer_run.Start(), GetPosition(), is8_bit_).length();
   bool valid_number;
-  if (is8_bit_)
+  if (is8_bit_) {
+    number = CharactersToDouble(integer_run.Start(), length_of_double,
+                                &valid_number);
+  } else {
     number =
-        CharactersToFloat(integer_run.Start(), length_of_float, &valid_number);
-  else
-    number =
-        CharactersToFloat(reinterpret_cast<const UChar*>(integer_run.Start()),
-                          length_of_float, &valid_number);
+        CharactersToDouble(reinterpret_cast<const UChar*>(integer_run.Start()),
+                           length_of_double, &valid_number);
+  }
+
+  if (number == std::numeric_limits<double>::infinity())
+    return false;
 
   if (!valid_number)
-    number = std::numeric_limits<float>::max();
+    number = std::numeric_limits<double>::max();
   return true;
 }
 
-bool VTTScanner::ScanPercentage(float& percentage) {
+bool VTTScanner::ScanPercentage(double& percentage) {
   Position saved_position = GetPosition();
-  if (!ScanFloat(percentage))
+  if (!ScanDouble(percentage))
     return false;
   if (Scan('%'))
     return true;
@@ -178,5 +182,4 @@
   SeekTo(saved_position);
   return false;
 }
-
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.h b/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.h
index 0089b8c..44f3401 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.h
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTScanner.h
@@ -136,10 +136,10 @@
   unsigned ScanDigits(int& number);
 
   // Scan a floating point value on one of the forms: \d+\.? \d+\.\d+ \.\d+
-  bool ScanFloat(float& number);
+  bool ScanDouble(double& number);
 
-  // Scan a floating point value (per scanFloat) followed by a '%'.
-  bool ScanPercentage(float& percentage);
+  // Scan a floating point value (per ScanDouble) followed by a '%'.
+  bool ScanPercentage(double& percentage);
 
  protected:
   Position GetPosition() const { return data_.characters8; }
diff --git a/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp b/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp
index 59f921a..34c5775 100644
--- a/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp
+++ b/third_party/WebKit/Source/core/html/track/vtt/VTTScannerTest.cpp
@@ -281,45 +281,45 @@
   TEST_WITH(ScanDigits2, "-654 1000000000000000000");
 }
 
-void ScanFloatValue(const String& input) {
+void ScanDoubleValue(const String& input) {
   VTTScanner scanner(input);
-  float value;
+  double value;
   // "1."
-  EXPECT_TRUE(scanner.ScanFloat(value));
-  EXPECT_EQ(value, 1.0f);
+  EXPECT_TRUE(scanner.ScanDouble(value));
+  EXPECT_EQ(value, 1.0);
   EXPECT_TRUE(scanner.Scan(' '));
 
   // "1.0"
-  EXPECT_TRUE(scanner.ScanFloat(value));
-  EXPECT_EQ(value, 1.0f);
+  EXPECT_TRUE(scanner.ScanDouble(value));
+  EXPECT_EQ(value, 1.0);
   EXPECT_TRUE(scanner.Scan(' '));
 
   // ".0"
-  EXPECT_TRUE(scanner.ScanFloat(value));
-  EXPECT_EQ(value, 0.0f);
+  EXPECT_TRUE(scanner.ScanDouble(value));
+  EXPECT_EQ(value, 0.0);
   EXPECT_TRUE(scanner.Scan(' '));
 
   // "." (invalid)
-  EXPECT_FALSE(scanner.ScanFloat(value));
+  EXPECT_FALSE(scanner.ScanDouble(value));
   EXPECT_TRUE(scanner.Match('.'));
   EXPECT_TRUE(scanner.Scan('.'));
   EXPECT_TRUE(scanner.Scan(' '));
 
   // "1.0000"
-  EXPECT_TRUE(scanner.ScanFloat(value));
-  EXPECT_EQ(value, 1.0f);
+  EXPECT_TRUE(scanner.ScanDouble(value));
+  EXPECT_EQ(value, 1.0);
   EXPECT_TRUE(scanner.Scan(' '));
 
   // "01.000"
-  EXPECT_TRUE(scanner.ScanFloat(value));
-  EXPECT_EQ(value, 1.0f);
+  EXPECT_TRUE(scanner.ScanDouble(value));
+  EXPECT_EQ(value, 1.0);
 
   EXPECT_TRUE(scanner.IsAtEnd());
 }
 
-// Tests scanFloat().
-TEST(VTTScannerTest, ScanFloat) {
-  TEST_WITH(ScanFloatValue, "1. 1.0 .0 . 1.0000 01.000");
+// Tests ScanDouble().
+TEST(VTTScannerTest, ScanDouble) {
+  TEST_WITH(ScanDoubleValue, "1. 1.0 .0 . 1.0000 01.000");
 }
 
 #undef TEST_WITH
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index 761bad5..a55de28 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -71,7 +71,6 @@
 #include "core/layout/HitTestRequest.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/resource/ImageResourceContent.h"
diff --git a/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp b/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp
index 784676b4..39a9358 100644
--- a/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp
@@ -7,7 +7,7 @@
 #include "core/frame/LocalFrame.h"
 #include "core/frame/LocalFrameView.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 #include "platform/scroll/ScrollableArea.h"
 #include "public/platform/WebMouseEvent.h"
diff --git a/third_party/WebKit/Source/core/input/GestureManager.cpp b/third_party/WebKit/Source/core/input/GestureManager.cpp
index 474a942e..3d2e12a 100644
--- a/third_party/WebKit/Source/core/input/GestureManager.cpp
+++ b/third_party/WebKit/Source/core/input/GestureManager.cpp
@@ -180,7 +180,7 @@
   if (current_hit_test.InnerNode()) {
     LocalFrame& main_frame = frame_->LocalFrameRoot();
     if (main_frame.View())
-      main_frame.View()->UpdateLifecycleToCompositingCleanPlusScrolling();
+      main_frame.View()->UpdateLifecycleToPrePaintClean();
     adjusted_point = frame_view->RootFrameToContents(
         FlooredIntPoint(gesture_event.PositionInRootFrame()));
     current_hit_test = EventHandlingUtil::HitTestResultInFrame(
diff --git a/third_party/WebKit/Source/core/input/MouseEventManager.cpp b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
index b0dc8a8..fd59ce7 100644
--- a/third_party/WebKit/Source/core/input/MouseEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseEventManager.cpp
@@ -25,7 +25,7 @@
 #include "core/input/InputDeviceCapabilities.h"
 #include "core/input/KeyboardEventManager.h"
 #include "core/layout/HitTestResult.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/AutoscrollController.h"
 #include "core/page/DragController.h"
 #include "core/page/DragState.h"
diff --git a/third_party/WebKit/Source/core/input/MouseWheelEventManager.cpp b/third_party/WebKit/Source/core/input/MouseWheelEventManager.cpp
index a438d58c..2882105 100644
--- a/third_party/WebKit/Source/core/input/MouseWheelEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/MouseWheelEventManager.cpp
@@ -12,7 +12,7 @@
 #include "core/input/EventHandlingUtil.h"
 #include "core/layout/HitTestRequest.h"
 #include "core/layout/HitTestResult.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "public/platform/WebMouseWheelEvent.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/input/ScrollManager.cpp b/third_party/WebKit/Source/core/input/ScrollManager.cpp
index 39dcd6d..389824a 100644
--- a/third_party/WebKit/Source/core/input/ScrollManager.cpp
+++ b/third_party/WebKit/Source/core/input/ScrollManager.cpp
@@ -15,7 +15,7 @@
 #include "core/input/EventHandlingUtil.h"
 #include "core/layout/LayoutBlock.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/AutoscrollController.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/OverscrollController.h"
diff --git a/third_party/WebKit/Source/core/input/TouchActionTest.cpp b/third_party/WebKit/Source/core/input/TouchActionTest.cpp
index 1bd07835..d45655c3 100644
--- a/third_party/WebKit/Source/core/input/TouchActionTest.cpp
+++ b/third_party/WebKit/Source/core/input/TouchActionTest.cpp
@@ -43,7 +43,7 @@
 #include "core/input/EventHandler.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutTreeAsText.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "platform/graphics/TouchAction.h"
 #include "platform/testing/URLTestHelpers.h"
 #include "platform/testing/UnitTestHelpers.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index 4ca3d97..4778770 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -77,7 +77,7 @@
 #include "core/layout/LayoutObject.h"
 #include "core/layout/LayoutObjectInlines.h"
 #include "core/layout/LayoutText.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/line/InlineTextBox.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
index 447386d1..32c6e53 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -71,7 +71,7 @@
 #include "core/inspector/V8InspectorString.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutInline.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/line/InlineTextBox.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/page/FrameTree.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
index 5530aee..21cbe275 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -40,7 +40,7 @@
 #include "core/inspector/IdentifiersFactory.h"
 #include "core/inspector/InspectedFrames.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp
index e2a9fd61..b481653 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorOverlayAgent.cpp
@@ -53,7 +53,7 @@
 #include "core/inspector/InspectedFrames.h"
 #include "core/inspector/InspectorDOMAgent.h"
 #include "core/inspector/InspectorOverlayHost.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/EmptyClients.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/page/ChromeClient.h"
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
index 1f5f337..ad1914e 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTraceEvents.cpp
@@ -341,6 +341,8 @@
       return "full code";
     case v8::ScriptCompiler::kConsumeCodeCache:
       return "code";
+    default:
+      NOTREACHED();
   }
   NOTREACHED();
   return "";
diff --git a/third_party/WebKit/Source/core/layout/BUILD.gn b/third_party/WebKit/Source/core/layout/BUILD.gn
index 44de20c..bbfbc2c 100644
--- a/third_party/WebKit/Source/core/layout/BUILD.gn
+++ b/third_party/WebKit/Source/core/layout/BUILD.gn
@@ -248,8 +248,6 @@
     "api/LayoutBlockItem.h",
     "api/LayoutBoxItem.h",
     "api/LayoutBoxModel.h",
-    "api/LayoutEmbeddedContentItem.h",
-    "api/LayoutEmbeddedItem.h",
     "api/LayoutFullScreenItem.h",
     "api/LayoutImageItem.h",
     "api/LayoutItem.h",
@@ -261,7 +259,6 @@
     "api/LayoutTextControlItem.h",
     "api/LayoutTextFragmentItem.h",
     "api/LayoutTextItem.h",
-    "api/LayoutViewItem.h",
     "api/LineLayoutAPIShim.h",
     "api/LineLayoutBR.h",
     "api/LineLayoutBlockFlow.h",
diff --git a/third_party/WebKit/Source/core/layout/IntersectionGeometry.cpp b/third_party/WebKit/Source/core/layout/IntersectionGeometry.cpp
index 037d67e7..c77cfef 100644
--- a/third_party/WebKit/Source/core/layout/IntersectionGeometry.cpp
+++ b/third_party/WebKit/Source/core/layout/IntersectionGeometry.cpp
@@ -10,7 +10,6 @@
 #include "core/layout/LayoutBox.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/paint/PaintLayer.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 4b2d9ce..38a8436 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -1709,6 +1709,18 @@
   return std::min(effective_margin, remaining_space);
 }
 
+static LayoutBlockFlow* PreviousBlockFlowInFormattingContext(
+    const LayoutBox& child) {
+  LayoutObject* prev = child.PreviousSibling();
+  while (prev && (!prev->IsLayoutBlockFlow() ||
+                  ToLayoutBlockFlow(prev)->CreatesNewFormattingContext())) {
+    prev = prev->PreviousSibling();
+  }
+  if (prev)
+    return ToLayoutBlockFlow(prev);
+  return nullptr;
+}
+
 LayoutUnit LayoutBlockFlow::CollapseMargins(
     LayoutBox& child,
     BlockChildrenLayoutInfo& layout_info,
@@ -1896,18 +1908,16 @@
   if (logical_top < before_collapse_logical_top) {
     LayoutUnit old_logical_height = LogicalHeight();
     SetLogicalHeight(logical_top);
+    LayoutBlockFlow* previous_block_flow =
+        PreviousBlockFlowInFormattingContext(child);
     while (previous_block_flow) {
       auto lowest_float = previous_block_flow->LogicalTop() +
                           previous_block_flow->LowestFloatLogicalBottom();
-      if (lowest_float > logical_top)
-        AddOverhangingFloats(previous_block_flow, false);
-      else
+      if (lowest_float <= logical_top)
         break;
-      LayoutObject* prev = previous_block_flow->PreviousSibling();
-      if (prev && prev->IsLayoutBlockFlow())
-        previous_block_flow = ToLayoutBlockFlow(prev);
-      else
-        previous_block_flow = nullptr;
+      AddOverhangingFloats(previous_block_flow, false);
+      previous_block_flow =
+          PreviousBlockFlowInFormattingContext(*previous_block_flow);
     }
     SetLogicalHeight(old_logical_height);
   }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 33e1ac34..198a1a43 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -52,7 +52,6 @@
 #include "core/layout/LayoutTableCell.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/layout/api/LineLayoutBlockFlow.h"
 #include "core/layout/api/LineLayoutBox.h"
 #include "core/layout/ng/geometry/ng_box_strut.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutEmbeddedContent.cpp b/third_party/WebKit/Source/core/layout/LayoutEmbeddedContent.cpp
index 2a2e5c5f..0532559e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutEmbeddedContent.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutEmbeddedContent.cpp
@@ -36,7 +36,6 @@
 #include "core/layout/LayoutAnalyzer.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/scrolling/RootScrollerUtil.h"
 #include "core/paint/EmbeddedContentPainter.h"
 
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index fa96e597..b62be73 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -76,7 +76,6 @@
 #include "core/layout/LayoutTheme.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/layout/ng/layout_ng_block_flow.h"
 #include "core/layout/ng/layout_ng_list_item.h"
 #include "core/layout/ng/layout_ng_table_cell.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp b/third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp
index 09c035d7..7b95352 100644
--- a/third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutScrollbar.cpp
@@ -32,7 +32,6 @@
 #include "core/layout/LayoutScrollbarTheme.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/paint/ObjectPaintInvalidator.h"
 #include "platform/graphics/GraphicsContext.h"
 
diff --git a/third_party/WebKit/Source/core/layout/LayoutTestHelper.h b/third_party/WebKit/Source/core/layout/LayoutTestHelper.h
index 805fe25..ca0f0a65 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTestHelper.h
+++ b/third_party/WebKit/Source/core/layout/LayoutTestHelper.h
@@ -13,8 +13,8 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/Settings.h"
 #include "core/html/HTMLElement.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/EmptyClients.h"
 #include "core/testing/PageTestBase.h"
 #include "platform/testing/UseMockScrollbarSettings.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp b/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
index 270876f..2395858 100644
--- a/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutTreeAsText.cpp
@@ -44,7 +44,6 @@
 #include "core/layout/LayoutListMarker.h"
 #include "core/layout/LayoutTableCell.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/layout/line/InlineTextBox.h"
 #include "core/layout/ng/layout_ng_list_item.h"
 #include "core/layout/svg/LayoutSVGImage.h"
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 212f7a2..fa61137 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -34,10 +34,9 @@
 #include "core/layout/LayoutCounter.h"
 #include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutGeometryMap.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/ViewFragmentationContext.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/layout/svg/LayoutSVGRoot.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
@@ -118,7 +117,7 @@
   // Note that if an iframe has its render pipeline throttled, it will not
   // update layout here, and it will also not propagate the hit test into the
   // iframe's inner document.
-  GetFrameView()->UpdateLifecycleToCompositingCleanPlusScrolling();
+  GetFrameView()->UpdateLifecycleToPrePaintClean();
   HitTestLatencyRecorder hit_test_latency_recorder(
       result.GetHitTestRequest().AllowsChildFrameContent());
   return HitTestNoLifecycleUpdate(result);
diff --git a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
index 8a4f08b..84f8ec5 100644
--- a/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
+++ b/third_party/WebKit/Source/core/layout/TextAutosizer.cpp
@@ -47,7 +47,6 @@
 #include "core/layout/LayoutTableCell.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 #include "platform/geometry/IntRect.h"
diff --git a/third_party/WebKit/Source/core/layout/api/LayoutEmbeddedContentItem.h b/third_party/WebKit/Source/core/layout/api/LayoutEmbeddedContentItem.h
deleted file mode 100644
index fa5236f6..0000000
--- a/third_party/WebKit/Source/core/layout/api/LayoutEmbeddedContentItem.h
+++ /dev/null
@@ -1,44 +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.
-
-#ifndef LayoutEmbeddedContentItem_h
-#define LayoutEmbeddedContentItem_h
-
-#include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutBoxItem.h"
-
-namespace blink {
-
-class LayoutEmbeddedContentItem : public LayoutBoxItem {
- public:
-  explicit LayoutEmbeddedContentItem(
-      LayoutEmbeddedContent* layout_embedded_content)
-      : LayoutBoxItem(layout_embedded_content) {}
-
-  explicit LayoutEmbeddedContentItem(const LayoutItem& item)
-      : LayoutBoxItem(item) {
-    SECURITY_DCHECK(!item || item.IsLayoutEmbeddedContent());
-  }
-
-  explicit LayoutEmbeddedContentItem(std::nullptr_t) : LayoutBoxItem(nullptr) {}
-
-  LayoutEmbeddedContentItem() {}
-
-  void UpdateOnEmbeddedContentViewChange() {
-    ToPart()->UpdateOnEmbeddedContentViewChange();
-  }
-
- private:
-  LayoutEmbeddedContent* ToPart() {
-    return ToLayoutEmbeddedContent(GetLayoutObject());
-  }
-
-  const LayoutEmbeddedContent* ToPart() const {
-    return ToLayoutEmbeddedContent(GetLayoutObject());
-  }
-};
-
-}  // namespace blink
-
-#endif  // LayoutEmbeddedContentItem_h
diff --git a/third_party/WebKit/Source/core/layout/api/LayoutEmbeddedItem.h b/third_party/WebKit/Source/core/layout/api/LayoutEmbeddedItem.h
deleted file mode 100644
index 33d95c49..0000000
--- a/third_party/WebKit/Source/core/layout/api/LayoutEmbeddedItem.h
+++ /dev/null
@@ -1,49 +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.
-
-#ifndef LayoutEmbeddedItem_h
-#define LayoutEmbeddedItem_h
-
-#include "core/layout/LayoutEmbeddedObject.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-
-namespace blink {
-
-class LayoutEmbeddedItem : public LayoutEmbeddedContentItem {
- public:
-  explicit LayoutEmbeddedItem(LayoutEmbeddedObject* layout_embedded_object)
-      : LayoutEmbeddedContentItem(layout_embedded_object) {}
-
-  explicit LayoutEmbeddedItem(const LayoutItem& item)
-      : LayoutEmbeddedContentItem(item) {
-    SECURITY_DCHECK(!item || item.IsEmbeddedObject());
-  }
-
-  explicit LayoutEmbeddedItem(std::nullptr_t)
-      : LayoutEmbeddedContentItem(nullptr) {}
-
-  LayoutEmbeddedItem() {}
-
-  void SetPluginAvailability(
-      LayoutEmbeddedObject::PluginAvailability availability) {
-    ToEmbeddedObject()->SetPluginAvailability(availability);
-  }
-
-  bool ShowsUnavailablePluginIndicator() const {
-    return ToEmbeddedObject()->ShowsUnavailablePluginIndicator();
-  }
-
- private:
-  LayoutEmbeddedObject* ToEmbeddedObject() {
-    return ToLayoutEmbeddedObject(GetLayoutObject());
-  }
-
-  const LayoutEmbeddedObject* ToEmbeddedObject() const {
-    return ToLayoutEmbeddedObject(GetLayoutObject());
-  }
-};
-
-}  // namespace blink
-
-#endif  // LayoutEmbeddedItem_h
diff --git a/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h b/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h
deleted file mode 100644
index 2e0cbe7..0000000
--- a/third_party/WebKit/Source/core/layout/api/LayoutViewItem.h
+++ /dev/null
@@ -1,51 +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.
-
-#ifndef LayoutViewItem_h
-#define LayoutViewItem_h
-
-#include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutBlockItem.h"
-
-namespace blink {
-
-class LayoutViewItem : public LayoutBlockItem {
- public:
-  explicit LayoutViewItem(LayoutView* layout_view)
-      : LayoutBlockItem(layout_view) {}
-
-  explicit LayoutViewItem(const LayoutBlockItem& item) : LayoutBlockItem(item) {
-    SECURITY_DCHECK(!item || item.IsLayoutView());
-  }
-
-  explicit LayoutViewItem(std::nullptr_t) : LayoutBlockItem(nullptr) {}
-
-  LayoutViewItem() {}
-
-  bool HitTest(HitTestResult& result) { return ToView()->HitTest(result); }
-
-  bool HitTestNoLifecycleUpdate(HitTestResult& result) {
-    return ToView()->HitTestNoLifecycleUpdate(result);
-  }
-
-  unsigned HitTestCount() const { return ToView()->HitTestCount(); }
-
-  unsigned HitTestCacheHits() const { return ToView()->HitTestCacheHits(); }
-
-  void ClearHitTestCache() { ToView()->ClearHitTestCache(); }
-
-  void UpdateCounters() { ToView()->UpdateCounters(); }
-
- private:
-  LayoutView* ToView() { return ToLayoutView(GetLayoutObject()); }
-  const LayoutView* ToView() const { return ToLayoutView(GetLayoutObject()); }
-};
-
-inline LayoutViewItem LayoutItem::View() const {
-  return LayoutViewItem(layout_object_->View());
-}
-
-}  // namespace blink
-
-#endif  // LayoutViewItem_h
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
index 79b4979f..acaa6bd4 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGRoot.cpp
@@ -26,8 +26,8 @@
 #include "core/frame/LocalFrame.h"
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutAnalyzer.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/layout/svg/LayoutSVGText.h"
 #include "core/layout/svg/SVGLayoutSupport.h"
 #include "core/layout/svg/SVGResourcesCache.h"
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 7e1582d..61751db 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1528,7 +1528,8 @@
   // defined state should the navigation fail.
   if (!had_placeholder_client_document_loader &&
       type == kFrameLoadTypeStandard &&
-      navigation_policy == kNavigationPolicyCurrentTab) {
+      (navigation_policy == kNavigationPolicyCurrentTab ||
+       navigation_policy == kNavigationPolicyHandledByClient)) {
     frame_->GetDocument()->CheckCompleted();
   }
   DetachDocumentLoader(provisional_document_loader_);
diff --git a/third_party/WebKit/Source/core/page/DragController.cpp b/third_party/WebKit/Source/core/page/DragController.cpp
index 8a24b45..d3f3a309 100644
--- a/third_party/WebKit/Source/core/page/DragController.cpp
+++ b/third_party/WebKit/Source/core/page/DragController.cpp
@@ -64,7 +64,7 @@
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutImage.h"
 #include "core/layout/LayoutTheme.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/resource/ImageResourceContent.h"
diff --git a/third_party/WebKit/Source/core/page/PrintContext.cpp b/third_party/WebKit/Source/core/page/PrintContext.cpp
index e40998aa..5f1e171 100644
--- a/third_party/WebKit/Source/core/page/PrintContext.cpp
+++ b/third_party/WebKit/Source/core/page/PrintContext.cpp
@@ -25,7 +25,6 @@
 #include "core/frame/LocalFrame.h"
 #include "core/frame/LocalFrameView.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "platform/graphics/GraphicsContext.h"
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
index 3804aec..b802b35 100644
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
@@ -11,7 +11,7 @@
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/layout/LayoutBox.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/RootScrollerUtil.h"
 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
index f6777ee0..8fa70b8 100644
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerTest.cpp
@@ -14,7 +14,7 @@
 #include "core/geometry/DOMRect.h"
 #include "core/html/HTMLFrameOwnerElement.h"
 #include "core/layout/LayoutBox.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/RootScrollerController.h"
 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
@@ -1287,7 +1287,8 @@
 // Test that hit testing in the area revealed at the bottom of the screen
 // revealed by hiding the URL bar works properly when using a root scroller
 // when the target and scroller are in the same PaintLayer.
-TEST_P(RootScrollerHitTest, HitTestInAreaRevealedByURLBarSameLayer) {
+// TODO(chrishtr): fix this for root scrollers.
+TEST_P(RootScrollerHitTest, DISABLED_HitTestInAreaRevealedByURLBarSameLayer) {
   // Add a target at the bottom of the root scroller that's the size of the url
   // bar. We'll test that hiding the URL bar appropriately adjusts clipping so
   // that we can hit this target.
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 21d991586..8d8c030 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -38,8 +38,7 @@
 #include "core/input/TouchActionUtil.h"
 #include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutGeometryMap.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 #include "core/paint/compositing/CompositedLayerMapping.h"
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp
index 403be63..f040536e 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinatorTest.cpp
@@ -34,7 +34,7 @@
 #include "core/frame/WebLocalFrameImpl.h"
 #include "core/html/HTMLIFrameElement.h"
 #include "core/layout/LayoutEmbeddedContent.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/Page.h"
 #include "core/paint/compositing/CompositedLayerMapping.h"
 #include "core/paint/compositing/PaintLayerCompositor.h"
diff --git a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
index 56302d5..dddb1d5 100644
--- a/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
+++ b/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp
@@ -547,13 +547,13 @@
       BorderEdge edges[4];
       positioning_box_.StyleRef().GetBorderEdgeInfo(edges);
       const auto border_outsets = positioning_box_.BorderBoxOutsets();
-      if (edges[kBSTop].ObscuresBackground())
+      if (edges[static_cast<unsigned>(BoxSide::kTop)].ObscuresBackground())
         dest_adjust.SetTop(border_outsets.Top());
-      if (edges[kBSRight].ObscuresBackground())
+      if (edges[static_cast<unsigned>(BoxSide::kRight)].ObscuresBackground())
         dest_adjust.SetRight(border_outsets.Right());
-      if (edges[kBSBottom].ObscuresBackground())
+      if (edges[static_cast<unsigned>(BoxSide::kBottom)].ObscuresBackground())
         dest_adjust.SetBottom(border_outsets.Bottom());
-      if (edges[kBSLeft].ObscuresBackground())
+      if (edges[static_cast<unsigned>(BoxSide::kLeft)].ObscuresBackground())
         dest_adjust.SetLeft(border_outsets.Left());
     } break;
     case EFillBox::kText:
diff --git a/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp b/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
index b930dcb..9dc2372 100644
--- a/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxBorderPainter.cpp
@@ -19,16 +19,16 @@
 namespace {
 
 enum BorderEdgeFlag {
-  kTopBorderEdge = 1 << kBSTop,
-  kRightBorderEdge = 1 << kBSRight,
-  kBottomBorderEdge = 1 << kBSBottom,
-  kLeftBorderEdge = 1 << kBSLeft,
+  kTopBorderEdge = 1 << static_cast<unsigned>(BoxSide::kTop),
+  kRightBorderEdge = 1 << static_cast<unsigned>(BoxSide::kRight),
+  kBottomBorderEdge = 1 << static_cast<unsigned>(BoxSide::kBottom),
+  kLeftBorderEdge = 1 << static_cast<unsigned>(BoxSide::kLeft),
   kAllBorderEdges =
       kTopBorderEdge | kBottomBorderEdge | kLeftBorderEdge | kRightBorderEdge
 };
 
 inline BorderEdgeFlag EdgeFlagForSide(BoxSide side) {
-  return static_cast<BorderEdgeFlag>(1 << side);
+  return static_cast<BorderEdgeFlag>(1 << static_cast<unsigned>(side));
 }
 
 inline bool IncludesEdge(BorderEdgeFlags flags, BoxSide side) {
@@ -71,9 +71,9 @@
   if (style == EBorderStyle::kInset || style == EBorderStyle::kGroove ||
       style == EBorderStyle::kRidge || style == EBorderStyle::kOutset) {
     const BorderEdgeFlags top_right_flags =
-        EdgeFlagForSide(kBSTop) | EdgeFlagForSide(kBSRight);
+        EdgeFlagForSide(BoxSide::kTop) | EdgeFlagForSide(BoxSide::kRight);
     const BorderEdgeFlags bottom_left_flags =
-        EdgeFlagForSide(kBSBottom) | EdgeFlagForSide(kBSLeft);
+        EdgeFlagForSide(BoxSide::kBottom) | EdgeFlagForSide(BoxSide::kLeft);
 
     BorderEdgeFlags flags =
         EdgeFlagForSide(side) | EdgeFlagForSide(adjacent_side);
@@ -85,14 +85,15 @@
 inline bool ColorsMatchAtCorner(BoxSide side,
                                 BoxSide adjacent_side,
                                 const BorderEdge edges[]) {
-  if (!edges[adjacent_side].ShouldRender())
+  if (!edges[static_cast<unsigned>(adjacent_side)].ShouldRender())
     return false;
 
-  if (!edges[side].SharesColorWith(edges[adjacent_side]))
+  if (!edges[static_cast<unsigned>(side)].SharesColorWith(
+          edges[static_cast<unsigned>(adjacent_side)]))
     return false;
 
-  return !BorderStyleHasUnmatchedColorsAtCorner(edges[side].BorderStyle(), side,
-                                                adjacent_side);
+  return !BorderStyleHasUnmatchedColorsAtCorner(
+      edges[static_cast<unsigned>(side)].BorderStyle(), side, adjacent_side);
 }
 
 inline bool BorderWillArcInnerEdge(const FloatSize& first_radius,
@@ -139,11 +140,11 @@
   FloatRect side_rect = outer_border.Rect();
   float width = edge.Width();
 
-  if (side == kBSTop)
+  if (side == static_cast<unsigned>(BoxSide::kTop))
     side_rect.SetHeight(width);
-  else if (side == kBSBottom)
+  else if (side == static_cast<unsigned>(BoxSide::kBottom))
     side_rect.ShiftYEdgeTo(side_rect.MaxY() - width);
-  else if (side == kBSLeft)
+  else if (side == static_cast<unsigned>(BoxSide::kLeft))
     side_rect.SetWidth(width);
   else
     side_rect.ShiftXEdgeTo(side_rect.MaxX() - width);
@@ -158,20 +159,24 @@
   float width;
 
   switch (side) {
-    case kBSTop:
-      width = side_rect.Height() - edges[kBSBottom].Width();
+    case BoxSide::kTop:
+      width = side_rect.Height() -
+              edges[static_cast<unsigned>(BoxSide::kBottom)].Width();
       side_rect.SetHeight(width);
       break;
-    case kBSBottom:
-      width = side_rect.Height() - edges[kBSTop].Width();
+    case BoxSide::kBottom:
+      width = side_rect.Height() -
+              edges[static_cast<unsigned>(BoxSide::kTop)].Width();
       side_rect.ShiftYEdgeTo(side_rect.MaxY() - width);
       break;
-    case kBSLeft:
-      width = side_rect.Width() - edges[kBSRight].Width();
+    case BoxSide::kLeft:
+      width = side_rect.Width() -
+              edges[static_cast<unsigned>(BoxSide::kRight)].Width();
       side_rect.SetWidth(width);
       break;
-    case kBSRight:
-      width = side_rect.Width() - edges[kBSLeft].Width();
+    case BoxSide::kRight:
+      width = side_rect.Width() -
+              edges[static_cast<unsigned>(BoxSide::kLeft)].Width();
       side_rect.ShiftXEdgeTo(side_rect.MaxX() - width);
       break;
   }
@@ -193,7 +198,7 @@
   float max_radii;
 
   switch (side) {
-    case kBSTop:
+    case BoxSide::kTop:
       overshoot = new_radii.TopLeft().Width() + new_radii.TopRight().Width() -
                   new_rect.Width();
       // FIXME: once we start pixel-snapping rounded rects after this point, the
@@ -211,7 +216,7 @@
         new_rect.SetHeight(max_radii);
       break;
 
-    case kBSBottom:
+    case BoxSide::kBottom:
       overshoot = new_radii.BottomLeft().Width() +
                   new_radii.BottomRight().Width() - new_rect.Width();
       if (overshoot > 0.1) {
@@ -229,7 +234,7 @@
       }
       break;
 
-    case kBSLeft:
+    case BoxSide::kLeft:
       overshoot = new_radii.TopLeft().Height() +
                   new_radii.BottomLeft().Height() - new_rect.Height();
       if (overshoot > 0.1) {
@@ -245,7 +250,7 @@
         new_rect.SetWidth(max_radii);
       break;
 
-    case kBSRight:
+    case BoxSide::kRight:
       overshoot = new_radii.TopRight().Height() +
                   new_radii.BottomRight().Height() - new_rect.Height();
       if (overshoot > 0.1) {
@@ -270,10 +275,15 @@
 LayoutRectOutsets DoubleStripeInsets(const BorderEdge edges[],
                                      BorderEdge::DoubleBorderStripe stripe) {
   // Insets are representes as negative outsets.
-  return LayoutRectOutsets(-edges[kBSTop].GetDoubleBorderStripeWidth(stripe),
-                           -edges[kBSRight].GetDoubleBorderStripeWidth(stripe),
-                           -edges[kBSBottom].GetDoubleBorderStripeWidth(stripe),
-                           -edges[kBSLeft].GetDoubleBorderStripeWidth(stripe));
+  return LayoutRectOutsets(
+      -edges[static_cast<unsigned>(BoxSide::kTop)].GetDoubleBorderStripeWidth(
+          stripe),
+      -edges[static_cast<unsigned>(BoxSide::kRight)].GetDoubleBorderStripeWidth(
+          stripe),
+      -edges[static_cast<unsigned>(BoxSide::kBottom)]
+           .GetDoubleBorderStripeWidth(stripe),
+      -edges[static_cast<unsigned>(BoxSide::kLeft)].GetDoubleBorderStripeWidth(
+          stripe));
 }
 
 float ClampOrRound(float border_width) {
@@ -364,10 +374,14 @@
 static_assert(EBorderStyle::kDouble == static_cast<EBorderStyle>(9),
               "unexpected EBorderStyle value");
 
-static_assert(kBSTop == 0, "unexpected BoxSide value");
-static_assert(kBSRight == 1, "unexpected BoxSide value");
-static_assert(kBSBottom == 2, "unexpected BoxSide value");
-static_assert(kBSLeft == 3, "unexpected BoxSide value");
+static_assert(static_cast<unsigned>(BoxSide::kTop) == 0,
+              "unexpected BoxSide value");
+static_assert(static_cast<unsigned>(BoxSide::kRight) == 1,
+              "unexpected BoxSide value");
+static_assert(static_cast<unsigned>(BoxSide::kBottom) == 2,
+              "unexpected BoxSide value");
+static_assert(static_cast<unsigned>(BoxSide::kLeft) == 3,
+              "unexpected BoxSide value");
 
 // Style-based paint order: non-solid edges (dashed/dotted/double) are painted
 // before solid edges (inset/outset/groove/ridge/solid) to maximize overdraw
@@ -432,8 +446,10 @@
     // alpha, style, side.
     std::sort(sorted_sides.begin(), sorted_sides.end(),
               [&border_painter](BoxSide a, BoxSide b) -> bool {
-                const BorderEdge& edge_a = border_painter.edges_[a];
-                const BorderEdge& edge_b = border_painter.edges_[b];
+                const BorderEdge& edge_a =
+                    border_painter.edges_[static_cast<unsigned>(a)];
+                const BorderEdge& edge_b =
+                    border_painter.edges_[static_cast<unsigned>(b)];
 
                 const unsigned alpha_a = edge_a.color.Alpha();
                 const unsigned alpha_b = edge_b.color.Alpha();
@@ -447,7 +463,8 @@
                 if (style_priority_a != style_priority_b)
                   return style_priority_a < style_priority_b;
 
-                return kSidePriority[a] < kSidePriority[b];
+                return kSidePriority[static_cast<unsigned>(a)] <
+                       kSidePriority[static_cast<unsigned>(b)];
               });
 
     // Finally, build the opacity group structures.
@@ -469,7 +486,8 @@
                           const Vector<BoxSide, 4>& sorted_sides) {
     unsigned current_alpha = 0;
     for (BoxSide side : sorted_sides) {
-      const BorderEdge& edge = border_painter.edges_[side];
+      const BorderEdge& edge =
+          border_painter.edges_[static_cast<unsigned>(side)];
       const unsigned edge_alpha = edge.color.Alpha();
 
       DCHECK_GT(edge_alpha, 0u);
@@ -555,7 +573,8 @@
     Path path;
     path.SetWindRule(RULE_NONZERO);
 
-    for (int i = kBSTop; i <= kBSLeft; ++i) {
+    for (unsigned int i = static_cast<unsigned>(BoxSide::kTop);
+         i <= static_cast<unsigned>(BoxSide::kLeft); ++i) {
       const BorderEdge& curr_edge = edges_[i];
       if (curr_edge.ShouldRender())
         path.AddRect(CalculateSideRect(outer_, curr_edge, i));
@@ -603,10 +622,10 @@
   // can pixel snap smaller.
   float max_width = outer_.Rect().Width();
   float max_height = outer_.Rect().Height();
-  edges_[kBSTop].ClampWidth(max_height);
-  edges_[kBSRight].ClampWidth(max_width);
-  edges_[kBSBottom].ClampWidth(max_height);
-  edges_[kBSLeft].ClampWidth(max_width);
+  edges_[static_cast<unsigned>(BoxSide::kTop)].ClampWidth(max_height);
+  edges_[static_cast<unsigned>(BoxSide::kRight)].ClampWidth(max_width);
+  edges_[static_cast<unsigned>(BoxSide::kBottom)].ClampWidth(max_height);
+  edges_[static_cast<unsigned>(BoxSide::kLeft)].ClampWidth(max_width);
 
   is_rounded_ = outer_.IsRounded();
 }
@@ -804,7 +823,7 @@
                                  BoxSide side,
                                  unsigned alpha,
                                  BorderEdgeFlags completed_edges) const {
-  const BorderEdge& edge = edges_[side];
+  const BorderEdge& edge = edges_[static_cast<unsigned>(side)];
   DCHECK(edge.ShouldRender());
   const Color color(edge.color.Red(), edge.color.Green(), edge.color.Blue(),
                     alpha);
@@ -815,7 +834,7 @@
   // TODO(fmalita): find a way to consolidate these without sacrificing
   // readability.
   switch (side) {
-    case kBSTop: {
+    case BoxSide::kTop: {
       bool use_path =
           is_rounded_ && (BorderStyleHasInnerDetail(edge.BorderStyle()) ||
                           BorderWillArcInnerEdge(inner_.GetRadii().TopLeft(),
@@ -825,11 +844,12 @@
       else
         side_rect.SetHeight(ClampOrRound(edge.Width()));
 
-      PaintOneBorderSide(context, side_rect, kBSTop, kBSLeft, kBSRight, path,
-                         border_info.anti_alias, color, completed_edges);
+      PaintOneBorderSide(context, side_rect, BoxSide::kTop, BoxSide::kLeft,
+                         BoxSide::kRight, path, border_info.anti_alias, color,
+                         completed_edges);
       break;
     }
-    case kBSBottom: {
+    case BoxSide::kBottom: {
       bool use_path = is_rounded_ &&
                       (BorderStyleHasInnerDetail(edge.BorderStyle()) ||
                        BorderWillArcInnerEdge(inner_.GetRadii().BottomLeft(),
@@ -839,11 +859,12 @@
       else
         side_rect.ShiftYEdgeTo(side_rect.MaxY() - ClampOrRound(edge.Width()));
 
-      PaintOneBorderSide(context, side_rect, kBSBottom, kBSLeft, kBSRight, path,
-                         border_info.anti_alias, color, completed_edges);
+      PaintOneBorderSide(context, side_rect, BoxSide::kBottom, BoxSide::kLeft,
+                         BoxSide::kRight, path, border_info.anti_alias, color,
+                         completed_edges);
       break;
     }
-    case kBSLeft: {
+    case BoxSide::kLeft: {
       bool use_path =
           is_rounded_ && (BorderStyleHasInnerDetail(edge.BorderStyle()) ||
                           BorderWillArcInnerEdge(inner_.GetRadii().BottomLeft(),
@@ -853,11 +874,12 @@
       else
         side_rect.SetWidth(ClampOrRound(edge.Width()));
 
-      PaintOneBorderSide(context, side_rect, kBSLeft, kBSTop, kBSBottom, path,
-                         border_info.anti_alias, color, completed_edges);
+      PaintOneBorderSide(context, side_rect, BoxSide::kLeft, BoxSide::kTop,
+                         BoxSide::kBottom, path, border_info.anti_alias, color,
+                         completed_edges);
       break;
     }
-    case kBSRight: {
+    case BoxSide::kRight: {
       bool use_path = is_rounded_ &&
                       (BorderStyleHasInnerDetail(edge.BorderStyle()) ||
                        BorderWillArcInnerEdge(inner_.GetRadii().BottomRight(),
@@ -867,8 +889,9 @@
       else
         side_rect.ShiftXEdgeTo(side_rect.MaxX() - ClampOrRound(edge.Width()));
 
-      PaintOneBorderSide(context, side_rect, kBSRight, kBSTop, kBSBottom, path,
-                         border_info.anti_alias, color, completed_edges);
+      PaintOneBorderSide(context, side_rect, BoxSide::kRight, BoxSide::kTop,
+                         BoxSide::kBottom, path, border_info.anti_alias, color,
+                         completed_edges);
       break;
     }
     default:
@@ -881,7 +904,8 @@
     BoxSide adjacent_side,
     BorderEdgeFlags completed_edges,
     bool antialias) const {
-  const BorderEdge& adjacent_edge = edges_[adjacent_side];
+  const BorderEdge& adjacent_edge =
+      edges_[static_cast<unsigned>(adjacent_side)];
 
   // No miters for missing edges.
   if (!adjacent_edge.is_present)
@@ -898,8 +922,10 @@
 
   // Non-anti-aliased miters ensure correct same-color seaming when required by
   // style.
-  if (BorderStylesRequireMiter(side, adjacent_side, edges_[side].BorderStyle(),
-                               adjacent_edge.BorderStyle()))
+  if (BorderStylesRequireMiter(
+          side, adjacent_side,
+          edges_[static_cast<unsigned>(side)].BorderStyle(),
+          adjacent_edge.BorderStyle()))
     return kHardMiter;
 
   // Overdraw the adjacent edge when the colors match and we have no style
@@ -933,10 +959,12 @@
     bool antialias,
     Color color,
     BorderEdgeFlags completed_edges) const {
-  const BorderEdge& edge_to_render = edges_[side];
+  const BorderEdge& edge_to_render = edges_[static_cast<unsigned>(side)];
   DCHECK(edge_to_render.Width());
-  const BorderEdge& adjacent_edge1 = edges_[adjacent_side1];
-  const BorderEdge& adjacent_edge2 = edges_[adjacent_side2];
+  const BorderEdge& adjacent_edge1 =
+      edges_[static_cast<unsigned>(adjacent_side1)];
+  const BorderEdge& adjacent_edge2 =
+      edges_[static_cast<unsigned>(adjacent_side2)];
 
   if (path) {
     MiterType miter1 = ColorsMatchAtCorner(side, adjacent_side1, edges_)
@@ -1021,11 +1049,11 @@
       return;
     }
     case EBorderStyle::kInset:
-      if (side == kBSTop || side == kBSLeft)
+      if (side == BoxSide::kTop || side == BoxSide::kLeft)
         color = color.Dark();
       break;
     case EBorderStyle::kOutset:
-      if (side == kBSBottom || side == kBSRight)
+      if (side == BoxSide::kBottom || side == BoxSide::kRight)
         color = color.Dark();
       break;
     default:
@@ -1046,8 +1074,10 @@
     EBorderStyle border_style) const {
   // Convert the path to be down the middle of the dots or dashes.
   const LayoutRectOutsets center_offsets(
-      -edges_[kBSTop].UsedWidth() * 0.5, -edges_[kBSRight].UsedWidth() * 0.5,
-      -edges_[kBSBottom].UsedWidth() * 0.5, -edges_[kBSLeft].UsedWidth() * 0.5);
+      -edges_[static_cast<unsigned>(BoxSide::kTop)].UsedWidth() * 0.5,
+      -edges_[static_cast<unsigned>(BoxSide::kRight)].UsedWidth() * 0.5,
+      -edges_[static_cast<unsigned>(BoxSide::kBottom)].UsedWidth() * 0.5,
+      -edges_[static_cast<unsigned>(BoxSide::kLeft)].UsedWidth() * 0.5);
   Path centerline_path;
   centerline_path.AddRoundedRect(style_.GetRoundedInnerBorderFor(
       border_rect, center_offsets, include_logical_left_edge_,
@@ -1166,10 +1196,13 @@
 
   // Paint inner only
   GraphicsContextStateSaver state_saver(graphics_context);
-  int top_width = edges_[kBSTop].UsedWidth() / 2;
-  int bottom_width = edges_[kBSBottom].UsedWidth() / 2;
-  int left_width = edges_[kBSLeft].UsedWidth() / 2;
-  int right_width = edges_[kBSRight].UsedWidth() / 2;
+  int top_width = edges_[static_cast<unsigned>(BoxSide::kTop)].UsedWidth() / 2;
+  int bottom_width =
+      edges_[static_cast<unsigned>(BoxSide::kBottom)].UsedWidth() / 2;
+  int left_width =
+      edges_[static_cast<unsigned>(BoxSide::kLeft)].UsedWidth() / 2;
+  int right_width =
+      edges_[static_cast<unsigned>(BoxSide::kRight)].UsedWidth() / 2;
 
   FloatRoundedRect clip_rect = style_.GetRoundedInnerBorderFor(
       border_rect,
@@ -1224,7 +1257,7 @@
   const static float kExtensionLength = 1e-1f;
   FloatSize extension_offset;
   switch (side) {
-    case kBSTop:
+    case BoxSide::kTop:
       edge_quad[0] = FloatPoint(outer_rect.MinXMinYCorner());
       edge_quad[1] = FloatPoint(inner_rect.MinXMinYCorner());
       edge_quad[2] = FloatPoint(inner_rect.MaxXMinYCorner());
@@ -1268,7 +1301,7 @@
       }
       break;
 
-    case kBSLeft:
+    case BoxSide::kLeft:
       // Swap the order of adjacent edges to allow common code
       std::swap(first_miter, second_miter);
       edge_quad[0] = FloatPoint(outer_rect.MinXMaxYCorner());
@@ -1315,7 +1348,7 @@
       }
       break;
 
-    case kBSBottom:
+    case BoxSide::kBottom:
       // Swap the order of adjacent edges to allow common code
       std::swap(first_miter, second_miter);
       edge_quad[0] = FloatPoint(outer_rect.MaxXMaxYCorner());
@@ -1364,7 +1397,7 @@
       }
       break;
 
-    case kBSRight:
+    case BoxSide::kRight:
       edge_quad[0] = FloatPoint(outer_rect.MaxXMinYCorner());
       edge_quad[1] = FloatPoint(inner_rect.MaxXMinYCorner());
       edge_quad[2] = FloatPoint(inner_rect.MaxXMaxYCorner());
diff --git a/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp b/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp
index bf511de..6f0c63d 100644
--- a/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxPainterBase.cpp
@@ -293,10 +293,14 @@
       }
     }
 
-    FloatRectOutsets insets(-fractional_inset * edges[kBSTop].Width(),
-                            -fractional_inset * edges[kBSRight].Width(),
-                            -fractional_inset * edges[kBSBottom].Width(),
-                            -fractional_inset * edges[kBSLeft].Width());
+    FloatRectOutsets insets(
+        -fractional_inset * edges[static_cast<unsigned>(BoxSide::kTop)].Width(),
+        -fractional_inset *
+            edges[static_cast<unsigned>(BoxSide::kRight)].Width(),
+        -fractional_inset *
+            edges[static_cast<unsigned>(BoxSide::kBottom)].Width(),
+        -fractional_inset *
+            edges[static_cast<unsigned>(BoxSide::kLeft)].Width());
 
     FloatRoundedRect background_rounded_rect = GetBackgroundRoundedRect(
         border_rect, include_logical_left_edge, include_logical_right_edge);
diff --git a/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp b/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp
index e86ba97e2..4e8cacf 100644
--- a/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/CollapsedBorderPainter.cpp
@@ -362,29 +362,31 @@
     ObjectPainter::DrawLineForBoxSide(
         context, rect.X() - before_.begin_outset,
         rect.Y() - before_.outer_width, rect.MaxX() + before_.end_outset,
-        rect.Y() + before_.inner_width, kBSTop, before_.value->GetColor(),
-        CollapsedBorderStyle(before_.value->Style()), 0, 0, true);
+        rect.Y() + before_.inner_width, BoxSide::kTop,
+        before_.value->GetColor(), CollapsedBorderStyle(before_.value->Style()),
+        0, 0, true);
   }
   if (after_.value) {
     ObjectPainter::DrawLineForBoxSide(
         context, rect.X() - after_.begin_outset,
         rect.MaxY() - after_.inner_width, rect.MaxX() + after_.end_outset,
-        rect.MaxY() + after_.outer_width, kBSBottom, after_.value->GetColor(),
-        CollapsedBorderStyle(after_.value->Style()), 0, 0, true);
+        rect.MaxY() + after_.outer_width, BoxSide::kBottom,
+        after_.value->GetColor(), CollapsedBorderStyle(after_.value->Style()),
+        0, 0, true);
   }
   if (start_.value) {
     ObjectPainter::DrawLineForBoxSide(
         context, rect.X() - start_.outer_width, rect.Y() - start_.begin_outset,
-        rect.X() + start_.inner_width, rect.MaxY() + start_.end_outset, kBSLeft,
-        start_.value->GetColor(), CollapsedBorderStyle(start_.value->Style()),
-        0, 0, true);
+        rect.X() + start_.inner_width, rect.MaxY() + start_.end_outset,
+        BoxSide::kLeft, start_.value->GetColor(),
+        CollapsedBorderStyle(start_.value->Style()), 0, 0, true);
   }
   if (end_.value) {
     ObjectPainter::DrawLineForBoxSide(
         context, rect.MaxX() - end_.inner_width, rect.Y() - end_.begin_outset,
-        rect.MaxX() + end_.outer_width, rect.MaxY() + end_.end_outset, kBSRight,
-        end_.value->GetColor(), CollapsedBorderStyle(end_.value->Style()), 0, 0,
-        true);
+        rect.MaxX() + end_.outer_width, rect.MaxY() + end_.end_outset,
+        BoxSide::kRight, end_.value->GetColor(),
+        CollapsedBorderStyle(end_.value->Style()), 0, 0, true);
   }
 }
 
diff --git a/third_party/WebKit/Source/core/paint/MultiColumnSetPainter.cpp b/third_party/WebKit/Source/core/paint/MultiColumnSetPainter.cpp
index d020b02ae..73d1f07 100644
--- a/third_party/WebKit/Source/core/paint/MultiColumnSetPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/MultiColumnSetPainter.cpp
@@ -56,8 +56,8 @@
   bool left_to_right =
       layout_multi_column_set_.Style()->IsLeftToRightDirection();
   BoxSide box_side = layout_multi_column_set_.IsHorizontalWritingMode()
-                         ? left_to_right ? kBSLeft : kBSRight
-                         : left_to_right ? kBSTop : kBSBottom;
+                         ? left_to_right ? BoxSide::kLeft : BoxSide::kRight
+                         : left_to_right ? BoxSide::kTop : BoxSide::kBottom;
   const Color& rule_color = layout_multi_column_set_.ResolveColor(
       block_style, GetCSSPropertyColumnRuleColor());
 
diff --git a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
index 35b3195a..9470dcd 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPaintInvalidator.cpp
@@ -6,8 +6,8 @@
 
 #include "core/frame/LocalFrame.h"
 #include "core/frame/LocalFrameView.h"
+#include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/paint/FindPaintOffsetAndVisualRectNeedingUpdate.h"
 #include "core/paint/PaintInvalidator.h"
 #include "core/paint/PaintLayer.h"
diff --git a/third_party/WebKit/Source/core/paint/ObjectPainterBase.cpp b/third_party/WebKit/Source/core/paint/ObjectPainterBase.cpp
index b9cc9de..91bf990 100644
--- a/third_party/WebKit/Source/core/paint/ObjectPainterBase.cpp
+++ b/third_party/WebKit/Source/core/paint/ObjectPainterBase.cpp
@@ -38,44 +38,44 @@
   // to increase the edge length to include the joint; - needs a negative
   // adjacent joint width (required by ObjectPainterBase::DrawLineForBoxSide).
   switch (edge1.side) {
-    case kBSTop:
+    case BoxSide::kTop:
       switch (edge2.side) {
-        case kBSRight:  // Clockwise
+        case BoxSide::kRight:  // Clockwise
           return outline_width;
-        case kBSLeft:  // Counterclockwise
+        case BoxSide::kLeft:  // Counterclockwise
           edge1.x2 += outline_width;
           edge2.y2 += outline_width;
           return -outline_width;
         default:  // Same side or no joint.
           return 0;
       }
-    case kBSRight:
+    case BoxSide::kRight:
       switch (edge2.side) {
-        case kBSBottom:  // Clockwise
+        case BoxSide::kBottom:  // Clockwise
           return outline_width;
-        case kBSTop:  // Counterclockwise
+        case BoxSide::kTop:  // Counterclockwise
           edge1.y2 += outline_width;
           edge2.x1 -= outline_width;
           return -outline_width;
         default:  // Same side or no joint.
           return 0;
       }
-    case kBSBottom:
+    case BoxSide::kBottom:
       switch (edge2.side) {
-        case kBSLeft:  // Clockwise
+        case BoxSide::kLeft:  // Clockwise
           return outline_width;
-        case kBSRight:  // Counterclockwise
+        case BoxSide::kRight:  // Counterclockwise
           edge1.x1 -= outline_width;
           edge2.y1 -= outline_width;
           return -outline_width;
         default:  // Same side or no joint.
           return 0;
       }
-    case kBSLeft:
+    case BoxSide::kLeft:
       switch (edge2.side) {
-        case kBSTop:  // Clockwise
+        case BoxSide::kTop:  // Clockwise
           return outline_width;
-        case kBSBottom:  // Counterclockwise
+        case BoxSide::kBottom:  // Counterclockwise
           edge1.y1 -= outline_width;
           edge2.x2 += outline_width;
           return -outline_width;
@@ -126,21 +126,21 @@
     if (edge.x1 == edge.x2) {
       if (edge.y1 < edge.y2) {
         edge.x1 -= width;
-        edge.side = kBSRight;
+        edge.side = BoxSide::kRight;
       } else {
         std::swap(edge.y1, edge.y2);
         edge.x2 += width;
-        edge.side = kBSLeft;
+        edge.side = BoxSide::kLeft;
       }
     } else {
       DCHECK(edge.y1 == edge.y2);
       if (edge.x1 < edge.x2) {
         edge.y2 += width;
-        edge.side = kBSTop;
+        edge.side = BoxSide::kTop;
       } else {
         std::swap(edge.x1, edge.x2);
         edge.y1 -= width;
-        edge.side = kBSBottom;
+        edge.side = BoxSide::kBottom;
       }
     }
   }
@@ -170,7 +170,7 @@
                              : AdjustJoint(width, edge, edges[i + 1]);
     int adjacent_width1 = adjacent_width_start;
     int adjacent_width2 = adjacent_width_end;
-    if (edge.side == kBSLeft || edge.side == kBSBottom)
+    if (edge.side == BoxSide::kLeft || edge.side == BoxSide::kBottom)
       std::swap(adjacent_width1, adjacent_width2);
     ObjectPainterBase::DrawLineForBoxSide(
         graphics_context, edge.x1, edge.y1, edge.x2, edge.y2, edge.side,
@@ -235,14 +235,14 @@
       style == EBorderStyle::kDashed ? kDashedStroke : kDottedStroke);
 
   switch (side) {
-    case kBSBottom:
-    case kBSTop: {
+    case BoxSide::kBottom:
+    case BoxSide::kTop: {
       int mid_y = y1 + thickness / 2;
       graphics_context.DrawLine(IntPoint(x1, mid_y), IntPoint(x2, mid_y));
       break;
     }
-    case kBSRight:
-    case kBSLeft: {
+    case BoxSide::kRight:
+    case BoxSide::kLeft: {
       int mid_x = x1 + thickness / 2;
       graphics_context.DrawLine(IntPoint(mid_x, y1), IntPoint(mid_x, y2));
       break;
@@ -274,14 +274,14 @@
     graphics_context.SetShouldAntialias(antialias);
 
     switch (side) {
-      case kBSTop:
-      case kBSBottom:
+      case BoxSide::kTop:
+      case BoxSide::kBottom:
         graphics_context.DrawRect(IntRect(x1, y1, length, third_of_thickness));
         graphics_context.DrawRect(
             IntRect(x1, y2 - third_of_thickness, length, third_of_thickness));
         break;
-      case kBSLeft:
-      case kBSRight:
+      case BoxSide::kLeft:
+      case BoxSide::kRight:
         graphics_context.DrawRect(IntRect(x1, y1, third_of_thickness, length));
         graphics_context.DrawRect(
             IntRect(x2 - third_of_thickness, y1, third_of_thickness, length));
@@ -299,7 +299,7 @@
       ((adjacent_width2 > 0) ? adjacent_width2 + 1 : adjacent_width2 - 1) / 3;
 
   switch (side) {
-    case kBSTop:
+    case BoxSide::kTop:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1 + std::max((-adjacent_width1 * 2 + 1) / 3, 0),
           y1, x2 - std::max((-adjacent_width2 * 2 + 1) / 3, 0),
@@ -312,7 +312,7 @@
           EBorderStyle::kSolid, adjacent1_big_third, adjacent2_big_third,
           antialias);
       break;
-    case kBSLeft:
+    case BoxSide::kLeft:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1,
           y1 + std::max((-adjacent_width1 * 2 + 1) / 3, 0),
@@ -327,7 +327,7 @@
           EBorderStyle::kSolid, adjacent1_big_third, adjacent2_big_third,
           antialias);
       break;
-    case kBSBottom:
+    case BoxSide::kBottom:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1 + std::max((adjacent_width1 * 2 + 1) / 3, 0), y1,
           x2 - std::max((adjacent_width2 * 2 + 1) / 3, 0),
@@ -340,7 +340,7 @@
           EBorderStyle::kSolid, adjacent1_big_third, adjacent2_big_third,
           antialias);
       break;
-    case kBSRight:
+    case BoxSide::kRight:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1, y1 + std::max((adjacent_width1 * 2 + 1) / 3, 0),
           x1 + third_of_thickness,
@@ -386,7 +386,7 @@
       ((adjacent_width2 > 0) ? adjacent_width2 + 1 : adjacent_width2 - 1) / 2;
 
   switch (side) {
-    case kBSTop:
+    case BoxSide::kTop:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1 + std::max(-adjacent_width1, 0) / 2, y1,
           x2 - std::max(-adjacent_width2, 0) / 2, (y1 + y2 + 1) / 2, side,
@@ -396,7 +396,7 @@
           (y1 + y2 + 1) / 2, x2 - std::max(adjacent_width2 + 1, 0) / 2, y2,
           side, color, s2, adjacent_width1 / 2, adjacent_width2 / 2, antialias);
       break;
-    case kBSLeft:
+    case BoxSide::kLeft:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1, y1 + std::max(-adjacent_width1, 0) / 2,
           (x1 + x2 + 1) / 2, y2 - std::max(-adjacent_width2, 0) / 2, side,
@@ -407,7 +407,7 @@
           y2 - std::max(adjacent_width2 + 1, 0) / 2, side, color, s2,
           adjacent_width1 / 2, adjacent_width2 / 2, antialias);
       break;
-    case kBSBottom:
+    case BoxSide::kBottom:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1 + std::max(adjacent_width1, 0) / 2, y1,
           x2 - std::max(adjacent_width2, 0) / 2, (y1 + y2 + 1) / 2, side, color,
@@ -417,7 +417,7 @@
           (y1 + y2 + 1) / 2, x2 - std::max(-adjacent_width2 + 1, 0) / 2, y2,
           side, color, s1, adjacent_width1 / 2, adjacent_width2 / 2, antialias);
       break;
-    case kBSRight:
+    case BoxSide::kRight:
       ObjectPainterBase::DrawLineForBoxSide(
           graphics_context, x1, y1 + std::max(adjacent_width1, 0) / 2,
           (x1 + x2 + 1) / 2, y2 - std::max(adjacent_width2, 0) / 2, side, color,
@@ -458,25 +458,25 @@
 
   FloatPoint quad[4];
   switch (side) {
-    case kBSTop:
+    case BoxSide::kTop:
       quad[0] = FloatPoint(x1 + std::max(-adjacent_width1, 0), y1);
       quad[1] = FloatPoint(x1 + std::max(adjacent_width1, 0), y2);
       quad[2] = FloatPoint(x2 - std::max(adjacent_width2, 0), y2);
       quad[3] = FloatPoint(x2 - std::max(-adjacent_width2, 0), y1);
       break;
-    case kBSBottom:
+    case BoxSide::kBottom:
       quad[0] = FloatPoint(x1 + std::max(adjacent_width1, 0), y1);
       quad[1] = FloatPoint(x1 + std::max(-adjacent_width1, 0), y2);
       quad[2] = FloatPoint(x2 - std::max(-adjacent_width2, 0), y2);
       quad[3] = FloatPoint(x2 - std::max(adjacent_width2, 0), y1);
       break;
-    case kBSLeft:
+    case BoxSide::kLeft:
       quad[0] = FloatPoint(x1, y1 + std::max(-adjacent_width1, 0));
       quad[1] = FloatPoint(x1, y2 - std::max(-adjacent_width2, 0));
       quad[2] = FloatPoint(x2, y2 - std::max(adjacent_width2, 0));
       quad[3] = FloatPoint(x2, y1 + std::max(adjacent_width1, 0));
       break;
-    case kBSRight:
+    case BoxSide::kRight:
       quad[0] = FloatPoint(x1, y1 + std::max(adjacent_width1, 0));
       quad[1] = FloatPoint(x1, y2 - std::max(adjacent_width2, 0));
       quad[2] = FloatPoint(x2, y2 - std::max(-adjacent_width2, 0));
@@ -530,7 +530,7 @@
                                            bool antialias) {
   float thickness;
   float length;
-  if (side == kBSTop || side == kBSBottom) {
+  if (side == BoxSide::kTop || side == BoxSide::kBottom) {
     thickness = y2 - y1;
     length = x2 - x1;
   } else {
@@ -570,12 +570,12 @@
     case EBorderStyle::kInset:
       // FIXME: Maybe we should lighten the colors on one side like Firefox.
       // https://bugs.webkit.org/show_bug.cgi?id=58608
-      if (side == kBSTop || side == kBSLeft)
+      if (side == BoxSide::kTop || side == BoxSide::kLeft)
         color = color.Dark();
     // fall through
     case EBorderStyle::kOutset:
       if (style == EBorderStyle::kOutset &&
-          (side == kBSBottom || side == kBSRight))
+          (side == BoxSide::kBottom || side == BoxSide::kRight))
         color = color.Dark();
     // fall through
     case EBorderStyle::kSolid:
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 51f8f22..65fba09e 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -61,8 +61,6 @@
 #include "core/layout/LayoutInline.h"
 #include "core/layout/LayoutTreeAsText.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/layout/svg/LayoutSVGResourceClipper.h"
 #include "core/layout/svg/LayoutSVGRoot.h"
 #include "core/page/Page.h"
@@ -1659,7 +1657,7 @@
   return !compositing_layer->EnclosingPaginationLayer();
 }
 
-void PaintLayer::CollectFragmentsForPaint(
+void PaintLayer::CollectFragments(
     PaintLayerFragments& fragments,
     const PaintLayer* root_layer,
     const LayoutRect& dirty_rect,
@@ -1699,155 +1697,6 @@
   }
 }
 
-void PaintLayer::CollectFragments(
-    PaintLayerFragments& fragments,
-    const PaintLayer* root_layer,
-    const LayoutRect& dirty_rect,
-    ClipRectsCacheSlot clip_rects_cache_slot,
-    PaintLayer::GeometryMapperOption geometry_mapper_option,
-    OverlayScrollbarClipBehavior overlay_scrollbar_clip_behavior,
-    ShouldRespectOverflowClipType respect_overflow_clip,
-    const LayoutPoint* offset_from_root,
-    const LayoutSize& sub_pixel_accumulation,
-    const LayoutRect* layer_bounding_box) const {
-  DCHECK_NE(DocumentLifecycle::kInPaint,
-            GetLayoutObject().GetDocument().Lifecycle().GetState());
-
-  // For unpaginated layers, there is only one fragment. We also avoid
-  // fragmentation when compositing, due to implementation limitations.
-  if (!EnclosingPaginationLayer() ||
-      !ShouldFragmentCompositedBounds(root_layer)) {
-    AppendSingleFragmentIgnoringPagination(
-        fragments, root_layer, dirty_rect, clip_rects_cache_slot,
-        geometry_mapper_option, overlay_scrollbar_clip_behavior,
-        respect_overflow_clip, offset_from_root, sub_pixel_accumulation);
-    return;
-  }
-
-  // Compute our offset within the enclosing pagination layer.
-  LayoutPoint offset_within_paginated_layer;
-  ConvertToLayerCoords(EnclosingPaginationLayer(),
-                       offset_within_paginated_layer);
-
-  // Calculate clip rects relative to the enclosingPaginationLayer. The purpose
-  // of this call is to determine our bounds clipped to intermediate layers
-  // between us and the pagination context. It's important to minimize the
-  // number of fragments we need to create and this helps with that.
-  ClipRectsContext pagination_clip_rects_context(
-      EnclosingPaginationLayer(), clip_rects_cache_slot,
-      overlay_scrollbar_clip_behavior);
-  if (respect_overflow_clip == kIgnoreOverflowClip)
-    pagination_clip_rects_context.SetIgnoreOverflowClip();
-  LayoutRect layer_bounds_in_flow_thread;
-  ClipRect background_rect_in_flow_thread;
-  ClipRect foreground_rect_in_flow_thread;
-  Clipper(geometry_mapper_option)
-      .CalculateRects(
-          pagination_clip_rects_context, nullptr,
-          LayoutRect(LayoutRect::InfiniteIntRect()),
-          layer_bounds_in_flow_thread, background_rect_in_flow_thread,
-          foreground_rect_in_flow_thread, &offset_within_paginated_layer);
-
-  // Take our bounding box within the flow thread and clip it.
-  LayoutRect layer_bounding_box_in_flow_thread =
-      layer_bounding_box ? *layer_bounding_box
-                         : PhysicalBoundingBox(offset_within_paginated_layer);
-  layer_bounding_box_in_flow_thread.Intersect(
-      background_rect_in_flow_thread.Rect());
-
-  LayoutFlowThread& enclosing_flow_thread =
-      ToLayoutFlowThread(EnclosingPaginationLayer()->GetLayoutObject());
-  // Visual offset from the root layer to the nearest fragmentation context.
-  LayoutPoint offset_of_pagination_layer_from_root;
-  bool root_layer_is_inside_pagination_layer =
-      root_layer->EnclosingPaginationLayer() == EnclosingPaginationLayer();
-  if (root_layer_is_inside_pagination_layer) {
-    // The root layer is in the same fragmentation context as this layer, so we
-    // need to look inside it and subtract the offset between the fragmentation
-    // context and the root layer.
-    offset_of_pagination_layer_from_root =
-        -root_layer->VisualOffsetFromAncestor(EnclosingPaginationLayer());
-  } else {
-    offset_of_pagination_layer_from_root =
-        EnclosingPaginationLayer()->VisualOffsetFromAncestor(root_layer);
-  }
-  // Make the dirty rect relative to the fragmentation context (multicol
-  // container, etc.).
-  LayoutRect dirty_rect_in_multicol_container(dirty_rect);
-  dirty_rect_in_multicol_container.Move(
-      enclosing_flow_thread.PhysicalLocation() -
-      offset_of_pagination_layer_from_root);
-
-  // Slice the layer into fragments. Each fragment needs to be processed (e.g.
-  // painted) separately. We pass enough information to walk a minimal number of
-  // fragments based on the pages/columns that intersect the actual dirtyRect as
-  // well as the pages/columns that intersect our layer's bounding box.
-  FragmentainerIterator iterator(enclosing_flow_thread,
-                                 layer_bounding_box_in_flow_thread,
-                                 dirty_rect_in_multicol_container);
-  if (iterator.AtEnd())
-    return;
-
-  // Get the parent clip rects of the pagination layer, since we need to
-  // intersect with that when painting column contents.
-  ClipRect ancestor_clip_rect = dirty_rect;
-  if (const PaintLayer* pagination_parent_layer =
-          EnclosingPaginationLayer()->Parent()) {
-    const PaintLayer* ancestor_layer = root_layer_is_inside_pagination_layer
-                                           ? pagination_parent_layer
-                                           : root_layer;
-    ClipRectsContext clip_rects_context(ancestor_layer, clip_rects_cache_slot,
-                                        overlay_scrollbar_clip_behavior);
-    if (respect_overflow_clip == kIgnoreOverflowClip)
-      clip_rects_context.SetIgnoreOverflowClip();
-
-    EnclosingPaginationLayer()
-        ->Clipper(geometry_mapper_option)
-        .CalculateBackgroundClipRect(clip_rects_context, ancestor_clip_rect);
-    if (root_layer_is_inside_pagination_layer)
-      ancestor_clip_rect.MoveBy(
-          -root_layer->VisualOffsetFromAncestor(ancestor_layer));
-    ancestor_clip_rect.Intersect(dirty_rect);
-  }
-
-  const LayoutSize sub_pixel_accumulation_if_needed =
-      offset_from_root ? sub_pixel_accumulation : LayoutSize();
-  for (; !iterator.AtEnd(); iterator.Advance()) {
-    PaintLayerFragment fragment;
-    fragment.pagination_offset = ToLayoutPoint(iterator.PaginationOffset());
-    LayoutRect pagination_clip = iterator.ClipRectInFlowThread();
-
-    // Set our four rects with all clipping applied that was internal to the
-    // flow thread.
-    fragment.SetRects(layer_bounds_in_flow_thread,
-                      background_rect_in_flow_thread,
-                      foreground_rect_in_flow_thread);
-
-    // Shift to the root-relative physical position used when painting the flow
-    // thread in this fragment.
-    LayoutPoint offset = fragment.pagination_offset +
-                         offset_of_pagination_layer_from_root +
-                         sub_pixel_accumulation_if_needed;
-    fragment.MoveBy(offset);
-    pagination_clip.MoveBy(offset);
-
-    // Intersect the fragment with our ancestor's background clip so that e.g.,
-    // columns in an overflow:hidden block are properly clipped by the overflow.
-    fragment.Intersect(ancestor_clip_rect.Rect());
-
-    // Now intersect with our pagination clip. This will typically mean we're
-    // just intersecting the dirty rect with the column clip, so the column clip
-    // ends up being all we apply.
-    fragment.Intersect(pagination_clip);
-
-    // TODO(mstensho): Don't add empty fragments. We've always done that in some
-    // cases, but there should be no reason to do so. Either filter them out
-    // here, or, even better: pass a better clip rectangle to the fragmentainer
-    // iterator, so that we won't end up with empty fragments here.
-    fragments.push_back(fragment);
-  }
-}
-
 static inline LayoutRect FrameVisibleRect(LayoutObject& layout_object) {
   LocalFrameView* frame_view = layout_object.GetDocument().View();
   if (!frame_view)
@@ -2173,11 +2022,11 @@
   if (applied_transform) {
     AppendSingleFragmentIgnoringPagination(
         layer_fragments, root_layer, hit_test_rect, clip_rects_cache_slot,
-        PaintLayer::kDoNotUseGeometryMapper,
+        PaintLayer::kUseGeometryMapper,
         kExcludeOverlayScrollbarSizeForHitTesting);
   } else {
     CollectFragments(layer_fragments, root_layer, hit_test_rect,
-                     clip_rects_cache_slot, PaintLayer::kDoNotUseGeometryMapper,
+                     clip_rects_cache_slot, PaintLayer::kUseGeometryMapper,
                      kExcludeOverlayScrollbarSizeForHitTesting);
   }
 
@@ -2290,42 +2139,18 @@
     double* z_offset,
     ClipRectsCacheSlot clip_rects_cache_slot) {
   PaintLayerFragments enclosing_pagination_fragments;
-  LayoutPoint offset_of_pagination_layer_from_root;
   // FIXME: We're missing a sub-pixel offset here crbug.com/348728
-  LayoutRect transformed_extent = TransparencyClipBox(
-      this, EnclosingPaginationLayer(), kHitTestingTransparencyClipBox,
-      PaintLayer::kRootOfTransparencyClipBox, LayoutSize());
+
   EnclosingPaginationLayer()->CollectFragments(
       enclosing_pagination_fragments, root_layer, hit_test_rect,
-      clip_rects_cache_slot, PaintLayer::kDoNotUseGeometryMapper,
-      kExcludeOverlayScrollbarSizeForHitTesting, kRespectOverflowClip,
-      &offset_of_pagination_layer_from_root, LayoutSize(), &transformed_extent);
+      clip_rects_cache_slot, PaintLayer::kUseGeometryMapper,
+      kExcludeOverlayScrollbarSizeForHitTesting, kRespectOverflowClip, nullptr,
+      LayoutSize());
 
-  for (int i = enclosing_pagination_fragments.size() - 1; i >= 0; --i) {
-    const PaintLayerFragment& fragment = enclosing_pagination_fragments.at(i);
-
+  for (const auto& fragment : enclosing_pagination_fragments) {
     // Apply the page/column clip for this fragment, as well as any clips
     // established by layers in between us and the enclosing pagination layer.
     LayoutRect clip_rect = fragment.background_rect.Rect();
-
-    // Now compute the clips within a given fragment
-    if (Parent() != EnclosingPaginationLayer()) {
-      EnclosingPaginationLayer()->ConvertToLayerCoords(
-          root_layer, offset_of_pagination_layer_from_root);
-
-      ClipRect parent_clip_rect;
-      Clipper(PaintLayer::kDoNotUseGeometryMapper)
-          .CalculateBackgroundClipRect(
-              ClipRectsContext(EnclosingPaginationLayer(),
-                               clip_rects_cache_slot,
-                               kExcludeOverlayScrollbarSizeForHitTesting),
-              parent_clip_rect);
-
-      parent_clip_rect.MoveBy(fragment.pagination_offset +
-                              offset_of_pagination_layer_from_root);
-      clip_rect.Intersect(parent_clip_rect.Rect());
-    }
-
     if (!hit_test_location.Intersects(clip_rect))
       continue;
 
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h
index 7bf56b9..7f290ef 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -887,21 +887,8 @@
   LayoutRect PaintingExtent(const PaintLayer* root_layer,
                             const LayoutSize& sub_pixel_accumulation,
                             GlobalPaintFlags);
-  void AppendSingleFragmentIgnoringPagination(
-      PaintLayerFragments&,
-      const PaintLayer* root_layer,
-      const LayoutRect& dirty_rect,
-      ClipRectsCacheSlot,
-      GeometryMapperOption,
-      OverlayScrollbarClipBehavior = kIgnorePlatformOverlayScrollbarSize,
-      ShouldRespectOverflowClipType = kRespectOverflowClip,
-      const LayoutPoint* offset_from_root = nullptr,
-      const LayoutSize& sub_pixel_accumulation = LayoutSize()) const;
 
-  // Use this method for callsites within paint, and |CollectFragments|
-  // otherwise. This is because non-paint use cases have not yet been
-  // migrated to use property trees.
-  void CollectFragmentsForPaint(
+  void AppendSingleFragmentIgnoringPagination(
       PaintLayerFragments&,
       const PaintLayer* root_layer,
       const LayoutRect& dirty_rect,
@@ -921,8 +908,7 @@
       OverlayScrollbarClipBehavior = kIgnorePlatformOverlayScrollbarSize,
       ShouldRespectOverflowClipType = kRespectOverflowClip,
       const LayoutPoint* offset_from_root = nullptr,
-      const LayoutSize& sub_pixel_accumulation = LayoutSize(),
-      const LayoutRect* layer_bounding_box = nullptr) const;
+      const LayoutSize& sub_pixel_accumulation = LayoutSize()) const;
 
   LayoutPoint LayoutBoxLocation() const {
     return GetLayoutObject().IsBox() ? ToLayoutBox(GetLayoutObject()).Location()
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
index 2231e8f..9a55586 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipper.cpp
@@ -490,6 +490,16 @@
   // TODO(chrishtr): generalize to multiple fragments.
   output.MoveBy(
       -context.root_layer->GetLayoutObject().FirstFragment().PaintOffset());
+
+  if (layer_ != *context.root_layer &&
+      context.overlay_scrollbar_clip_behavior ==
+          kExcludeOverlayScrollbarSizeForHitTesting &&
+      context.root_layer->GetLayoutBox() &&
+      context.root_layer->GetLayoutBox()->ShouldClipOverflow()) {
+    output.Intersect(context.root_layer->GetLayoutBox()->OverflowClipRect(
+        LayoutPoint(), kExcludeOverlayScrollbarSizeForHitTesting));
+  }
+
   output.Move(context.sub_pixel_accumulation);
 }
 
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
index 25f2082..c19cf253a 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerClipperTest.cpp
@@ -702,4 +702,98 @@
   EXPECT_EQ(LayoutRect(FloatRect(100, -100, 100, 200)), layer_bounds);
 }
 
+TEST_F(PaintLayerClipperTest, ScrollbarClipBehaviorChild) {
+  SetBodyInnerHTML(R"HTML(
+    <!DOCTYPE html>
+    <div id='parent' style='position:absolute; width: 200px; height: 300px;
+        overflow: scroll;'>
+      <div id='child' style='position: relative; width: 500px;
+           height: 500px'>
+      </div>
+    </div>
+  )HTML");
+
+  Element* parent = GetDocument().getElementById("parent");
+  PaintLayer* parent_paint_layer =
+      ToLayoutBoxModelObject(parent->GetLayoutObject())->Layer();
+
+  Element* child = GetDocument().getElementById("child");
+  PaintLayer* child_paint_layer =
+      ToLayoutBoxModelObject(child->GetLayoutObject())->Layer();
+
+  ClipRectsContext context(parent_paint_layer, kUncachedClipRects,
+                           kExcludeOverlayScrollbarSizeForHitTesting);
+
+  LayoutRect layer_bounds;
+  ClipRect background_rect, foreground_rect;
+  child_paint_layer->Clipper(PaintLayer::kUseGeometryMapper)
+      .CalculateRects(context,
+                      &child_paint_layer->GetLayoutObject().FirstFragment(),
+                      LayoutRect(LayoutRect::InfiniteIntRect()), layer_bounds,
+                      background_rect, foreground_rect);
+
+  // The background and foreground rect are clipped by the scrollbar size.
+  EXPECT_EQ(LayoutRect(0, 0, 193, 293), background_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 193, 293), foreground_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 500, 500), layer_bounds);
+
+  child_paint_layer->Clipper(PaintLayer::kDoNotUseGeometryMapper)
+      .CalculateRects(context, nullptr,
+                      LayoutRect(LayoutRect::InfiniteIntRect()), layer_bounds,
+                      background_rect, foreground_rect);
+
+  // The background and foreground rect are clipped by the scrollbar size.
+  EXPECT_EQ(LayoutRect(0, 0, 193, 293), background_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 193, 293), foreground_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 500, 500), layer_bounds);
+}
+
+TEST_F(PaintLayerClipperTest, ScrollbarClipBehaviorParent) {
+  SetBodyInnerHTML(R"HTML(
+    <!DOCTYPE html>
+    <div id='parent' style='position:absolute; width: 200px; height: 300px;
+        overflow: scroll;'>
+      <div id='child' style='position: relative; width: 500px;
+           height: 500px'>
+      </div>
+    </div>
+  )HTML");
+
+  Element* parent = GetDocument().getElementById("parent");
+  PaintLayer* parent_paint_layer =
+      ToLayoutBoxModelObject(parent->GetLayoutObject())->Layer();
+
+  Element* child = GetDocument().getElementById("child");
+  PaintLayer* child_paint_layer =
+      ToLayoutBoxModelObject(child->GetLayoutObject())->Layer();
+
+  ClipRectsContext context(parent_paint_layer, kUncachedClipRects,
+                           kExcludeOverlayScrollbarSizeForHitTesting);
+
+  LayoutRect layer_bounds;
+  ClipRect background_rect, foreground_rect;
+  parent_paint_layer->Clipper(PaintLayer::kUseGeometryMapper)
+      .CalculateRects(context,
+                      &child_paint_layer->GetLayoutObject().FirstFragment(),
+                      LayoutRect(LayoutRect::InfiniteIntRect()), layer_bounds,
+                      background_rect, foreground_rect);
+
+  // Only the foreground is clipped by the scrollbar size, because we
+  // called CalculateRects on the root layer.
+  EXPECT_EQ(LayoutRect(0, 0, 200, 300), background_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 193, 293), foreground_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 200, 300), layer_bounds);
+
+  parent_paint_layer->Clipper(PaintLayer::kDoNotUseGeometryMapper)
+      .CalculateRects(context, nullptr,
+                      LayoutRect(LayoutRect::InfiniteIntRect()), layer_bounds,
+                      background_rect, foreground_rect);
+
+  // Only the foreground is clipped by the scrollbar size, because we
+  // called CalculateRects on the root layer.
+  EXPECT_EQ(LayoutRect(0, 0, 200, 300), background_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 193, 293), foreground_rect.Rect());
+  EXPECT_EQ(LayoutRect(0, 0, 200, 300), layer_bounds);
+}
+
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index 31f5f8e..a02910c6 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -530,7 +530,7 @@
           LayoutRect(offset_from_root, LayoutSize(paint_layer_.Size())),
           LayoutRect(LayoutRect::InfiniteIntRect()), foreground_clip);
     } else {
-      paint_layer_for_fragments->CollectFragmentsForPaint(
+      paint_layer_for_fragments->CollectFragments(
           layer_fragments, local_painting_info.root_layer,
           local_painting_info.paint_dirty_rect, kUncachedClipRects,
           PaintLayer::kUseGeometryMapper, kIgnorePlatformOverlayScrollbarSize,
@@ -805,7 +805,7 @@
   } else if (parent_layer) {
     ShouldRespectOverflowClipType respect_overflow_clip =
         ShouldRespectOverflowClip(paint_flags, paint_layer_.GetLayoutObject());
-    paint_layer_.CollectFragmentsForPaint(
+    paint_layer_.CollectFragments(
         layer_fragments, painting_info.root_layer,
         painting_info.paint_dirty_rect, kUncachedClipRects,
         PaintLayer::kUseGeometryMapper, kIgnorePlatformOverlayScrollbarSize,
diff --git a/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp b/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp
index 844961b6..f617642 100644
--- a/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PrePaintTreeWalkTest.cpp
@@ -4,7 +4,7 @@
 
 #include "core/layout/LayoutTestHelper.h"
 #include "core/layout/LayoutTreeAsText.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/ObjectPaintProperties.h"
 #include "core/paint/PaintControllerPaintTest.h"
 #include "core/paint/PaintLayer.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
index 2b15899..e68edb0 100644
--- a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
@@ -48,7 +48,6 @@
 #include "core/layout/LayoutVideo.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutEmbeddedContentItem.h"
 #include "core/loader/resource/ImageResourceContent.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
index 1b62837..3f9fa34 100644
--- a/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
+++ b/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
@@ -7,7 +7,7 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/layout/LayoutBoxModelObject.h"
 #include "core/layout/LayoutTestHelper.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
 #include "public/platform/WebContentLayer.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/CompositingRequirementsUpdater.cpp b/third_party/WebKit/Source/core/paint/compositing/CompositingRequirementsUpdater.cpp
index 90cfc30d..61f58e37 100644
--- a/third_party/WebKit/Source/core/paint/compositing/CompositingRequirementsUpdater.cpp
+++ b/third_party/WebKit/Source/core/paint/compositing/CompositingRequirementsUpdater.cpp
@@ -29,7 +29,6 @@
 #include "base/macros.h"
 #include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutView.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/paint/PaintLayer.h"
 #include "core/paint/PaintLayerStackingNode.h"
 #include "core/paint/PaintLayerStackingNodeIterator.h"
diff --git a/third_party/WebKit/Source/core/paint/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/paint/compositing/PaintLayerCompositor.cpp
index 8a1d623..c092096 100644
--- a/third_party/WebKit/Source/core/paint/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/paint/compositing/PaintLayerCompositor.cpp
@@ -40,7 +40,7 @@
 #include "core/html/media/HTMLVideoElement.h"
 #include "core/layout/LayoutEmbeddedContent.h"
 #include "core/layout/LayoutVideo.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/ChromeClient.h"
 #include "core/page/Page.h"
 #include "core/page/scrolling/ScrollingCoordinator.h"
diff --git a/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp b/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp
index 5ca90e5..639e2ac1 100644
--- a/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp
+++ b/third_party/WebKit/Source/core/scheduler/FrameThrottlingTest.cpp
@@ -11,7 +11,7 @@
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/WebLocalFrameImpl.h"
 #include "core/html/HTMLIFrameElement.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/FocusController.h"
 #include "core/page/Page.h"
 #include "core/paint/PaintLayer.h"
diff --git a/third_party/WebKit/Source/core/style/ComputedStyle.cpp b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
index f2b46fc..8b20c67 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyle.cpp
+++ b/third_party/WebKit/Source/core/style/ComputedStyle.cpp
@@ -1959,7 +1959,8 @@
   BorderEdge edges[4];
   GetBorderEdgeInfo(edges);
 
-  for (int i = kBSTop; i <= kBSLeft; ++i) {
+  for (unsigned int i = static_cast<unsigned>(BoxSide::kTop);
+       i <= static_cast<unsigned>(BoxSide::kLeft); ++i) {
     const BorderEdge& curr_edge = edges[i];
     if (!curr_edge.ObscuresBackground())
       return false;
@@ -1973,21 +1974,21 @@
                                       bool include_logical_right_edge) const {
   bool horizontal = IsHorizontalWritingMode();
 
-  edges[kBSTop] = BorderEdge(
+  edges[static_cast<unsigned>(BoxSide::kTop)] = BorderEdge(
       BorderTopWidth(), VisitedDependentColor(GetCSSPropertyBorderTopColor()),
       BorderTopStyle(), horizontal || include_logical_left_edge);
 
-  edges[kBSRight] =
+  edges[static_cast<unsigned>(BoxSide::kRight)] =
       BorderEdge(BorderRightWidth(),
                  VisitedDependentColor(GetCSSPropertyBorderRightColor()),
                  BorderRightStyle(), !horizontal || include_logical_right_edge);
 
-  edges[kBSBottom] =
+  edges[static_cast<unsigned>(BoxSide::kBottom)] =
       BorderEdge(BorderBottomWidth(),
                  VisitedDependentColor(GetCSSPropertyBorderBottomColor()),
                  BorderBottomStyle(), horizontal || include_logical_right_edge);
 
-  edges[kBSLeft] = BorderEdge(
+  edges[static_cast<unsigned>(BoxSide::kLeft)] = BorderEdge(
       BorderLeftWidth(), VisitedDependentColor(GetCSSPropertyBorderLeftColor()),
       BorderLeftStyle(), !horizontal || include_logical_left_edge);
 }
diff --git a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
index beceb82f..bde18fa 100644
--- a/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
+++ b/third_party/WebKit/Source/core/style/ComputedStyleConstants.h
@@ -47,7 +47,7 @@
 
 // Sides used when drawing borders and outlines. The values should run clockwise
 // from top.
-enum BoxSide { kBSTop, kBSRight, kBSBottom, kBSLeft };
+enum class BoxSide : unsigned { kTop, kRight, kBottom, kLeft };
 
 // See core/dom/stylerecalc.md for an explanation on what each state means
 enum StyleRecalcChange {
diff --git a/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp b/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp
index bad12803..3446869 100644
--- a/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGLengthContext.cpp
@@ -28,7 +28,6 @@
 #include "core/dom/NodeComputedStyle.h"
 #include "core/frame/LocalFrameView.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/style/ComputedStyle.h"
 #include "core/svg/SVGSVGElement.h"
 #include "platform/LengthFunctions.h"
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index c5a5d5be..8e3e29f 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -106,8 +106,8 @@
 #include "core/layout/LayoutMenuList.h"
 #include "core/layout/LayoutObject.h"
 #include "core/layout/LayoutTreeAsText.h"
+#include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutMenuListItem.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/loader/DocumentLoader.h"
 #include "core/loader/FrameLoader.h"
 #include "core/loader/HistoryItem.h"
diff --git a/third_party/WebKit/Source/core/testing/sim/SimCompositor.cpp b/third_party/WebKit/Source/core/testing/sim/SimCompositor.cpp
index fa0a89d..33ffb22d 100644
--- a/third_party/WebKit/Source/core/testing/sim/SimCompositor.cpp
+++ b/third_party/WebKit/Source/core/testing/sim/SimCompositor.cpp
@@ -8,7 +8,7 @@
 #include "core/frame/LocalFrame.h"
 #include "core/frame/LocalFrameView.h"
 #include "core/frame/WebLocalFrameImpl.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/paint/PaintLayer.h"
 #include "core/paint/compositing/CompositedLayerMapping.h"
 #include "core/paint/compositing/PaintLayerCompositor.h"
diff --git a/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js b/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
index f55ea6c..7094cef 100644
--- a/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/data_grid/ViewportDataGrid.js
@@ -206,7 +206,7 @@
       var nodes = this.rootNode().flatChildren();
       var index = nodes.indexOf(visibleNodes[0]);
       this._updateStripesClass(!!(index % 2));
-      if (index !== -1 && !!(index % 2) !== this._firstVisibleIsStriped)
+      if (this._stickToBottom && index !== -1 && !!(index % 2) !== this._firstVisibleIsStriped)
         offset += 1;
     }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
index 38be8b9a..a646ae95 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElement.js
@@ -289,7 +289,7 @@
    * @override
    */
   expandRecursively() {
-    this._node.getSubtree(-1).then(UI.TreeElement.prototype.expandRecursively.bind(this, Number.MAX_VALUE));
+    this._node.getSubtree(-1, true).then(UI.TreeElement.prototype.expandRecursively.bind(this, Number.MAX_VALUE));
   }
 
   /**
@@ -538,8 +538,8 @@
     if (isEditable)
       contextMenu.editSection().appendItem(Common.UIString('Delete element'), this.remove.bind(this));
 
-    contextMenu.viewSection().appendItem(Common.UIString('Expand all'), this.expandRecursively.bind(this));
-    contextMenu.viewSection().appendItem(Common.UIString('Collapse all'), this.collapseRecursively.bind(this));
+    contextMenu.viewSection().appendItem(ls`Expand recursively`, this.expandRecursively.bind(this));
+    contextMenu.viewSection().appendItem(ls`Collapse children`, this.collapseChildren.bind(this));
   }
 
   _startEditing() {
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
index 613bd1d..ef57901 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkLogView.js
@@ -493,7 +493,7 @@
    * @return {number}
    */
   _computeRowHeight() {
-    return Math.floor(this._rawRowHeight * window.devicePixelRatio) / window.devicePixelRatio;
+    return Math.round(this._rawRowHeight * window.devicePixelRatio) / window.devicePixelRatio;
   }
 
   /**
diff --git a/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js b/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js
index d1b2429..ed52100d 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/NetworkWaterfallColumn.js
@@ -256,7 +256,7 @@
   }
 
   _updateRowHeight() {
-    this._rowHeight = Math.floor(this._rawRowHeight * window.devicePixelRatio) / window.devicePixelRatio;
+    this._rowHeight = Math.round(this._rawRowHeight * window.devicePixelRatio) / window.devicePixelRatio;
   }
 
   /**
diff --git a/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js b/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
index a3ab3f6e..3da66a6 100644
--- a/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
+++ b/third_party/WebKit/Source/devtools/front_end/object_ui/ObjectPropertiesSection.js
@@ -387,6 +387,13 @@
   _contextMenuEventFired(event) {
     var contextMenu = new UI.ContextMenu(event);
     contextMenu.appendApplicableItems(this._object);
+    if (this._object instanceof SDK.LocalJSONObject) {
+      contextMenu.viewSection().appendItem(
+          ls`Expand recursively`,
+          this._objectTreeElement.expandRecursively.bind(this._objectTreeElement, Number.MAX_VALUE));
+      contextMenu.viewSection().appendItem(
+          ls`Collapse children`, this._objectTreeElement.collapseChildren.bind(this._objectTreeElement));
+    }
     contextMenu.show();
   }
 
@@ -481,6 +488,7 @@
     /** @type {!Array.<!Object>} */
     this._highlightChanges = [];
     this._linkifier = linkifier;
+    this.listItemElement.addEventListener('contextmenu', this._contextMenuFired.bind(this), false);
   }
 
   /**
@@ -759,7 +767,6 @@
       this.nameElement.classList.add('synthetic-property');
 
     this._updatePropertyPath();
-    this.nameElement.addEventListener('contextmenu', this._contextMenuFired.bind(this, this.property), false);
 
     var separatorElement = createElementWithClass('span', 'object-properties-section-separator');
     separatorElement.textContent = ': ';
@@ -768,7 +775,6 @@
       var showPreview = this.property.name !== '__proto__';
       this.valueElement = ObjectUI.ObjectPropertiesSection.createValueElementWithCustomSupport(
           this.property.value, this.property.wasThrown, showPreview, this.listItemElement, this._linkifier);
-      this.valueElement.addEventListener('contextmenu', this._contextMenuFired.bind(this, this.property), false);
     } else if (this.property.getter) {
       this.valueElement = ObjectUI.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(
           this.property.parentObject, [this.property.name], this._onInvokeGetterClick.bind(this));
@@ -803,17 +809,22 @@
   }
 
   /**
-   * @param {!SDK.RemoteObjectProperty} property
    * @param {!Event} event
    */
-  _contextMenuFired(property, event) {
+  _contextMenuFired(event) {
     var contextMenu = new UI.ContextMenu(event);
-    if (property.symbol)
-      contextMenu.appendApplicableItems(property.symbol);
-    if (property.value)
-      contextMenu.appendApplicableItems(property.value);
-    var copyPathHandler = InspectorFrontendHost.copyText.bind(InspectorFrontendHost, this.nameElement.title);
-    contextMenu.clipboardSection().appendItem(Common.UIString('Copy property path'), copyPathHandler);
+    if (this.property.symbol)
+      contextMenu.appendApplicableItems(this.property.symbol);
+    if (this.property.value)
+      contextMenu.appendApplicableItems(this.property.value);
+    if (this.nameElement && this.nameElement.title) {
+      var copyPathHandler = InspectorFrontendHost.copyText.bind(InspectorFrontendHost, this.nameElement.title);
+      contextMenu.clipboardSection().appendItem(ls`Copy property path`, copyPathHandler);
+    }
+    if (this.property.parentObject instanceof SDK.LocalJSONObject) {
+      contextMenu.viewSection().appendItem(ls`Expand recursively`, this.expandRecursively.bind(this, Number.MAX_VALUE));
+      contextMenu.viewSection().appendItem(ls`Collapse children`, this.collapseChildren.bind(this));
+    }
     contextMenu.show();
   }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
index 0d69f51..dc06ffe4 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
@@ -478,10 +478,11 @@
 
   /**
    * @param {number} depth
+   * @param {boolean} pierce
    * @return {!Promise<?Array<!SDK.DOMNode>>}
    */
-  async getSubtree(depth) {
-    var response = await this._agent.invoke_requestChildNodes({nodeId: this.id, depth});
+  async getSubtree(depth, pierce) {
+    var response = await this._agent.invoke_requestChildNodes({nodeId: this.id, depth: depth, pierce: pierce});
     return response[Protocol.Error] ? null : this._children;
   }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js b/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js
index 9389534..ca736d23 100644
--- a/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js
+++ b/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js
@@ -148,6 +148,7 @@
     var obj = SDK.RemoteObject.fromLocalObject(this._parsedJSON.data);
     var title = this._parsedJSON.prefix + obj.description + this._parsedJSON.suffix;
     this._treeOutline = new ObjectUI.ObjectPropertiesSection(obj, title);
+    this._treeOutline.enableContextMenu();
     this._treeOutline.setEditable(false);
     this._treeOutline.expand();
     this.element.appendChild(this._treeOutline.element);
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
index 043d5ec..d16957b 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/treeoutline.js
@@ -897,6 +897,13 @@
     }
   }
 
+  collapseChildren() {
+    if (!this._children)
+      return;
+    for (var child of this._children)
+      child.collapseRecursively();
+  }
+
   expand() {
     if (!this._expandable || (this.expanded && this._children))
       return;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index fc036b78..1ce940a 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -76,7 +76,6 @@
 #include "core/layout/LayoutTextFragment.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
 #include "core/layout/api/LineLayoutAPIShim.h"
 #include "core/loader/ProgressTracker.h"
 #include "core/page/Page.h"
@@ -1435,6 +1434,11 @@
       !layout_object_->IsBox())
     return nullptr;
 
+  auto* frame_view = DocumentFrameView();
+  if (!frame_view)
+    return nullptr;
+  frame_view->UpdateLifecycleToPrePaintClean();
+
   PaintLayer* layer = ToLayoutBox(layout_object_)->Layer();
 
   HitTestRequest request(HitTestRequest::kReadOnly | HitTestRequest::kActive);
diff --git a/third_party/WebKit/Source/modules/exported/WebAXObject.cpp b/third_party/WebKit/Source/modules/exported/WebAXObject.cpp
index 00c1ce1c..7e7a0ac 100644
--- a/third_party/WebKit/Source/modules/exported/WebAXObject.cpp
+++ b/third_party/WebKit/Source/modules/exported/WebAXObject.cpp
@@ -42,8 +42,7 @@
 #include "core/html_names.h"
 #include "core/input/KeyboardEventManager.h"
 #include "core/layout/LayoutObject.h"
-#include "core/layout/api/LayoutAPIShim.h"
-#include "core/layout/api/LayoutViewItem.h"
+#include "core/layout/LayoutView.h"
 #include "core/page/Page.h"
 #include "core/style/ComputedStyle.h"
 #include "modules/accessibility/AXObject.h"
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
index 5376553a..52fbda2 100644
--- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp
@@ -720,6 +720,14 @@
   panel_->MakeOpaque();
 }
 
+void MediaControlsImpl::MakeOpaqueFromPointerEvent() {
+  if (IsVisible())
+    return;
+
+  MakeOpaque();
+  pointer_event_did_show_controls_ = true;
+}
+
 void MediaControlsImpl::MakeTransparent() {
   // Only hide the cursor if the controls are enabled.
   if (MediaElement().ShouldShowControls())
@@ -1006,6 +1014,28 @@
     download_iph_manager_->UpdateInProductHelp();
 }
 
+void MediaControlsImpl::MaybeToggleControlsFromTap() {
+  if (MediaElement().paused())
+    return;
+
+  // If the controls are visible we should try to hide them unless they should
+  // be kept around for another reason. If the controls are not visible then
+  // show them and start the timer to automatically hide them. If a pointer
+  // event showed the controls in this batch of events then we should not hiden
+  // the controls.
+  if (IsVisible() && !pointer_event_did_show_controls_) {
+    MakeTransparent();
+  } else {
+    MakeOpaque();
+    if (ShouldHideMediaControls(kIgnoreWaitForTimer)) {
+      keep_showing_until_timer_fires_ = true;
+      StartHideMediaControlsTimer();
+    }
+
+    pointer_event_did_show_controls_ = false;
+  }
+}
+
 void MediaControlsImpl::DefaultEventHandler(Event* event) {
   HTMLDivElement::DefaultEventHandler(event);
 
@@ -1027,7 +1057,7 @@
   // Touch events are treated differently to avoid fake mouse events to trigger
   // random behavior. The expect behaviour for touch is that a tap will show the
   // controls and they will hide when the timer to hide fires.
-  if (is_touch_event) {
+  if (is_touch_event && !IsModern()) {
     if (event->type() != EventTypeNames::gesturetap)
       return;
 
@@ -1053,7 +1083,7 @@
     if (!ContainsRelatedTarget(event)) {
       is_mouse_over_controls_ = true;
       if (!MediaElement().paused()) {
-        MakeOpaque();
+        MakeOpaqueFromPointerEvent();
         StartHideMediaControlsIfNecessary();
       }
     }
@@ -1068,10 +1098,21 @@
     return;
   }
 
+  if (event->type() == EventTypeNames::click) {
+    MaybeToggleControlsFromTap();
+    return;
+  }
+
+  // The pointer event has finished so we should clear the bit.
+  if (event->type() == EventTypeNames::mouseout) {
+    pointer_event_did_show_controls_ = false;
+    return;
+  }
+
   if (event->type() == EventTypeNames::pointermove) {
     // When we get a mouse move, show the media controls, and start a timer
     // that will hide the media controls after a 3 seconds without a mouse move.
-    MakeOpaque();
+    MakeOpaqueFromPointerEvent();
     if (ShouldHideMediaControls(kIgnoreVideoHover))
       StartHideMediaControlsTimer();
     return;
diff --git a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h
index a1d94b5..1fc0da3 100644
--- a/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h
+++ b/third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.h
@@ -160,6 +160,8 @@
   };
   ControlsState State() const;
 
+  void MaybeToggleControlsFromTap();
+
  private:
   // MediaControlsMediaEventListener is a component that is listening to events
   // and calling the appropriate callback on MediaControlsImpl. The object is
@@ -201,6 +203,7 @@
   void InitializeControls();
 
   void MakeOpaque();
+  void MakeOpaqueFromPointerEvent();
   void MakeTransparent();
   bool IsVisible() const;
 
@@ -320,6 +323,8 @@
 
   bool keep_showing_until_timer_fires_ : 1;
 
+  bool pointer_event_did_show_controls_ = false;
+
   Member<MediaDownloadInProductHelpManager> download_iph_manager_;
 };
 
diff --git a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp
index 8ac7f2b..4374402 100644
--- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp
+++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.cpp
@@ -35,11 +35,8 @@
           (y >= (rect.top() - margin)) && (y <= (rect.bottom() + margin)));
 }
 
-// The delay if a touch is outside the internal button.
-constexpr WTF::TimeDelta kOutsideTouchDelay = TimeDelta::FromMilliseconds(300);
-
-// The delay if a touch is inside the internal button.
-constexpr WTF::TimeDelta kInsideTouchDelay = TimeDelta::FromMilliseconds(0);
+// The delay between two taps to be recognized as a double tap gesture.
+constexpr WTF::TimeDelta kDoubleTapDelay = TimeDelta::FromMilliseconds(300);
 
 // The number of seconds to jump when double tapping.
 constexpr int kNumberOfSecondsToJump = 10;
@@ -185,22 +182,13 @@
     left_jump_arrow_->Show();
 }
 
-void MediaControlOverlayPlayButtonElement::HandlePlayPauseEvent(
-    Event* event,
-    WTF::TimeDelta delay) {
-  event->SetDefaultHandled();
-
-  if (tap_timer_.IsActive())
-    return;
-
-  tap_timer_.StartOneShot(delay, FROM_HERE);
-}
-
 void MediaControlOverlayPlayButtonElement::DefaultEventHandler(Event* event) {
   if (event->type() == EventTypeNames::click) {
+    event->SetDefaultHandled();
+
     // Double tap to navigate should only be available on modern controls.
     if (!MediaControlsImpl::IsModern() || !event->IsMouseEvent()) {
-      HandlePlayPauseEvent(event, kInsideTouchDelay);
+      MaybePlayPause();
       return;
     }
 
@@ -209,7 +197,7 @@
     // TODO(beccahughes): Move to PointerEvent.
     MouseEvent* mouse_event = ToMouseEvent(event);
     if (!mouse_event->HasPosition()) {
-      HandlePlayPauseEvent(event, kInsideTouchDelay);
+      MaybePlayPause();
       return;
     }
 
@@ -218,12 +206,14 @@
     if (IsPointInRect(*internal_button_->getBoundingClientRect(),
                       kInnerButtonTouchPaddingSize, mouse_event->clientX(),
                       mouse_event->clientY())) {
-      HandlePlayPauseEvent(event, kInsideTouchDelay);
+      MaybePlayPause();
     } else if (!tap_timer_.IsActive()) {
       // If there was not a previous touch and this was outside of the button
-      // then we should play/pause but with a small unnoticeable delay to allow
-      // for a secondary tap.
-      HandlePlayPauseEvent(event, kOutsideTouchDelay);
+      // then we should toggle visibility with a small unnoticeable delay in
+      // case their is a second tap.
+      if (tap_timer_.IsActive())
+        return;
+      tap_timer_.StartOneShot(kDoubleTapDelay, FROM_HERE);
     } else {
       // Cancel the play pause event.
       tap_timer_.Stop();
@@ -264,11 +254,7 @@
 }
 
 void MediaControlOverlayPlayButtonElement::TapTimerFired(TimerBase*) {
-  std::unique_ptr<UserGestureIndicator> user_gesture_scope =
-      Frame::NotifyUserActivation(GetDocument().GetFrame(),
-                                  UserGestureToken::kNewGesture);
-
-  MaybePlayPause();
+  GetMediaControls().MaybeToggleControlsFromTap();
 }
 
 void MediaControlOverlayPlayButtonElement::Trace(blink::Visitor* visitor) {
diff --git a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.h b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.h
index f5961a35..66a0e212 100644
--- a/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.h
+++ b/third_party/WebKit/Source/modules/media_controls/elements/MediaControlOverlayPlayButtonElement.h
@@ -78,8 +78,6 @@
   void MaybePlayPause();
   void MaybeJump(int);
 
-  void HandlePlayPauseEvent(Event*, WTF::TimeDelta);
-
   TaskRunnerTimer<MediaControlOverlayPlayButtonElement> tap_timer_;
 
   Member<HTMLDivElement> internal_button_;
diff --git a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
index 39c346c4..c306452 100644
--- a/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
+++ b/third_party/WebKit/Source/platform/exported/WebURLRequest.cpp
@@ -428,6 +428,13 @@
       static_cast<blink::InputToLoadPerfMetricReportPolicy>(policy));
 }
 
+base::Optional<WebString> WebURLRequest::GetSuggestedFilename() const {
+  if (!resource_request_->GetSuggestedFilename().has_value())
+    return base::Optional<WebString>();
+  return static_cast<WebString>(
+      resource_request_->GetSuggestedFilename().value());
+}
+
 const ResourceRequest& WebURLRequest::ToResourceRequest() const {
   DCHECK(resource_request_);
   return *resource_request_;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
index edc2287..c4dd9c27 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp
@@ -776,6 +776,19 @@
   EXPECT_NEAR(result->Width(), result->Bounds().Width(), result->Width() * .1);
 }
 
+TEST_F(HarfBuzzShaperTest, SubRange) {
+  String string(u"Hello world");
+  TextDirection direction = TextDirection::kRtl;
+  HarfBuzzShaper shaper(string.Characters16(), string.length());
+  scoped_refptr<ShapeResult> result = shaper.Shape(&font, direction);
+
+  scoped_refptr<ShapeResult> sub_range = result->SubRange(4, 7);
+  DCHECK_EQ(4u, sub_range->StartIndexForResult());
+  DCHECK_EQ(7u, sub_range->EndIndexForResult());
+  DCHECK_EQ(3u, sub_range->NumCharacters());
+  DCHECK_EQ(result->Direction(), sub_range->Direction());
+}
+
 TEST_F(HarfBuzzShaperTest, SafeToBreakLatinCommonLigatures) {
   FontDescription::VariantLigatures ligatures;
   ligatures.common = FontDescription::kEnabledLigaturesState;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
index f2585ae..258b548 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
@@ -195,16 +195,21 @@
   data.offset = FloatSize(offset_x, offset_y);
 }
 
-ShapeResult::ShapeResult(const Font* font,
+ShapeResult::ShapeResult(const SimpleFontData* font_data,
                          unsigned num_characters,
                          TextDirection direction)
     : width_(0),
-      primary_font_(const_cast<SimpleFontData*>(font->PrimaryFont())),
+      primary_font_(font_data),
       num_characters_(num_characters),
       num_glyphs_(0),
       direction_(static_cast<unsigned>(direction)),
       has_vertical_offsets_(0) {}
 
+ShapeResult::ShapeResult(const Font* font,
+                         unsigned num_characters,
+                         TextDirection direction)
+    : ShapeResult(font->PrimaryFont(), num_characters, direction) {}
+
 ShapeResult::ShapeResult(const ShapeResult& other)
     : width_(other.width_),
       glyph_bounding_box_(other.glyph_bounding_box_),
@@ -814,6 +819,14 @@
 #endif
 }
 
+scoped_refptr<ShapeResult> ShapeResult::SubRange(unsigned start_offset,
+                                                 unsigned end_offset) const {
+  scoped_refptr<ShapeResult> sub_range =
+      Create(primary_font_.get(), 0, Direction());
+  CopyRange(start_offset, end_offset, sub_range.get());
+  return sub_range;
+}
+
 #if DCHECK_IS_ON()
 void ShapeResult::CheckConsistency() const {
   if (runs_.IsEmpty()) {
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
index 2d265c9..6822ba6 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.h
@@ -124,6 +124,8 @@
                                          const TextRun&) const;
 
   void CopyRange(unsigned start, unsigned end, ShapeResult*) const;
+  scoped_refptr<ShapeResult> SubRange(unsigned start_offset,
+                                      unsigned end_offset) const;
 
   String ToString() const;
   void ToString(StringBuilder*) const;
@@ -138,10 +140,16 @@
 #endif
 
  protected:
-
+  ShapeResult(const SimpleFontData*, unsigned num_characters, TextDirection);
   ShapeResult(const Font*, unsigned num_characters, TextDirection);
   ShapeResult(const ShapeResult&);
 
+  static scoped_refptr<ShapeResult> Create(const SimpleFontData* font_data,
+                                           unsigned num_characters,
+                                           TextDirection direction) {
+    return base::AdoptRef(
+        new ShapeResult(font_data, num_characters, direction));
+  }
   static scoped_refptr<ShapeResult> Create(const ShapeResult& other) {
     return base::AdoptRef(new ShapeResult(other));
   }
@@ -166,7 +174,7 @@
   float width_;
   FloatRect glyph_bounding_box_;
   Vector<std::unique_ptr<RunInfo>> runs_;
-  scoped_refptr<SimpleFontData> primary_font_;
+  scoped_refptr<const SimpleFontData> primary_font_;
 
   unsigned num_characters_;
   unsigned num_glyphs_ : 30;
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp
index c17a437..6ed7065 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapingLineBreaker.cpp
@@ -387,8 +387,7 @@
   TextDirection direction = result_->Direction();
   if (first_safe == start) {
     // If |start| is safe-to-break no reshape is needed.
-    line_result = ShapeResult::Create(font_, 0, direction);
-    result_->CopyRange(start, range_end, line_result.get());
+    line_result = result_->SubRange(start, range_end);
   } else if (first_safe < range_end) {
     // Otherwise reshape to |first_safe|, then copy the rest.
     line_result = Shape(direction, start, first_safe);
diff --git a/third_party/WebKit/Source/platform/graphics/highcontrast/highcontrast_classifier.h b/third_party/WebKit/Source/platform/graphics/highcontrast/highcontrast_classifier.h
index 31b2641..3301b6e1 100644
--- a/third_party/WebKit/Source/platform/graphics/highcontrast/highcontrast_classifier.h
+++ b/third_party/WebKit/Source/platform/graphics/highcontrast/highcontrast_classifier.h
@@ -2,6 +2,9 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#ifndef highcontrast_classifier_h
+#define highcontrast_classifier_h
+
 // This file is automatically generated using tfNative from a neural network,
 // trained by TensorFlow. Please do not edit.
 
@@ -27,3 +30,5 @@
     FixedAllocations* __restrict fixed);
 
 }  // namespace highcontrast_tfnative_model
+
+#endif  // highcontrast_tfnative_model
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index cb91102..a83672f 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -1317,9 +1317,10 @@
     if (resource && resource->IsLinkPreload() && resource->IsUnusedPreload()) {
       Context().AddWarningConsoleMessage(
           "The resource " + resource->Url().GetString() +
-              " was preloaded using link preload but not used within a few "
-              "seconds from the window's load event. Please make sure it "
-              "wasn't preloaded for nothing.",
+              " was preloaded using link preload but not used within a few " +
+              "seconds from the window's load event. Please make sure it " +
+              "Please make sure it has an appropriate `as` value and it is " +
+              "preloaded intentionally.",
           FetchContext::kJSSource);
     }
   }
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
index d1ca12b..3573424 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.cpp
@@ -120,6 +120,7 @@
   cors_preflight_policy_ = data->cors_preflight_policy_;
   input_perf_metric_report_policy_ = data->input_perf_metric_report_policy_;
   redirect_status_ = data->redirect_status_;
+  suggested_filename_ = data->suggested_filename_;
 }
 
 ResourceRequest::ResourceRequest(const ResourceRequest&) = default;
@@ -206,6 +207,7 @@
   data->cors_preflight_policy_ = cors_preflight_policy_;
   data->input_perf_metric_report_policy_ = input_perf_metric_report_policy_;
   data->redirect_status_ = redirect_status_;
+  data->suggested_filename_ = suggested_filename_;
   return data;
 }
 
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
index d63cab1..a61ce5e 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceRequest.h
@@ -37,6 +37,7 @@
 #include "platform/weborigin/KURL.h"
 #include "platform/weborigin/Referrer.h"
 #include "platform/weborigin/SecurityOrigin.h"
+#include "platform/wtf/Optional.h"
 #include "platform/wtf/RefCounted.h"
 #include "public/platform/WebAddressSpace.h"
 #include "public/platform/WebURLRequest.h"
@@ -345,6 +346,13 @@
   void SetRedirectStatus(RedirectStatus status) { redirect_status_ = status; }
   RedirectStatus GetRedirectStatus() const { return redirect_status_; }
 
+  void SetSuggestedFilename(const WTF::Optional<String>& suggested_filename) {
+    suggested_filename_ = suggested_filename;
+  }
+  const WTF::Optional<String>& GetSuggestedFilename() const {
+    return suggested_filename_;
+  }
+
   void SetNavigationStartTime(double);
   double NavigationStartTime() const { return navigation_start_; }
 
@@ -398,6 +406,7 @@
   bool is_same_document_navigation_;
   InputToLoadPerfMetricReportPolicy input_perf_metric_report_policy_;
   RedirectStatus redirect_status_;
+  WTF::Optional<String> suggested_filename_;
 
   mutable CacheControlHeader cache_control_header_cache_;
 
@@ -458,6 +467,7 @@
   network::mojom::CORSPreflightPolicy cors_preflight_policy_;
   InputToLoadPerfMetricReportPolicy input_perf_metric_report_policy_;
   ResourceRequest::RedirectStatus redirect_status_;
+  base::Optional<String> suggested_filename_;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Tools/lldb/lldb_webkit.py b/third_party/WebKit/Tools/lldb/lldb_webkit.py
index 47b524b..2347291 100644
--- a/third_party/WebKit/Tools/lldb/lldb_webkit.py
+++ b/third_party/WebKit/Tools/lldb/lldb_webkit.py
@@ -40,9 +40,9 @@
     debugger.HandleCommand('type summary add --expand -F lldb_webkit.WTFHashTable_SummaryProvider -x "WTF::HashTable<.+>$"')
     debugger.HandleCommand('type synthetic add -x "WTF::Vector<.+>$" --python-class lldb_webkit.WTFVectorProvider')
     debugger.HandleCommand('type synthetic add -x "WTF::HashTable<.+>$" --python-class lldb_webkit.WTFHashTableProvider')
-    debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutUnit_SummaryProvider WebCore::LayoutUnit')
-    debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutSize_SummaryProvider WebCore::LayoutSize')
-    debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutPoint_SummaryProvider WebCore::LayoutPoint')
+    debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutUnit_SummaryProvider blink::LayoutUnit')
+    debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutSize_SummaryProvider blink::LayoutSize')
+    debugger.HandleCommand('type summary add -F lldb_webkit.WebCoreLayoutPoint_SummaryProvider blink::LayoutPoint')
 
 
 def WTFString_SummaryProvider(valobj, dict):
@@ -177,7 +177,7 @@
 
 
 class WebCoreLayoutUnitProvider:
-    "Print a WebCore::LayoutUnit"
+    "Print a blink::LayoutUnit"
     def __init__(self, valobj, dict):
         self.valobj = valobj
 
@@ -186,7 +186,7 @@
 
 
 class WebCoreLayoutSizeProvider:
-    "Print a WebCore::LayoutSize"
+    "Print a blink::LayoutSize"
     def __init__(self, valobj, dict):
         self.valobj = valobj
 
@@ -198,7 +198,7 @@
 
 
 class WebCoreLayoutPointProvider:
-    "Print a WebCore::LayoutPoint"
+    "Print a blink::LayoutPoint"
     def __init__(self, valobj, dict):
         self.valobj = valobj
 
diff --git a/third_party/WebKit/common/BUILD.gn b/third_party/WebKit/common/BUILD.gn
index 78b8849d..b258e9d7056 100644
--- a/third_party/WebKit/common/BUILD.gn
+++ b/third_party/WebKit/common/BUILD.gn
@@ -55,6 +55,7 @@
     "origin_trials/trial_token_validator.h",
     "page/launching_process_state.h",
     "quota/quota_status_code.h",
+    "quota/storage_type.h",
     "sandbox_flags.h",
   ]
 
diff --git a/third_party/WebKit/common/quota/storage_type.h b/third_party/WebKit/common/quota/storage_type.h
new file mode 100644
index 0000000..d5c0288
--- /dev/null
+++ b/third_party/WebKit/common/quota/storage_type.h
@@ -0,0 +1,21 @@
+// 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 THIRD_PARTY_WEBKIT_COMMON_QUOTA_STORAGE_TYPE_H_
+#define THIRD_PARTY_WEBKIT_COMMON_QUOTA_STORAGE_TYPE_H_
+
+namespace blink {
+
+// TODO(sashab): Remove this and use mojom::storage::StorageType instead.
+enum class StorageType {
+  kTemporary,
+  kPersistent,
+  kSyncable,
+  kQuotaNotManaged,
+  kUnknown,
+};
+
+}  // namespace blink
+
+#endif  // THIRD_PARTY_WEBKIT_COMMON_QUOTA_STORAGE_TYPE_H_
diff --git a/third_party/WebKit/public/platform/WebStorageQuotaType.h b/third_party/WebKit/public/platform/WebStorageQuotaType.h
index 81b065e7..a816bb2f 100644
--- a/third_party/WebKit/public/platform/WebStorageQuotaType.h
+++ b/third_party/WebKit/public/platform/WebStorageQuotaType.h
@@ -33,6 +33,8 @@
 
 namespace blink {
 
+// TODO(sashab): Remove this class and update callers to use blink::StorageType
+// instead.
 enum WebStorageQuotaType {
   kWebStorageQuotaTypeTemporary,
   kWebStorageQuotaTypePersistent,
diff --git a/third_party/WebKit/public/platform/WebURLRequest.h b/third_party/WebKit/public/platform/WebURLRequest.h
index 286c7be..7761360 100644
--- a/third_party/WebKit/public/platform/WebURLRequest.h
+++ b/third_party/WebKit/public/platform/WebURLRequest.h
@@ -36,6 +36,7 @@
 #include "WebHTTPBody.h"
 #include "WebReferrerPolicy.h"
 #include "WebSecurityOrigin.h"
+#include "base/optional.h"
 #include "services/network/public/interfaces/cors.mojom-shared.h"
 #include "services/network/public/interfaces/fetch_api.mojom-shared.h"
 #include "services/network/public/interfaces/request_context_frame_type.mojom-shared.h"
@@ -344,6 +345,10 @@
   // in-between.
   BLINK_PLATFORM_EXPORT void SetIsSameDocumentNavigation(bool);
 
+  // If this request was created from an anchor with a download attribute, this
+  // is the value provided there.
+  BLINK_PLATFORM_EXPORT base::Optional<WebString> GetSuggestedFilename() const;
+
 #if INSIDE_BLINK
   BLINK_PLATFORM_EXPORT ResourceRequest& ToMutableResourceRequest();
   BLINK_PLATFORM_EXPORT const ResourceRequest& ToResourceRequest() const;
diff --git a/third_party/android_platform/development/scripts/stack b/third_party/android_platform/development/scripts/stack
index a69cec3..ea0d1d7 100755
--- a/third_party/android_platform/development/scripts/stack
+++ b/third_party/android_platform/development/scripts/stack
@@ -1,249 +1,8 @@
-#!/usr/bin/env python
-#
-# Copyright (C) 2013 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
+#! /bin/bash
+# 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.
 
-"""stack symbolizes native crash dumps."""
+base_dir=$(dirname "$0")
 
-import getopt
-import glob
-import logging
-import os
-import sys
-
-import stack_core
-import stack_libs
-import subprocess
-import symbol
-import sys
-
-sys.path.insert(0, os.path.join(os.path.dirname(__file__),
-                                os.pardir, os.pardir, os.pardir, os.pardir,
-                                'build', 'android'))
-
-from pylib import constants
-
-sys.path.insert(0, os.path.join(os.path.dirname(__file__),
-                                os.pardir, os.pardir, os.pardir, os.pardir,
-                                'tools', 'python'))
-import llvm_symbolizer
-
-DEFAULT_SYMROOT='/tmp/symbols'
-# From: https://source.android.com/source/build-numbers.html
-_ANDROID_M_MAJOR_VERSION=6
-
-def PrintUsage():
-  """Print usage and exit with error."""
-  # pylint: disable-msg=C6310
-  print
-  print "  usage: " + sys.argv[0] + " [options] [FILE]"
-  print
-  print "  --symbols-dir=path"
-  print "       the path to a symbols dir, such as =/tmp/out/target/product/dream/symbols"
-  print
-  print "  --chrome-symbols-dir=path"
-  print "       the path to a Chrome symbols dir (can be absolute or relative"
-  print "       to src), such as =out/Debug/lib.unstripped"
-  print
-  print "  --output-directory=path"
-  print "       the path to the build output directory, such as out/Debug."
-  print "       Ignored if --chrome-symbols-dir is passed."
-  print
-  print "  --packed-relocation-adjustments"
-  print "  --no-packed-relocation-adjustments"
-  print "       turn packed relocation adjustment on and off (default is off)"
-  print "       If running on pre-M Android and the stack trace appears to"
-  print "       make no sense, try turning this feature on."
-  print
-  print "  --symbols-zip=path"
-  print "       the path to a symbols zip file, such as =dream-symbols-12345.zip"
-  print
-  print "  --more-info"
-  print "  --less-info"
-  print "       Change the level of detail in the output."
-  print "       --more-info is slower and more verbose, but more functions will"
-  print "       be fully qualified with namespace/classname and have full"
-  print "       argument information. Also, the 'stack data' section will be"
-  print "       printed."
-  print
-  print "  --arch=arm|arm64|x64|x86|mips"
-  print "       the target architecture"
-  print
-  print "  --fallback-monochrome"
-  print "       fallback to monochrome instead of chrome if fail to detect"
-  print "       shared lib which is loaded from APK, this doesn't work for"
-  print "       component build."
-  print
-  print "  --verbose"
-  print "       enable extra logging, particularly for debugging failed symbolization"
-  print
-  print "  FILE should contain a stack trace in it somewhere"
-  print "       the tool will find that and re-print it with"
-  print "       source files and line numbers.  If you don't"
-  print "       pass FILE, or if file is -, it reads from"
-  print "       stdin."
-  print
-  # pylint: enable-msg=C6310
-  sys.exit(1)
-
-def UnzipSymbols(symbolfile, symdir=None):
-  """Unzips a file to DEFAULT_SYMROOT and returns the unzipped location.
-
-  Args:
-    symbolfile: The .zip file to unzip
-    symdir: Optional temporary directory to use for extraction
-
-  Returns:
-    A tuple containing (the directory into which the zip file was unzipped,
-    the path to the "symbols" directory in the unzipped file).  To clean
-    up, the caller can delete the first element of the tuple.
-
-  Raises:
-    SymbolDownloadException: When the unzip fails.
-  """
-  if not symdir:
-    symdir = "%s/%s" % (DEFAULT_SYMROOT, hash(symbolfile))
-  if not os.path.exists(symdir):
-    os.makedirs(symdir)
-
-  print "extracting %s..." % symbolfile
-  saveddir = os.getcwd()
-  os.chdir(symdir)
-  try:
-    unzipcode = subprocess.call(["unzip", "-qq", "-o", symbolfile])
-    if unzipcode > 0:
-      os.remove(symbolfile)
-      raise SymbolDownloadException("failed to extract symbol files (%s)."
-                                    % symbolfile)
-  finally:
-    os.chdir(saveddir)
-
-  android_symbols = glob.glob("%s/out/target/product/*/symbols" % symdir)
-  if android_symbols:
-    return (symdir, android_symbols[0])
-  else:
-    # This is a zip of Chrome symbols, so symbol.CHROME_SYMBOLS_DIR needs to be
-    # updated to point here.
-    symbol.CHROME_SYMBOLS_DIR = symdir
-    return (symdir, symdir)
-
-
-def main(argv):
-  try:
-    options, arguments = getopt.getopt(argv, "",
-                                       ["packed-relocation-adjustments",
-                                        "no-packed-relocation-adjustments",
-                                        "more-info",
-                                        "less-info",
-                                        "chrome-symbols-dir=",
-                                        "output-directory=",
-                                        "symbols-dir=",
-                                        "symbols-zip=",
-                                        "packed-lib=",
-                                        "arch=",
-                                        "fallback-monochrome",
-                                        "verbose",
-                                        "help"])
-  except getopt.GetoptError, unused_error:
-    PrintUsage()
-
-  zip_arg = None
-  more_info = False
-  fallback_monochrome = False
-  arch_defined = False
-  packed_libs = []
-  for option, value in options:
-    if option == "--help":
-      PrintUsage()
-    elif option == "--symbols-dir":
-      symbol.SYMBOLS_DIR = os.path.expanduser(value)
-    elif option == "--symbols-zip":
-      zip_arg = os.path.expanduser(value)
-    elif option == "--arch":
-      symbol.ARCH = value
-      arch_defined = True
-    elif option == "--chrome-symbols-dir":
-      symbol.CHROME_SYMBOLS_DIR = os.path.join(symbol.CHROME_SRC, value)
-    elif option == "--output-directory":
-      constants.SetOutputDirectory(value)
-    elif option == "--packed-lib":
-      packed_libs.append(os.path.expanduser(value))
-    elif option == "--more-info":
-      more_info = True
-    elif option == "--less-info":
-      more_info = False
-    elif option == "--fallback-monochrome":
-      fallback_monochrome = True
-    elif option == "--verbose":
-      logging.basicConfig(level=logging.DEBUG)
-    elif option in (
-        '--packed-relocation-adjustments',
-        '--no-packed-relocation-adjustments'):
-      print ('--[no-]packed-relocation-adjustments options are deprecated. '
-             'Specify packed libs directory instead.')
-
-  if len(arguments) > 1:
-    PrintUsage()
-
-  # Do an up-front test that the output directory is known.
-  if not symbol.CHROME_SYMBOLS_DIR:
-    constants.CheckOutputDirectory()
-
-  if not arguments or arguments[0] == "-":
-    print "Reading native crash info from stdin"
-    f = sys.stdin
-  else:
-    print "Searching for native crashes in: " + os.path.realpath(arguments[0])
-    f = open(arguments[0], "r")
-
-  lines = f.readlines()
-  f.close()
-
-  rootdir = None
-  if zip_arg:
-    rootdir, symbol.SYMBOLS_DIR = UnzipSymbols(zip_arg)
-
-  version = stack_libs.GetTargetAndroidVersionNumber(lines)
-  if version is None:
-    print ("Unknown Android release, "
-           "consider passing --packed-lib.")
-  elif version < _ANDROID_M_MAJOR_VERSION and not packed_libs:
-    print ("Pre-M Android release detected, "
-           "but --packed-lib not specified. Stack symbolization may fail.")
-
-  if (version is None or version < _ANDROID_M_MAJOR_VERSION) and packed_libs:
-    load_vaddrs = stack_libs.GetLoadVaddrs(stripped_libs=packed_libs)
-  else:
-    load_vaddrs = {}
-
-  print ("Reading Android symbols from: "
-         + os.path.normpath(symbol.SYMBOLS_DIR))
-  chrome_search_path = symbol.GetLibrarySearchPaths()
-
-  with llvm_symbolizer.LLVMSymbolizer() as symbolizer:
-    print ("Searching for Chrome symbols from within: "
-           + ':'.join((os.path.normpath(d) for d in chrome_search_path)))
-    stack_core.ConvertTrace(lines, load_vaddrs, more_info, fallback_monochrome,
-                            arch_defined, symbolizer)
-
-  if rootdir:
-    # be a good citizen and clean up...os.rmdir and os.removedirs() don't work
-    cmd = "rm -rf \"%s\"" % rootdir
-    print "\ncleaning up (%s)" % cmd
-    os.system(cmd)
-
-if __name__ == "__main__":
-  sys.exit(main(sys.argv[1:]))
-
-# vi: ts=2 sw=2
+exec python "$base_dir/stack.py" "$@"
diff --git a/third_party/android_platform/development/scripts/stack.py b/third_party/android_platform/development/scripts/stack.py
new file mode 100755
index 0000000..a69cec3
--- /dev/null
+++ b/third_party/android_platform/development/scripts/stack.py
@@ -0,0 +1,249 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2013 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""stack symbolizes native crash dumps."""
+
+import getopt
+import glob
+import logging
+import os
+import sys
+
+import stack_core
+import stack_libs
+import subprocess
+import symbol
+import sys
+
+sys.path.insert(0, os.path.join(os.path.dirname(__file__),
+                                os.pardir, os.pardir, os.pardir, os.pardir,
+                                'build', 'android'))
+
+from pylib import constants
+
+sys.path.insert(0, os.path.join(os.path.dirname(__file__),
+                                os.pardir, os.pardir, os.pardir, os.pardir,
+                                'tools', 'python'))
+import llvm_symbolizer
+
+DEFAULT_SYMROOT='/tmp/symbols'
+# From: https://source.android.com/source/build-numbers.html
+_ANDROID_M_MAJOR_VERSION=6
+
+def PrintUsage():
+  """Print usage and exit with error."""
+  # pylint: disable-msg=C6310
+  print
+  print "  usage: " + sys.argv[0] + " [options] [FILE]"
+  print
+  print "  --symbols-dir=path"
+  print "       the path to a symbols dir, such as =/tmp/out/target/product/dream/symbols"
+  print
+  print "  --chrome-symbols-dir=path"
+  print "       the path to a Chrome symbols dir (can be absolute or relative"
+  print "       to src), such as =out/Debug/lib.unstripped"
+  print
+  print "  --output-directory=path"
+  print "       the path to the build output directory, such as out/Debug."
+  print "       Ignored if --chrome-symbols-dir is passed."
+  print
+  print "  --packed-relocation-adjustments"
+  print "  --no-packed-relocation-adjustments"
+  print "       turn packed relocation adjustment on and off (default is off)"
+  print "       If running on pre-M Android and the stack trace appears to"
+  print "       make no sense, try turning this feature on."
+  print
+  print "  --symbols-zip=path"
+  print "       the path to a symbols zip file, such as =dream-symbols-12345.zip"
+  print
+  print "  --more-info"
+  print "  --less-info"
+  print "       Change the level of detail in the output."
+  print "       --more-info is slower and more verbose, but more functions will"
+  print "       be fully qualified with namespace/classname and have full"
+  print "       argument information. Also, the 'stack data' section will be"
+  print "       printed."
+  print
+  print "  --arch=arm|arm64|x64|x86|mips"
+  print "       the target architecture"
+  print
+  print "  --fallback-monochrome"
+  print "       fallback to monochrome instead of chrome if fail to detect"
+  print "       shared lib which is loaded from APK, this doesn't work for"
+  print "       component build."
+  print
+  print "  --verbose"
+  print "       enable extra logging, particularly for debugging failed symbolization"
+  print
+  print "  FILE should contain a stack trace in it somewhere"
+  print "       the tool will find that and re-print it with"
+  print "       source files and line numbers.  If you don't"
+  print "       pass FILE, or if file is -, it reads from"
+  print "       stdin."
+  print
+  # pylint: enable-msg=C6310
+  sys.exit(1)
+
+def UnzipSymbols(symbolfile, symdir=None):
+  """Unzips a file to DEFAULT_SYMROOT and returns the unzipped location.
+
+  Args:
+    symbolfile: The .zip file to unzip
+    symdir: Optional temporary directory to use for extraction
+
+  Returns:
+    A tuple containing (the directory into which the zip file was unzipped,
+    the path to the "symbols" directory in the unzipped file).  To clean
+    up, the caller can delete the first element of the tuple.
+
+  Raises:
+    SymbolDownloadException: When the unzip fails.
+  """
+  if not symdir:
+    symdir = "%s/%s" % (DEFAULT_SYMROOT, hash(symbolfile))
+  if not os.path.exists(symdir):
+    os.makedirs(symdir)
+
+  print "extracting %s..." % symbolfile
+  saveddir = os.getcwd()
+  os.chdir(symdir)
+  try:
+    unzipcode = subprocess.call(["unzip", "-qq", "-o", symbolfile])
+    if unzipcode > 0:
+      os.remove(symbolfile)
+      raise SymbolDownloadException("failed to extract symbol files (%s)."
+                                    % symbolfile)
+  finally:
+    os.chdir(saveddir)
+
+  android_symbols = glob.glob("%s/out/target/product/*/symbols" % symdir)
+  if android_symbols:
+    return (symdir, android_symbols[0])
+  else:
+    # This is a zip of Chrome symbols, so symbol.CHROME_SYMBOLS_DIR needs to be
+    # updated to point here.
+    symbol.CHROME_SYMBOLS_DIR = symdir
+    return (symdir, symdir)
+
+
+def main(argv):
+  try:
+    options, arguments = getopt.getopt(argv, "",
+                                       ["packed-relocation-adjustments",
+                                        "no-packed-relocation-adjustments",
+                                        "more-info",
+                                        "less-info",
+                                        "chrome-symbols-dir=",
+                                        "output-directory=",
+                                        "symbols-dir=",
+                                        "symbols-zip=",
+                                        "packed-lib=",
+                                        "arch=",
+                                        "fallback-monochrome",
+                                        "verbose",
+                                        "help"])
+  except getopt.GetoptError, unused_error:
+    PrintUsage()
+
+  zip_arg = None
+  more_info = False
+  fallback_monochrome = False
+  arch_defined = False
+  packed_libs = []
+  for option, value in options:
+    if option == "--help":
+      PrintUsage()
+    elif option == "--symbols-dir":
+      symbol.SYMBOLS_DIR = os.path.expanduser(value)
+    elif option == "--symbols-zip":
+      zip_arg = os.path.expanduser(value)
+    elif option == "--arch":
+      symbol.ARCH = value
+      arch_defined = True
+    elif option == "--chrome-symbols-dir":
+      symbol.CHROME_SYMBOLS_DIR = os.path.join(symbol.CHROME_SRC, value)
+    elif option == "--output-directory":
+      constants.SetOutputDirectory(value)
+    elif option == "--packed-lib":
+      packed_libs.append(os.path.expanduser(value))
+    elif option == "--more-info":
+      more_info = True
+    elif option == "--less-info":
+      more_info = False
+    elif option == "--fallback-monochrome":
+      fallback_monochrome = True
+    elif option == "--verbose":
+      logging.basicConfig(level=logging.DEBUG)
+    elif option in (
+        '--packed-relocation-adjustments',
+        '--no-packed-relocation-adjustments'):
+      print ('--[no-]packed-relocation-adjustments options are deprecated. '
+             'Specify packed libs directory instead.')
+
+  if len(arguments) > 1:
+    PrintUsage()
+
+  # Do an up-front test that the output directory is known.
+  if not symbol.CHROME_SYMBOLS_DIR:
+    constants.CheckOutputDirectory()
+
+  if not arguments or arguments[0] == "-":
+    print "Reading native crash info from stdin"
+    f = sys.stdin
+  else:
+    print "Searching for native crashes in: " + os.path.realpath(arguments[0])
+    f = open(arguments[0], "r")
+
+  lines = f.readlines()
+  f.close()
+
+  rootdir = None
+  if zip_arg:
+    rootdir, symbol.SYMBOLS_DIR = UnzipSymbols(zip_arg)
+
+  version = stack_libs.GetTargetAndroidVersionNumber(lines)
+  if version is None:
+    print ("Unknown Android release, "
+           "consider passing --packed-lib.")
+  elif version < _ANDROID_M_MAJOR_VERSION and not packed_libs:
+    print ("Pre-M Android release detected, "
+           "but --packed-lib not specified. Stack symbolization may fail.")
+
+  if (version is None or version < _ANDROID_M_MAJOR_VERSION) and packed_libs:
+    load_vaddrs = stack_libs.GetLoadVaddrs(stripped_libs=packed_libs)
+  else:
+    load_vaddrs = {}
+
+  print ("Reading Android symbols from: "
+         + os.path.normpath(symbol.SYMBOLS_DIR))
+  chrome_search_path = symbol.GetLibrarySearchPaths()
+
+  with llvm_symbolizer.LLVMSymbolizer() as symbolizer:
+    print ("Searching for Chrome symbols from within: "
+           + ':'.join((os.path.normpath(d) for d in chrome_search_path)))
+    stack_core.ConvertTrace(lines, load_vaddrs, more_info, fallback_monochrome,
+                            arch_defined, symbolizer)
+
+  if rootdir:
+    # be a good citizen and clean up...os.rmdir and os.removedirs() don't work
+    cmd = "rm -rf \"%s\"" % rootdir
+    print "\ncleaning up (%s)" % cmd
+    os.system(cmd)
+
+if __name__ == "__main__":
+  sys.exit(main(sys.argv[1:]))
+
+# vi: ts=2 sw=2
diff --git a/tools/binary_size/libsupersize/archive.py b/tools/binary_size/libsupersize/archive.py
index 1df0b4e..a39e13a 100644
--- a/tools/binary_size/libsupersize/archive.py
+++ b/tools/binary_size/libsupersize/archive.py
@@ -20,6 +20,7 @@
 import zipfile
 
 import concurrent
+import demangle
 import describe
 import file_format
 import function_signature
@@ -73,22 +74,6 @@
       symbol.full_name = full_name[4:]
 
 
-def _UnmangleRemainingSymbols(raw_symbols, tool_prefix):
-  """Uses c++filt to unmangle any symbols that need it."""
-  to_process = [s for s in raw_symbols if s.full_name.startswith('_Z')]
-  if not to_process:
-    return
-
-  logging.info('Unmangling %d names', len(to_process))
-  proc = subprocess.Popen([path_util.GetCppFiltPath(tool_prefix)],
-                          stdin=subprocess.PIPE, stdout=subprocess.PIPE)
-  stdout = proc.communicate('\n'.join(s.full_name for s in to_process))[0]
-  assert proc.returncode == 0
-
-  for i, line in enumerate(stdout.splitlines()):
-    to_process[i].full_name = line
-
-
 def _NormalizeNames(raw_symbols):
   """Ensures that all names are formatted in a useful way.
 
@@ -645,9 +630,9 @@
 
   logging.info('Stripping linker prefixes from symbol names')
   _StripLinkerAddedSymbolPrefixes(raw_symbols)
-  # Map file for some reason doesn't unmangle all names.
-  # Unmangle prints its own log statement.
-  _UnmangleRemainingSymbols(raw_symbols, tool_prefix)
+  # Map file for some reason doesn't demangle all names.
+  # Demangle prints its own log statement.
+  demangle.DemangleRemainingSymbols(raw_symbols, tool_prefix)
 
   if elf_path:
     logging.info(
diff --git a/tools/binary_size/libsupersize/demangle.py b/tools/binary_size/libsupersize/demangle.py
new file mode 100644
index 0000000..e1280765
--- /dev/null
+++ b/tools/binary_size/libsupersize/demangle.py
@@ -0,0 +1,71 @@
+# 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.
+
+"""Utilities for demangling C++ symbols."""
+
+import collections
+import logging
+import subprocess
+
+import path_util
+
+def _DemangleNames(names, tool_prefix):
+  """Uses c++filt to demangle a list of names."""
+  proc = subprocess.Popen([path_util.GetCppFiltPath(tool_prefix)],
+                          stdin=subprocess.PIPE, stdout=subprocess.PIPE)
+  stdout = proc.communicate('\n'.join(names))[0]
+  assert proc.returncode == 0
+  return stdout.splitlines()
+
+
+def DemangleRemainingSymbols(raw_symbols, tool_prefix):
+  """Demangles any symbols that need it."""
+  to_process = [s for s in raw_symbols if s.full_name.startswith('_Z')]
+  if not to_process:
+    return
+
+  logging.info('Demangling %d symbols', len(to_process))
+  names = _DemangleNames((s.full_name for s in to_process), tool_prefix)
+  for i, name in enumerate(names):
+    to_process[i].full_name = name
+
+
+def DemangleSetsInDicts(key_to_names, tool_prefix):
+  """Demangles values as sets, and returns the result.
+
+  |key_to_names| is a dict from key to sets (or lists) of mangled names.
+  """
+  all_names = []
+  for names in key_to_names.itervalues():
+    all_names.extend(n for n in names if n.startswith('_Z'))
+  if not all_names:
+    return key_to_names
+
+  logging.info('Demangling %d values', len(all_names))
+  it = iter(_DemangleNames(all_names, tool_prefix))
+  ret = {}
+  for key, names in key_to_names.iteritems():
+    ret[key] = set(next(it) if n.startswith('_Z') else n for n in names)
+  assert(next(it, None) is None)
+  return ret
+
+
+def DemangleKeysAndMergeLists(name_to_list, tool_prefix):
+  """Demangles keys of a dict of lists, and returns the result.
+
+  Keys may demangle to a common name. When this happens, the corresponding lists
+  are merged in arbitrary order.
+  """
+  keys = [key for key in name_to_list if key.startswith('_Z')]
+  if not keys:
+    return name_to_list
+
+  logging.info('Demangling %d keys', len(keys))
+  key_iter = iter(_DemangleNames(keys, tool_prefix))
+  ret = collections.defaultdict(list)
+  for key, val in name_to_list.iteritems():
+    ret[next(key_iter) if key.startswith('_Z') else key] += val
+  assert(next(key_iter, None) is None)
+  logging.info('* %d keys become %d keys' % (len(name_to_list), len(ret)))
+  return ret
diff --git a/tools/binary_size/libsupersize/nm.py b/tools/binary_size/libsupersize/nm.py
index 4a797de..6f97d3a1 100755
--- a/tools/binary_size/libsupersize/nm.py
+++ b/tools/binary_size/libsupersize/nm.py
@@ -58,6 +58,7 @@
 import traceback
 
 import concurrent
+import demangle
 import models
 import path_util
 
@@ -139,25 +140,28 @@
   # About 60mb of output, but piping takes ~30s, and loading it into RAM
   # directly takes 3s.
   args = [path_util.GetNmPath(tool_prefix), '--no-sort', '--defined-only',
-          '--demangle', elf_path]
+          elf_path]
   output = subprocess.check_output(args)
   for line in output.splitlines():
     space_idx = line.find(' ')
     address_str = line[:space_idx]
     section = line[space_idx + 1]
-    name = line[space_idx + 3:]
+    mangled_name = line[space_idx + 3:]
 
     # To verify that rodata does not have aliases:
     #   nm --no-sort --defined-only libchrome.so > nm.out
     #   grep -v '\$' nm.out | grep ' r ' | sort | cut -d' ' -f1 > addrs
     #   wc -l < addrs; uniq < addrs | wc -l
-    if section not in 'tTW' or not _IsRelevantNmName(name):
+    if section not in 'tTW' or not _IsRelevantNmName(mangled_name):
       continue
 
     address = int(address_str, 16)
     if not address:
       continue
-    names_by_address[address].add(name)
+    names_by_address[address].add(mangled_name)
+
+  # Demangle all names.
+  names_by_address = demangle.DemangleSetsInDicts(names_by_address, tool_prefix)
 
   # Since this is run in a separate process, minimize data passing by returning
   # only aliased symbols.
@@ -305,16 +309,16 @@
       break
     space_idx = line.find(' ')  # Skip over address.
     section = line[space_idx + 1]
-    name = line[space_idx + 3:]
-    if _IsRelevantNmName(name):
+    mangled_name = line[space_idx + 3:]
+    if _IsRelevantNmName(mangled_name):
       # Refer to _IsRelevantObjectFileName() for examples of names.
       if section == 'r' and (
-          name.startswith('.L.str') or
-          name.startswith('.L__') and name.find('.', 3) != -1):
+          mangled_name.startswith('.L.str') or
+          mangled_name.startswith('.L__') and mangled_name.find('.', 3) != -1):
         # Leave as a string for easier marshalling.
         string_addresses.append(line[:space_idx].lstrip('0') or '0')
-      elif _IsRelevantObjectFileName(name):
-        symbol_names.add(name)
+      elif _IsRelevantObjectFileName(mangled_name):
+        symbol_names.add(mangled_name)
   return string_addresses, symbol_names
 
 
@@ -463,8 +467,7 @@
     target: Either a single path to a .a (as a string), or a list of .o paths.
   """
   is_archive = isinstance(target, basestring)
-  args = [path_util.GetNmPath(tool_prefix), '--no-sort', '--defined-only',
-          '--demangle']
+  args = [path_util.GetNmPath(tool_prefix), '--no-sort', '--defined-only']
   if is_archive:
     args.append(target)
   else:
@@ -490,8 +493,8 @@
       # E.g. foo/bar.a(baz.o)
       path = '%s(%s)' % (target, path)
 
-    string_addresses, symbol_names = _ParseOneObjectFileNmOutput(lines)
-    symbol_names_by_path[path] = symbol_names
+    string_addresses, mangled_symbol_names = _ParseOneObjectFileNmOutput(lines)
+    symbol_names_by_path[path] = mangled_symbol_names
     if string_addresses:
       string_addresses_by_path[path] = string_addresses
     path = next(lines, ':')[:-1]
@@ -532,6 +535,7 @@
     # and our output is a dict where paths are the key.
     results = concurrent.BulkForkAndCall(_RunNmOnIntermediates, params)
 
+    # Names are still mangled.
     all_paths_by_name = self._paths_by_name
     for encoded_syms, encoded_strs in results:
       symbol_names_by_path = concurrent.DecodeDictOfLists(encoded_syms)
@@ -544,8 +548,12 @@
     logging.debug('worker: AnalyzePaths() completed.')
 
   def SortPaths(self):
-    for paths in self._paths_by_name.itervalues():
-      paths.sort()
+    # Finally, demangle all names, which can result in some merging of lists.
+    self._paths_by_name = demangle.DemangleKeysAndMergeLists(
+        self._paths_by_name, self._tool_prefix)
+    # Sort and uniquefy.
+    for key in self._paths_by_name.iterkeys():
+      self._paths_by_name[key] = sorted(set(self._paths_by_name[key]))
 
   def AnalyzeStringLiterals(self, elf_path, elf_string_positions):
     logging.debug('worker: AnalyzeStringLiterals() started.')
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config
index 19563760..420a072 100644
--- a/tools/perf/expectations.config
+++ b/tools/perf/expectations.config
@@ -191,6 +191,7 @@
 [ Android_Webview ] system_health.common_mobile/browse:chrome:newtab [ Skip ]
 crbug.com/738854 [ Nexus_5X ] system_health.common_mobile/load:tools:drive [ Skip ]
 crbug.com/738854 [ Android_Webview ] system_health.common_mobile/load:tools:drive [ Skip ]
+crbug.com/797261 [ Android_Webview ] system_health.common_mobile/load:games:spychase [ Skip ]
 
 # Benchmark: system_health.memory_desktop
 crbug.com/728576 [ Mac ] system_health.memory_desktop/browse:news:cnn [ Skip ]
@@ -220,6 +221,7 @@
 crbug.com/780779 [ Nexus_5 ] system_health.memory_mobile/browse:social:facebook [ Skip ]
 crbug.com/738854 [ Nexus_5X ] system_health.memory_mobile/load:tools:drive [ Skip ]
 crbug.com/738854 [ Android_Webview ] system_health.memory_mobile/load:tools:drive [ Skip ]
+crbug.com/797261 [ Android_Webview ] system_health.common_mobile/load:games:spychase [ Skip ]
 
 # Benchmark: tab_switching.typical_25
 crbug.com/747026 [ Mac ] tab_switching.typical_25/multitab:misc:typical24 [ Skip ]