diff --git a/DEPS b/DEPS
index 9ee6942..351af54 100644
--- a/DEPS
+++ b/DEPS
@@ -40,11 +40,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': '7717d4a343bad38017c91459f1637868844bda47',
+  'skia_revision': '57bc1e7bc804be4779dd09409046f62c4d43e3cd',
   # 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': 'f1da084ab19f34a86cc13464ac45a46dc32b9d25',
+  'v8_revision': 'd355bb5edb0419a0ca9b41547720fb99adf025fd',
   # 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.
@@ -64,7 +64,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling PDFium
   # and whatever else without interference from each other.
-  'pdfium_revision': 'e73fea598f088151213fb11100798c615543ca2f',
+  'pdfium_revision': '6e162b54f708d7957c04d8dffce367fbeaa1a366',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling openmax_dl
   # and whatever else without interference from each other.
@@ -72,7 +72,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling BoringSSL
   # and whatever else without interference from each other.
-  'boringssl_revision': '1252f8758ab1c4c4a14db25f9fa53e5950e4bcda',
+  'boringssl_revision': '358baeb9a4df81ccb916a5b8cf0ed059087645bd',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling google-toolbox-for-mac
   # and whatever else without interference from each other.
diff --git a/WATCHLISTS b/WATCHLISTS
index 2cfc1a6d..779401b 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -830,8 +830,8 @@
                   'ios/chrome/browser/ui/reading_list',
     },
     'remoting': {
-      'filepath': 'remoting/' \
-                  '|testing/chromoting'
+      'filepath': '^remoting/' \
+                  '|^testing/chromoting'
     },
     'rlz_id': {
       'filepath' :'rlz/lib/machine_id.cc|'\
diff --git a/android_webview/BUILD.gn b/android_webview/BUILD.gn
index f239a8d..056656de 100644
--- a/android_webview/BUILD.gn
+++ b/android_webview/BUILD.gn
@@ -355,11 +355,11 @@
     "browser/aw_render_thread_context_provider.h",
     "browser/aw_resource_context.cc",
     "browser/aw_resource_context.h",
-    "browser/aw_resource_throttle.cc",
-    "browser/aw_resource_throttle.h",
     "browser/aw_result_codes.h",
     "browser/aw_safe_browsing_config_helper.cc",
     "browser/aw_safe_browsing_config_helper.h",
+    "browser/aw_safe_browsing_resource_throttle.cc",
+    "browser/aw_safe_browsing_resource_throttle.h",
     "browser/aw_safe_browsing_ui_manager.cc",
     "browser/aw_safe_browsing_ui_manager.h",
     "browser/aw_ssl_host_state_delegate.cc",
diff --git a/android_webview/browser/aw_resource_throttle.cc b/android_webview/browser/aw_safe_browsing_resource_throttle.cc
similarity index 93%
rename from android_webview/browser/aw_resource_throttle.cc
rename to android_webview/browser/aw_safe_browsing_resource_throttle.cc
index 5b818c8..507a0a5 100644
--- a/android_webview/browser/aw_resource_throttle.cc
+++ b/android_webview/browser/aw_safe_browsing_resource_throttle.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "android_webview/browser/aw_resource_throttle.h"
+#include "android_webview/browser/aw_safe_browsing_resource_throttle.h"
 
 #include "base/macros.h"
 #include "components/safe_browsing/base_resource_throttle.h"
@@ -41,7 +41,7 @@
 AwSafeBrowsingResourceThrottle::~AwSafeBrowsingResourceThrottle() {}
 
 void AwSafeBrowsingResourceThrottle::CancelResourceLoad() {
-  CancelWithError(net::ERR_BLOCKED_BY_ADMINISTRATOR);
+  CancelWithError(net::ERR_FAILED);
 }
 
 }  // namespace android_webview
diff --git a/android_webview/browser/aw_resource_throttle.h b/android_webview/browser/aw_safe_browsing_resource_throttle.h
similarity index 87%
rename from android_webview/browser/aw_resource_throttle.h
rename to android_webview/browser/aw_safe_browsing_resource_throttle.h
index 767b1bbd..cdaf6ad 100644
--- a/android_webview/browser/aw_resource_throttle.h
+++ b/android_webview/browser/aw_safe_browsing_resource_throttle.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 ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_THROTTLE_H_
-#define ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_THROTTLE_H_
+#ifndef ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_
+#define ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_
 
 #include "base/macros.h"
 #include "components/safe_browsing/base_resource_throttle.h"
@@ -47,4 +47,4 @@
 
 }  // namespace android_webview
 
-#endif  // ANDROID_WEBVIEW_BROWSER_AW_RESOURCE_THROTTLE_H_
+#endif  // ANDROID_WEBVIEW_BROWSER_AW_SAFE_BROWSING_RESOURCE_THROTTLE_H_
diff --git a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
index 090ba268..a342220a4 100644
--- a/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
+++ b/android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
@@ -12,8 +12,8 @@
 #include "android_webview/browser/aw_contents_io_thread_client.h"
 #include "android_webview/browser/aw_login_delegate.h"
 #include "android_webview/browser/aw_resource_context.h"
-#include "android_webview/browser/aw_resource_throttle.h"
 #include "android_webview/browser/aw_safe_browsing_config_helper.h"
+#include "android_webview/browser/aw_safe_browsing_resource_throttle.h"
 #include "android_webview/browser/net/aw_web_resource_request.h"
 #include "android_webview/browser/renderer_host/auto_login_parser.h"
 #include "android_webview/common/url_constants.h"
diff --git a/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java b/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
index f960eefc..83d16b1 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwBrowserContext.java
@@ -7,7 +7,6 @@
 import android.content.Context;
 import android.content.SharedPreferences;
 
-import org.chromium.base.CommandLine;
 import org.chromium.components.safe_browsing.SafeBrowsingApiBridge;
 import org.chromium.components.safe_browsing.SafeBrowsingApiHandler;
 import org.chromium.content.browser.AppWebMessagePortService;
@@ -35,7 +34,7 @@
         mSharedPreferences = sharedPreferences;
         mApplicationContext = applicationContext;
 
-        if (CommandLine.getInstance().hasSwitch(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT)) {
+        if (AwContentsStatics.getSafeBrowsingEnabled()) {
             initSafeBrowsingApiHandler();
         }
     }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java b/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
index a9e4497d..1ad332a0 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwContentsStatics.java
@@ -79,6 +79,10 @@
         nativeSetServiceWorkerIoThreadClient(ioThreadClient, browserContext);
     }
 
+    public static boolean getSafeBrowsingEnabled() {
+        return nativeGetSafeBrowsingEnabled();
+    }
+
     public static void setSafeBrowsingEnabled(boolean enable) {
         nativeSetSafeBrowsingEnabled(enable);
     }
@@ -92,5 +96,6 @@
     private static native String nativeGetProductVersion();
     private static native void nativeSetServiceWorkerIoThreadClient(
             AwContentsIoThreadClient ioThreadClient, AwBrowserContext browserContext);
+    private static native boolean nativeGetSafeBrowsingEnabled();
     private static native void nativeSetSafeBrowsingEnabled(boolean enable);
 }
diff --git a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
index 1a8c3ea..6a551661 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwSafeBrowsingConfigHelper.java
@@ -76,4 +76,4 @@
 
     // Not meant to be instantiated.
     private AwSafeBrowsingConfigHelper() {}
-}
\ No newline at end of file
+}
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
index a0ce792..dd079f1 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java
@@ -98,6 +98,7 @@
         if (mBrowserContext != null) {
             throw new AndroidRuntimeException("There should only be one browser context.");
         }
+        getActivity(); // The Activity must be launched in order to load native code
         final InMemorySharedPreferences prefs = new InMemorySharedPreferences();
         final Context appContext = getInstrumentation().getTargetContext().getApplicationContext();
         getInstrumentation().runOnMainSync(new Runnable() {
diff --git a/android_webview/native/aw_contents_statics.cc b/android_webview/native/aw_contents_statics.cc
index e968f75..975c9527 100644
--- a/android_webview/native/aw_contents_statics.cc
+++ b/android_webview/native/aw_contents_statics.cc
@@ -77,6 +77,12 @@
 }
 
 // static
+jboolean GetSafeBrowsingEnabled(JNIEnv* env,
+                            const JavaParamRef<jclass>&) {
+  return AwSafeBrowsingConfigHelper::GetSafeBrowsingEnabled();
+}
+
+// static
 void SetSafeBrowsingEnabled(JNIEnv* env,
                             const JavaParamRef<jclass>&,
                             jboolean enable) {
diff --git a/ash/app_list/app_list_presenter_delegate_unittest.cc b/ash/app_list/app_list_presenter_delegate_unittest.cc
index 71324ae..3844f22 100644
--- a/ash/app_list/app_list_presenter_delegate_unittest.cc
+++ b/ash/app_list/app_list_presenter_delegate_unittest.cc
@@ -115,9 +115,6 @@
 // Tests opening the app launcher on a non-primary display, then deleting the
 // display.
 TEST_F(AppListPresenterDelegateTest, NonPrimaryDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Set up a screen with two displays (horizontally adjacent).
   UpdateDisplay("1024x768,1024x768");
 
diff --git a/ash/common/devtools/ash_devtools_unittest.cc b/ash/common/devtools/ash_devtools_unittest.cc
index d3e29a045..eae4d8e 100644
--- a/ash/common/devtools/ash_devtools_unittest.cc
+++ b/ash/common/devtools/ash_devtools_unittest.cc
@@ -622,8 +622,6 @@
 }
 
 TEST_F(AshDevToolsTest, MultipleDisplayHighlight) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("300x400,500x500");
 
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
diff --git a/ash/common/test/ash_test.cc b/ash/common/test/ash_test.cc
index 3afcf64e..245ce6b 100644
--- a/ash/common/test/ash_test.cc
+++ b/ash/common/test/ash_test.cc
@@ -48,10 +48,6 @@
       WmShell::Get()->system_tray_delegate());
 }
 
-bool AshTest::SupportsMultipleDisplays() const {
-  return test_impl_->SupportsMultipleDisplays();
-}
-
 void AshTest::UpdateDisplay(const std::string& display_spec) {
   return test_impl_->UpdateDisplay(display_spec);
 }
diff --git a/ash/common/test/ash_test.h b/ash/common/test/ash_test.h
index 570178d..d91c4d6 100644
--- a/ash/common/test/ash_test.h
+++ b/ash/common/test/ash_test.h
@@ -73,8 +73,6 @@
 
   static test::TestSystemTrayDelegate* GetSystemTrayDelegate();
 
-  bool SupportsMultipleDisplays() const;
-
   // Update the display configuration as given in |display_spec|.
   // See test::DisplayManagerTestApi::UpdateDisplay for more details.
   void UpdateDisplay(const std::string& display_spec);
diff --git a/ash/common/test/ash_test_impl.h b/ash/common/test/ash_test_impl.h
index c59260b..8984dfbf 100644
--- a/ash/common/test/ash_test_impl.h
+++ b/ash/common/test/ash_test_impl.h
@@ -37,7 +37,6 @@
   // These functions mirror that of AshTest, see it for details.
   virtual void SetUp() = 0;
   virtual void TearDown() = 0;
-  virtual bool SupportsMultipleDisplays() const = 0;
   virtual void UpdateDisplay(const std::string& display_spec) = 0;
   virtual std::unique_ptr<WindowOwner> CreateTestWindow(
       const gfx::Rect& bounds_in_screen,
diff --git a/ash/common/wallpaper/wallpaper_controller_unittest.cc b/ash/common/wallpaper/wallpaper_controller_unittest.cc
index acbb0bf..b05bf4a 100644
--- a/ash/common/wallpaper/wallpaper_controller_unittest.cc
+++ b/ash/common/wallpaper/wallpaper_controller_unittest.cc
@@ -348,9 +348,6 @@
 }
 
 TEST_F(WallpaperControllerTest, ResizeCustomWallpaper) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("320x200");
 
   gfx::ImageSkia image = CreateImage(640, 480, kCustomWallpaperColor);
@@ -388,9 +385,6 @@
   EXPECT_EQ("1000x300",
             WallpaperController::GetMaxDisplaySizeInNative().ToString());
 
-  if (!SupportsMultipleDisplays())
-    return;
-
   // First display has maximum size.
   UpdateDisplay("400x300,100x100");
   EXPECT_EQ("400x300",
diff --git a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
index b2e11e5a..a0c4b8ee 100644
--- a/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/common/wm/workspace/workspace_layout_manager_unittest.cc
@@ -107,9 +107,6 @@
   EXPECT_EQ("0,0 100x100", window_state->GetRestoreBoundsInScreen().ToString());
   EXPECT_EQ("10,15 25x35", window->GetBounds().ToString());
 
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x300,500x400");
   window->SetBoundsInScreen(gfx::Rect(600, 0, 100, 100), GetSecondaryDisplay());
   EXPECT_EQ(WmShell::Get()->GetAllRootWindows()[1], window->GetRootWindow());
@@ -130,9 +127,6 @@
 }
 
 TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x400,400x500");
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
 
@@ -205,8 +199,6 @@
 }
 
 TEST_F(WorkspaceLayoutManagerTest, MaximizeInDisplayToBeRestored) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("300x400,400x500");
 
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
@@ -267,8 +259,6 @@
 }
 
 TEST_F(WorkspaceLayoutManagerTest, FullscreenInDisplayToBeRestored) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("300x400,400x500");
 
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
diff --git a/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc b/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
index 0279a436..1943640 100644
--- a/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
+++ b/ash/content/keyboard_overlay/keyboard_overlay_delegate_unittest.cc
@@ -32,9 +32,6 @@
 
 // Verifies we can show and close the widget for the overlay dialog.
 TEST_P(KeyboardOverlayDelegateTest, ShowAndClose) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x400,300x200");
   GetPrimaryShelf()->SetAlignment(shelf_alignment());
   KeyboardOverlayDelegate delegate(base::ASCIIToUTF16("Title"),
diff --git a/ash/display/cursor_window_controller_unittest.cc b/ash/display/cursor_window_controller_unittest.cc
index a2612e46..bb87800 100644
--- a/ash/display/cursor_window_controller_unittest.cc
+++ b/ash/display/cursor_window_controller_unittest.cc
@@ -65,9 +65,6 @@
 // Test that the composited cursor moves to another display when the real cursor
 // moves to another display.
 TEST_F(CursorWindowControllerTest, MoveToDifferentDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,200x200*2/r");
 
   WindowTreeHostManager* window_tree_host_manager =
diff --git a/ash/display/display_error_observer_chromeos_unittest.cc b/ash/display/display_error_observer_chromeos_unittest.cc
index c3da7d2b..a6863a3 100644
--- a/ash/display/display_error_observer_chromeos_unittest.cc
+++ b/ash/display/display_error_observer_chromeos_unittest.cc
@@ -42,9 +42,6 @@
 };
 
 TEST_F(DisplayErrorObserverTest, Normal) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,300x300");
   observer()->OnDisplayModeChangeFailed(
       display::DisplayConfigurator::DisplayStateList(),
@@ -54,9 +51,6 @@
 }
 
 TEST_F(DisplayErrorObserverTest, CallTwice) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,300x300");
   observer()->OnDisplayModeChangeFailed(
       display::DisplayConfigurator::DisplayStateList(),
@@ -73,9 +67,6 @@
 }
 
 TEST_F(DisplayErrorObserverTest, CallWithDifferentState) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,300x300");
   observer()->OnDisplayModeChangeFailed(
       display::DisplayConfigurator::DisplayStateList(),
diff --git a/ash/display/display_manager_unittest.cc b/ash/display/display_manager_unittest.cc
index cf6fcf6..e6d7313 100644
--- a/ash/display/display_manager_unittest.cc
+++ b/ash/display/display_manager_unittest.cc
@@ -150,9 +150,6 @@
                     MaterialDesignController::MATERIAL_EXPERIMENTAL));
 
 TEST_P(DisplayManagerTest, UpdateDisplayTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   EXPECT_EQ(1U, display_manager()->GetNumDisplays());
 
   // Update primary and add seconary.
@@ -255,8 +252,6 @@
 }
 
 TEST_P(DisplayManagerTest, ScaleOnlyChange) {
-  if (!SupportsMultipleDisplays())
-    return;
   display_manager()->ToggleDisplayScaleFactor();
   EXPECT_TRUE(changed_metrics() &
               display::DisplayObserver::DISPLAY_METRIC_BOUNDS);
@@ -266,9 +261,6 @@
 
 // Test in emulation mode (use_fullscreen_host_window=false)
 TEST_P(DisplayManagerTest, EmulatorTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   EXPECT_EQ(1U, display_manager()->GetNumDisplays());
 
   display_manager()->AddRemoveDisplay();
@@ -289,9 +281,6 @@
 
 // Tests support for 3 displays.
 TEST_P(DisplayManagerTest, UpdateThreeDisplaysWithDefaultLayout) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   EXPECT_EQ(1U, display_manager()->GetNumDisplays());
 
   // Test with three displays. Native origin will not affect ash
@@ -351,9 +340,6 @@
 }
 
 TEST_P(DisplayManagerTest, LayoutMorethanThreeDisplaysTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
   display::DisplayIdList list = display::test::CreateDisplayIdListN(
       3, primary_id, primary_id + 1, primary_id + 2);
@@ -466,24 +452,16 @@
 }
 
 TEST_P(DisplayManagerTest, NoMirrorInThreeDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("640x480,320x200,400x300");
   ash::Shell::GetInstance()->display_configuration_controller()->SetMirrorMode(
       true, true);
   EXPECT_FALSE(display_manager()->IsInMirrorMode());
   EXPECT_EQ(3u, display_manager()->GetNumDisplays());
-#if defined(OS_CHROMEOS)
   EXPECT_EQ(l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_MIRRORING_NOT_SUPPORTED),
             GetDisplayErrorNotificationMessageForTest());
-#endif
 }
 
 TEST_P(DisplayManagerTest, OverscanInsetsTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("0+0-500x500,0+501-400x400");
   reset();
   ASSERT_EQ(2u, display_manager()->GetNumDisplays());
@@ -606,9 +584,6 @@
 }
 
 TEST_P(DisplayManagerTest, ZeroOverscanInsets) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Make sure the display change events is emitted for overscan inset changes.
   UpdateDisplay("0+0-500x500,0+501-400x400");
   ASSERT_EQ(2u, display_manager()->GetNumDisplays());
@@ -629,11 +604,7 @@
   EXPECT_EQ(display2_id, changed()[0].id());
 }
 
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, TouchCalibrationTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("0+0-500x500,0+501-1024x600");
   reset();
 
@@ -702,10 +673,7 @@
   EXPECT_FALSE(updated_display_info2.has_touch_calibration_data());
   EXPECT_EQ(touch_data, updated_display_info2.GetTouchCalibrationData());
 }
-#endif  // defined(OS_CHROMEOS)
 
-#if !defined(OS_WIN)
-// Disabled on windows because of http://crbug.com/650326.
 TEST_P(DisplayManagerTest, TestDeviceScaleOnlyChange) {
   UpdateDisplay("1000x600");
   aura::WindowTreeHost* host = Shell::GetPrimaryRootWindow()->GetHost();
@@ -720,7 +688,6 @@
   EXPECT_EQ("500x300",
             Shell::GetPrimaryRootWindow()->bounds().size().ToString());
 }
-#endif
 
 display::ManagedDisplayInfo CreateDisplayInfo(int64_t id,
                                               const gfx::Rect& bounds) {
@@ -757,9 +724,6 @@
   EXPECT_EQ(1U, display_manager()->num_connected_displays());
   EXPECT_FALSE(display_manager()->IsInMirrorMode());
 
-  if (!SupportsMultipleDisplays())
-    return;
-
   // External connected while primary was disconnected.
   display_info_list.push_back(external_display_info);
   display_manager()->OnNativeDisplaysChanged(display_info_list);
@@ -898,9 +862,6 @@
 // Make sure crash does not happen if add and remove happens at the same time.
 // See: crbug.com/414394
 TEST_P(DisplayManagerTest, DisplayAddRemoveAtTheSameTime) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("100+0-500x500,0+501-400x400");
 
   const int64_t primary_id = WindowTreeHostManager::GetPrimaryDisplayId();
@@ -928,9 +889,6 @@
   EXPECT_EQ("600x600", GetDisplayForId(third_id).size().ToString());
 }
 
-// TODO(scottmg): RootWindow doesn't get resized on Windows
-// Ash. http://crbug.com/247916.
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, TestNativeDisplaysChangedNoInternal) {
   EXPECT_EQ(1U, display_manager()->GetNumDisplays());
 
@@ -953,12 +911,8 @@
                            .size()
                            .ToString());
 }
-#endif  // defined(OS_CHROMEOS)
 
 TEST_P(DisplayManagerTest, NativeDisplaysChangedAfterPrimaryChange) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   const int64_t internal_display_id =
       display::test::DisplayManagerTestApi(display_manager())
           .SetFirstDisplayAsInternalDisplay();
@@ -990,8 +944,6 @@
   EXPECT_EQ("0,0 100x100", GetDisplayForId(10).bounds().ToString());
 }
 
-// TODO(msw): Broken on Windows. http://crbug.com/584038
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, DontRememberBestResolution) {
   int display_id = 1000;
   display::ManagedDisplayInfo native_display_info =
@@ -1058,10 +1010,7 @@
   EXPECT_TRUE(expected_mode->IsEquivalent(
       display_manager()->GetActiveModeForDisplayId(display_id)));
 }
-#endif  // defined(OS_CHROMEOS)
 
-// TODO(msw): Broken on Windows. http://crbug.com/584038
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, ResolutionFallback) {
   int display_id = 1000;
   display::ManagedDisplayInfo native_display_info =
@@ -1118,12 +1067,8 @@
     EXPECT_TRUE(mode->native());
   }
 }
-#endif  // defined(OS_CHROMEOS)
 
 TEST_P(DisplayManagerTest, Rotate) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("100x200/r,300x400/l");
   EXPECT_EQ("1,1 100x200", GetDisplayInfoAt(0).bounds_in_native().ToString());
   EXPECT_EQ("200x100", GetDisplayInfoAt(0).size_in_pixel().ToString());
@@ -1208,8 +1153,6 @@
             post_rotation_info.GetActiveRotation());
 }
 
-// TODO(msw): Broken on Windows. http://crbug.com/584038
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, UIScale) {
   display::test::ScopedDisable125DSFForUIScaling disable;
 
@@ -1335,7 +1278,6 @@
   EXPECT_EQ(1.0f, display.device_scale_factor());
   EXPECT_EQ("1280x850", display.bounds().size().ToString());
 }
-#endif  // defined(OS_CHROMEOS)
 
 TEST_P(DisplayManagerTest, UIScaleWithDisplayMode) {
   int display_id = 1000;
@@ -1472,8 +1414,6 @@
   EXPECT_EQ("1536x864", GetDisplayForId(display_id).size().ToString());
 }
 
-// TODO(msw): Broken on Windows. http://crbug.com/584038
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, Use125DSFForUIScaling) {
   int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
 
@@ -1501,10 +1441,7 @@
   EXPECT_EQ(1.25f, GetDisplayInfoAt(0).GetEffectiveUIScale());
   EXPECT_EQ("2400x1350", GetDisplayForId(display_id).size().ToString());
 }
-#endif  // defined(OS_CHROMEOS)
 
-// TODO(msw): Broken on Windows. http://crbug.com/584038
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, FHD125DefaultsTo08UIScaling) {
   int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
 
@@ -1532,10 +1469,7 @@
   EXPECT_EQ(1.25f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor());
   EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveUIScale());
 }
-#endif  // defined(OS_CHROMEOS)
 
-// TODO(msw): Broken on Windows. http://crbug.com/584038
-#if defined(OS_CHROMEOS)
 // Don't default to 1.25 DSF if the user already has a prefrence stored for
 // the internal display.
 TEST_P(DisplayManagerTest, FHD125DefaultsTo08UIScalingNoOverride) {
@@ -1569,11 +1503,8 @@
   EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveDeviceScaleFactor());
   EXPECT_EQ(1.0f, GetDisplayInfoAt(0).GetEffectiveUIScale());
 }
-#endif  // defined(OS_CHROMEOS)
 
 TEST_P(DisplayManagerTest, ResolutionChangeInUnifiedMode) {
-  if (!SupportsMultipleDisplays())
-    return;
   // Don't check root window destruction in unified mode.
   Shell::GetPrimaryRootWindow()->RemoveObserver(this);
 
@@ -1618,9 +1549,6 @@
   EXPECT_EQ("1200x600", active_mode->size().ToString());
 }
 
-// TODO(scottmg): RootWindow doesn't get resized on Windows
-// Ash. http://crbug.com/247916.
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, UpdateMouseCursorAfterRotateZoom) {
   // Make sure just rotating will not change native location.
   UpdateDisplay("300x200,200x150");
@@ -1668,7 +1596,6 @@
   UpdateDisplay("600x400,400x200*2@1.5");
   EXPECT_EQ("750,75", env->last_mouse_location().ToString());
 }
-#endif  // defined(OS_CHROMEOS)
 
 class TestDisplayObserver : public display::DisplayObserver {
  public:
@@ -1704,9 +1631,6 @@
 };
 
 TEST_P(DisplayManagerTest, SoftwareMirroring) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x400,400x500");
 
   test::MirrorWindowTestApi test_api;
@@ -1770,9 +1694,6 @@
 }
 
 TEST_P(DisplayManagerTest, RotateInSoftwareMirroring) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,500x300");
   display_manager()->SetMirrorMode(true);
 
@@ -1785,8 +1706,6 @@
 }
 
 TEST_P(DisplayManagerTest, SingleDisplayToSoftwareMirroring) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("600x400");
 
   display_manager()->SetMultiDisplayMode(display::DisplayManager::MIRRORING);
@@ -1806,14 +1725,8 @@
       window_tree_host_manager->mirror_window_controller()->GetWindow());
 }
 
-#if defined(OS_CHROMEOS)
 // Make sure this does not cause any crashes. See http://crbug.com/412910
-// This test is limited to OS_CHROMEOS because CursorCompositingEnabled is only
-// for ChromeOS.
 TEST_P(DisplayManagerTest, SoftwareMirroringWithCompositingCursor) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x400,400x500");
 
   test::MirrorWindowTestApi test_api;
@@ -1844,12 +1757,8 @@
 
   Shell::GetInstance()->SetCursorCompositingEnabled(false);
 }
-#endif  // OS_CHROMEOS
 
 TEST_P(DisplayManagerTest, MirroredLayout) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,400x400");
   EXPECT_FALSE(display_manager()->GetCurrentDisplayLayout().mirrored);
   EXPECT_EQ(2, display::Screen::GetScreen()->GetNumDisplays());
@@ -1921,8 +1830,6 @@
 }
 
 TEST_P(DisplayManagerTest, NotifyPrimaryChange) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("500x500,500x500");
   SwapPrimaryDisplay();
   reset();
@@ -1946,8 +1853,6 @@
 }
 
 TEST_P(DisplayManagerTest, NotifyPrimaryChangeUndock) {
-  if (!SupportsMultipleDisplays())
-    return;
   // Assume the default display is an external display, and
   // emulates undocking by switching to another display.
   display::ManagedDisplayInfo another_display_info =
@@ -1964,9 +1869,6 @@
               display::DisplayObserver::DISPLAY_METRIC_PRIMARY);
 }
 
-// TODO(scottmg): RootWindow doesn't get resized on Windows
-// Ash. http://crbug.com/247916.
-#if defined(OS_CHROMEOS)
 TEST_P(DisplayManagerTest, UpdateDisplayWithHostOrigin) {
   UpdateDisplay("100x200,300x400");
   ASSERT_EQ(2, display::Screen::GetScreen()->GetNumDisplays());
@@ -2003,12 +1905,8 @@
   EXPECT_EQ("300,500", host1->GetBoundsInPixels().origin().ToString());
   EXPECT_EQ("200x300", host1->GetBoundsInPixels().size().ToString());
 }
-#endif  // defined(OS_CHROMEOS)
 
 TEST_P(DisplayManagerTest, UnifiedDesktopBasic) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Don't check root window destruction in unified mode.
   Shell::GetPrimaryRootWindow()->RemoveObserver(this);
 
@@ -2068,8 +1966,6 @@
 }
 
 TEST_P(DisplayManagerTest, UnifiedDesktopWithHardwareMirroring) {
-  if (!SupportsMultipleDisplays())
-    return;
   // Don't check root window destruction in unified mode.
   Shell::GetPrimaryRootWindow()->RemoveObserver(this);
 
@@ -2108,8 +2004,6 @@
 }
 
 TEST_P(DisplayManagerTest, UnifiedDesktopEnabledWithExtended) {
-  if (!SupportsMultipleDisplays())
-    return;
   // Don't check root window destruction in unified mode.
   Shell::GetPrimaryRootWindow()->RemoveObserver(this);
 
@@ -2125,8 +2019,6 @@
 }
 
 TEST_P(DisplayManagerTest, UnifiedDesktopWith2xDSF) {
-  if (!SupportsMultipleDisplays())
-    return;
   // Don't check root window destruction in unified mode.
   Shell::GetPrimaryRootWindow()->RemoveObserver(this);
 
@@ -2229,8 +2121,6 @@
 // Updating displays again in unified desktop mode should not crash.
 // crbug.com/491094.
 TEST_P(DisplayManagerTest, ConfigureUnifiedTwice) {
-  if (!SupportsMultipleDisplays())
-    return;
   // Don't check root window destruction in unified mode.
   Shell::GetPrimaryRootWindow()->RemoveObserver(this);
 
@@ -2243,8 +2133,6 @@
 }
 
 TEST_P(DisplayManagerTest, NoRotateUnifiedDesktop) {
-  if (!SupportsMultipleDisplays())
-    return;
   display_manager()->SetUnifiedDesktopEnabled(true);
 
   // Don't check root window destruction in unified mode.
@@ -2271,9 +2159,6 @@
 // Makes sure the transition from unified to single won't crash
 // with docked windows.
 TEST_P(DisplayManagerTest, UnifiedWithDockWindows) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Enable window docking for this test.
   base::CommandLine::ForCurrentProcess()->AppendSwitch(
       ash::switches::kAshEnableDockedWindows);
@@ -2302,8 +2187,6 @@
 }
 
 TEST_P(DisplayManagerTest, DockMode) {
-  if (!SupportsMultipleDisplays())
-    return;
   const int64_t internal_id = 1;
   const int64_t external_id = 2;
 
@@ -2338,8 +2221,6 @@
 
 // Make sure that bad layout information is ignored and does not crash.
 TEST_P(DisplayManagerTest, DontRegisterBadConfig) {
-  if (!SupportsMultipleDisplays())
-    return;
   display::DisplayIdList list = display::test::CreateDisplayIdList2(1, 2);
   display::DisplayLayoutBuilder builder(1);
   builder.AddDisplayPlacement(2, 1, display::DisplayPlacement::LEFT, 0);
@@ -2357,8 +2238,6 @@
   void TearDown() override {
     display::Screen* orig_screen = display::Screen::GetScreen();
     AshTestBase::TearDown();
-    if (!SupportsMultipleDisplays())
-      return;
     display::Screen* screen = display::Screen::GetScreen();
     EXPECT_NE(orig_screen, screen);
     EXPECT_EQ(2, screen->GetNumDisplays());
@@ -2373,12 +2252,9 @@
 };
 
 TEST_F(ScreenShutdownTest, ScreenAfterShutdown) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("500x300,800x400");
 }
 
-#if defined(OS_CHROMEOS)
 namespace {
 
 // A helper class that sets the display configuration and starts ash.
@@ -2567,6 +2443,4 @@
   EXPECT_EQ(id2, stored.placement_list[0].display_id);
 }
 
-#endif  // OS_CHROMEOS
-
 }  // namespace ash
diff --git a/ash/display/display_util_unittest.cc b/ash/display/display_util_unittest.cc
index d77893d..9ec1d0d 100644
--- a/ash/display/display_util_unittest.cc
+++ b/ash/display/display_util_unittest.cc
@@ -13,8 +13,6 @@
 typedef test::AshTestBase DisplayUtilTest;
 
 TEST_F(DisplayUtilTest, RotatedDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
   {
     UpdateDisplay("10+10-500x400,600+10-1000x600/r");
     aura::Window::Windows root_windows = Shell::GetAllRootWindows();
diff --git a/ash/display/extended_mouse_warp_controller_unittest.cc b/ash/display/extended_mouse_warp_controller_unittest.cc
index 61214ac..ccc276a 100644
--- a/ash/display/extended_mouse_warp_controller_unittest.cc
+++ b/ash/display/extended_mouse_warp_controller_unittest.cc
@@ -50,9 +50,6 @@
 
 // Verifies if MouseCursorEventFilter's bounds calculation works correctly.
 TEST_F(ExtendedMouseWarpControllerTest, IndicatorBoundsTestOnRight) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("360x360,700x700");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   int64_t display_0_id = display::Screen::GetScreen()
@@ -123,9 +120,6 @@
 }
 
 TEST_F(ExtendedMouseWarpControllerTest, IndicatorBoundsTestOnLeft) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("360x360,700x700");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -167,9 +161,6 @@
 }
 
 TEST_F(ExtendedMouseWarpControllerTest, IndicatorBoundsTestOnTopBottom) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("360x360,700x700");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   int64_t display_0_id = display::Screen::GetScreen()
@@ -223,9 +214,6 @@
 
 // Verify indicators show up as expected with 3+ displays.
 TEST_F(ExtendedMouseWarpControllerTest, IndicatorBoundsTestThreeDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("360x360,700x700,1000x1000");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   display::Screen* screen = display::Screen::GetScreen();
@@ -280,8 +268,6 @@
 
 TEST_F(ExtendedMouseWarpControllerTest,
        IndicatorBoundsTestThreeDisplaysWithLayout) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("700x500,500x500,1000x1000");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   display::Screen* screen = display::Screen::GetScreen();
@@ -330,8 +316,6 @@
 
 TEST_F(ExtendedMouseWarpControllerTest,
        IndicatorBoundsTestThreeDisplaysWithLayout2) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("700x500,500x500,1000x1000");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   display::Screen* screen = display::Screen::GetScreen();
diff --git a/ash/display/mouse_cursor_event_filter_unittest.cc b/ash/display/mouse_cursor_event_filter_unittest.cc
index be81f86..73812e1 100644
--- a/ash/display/mouse_cursor_event_filter_unittest.cc
+++ b/ash/display/mouse_cursor_event_filter_unittest.cc
@@ -37,9 +37,6 @@
 // Verifies if the mouse pointer correctly moves to another display when there
 // are two displays.
 TEST_F(MouseCursorEventFilterTest, WarpMouse) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
 
   ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::GetInstance()
@@ -77,9 +74,6 @@
 // Verifies if the mouse pointer correctly moves to another display even when
 // two displays are not the same size.
 TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentSizeDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,600x600");  // the second one is larger.
 
   ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::GetInstance()
@@ -105,9 +99,6 @@
 // different scale factors. In native coords mode, there is no
 // difference between drag and move.
 TEST_F(MouseCursorEventFilterTest, WarpMouseDifferentScaleDisplaysInNative) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,600x600*2");
 
   ASSERT_EQ(display::DisplayPlacement::RIGHT, Shell::GetInstance()
@@ -133,9 +124,6 @@
 // Verifies if MouseCursorEventFilter::set_mouse_warp_enabled() works as
 // expected.
 TEST_F(MouseCursorEventFilterTest, SetMouseWarpModeFlag) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
 
   event_filter()->set_mouse_warp_enabled(false);
@@ -153,9 +141,6 @@
 // across root windows with different device scale factors
 // (http://crbug.com/154183).
 TEST_F(MouseCursorEventFilterTest, CursorDeviceScaleFactor) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,800x800*2");
   display_manager()->SetLayoutForCurrentDisplays(
       display::test::CreateDisplayLayout(display_manager(),
diff --git a/ash/display/resolution_notification_controller_unittest.cc b/ash/display/resolution_notification_controller_unittest.cc
index 7195aa7..80678da 100644
--- a/ash/display/resolution_notification_controller_unittest.cc
+++ b/ash/display/resolution_notification_controller_unittest.cc
@@ -150,9 +150,6 @@
 
 // Basic behaviors and verifies it doesn't cause crashes.
 TEST_F(ResolutionNotificationControllerTest, Basic) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x300#300x300%57|200x200%58,250x250#250x250%59|200x200%60");
   int64_t id2 = display_manager()->GetSecondaryDisplay().id();
   ASSERT_EQ(0, accept_count());
@@ -183,9 +180,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, ClickMeansAccept) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x300#300x300%57|200x200%58,250x250#250x250%59|200x200%60");
   int64_t id2 = display_manager()->GetSecondaryDisplay().id();
   ASSERT_EQ(0, accept_count());
@@ -214,9 +208,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, AcceptButton) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x300#300x300%59|200x200%60");
   const display::Display& display =
       display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -254,9 +245,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, Close) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("100x100,150x150#150x150%59|200x200%60");
   int64_t id2 = display_manager()->GetSecondaryDisplay().id();
   ASSERT_EQ(0, accept_count());
@@ -282,9 +270,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, Timeout) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x300#300x300%59|200x200%60");
   const display::Display& display =
       display::Screen::GetScreen()->GetPrimaryDisplay();
@@ -306,9 +291,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, DisplayDisconnected) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay(
       "300x300#300x300%56|200x200%57,"
       "200x200#250x250%58|200x200%59|100x100%60");
@@ -331,9 +313,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, MultipleResolutionChange) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay(
       "300x300#300x300%56|200x200%57,"
       "250x250#250x250%58|200x200%59");
@@ -372,9 +351,6 @@
 }
 
 TEST_F(ResolutionNotificationControllerTest, Fallback) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay(
       "300x300#300x300%56|200x200%57,"
       "250x250#250x250%58|220x220%59|200x200%60");
diff --git a/ash/display/root_window_transformers_unittest.cc b/ash/display/root_window_transformers_unittest.cc
index eb850a3c..fdcc28b 100644
--- a/ash/display/root_window_transformers_unittest.cc
+++ b/ash/display/root_window_transformers_unittest.cc
@@ -255,9 +255,6 @@
 }
 
 TEST_F(RootWindowTransformersTest, ScaleAndMagnify) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   TestEventHandler event_handler;
   Shell::GetInstance()->AddPreTargetHandler(&event_handler);
 
@@ -423,8 +420,6 @@
 }
 
 TEST_F(RootWindowTransformersTest, LetterBoxPillarBox) {
-  if (!SupportsMultipleDisplays())
-    return;
   test::MirrorWindowTestApi test_api;
   display_manager()->SetMultiDisplayMode(display::DisplayManager::MIRRORING);
   UpdateDisplay("400x200,500x500");
diff --git a/ash/display/screen_ash_unittest.cc b/ash/display/screen_ash_unittest.cc
index 747474f..4f02ab0 100644
--- a/ash/display/screen_ash_unittest.cc
+++ b/ash/display/screen_ash_unittest.cc
@@ -22,9 +22,6 @@
 // Tests that ScreenAsh::GetWindowAtScreenPoint() returns the correct window on
 // the correct display.
 TEST_F(ScreenAshTest, TestGetWindowAtScreenPoint) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,400x400");
 
   aura::test::TestWindowDelegate delegate;
diff --git a/ash/display/unified_mouse_warp_controller_unittest.cc b/ash/display/unified_mouse_warp_controller_unittest.cc
index 6cdc94ea..2fa86f7 100644
--- a/ash/display/unified_mouse_warp_controller_unittest.cc
+++ b/ash/display/unified_mouse_warp_controller_unittest.cc
@@ -155,9 +155,6 @@
 
 // Verifies if MouseCursorEventFilter's bounds calculation works correctly.
 TEST_F(UnifiedMouseWarpControllerTest, BoundaryTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   {
     SCOPED_TRACE("1x1");
     BoundaryTestBody("400x400,0+450-700x400", "400x400,0+450-700x600");
@@ -179,8 +176,6 @@
 // Verifies if the mouse pointer correctly moves to another display in
 // unified desktop mode.
 TEST_F(UnifiedMouseWarpControllerTest, WarpMouse) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("500x500,600+0-500x500");
   ASSERT_EQ(1, display::Screen::GetScreen()->GetNumDisplays());
 
diff --git a/ash/display/window_tree_host_manager_unittest.cc b/ash/display/window_tree_host_manager_unittest.cc
index 49c4095..043d802 100644
--- a/ash/display/window_tree_host_manager_unittest.cc
+++ b/ash/display/window_tree_host_manager_unittest.cc
@@ -249,8 +249,6 @@
 
   void TearDown() override {
     test::AshTestBase::TearDown();
-    if (!SupportsMultipleDisplays())
-      return;
 
     // Make sure that primary display is accessible after shutdown.
     display::Display primary =
@@ -425,23 +423,14 @@
                     MaterialDesignController::MATERIAL_EXPERIMENTAL));
 
 TEST_F(WindowTreeHostManagerShutdownTest, Shutdown) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("444x333, 200x200");
 }
 
 TEST_F(WindowTreeHostManagerStartupTest, Startup) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   EXPECT_TRUE(startup_helper()->displays_initialized());
 }
 
 TEST_P(WindowTreeHostManagerTest, SecondaryDisplayLayout) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Creates windows to catch activation change event.
   std::unique_ptr<aura::Window> w1(CreateTestWindowInShellWithId(1));
   w1->Focus();
@@ -604,9 +593,6 @@
 }  // namespace
 
 TEST_P(WindowTreeHostManagerTest, MirrorToDockedWithFullscreen) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Creates windows to catch activation change event.
   std::unique_ptr<aura::Window> w1(CreateTestWindowInShellWithId(1));
   w1->Focus();
@@ -656,9 +642,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, BoundsUpdated) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Creates windows to catch activation change event.
   std::unique_ptr<aura::Window> w1(CreateTestWindowInShellWithId(1));
   w1->Focus();
@@ -769,9 +752,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, FindNearestDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   WindowTreeHostManager* window_tree_host_manager =
       Shell::GetInstance()->window_tree_host_manager();
 
@@ -831,8 +811,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, SwapPrimaryById) {
-  if (!SupportsMultipleDisplays())
-    return;
   const int height_offset = GetMdMaximizedWindowHeightOffset();
 
   WindowTreeHostManager* window_tree_host_manager =
@@ -983,8 +961,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, SetPrimaryWithThreeDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("500x400,400x300,300x200");
   int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
   display::DisplayIdList non_primary_ids =
@@ -1105,8 +1081,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, SetPrimaryWithFourDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("600x500,500x400,400x300,300x200");
   int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
   display::DisplayIdList non_primary_ids =
@@ -1216,9 +1190,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, OverscanInsets) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   WindowTreeHostManager* window_tree_host_manager =
       Shell::GetInstance()->window_tree_host_manager();
   TestEventHandler event_handler;
@@ -1266,9 +1237,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, Rotate) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   TestEventHandler event_handler;
   Shell::GetInstance()->AddPreTargetHandler(&event_handler);
 
@@ -1323,7 +1291,6 @@
             GetActiveDisplayRotation(display2_id));
   EXPECT_EQ(1, observer.GetRotationChangedCountAndReset());
 
-#if !defined(OS_WIN)
   ui::test::EventGenerator generator2(root_windows[1]);
   generator2.MoveMouseToInHost(50, 40);
   EXPECT_EQ("179,25", event_handler.GetLocationAndReset());
@@ -1344,15 +1311,11 @@
 
   generator1.MoveMouseToInHost(50, 40);
   EXPECT_EQ("69,159", event_handler.GetLocationAndReset());
-#endif
 
   Shell::GetInstance()->RemovePreTargetHandler(&event_handler);
 }
 
 TEST_P(WindowTreeHostManagerTest, ScaleRootWindow) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   TestEventHandler event_handler;
   Shell::GetInstance()->AddPreTargetHandler(&event_handler);
 
@@ -1388,9 +1351,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, TouchScale) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   TestEventHandler event_handler;
   Shell::GetInstance()->AddPreTargetHandler(&event_handler);
 
@@ -1420,9 +1380,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, ConvertHostToRootCoords) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   TestEventHandler event_handler;
   Shell::GetInstance()->AddPreTargetHandler(&event_handler);
 
@@ -1482,9 +1439,6 @@
 // Make sure that the compositor based mirroring can switch
 // from/to dock mode.
 TEST_P(WindowTreeHostManagerTest, DockToSingle) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   const int64_t internal_id = 1;
 
   const display::ManagedDisplayInfo internal_display_info =
@@ -1527,9 +1481,6 @@
 // Tests if switching two displays at the same time while the primary display
 // is swapped should not cause a crash. (crbug.com/426292)
 TEST_P(WindowTreeHostManagerTest, ReplaceSwappedPrimary) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   const display::ManagedDisplayInfo first_display_info =
       CreateDisplayInfo(10, 0, display::Display::ROTATE_0);
   const display::ManagedDisplayInfo second_display_info =
@@ -1590,9 +1541,6 @@
 // in one configuration event.
 // See crbug.com/547280.
 TEST_P(WindowTreeHostManagerTest, ReplacePrimary) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   display::ManagedDisplayInfo first_display_info =
       CreateDisplayInfo(10, 0, display::Display::ROTATE_0);
   first_display_info.SetBounds(gfx::Rect(0, 0, 400, 400));
@@ -1621,9 +1569,6 @@
 }
 
 TEST_P(WindowTreeHostManagerTest, UpdateMouseLocationAfterDisplayChange) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,300x300");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -1665,9 +1610,6 @@
 
 TEST_P(WindowTreeHostManagerTest,
        UpdateMouseLocationAfterDisplayChange_2ndOnLeft) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Set the 2nd display on the left.
   display::DisplayLayoutStore* layout_store = display_manager()->layout_store();
   display::DisplayPlacement new_default(display::DisplayPlacement::LEFT, 0);
@@ -1704,9 +1646,6 @@
 // are updated when the primary display is swapped.
 TEST_P(WindowTreeHostManagerTest,
        UpdateMouseLocationAfterDisplayChange_SwapPrimary) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,200x200*2/r");
 
   aura::Env* env = aura::Env::GetInstance();
@@ -1733,9 +1672,6 @@
 // and rotation are updated when the primary display is disconnected.
 TEST_P(WindowTreeHostManagerTest,
        UpdateMouseLocationAfterDisplayChange_PrimaryDisconnected) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   aura::Env* env = aura::Env::GetInstance();
   Shell* shell = Shell::GetInstance();
   WindowTreeHostManager* window_tree_host_manager =
@@ -1769,9 +1705,6 @@
 // OnDisplayRemoved() should not cause crash. See http://crbug.com/415222
 TEST_P(WindowTreeHostManagerTest,
        GetRootWindowForDisplayIdDuringDisplayDisconnection) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x300,200x200");
   aura::Window* root2 = Shell::GetInstance()
                             ->window_tree_host_manager()
diff --git a/ash/drag_drop/drag_drop_controller_unittest.cc b/ash/drag_drop/drag_drop_controller_unittest.cc
index dba9ef0..5218187 100644
--- a/ash/drag_drop/drag_drop_controller_unittest.cc
+++ b/ash/drag_drop/drag_drop_controller_unittest.cc
@@ -936,9 +936,6 @@
 // Verifies the drag image moves back to the position where drag is started
 // across displays when drag is cancelled.
 TEST_F(DragDropControllerTest, DragCancelAcrossDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   aura::Window::Windows root_windows =
       Shell::GetInstance()->GetAllRootWindows();
@@ -1017,9 +1014,6 @@
 
 // Verifies that a drag is aborted if a display is disconnected during the drag.
 TEST_F(DragDropControllerTest, DragCancelOnDisplayDisconnect) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   for (aura::Window* root : Shell::GetInstance()->GetAllRootWindows()) {
     aura::client::SetDragDropClient(root, drag_drop_controller_.get());
diff --git a/ash/drag_drop/drag_drop_interactive_uitest.cc b/ash/drag_drop/drag_drop_interactive_uitest.cc
index 886d186..4c0e0d0 100644
--- a/ash/drag_drop/drag_drop_interactive_uitest.cc
+++ b/ash/drag_drop/drag_drop_interactive_uitest.cc
@@ -116,9 +116,6 @@
 // Test if the mouse gets moved properly to another display
 // during drag & drop operation.
 TEST_F(DragDropTest, DragDropAcrossMultiDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   aura::Window::Windows root_windows =
       Shell::GetInstance()->GetAllRootWindows();
diff --git a/ash/drag_drop/drag_drop_tracker_unittest.cc b/ash/drag_drop/drag_drop_tracker_unittest.cc
index 9e4cf69..3694b062 100644
--- a/ash/drag_drop/drag_drop_tracker_unittest.cc
+++ b/ash/drag_drop/drag_drop_tracker_unittest.cc
@@ -50,9 +50,6 @@
 };
 
 TEST_F(DragDropTrackerTest, GetTarget) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,300x300");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   EXPECT_EQ(2U, root_windows.size());
@@ -115,9 +112,6 @@
 }
 
 TEST_F(DragDropTrackerTest, ConvertEvent) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("200x200,300x300");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   EXPECT_EQ(2U, root_windows.size());
diff --git a/ash/extended_desktop_unittest.cc b/ash/extended_desktop_unittest.cc
index 001902b..8747c72 100644
--- a/ash/extended_desktop_unittest.cc
+++ b/ash/extended_desktop_unittest.cc
@@ -168,9 +168,6 @@
 // Test conditions that root windows in extended desktop mode
 // must satisfy.
 TEST_F(ExtendedDesktopTest, Basic) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -190,9 +187,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, Activation) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -224,9 +218,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, SystemModal) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -261,9 +252,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, TestCursor) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   aura::WindowTreeHost* host0 = root_windows[0]->GetHost();
@@ -276,9 +264,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, TestCursorLocation) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   aura::test::WindowTestApi root_window0_test_api(root_windows[0]);
@@ -302,9 +287,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, GetRootWindowAt) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("700x500,500x500");
   SetSecondaryDisplayLayout(display::DisplayPlacement::LEFT);
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -330,9 +312,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, GetRootWindowMatching) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("700x500,500x500");
   SetSecondaryDisplayLayout(display::DisplayPlacement::LEFT);
 
@@ -370,9 +349,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, Capture) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -440,9 +416,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, CaptureEventLocation) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -475,9 +448,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, CaptureEventLocationHighDPI) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600*2,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -510,9 +480,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, CaptureEventLocationHighDPI_2) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400*2");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -549,9 +516,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, MoveWindow) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   views::Widget* d1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
@@ -583,9 +547,6 @@
 // Verifies if the mouse event arrives to the window even when the window
 // moves to another root in a pre-target handler.  See: crbug.com/157583
 TEST_F(ExtendedDesktopTest, MoveWindowByMouseClick) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
 
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -606,9 +567,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, MoveWindowToDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x1000,1000x1000");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -636,9 +594,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, MoveWindowWithTransient) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 100, 100));
@@ -685,10 +640,7 @@
 }
 
 // Test if the Window::ConvertPointToTarget works across root windows.
-// TODO(oshima): Move multiple display suport and this test to aura.
 TEST_F(ExtendedDesktopTest, ConvertPoint) {
-  if (!SupportsMultipleDisplays())
-    return;
   display::Screen* screen = display::Screen::GetScreen();
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -744,9 +696,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, OpenSystemTray) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x600,600x400");
   SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
   ASSERT_FALSE(tray->HasSystemBubble());
@@ -778,9 +727,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, StayInSameRootWindow) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("100x100,200x200");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   views::Widget* w1 = CreateTestWidget(gfx::Rect(10, 10, 50, 50));
@@ -819,9 +765,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, KeyEventsOnLockScreen) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("100x100,200x200");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -892,9 +835,6 @@
 }
 
 TEST_F(ExtendedDesktopTest, PassiveGrab) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   EventLocationRecordingEventHandler event_handler;
   ash::Shell::GetInstance()->AddPreTargetHandler(&event_handler);
 
diff --git a/ash/magnifier/magnification_controller_unittest.cc b/ash/magnifier/magnification_controller_unittest.cc
index 8f5e7c2c..f765700 100644
--- a/ash/magnifier/magnification_controller_unittest.cc
+++ b/ash/magnifier/magnification_controller_unittest.cc
@@ -673,8 +673,6 @@
 
 // Make sure that unified desktop can enter magnified mode.
 TEST_F(MagnificationControllerTest, EnableMagnifierInUnifiedDesktop) {
-  if (!SupportsMultipleDisplays())
-    return;
   Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true);
 
   EXPECT_EQ(1.0f, GetMagnificationController()->GetScale());
diff --git a/ash/magnifier/partial_magnification_controller_unittest.cc b/ash/magnifier/partial_magnification_controller_unittest.cc
index f0f571e..1c8e4b5bc 100644
--- a/ash/magnifier/partial_magnification_controller_unittest.cc
+++ b/ash/magnifier/partial_magnification_controller_unittest.cc
@@ -89,8 +89,6 @@
 // Verifies that nothing bad happens if a second display is disconnected while
 // the magnifier is active.
 TEST_F(PartialMagnificationControllerTest, MultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
   GetEventGenerator().EnterPenPointerMode();
 
   // Active magnifier with two displays, move it to the second display.
diff --git a/ash/mus/manifest.json b/ash/mus/manifest.json
index 29ca609..99ed7ff 100644
--- a/ash/mus/manifest.json
+++ b/ash/mus/manifest.json
@@ -27,7 +27,7 @@
         "*": [ "accessibility", "app" ],
         "content_browser": [ "ash" ],
         "preferences": [ "preferences_manager" ],
-        "ui": [ "window_manager" ],
+        "ui": [ "display_test", "window_manager" ],
         "touch_hud": [ "mash:launchable" ]
       }
     }
diff --git a/ash/mus/test/ash_test_impl_mus.cc b/ash/mus/test/ash_test_impl_mus.cc
index e4e9186..71a44f4 100644
--- a/ash/mus/test/ash_test_impl_mus.cc
+++ b/ash/mus/test/ash_test_impl_mus.cc
@@ -46,10 +46,6 @@
   wm_test_base_->TearDown();
 }
 
-bool AshTestImplMus::SupportsMultipleDisplays() const {
-  return wm_test_base_->SupportsMultipleDisplays();
-}
-
 void AshTestImplMus::UpdateDisplay(const std::string& display_spec) {
   wm_test_base_->UpdateDisplay(display_spec);
 }
diff --git a/ash/mus/test/ash_test_impl_mus.h b/ash/mus/test/ash_test_impl_mus.h
index 1f62ab3..e0ba272f 100644
--- a/ash/mus/test/ash_test_impl_mus.h
+++ b/ash/mus/test/ash_test_impl_mus.h
@@ -23,7 +23,6 @@
   // AshTestImpl:
   void SetUp() override;
   void TearDown() override;
-  bool SupportsMultipleDisplays() const override;
   void UpdateDisplay(const std::string& display_spec) override;
   std::unique_ptr<WindowOwner> CreateTestWindow(
       const gfx::Rect& bounds_in_screen,
diff --git a/ash/mus/test/wm_test_base.cc b/ash/mus/test/wm_test_base.cc
index 0ba9d4b..487a1caa 100644
--- a/ash/mus/test/wm_test_base.cc
+++ b/ash/mus/test/wm_test_base.cc
@@ -68,10 +68,6 @@
       << "You have overridden TearDown but never called WmTestBase::TearDown";
 }
 
-bool WmTestBase::SupportsMultipleDisplays() const {
-  return true;
-}
-
 void WmTestBase::UpdateDisplay(const std::string& display_spec) {
   test_helper_->UpdateDisplay(display_spec);
 }
diff --git a/ash/mus/test/wm_test_base.h b/ash/mus/test/wm_test_base.h
index d141dc0..a9fe837d7 100644
--- a/ash/mus/test/wm_test_base.h
+++ b/ash/mus/test/wm_test_base.h
@@ -44,9 +44,6 @@
   WmTestBase();
   ~WmTestBase() override;
 
-  // TODO(sky): temporary until http://crbug.com/611563 is fixed.
-  bool SupportsMultipleDisplays() const;
-
   // Update the display configuration as given in |display_spec|.
   // See test::DisplayManagerTestApi::UpdateDisplay for more details.
   void UpdateDisplay(const std::string& display_spec);
diff --git a/ash/mus/top_level_window_factory_unittest.cc b/ash/mus/top_level_window_factory_unittest.cc
index 61a5a21..2e016c1 100644
--- a/ash/mus/top_level_window_factory_unittest.cc
+++ b/ash/mus/top_level_window_factory_unittest.cc
@@ -32,9 +32,6 @@
 using TopLevelWindowFactoryWmTest = mus::WmTestBase;
 
 TEST_F(TopLevelWindowFactoryWmTest, IsWindowShownInCorrectDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   EXPECT_NE(GetPrimaryDisplay().id(), GetSecondaryDisplay().id());
 
diff --git a/ash/root_window_controller_unittest.cc b/ash/root_window_controller_unittest.cc
index c70bd2f..d6369dd0 100644
--- a/ash/root_window_controller_unittest.cc
+++ b/ash/root_window_controller_unittest.cc
@@ -144,8 +144,6 @@
                     MaterialDesignController::MATERIAL_EXPERIMENTAL));
 
 TEST_P(RootWindowControllerTest, MoveWindows_Basic) {
-  if (!SupportsMultipleDisplays())
-    return;
   const int height_offset = GetMdMaximizedWindowHeightOffset();
 
   // Windows origin should be doubled when moved to the 1st display.
@@ -268,9 +266,6 @@
 }
 
 TEST_P(RootWindowControllerTest, MoveWindows_Modal) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
 
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -301,8 +296,6 @@
 
 // Make sure lock related windows moves.
 TEST_P(RootWindowControllerTest, MoveWindows_LockWindowsInUnified) {
-  if (!SupportsMultipleDisplays())
-    return;
   display_manager()->SetUnifiedDesktopEnabled(true);
 
   UpdateDisplay("500x500");
@@ -535,9 +528,6 @@
 }
 
 TEST_P(RootWindowControllerTest, MultipleDisplaysGetWindowForFullscreenMode) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x600,600x600");
   Shell::RootWindowControllerList controllers =
       Shell::GetInstance()->GetAllRootWindowControllers();
@@ -575,8 +565,6 @@
 // Test that GetRootWindowController() works with multiple displays and
 // child widgets.
 TEST_P(RootWindowControllerTest, GetRootWindowController) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("600x600,600x600");
   Shell::RootWindowControllerList controllers =
       Shell::GetInstance()->GetAllRootWindowControllers();
@@ -748,9 +736,6 @@
 // on primary root window if no window has touch capability.
 TEST_F(VirtualKeyboardRootWindowControllerTest,
        VirtualKeyboardOnPrimaryRootWindowDefault) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
 
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -769,9 +754,6 @@
 // a display which has touch capability.
 TEST_F(VirtualKeyboardRootWindowControllerTest,
        VirtualKeyboardOnTouchableDisplayOnly) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
   display::Display secondary_display =
       Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
@@ -822,9 +804,6 @@
 // Test for http://crbug.com/303429. If both of displays have touch capability,
 // virtual keyboard follows the input focus.
 TEST_F(VirtualKeyboardRootWindowControllerTest, FollowInputFocus) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
   const int64_t primary_display_id =
       display::Screen::GetScreen()->GetPrimaryDisplay().id();
@@ -893,9 +872,6 @@
 // capability, the virtual keyboard shows up on the specified display.
 TEST_F(VirtualKeyboardRootWindowControllerTest,
        VirtualKeyboardShowOnSpecifiedDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
   display::Display secondary_display =
       Shell::GetInstance()->display_manager()->GetSecondaryDisplay();
@@ -1087,9 +1063,6 @@
 
 TEST_F(VirtualKeyboardRootWindowControllerTest,
        EnsureCaretInWorkAreaWithMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,600x600");
   const int64_t primary_display_id =
       display::Screen::GetScreen()->GetPrimaryDisplay().id();
diff --git a/ash/screen_util_unittest.cc b/ash/screen_util_unittest.cc
index 13c2363..3d5850e 100644
--- a/ash/screen_util_unittest.cc
+++ b/ash/screen_util_unittest.cc
@@ -30,8 +30,6 @@
                     MaterialDesignController::MATERIAL_EXPERIMENTAL));
 
 TEST_P(ScreenUtilTest, Bounds) {
-  if (!SupportsMultipleDisplays())
-    return;
   const int height_offset = GetMdMaximizedWindowHeightOffset();
 
   UpdateDisplay("600x600,500x500");
@@ -74,9 +72,6 @@
 // Test verifies a stable handling of secondary screen widget changes
 // (crbug.com/226132).
 TEST_P(ScreenUtilTest, StabilityTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x600,500x500");
   views::Widget* secondary = views::Widget::CreateWindowWithContextAndBounds(
       NULL, CurrentContext(), gfx::Rect(610, 10, 100, 100));
@@ -91,9 +86,6 @@
 }
 
 TEST_P(ScreenUtilTest, ConvertRect) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x600,500x500");
 
   views::Widget* primary = views::Widget::CreateWindowWithContextAndBounds(
@@ -123,9 +115,6 @@
 }
 
 TEST_P(ScreenUtilTest, ShelfDisplayBoundsInUnifiedDesktop) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   display_manager()->SetUnifiedDesktopEnabled(true);
 
   views::Widget* widget = views::Widget::CreateWindowWithContextAndBounds(
diff --git a/ash/shelf/shelf_layout_manager_unittest.cc b/ash/shelf/shelf_layout_manager_unittest.cc
index b5ee95f..d3424f0 100644
--- a/ash/shelf/shelf_layout_manager_unittest.cc
+++ b/ash/shelf/shelf_layout_manager_unittest.cc
@@ -755,9 +755,6 @@
 // Test the behavior of the shelf when it is auto hidden and it is on the
 // boundary between the primary and the secondary display.
 TEST_F(ShelfLayoutManagerTest, AutoHideShelfOnScreenBoundary) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
       display::test::CreateDisplayLayout(display_manager(),
@@ -997,9 +994,6 @@
 // to AutoHide, viewing the AppList on one of them doesn't unhide the other
 // hidden shelf.
 TEST_F(ShelfLayoutManagerTest, DualDisplayOpenAppListWithShelfAutoHideState) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Create two displays.
   UpdateDisplay("0+0-200x200,+200+0-100x100");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -1118,9 +1112,6 @@
 // Tests the correct behavior of the shelf when there is a system modal window
 // open when we have dual display.
 TEST_F(ShelfLayoutManagerTest, ShelfWithSystemModalWindowDualDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Create two displays.
   UpdateDisplay("200x200,100x100");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
@@ -1195,9 +1186,6 @@
 // Test the behavior of the shelf when a window on one display is fullscreen
 // but the other display has the active window.
 TEST_F(ShelfLayoutManagerTest, FullscreenWindowOnSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   Shell::RootWindowControllerList root_window_controllers =
@@ -1340,9 +1328,6 @@
 }
 
 TEST_F(ShelfLayoutManagerTest, WindowVisibilityDisablesAutoHide) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   WmShelf* shelf = GetPrimaryShelf();
   ShelfLayoutManager* layout_manager = GetShelfLayoutManager();
@@ -1699,9 +1684,6 @@
 }
 
 TEST_F(ShelfLayoutManagerTest, ShelfLayoutInUnifiedDesktop) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   Shell::GetInstance()->display_manager()->SetUnifiedDesktopEnabled(true);
   UpdateDisplay("500x400, 500x400");
 
diff --git a/ash/shelf/shelf_view_unittest.cc b/ash/shelf/shelf_view_unittest.cc
index 522934a..50a46af 100644
--- a/ash/shelf/shelf_view_unittest.cc
+++ b/ash/shelf/shelf_view_unittest.cc
@@ -197,9 +197,6 @@
 // Make sure creating/deleting an window on one displays notifies a
 // shelf on external display as well as one on primary.
 TEST_F(WmShelfObserverIconTest, AddRemoveWithMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   WmWindow* second_root = WmShell::Get()->GetAllRootWindows()[1];
   WmShelf* second_shelf = second_root->GetRootWindowController()->GetShelf();
@@ -1683,10 +1680,6 @@
 
 // Check the drag insertion bounds of shelf view in multi monitor environment.
 TEST_F(ShelfViewTest, CheckDragInsertBoundsWithMultiMonitor) {
-  // win8-aura doesn't support multiple display.
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   WmShelf* secondary_shelf =
       WmShelf::ForWindow(WmShell::Get()->GetAllRootWindows()[1]);
@@ -1751,10 +1744,6 @@
 
 // Checks the rip an item off from left aligned shelf in secondary monitor.
 TEST_F(ShelfViewTest, CheckRipOffFromLeftShelfAlignmentWithMultiMonitor) {
-  // win8-aura doesn't support multiple display.
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   ASSERT_EQ(2U, WmShell::Get()->GetAllRootWindows().size());
 
diff --git a/ash/shelf/shelf_widget_unittest.cc b/ash/shelf/shelf_widget_unittest.cc
index dc1430a..a2330e3c 100644
--- a/ash/shelf/shelf_widget_unittest.cc
+++ b/ash/shelf/shelf_widget_unittest.cc
@@ -88,9 +88,6 @@
 }
 
 TEST_P(ShelfWidgetTest, TestAlignmentForMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Note that for a left- and right-aligned shelf, this offset must be
   // applied to a maximized window's width rather than its height.
   const int offset = GetMdMaximizedWindowHeightOffset();
@@ -169,9 +166,6 @@
 // container and status widget has finished sizing.
 // See http://crbug.com/252533
 TEST_P(ShelfWidgetTest, ShelfInitiallySizedAfterLogin) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   SetUserLoggedIn(false);
   UpdateDisplay("300x200,400x300");
 
diff --git a/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc b/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc
index b0355d5..a902e92 100644
--- a/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc
+++ b/ash/system/chromeos/rotation/tray_rotation_lock_unittest.cc
@@ -159,8 +159,6 @@
 // Tests that the when the tray view is created for a secondary display, that
 // it is not visible, and that MaximizeMode does not affect visibility.
 TEST_F(TrayRotationLockTest, CreateSecondaryTrayView) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("400x400,200x200");
 
   SetUpForStatusAreaWidget(
@@ -206,8 +204,6 @@
 // Tests that no default view is created when the target is a secondary
 // display.
 TEST_F(TrayRotationLockTest, CreateSecondaryDefaultView) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("400x400,200x200");
 
   TearDownViews();
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc
index dd8c308d..7f5b491 100644
--- a/ash/system/overview/overview_button_tray_unittest.cc
+++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -141,9 +141,6 @@
 // when MaximizeMode has been enabled,  when we are using multiple displays.
 // By default the DisplayManger is in extended mode.
 TEST_F(OverviewButtonTrayTest, DisplaysOnBothDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,200x200");
   EXPECT_FALSE(GetTray()->visible());
   EXPECT_FALSE(GetSecondaryTray()->visible());
@@ -158,9 +155,6 @@
 // Tests if Maximize Mode is enabled before a secondary display is attached
 // that the second OverviewButtonTray should be created in a visible state.
 TEST_F(OverviewButtonTrayTest, SecondaryTrayCreatedVisible) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   WmShell::Get()->maximize_mode_controller()->EnableMaximizeModeWindowManager(
       true);
   UpdateDisplay("400x400,200x200");
diff --git a/ash/system/toast/toast_manager_unittest.cc b/ash/system/toast/toast_manager_unittest.cc
index 4317a4f3..86dad52 100644
--- a/ash/system/toast/toast_manager_unittest.cc
+++ b/ash/system/toast/toast_manager_unittest.cc
@@ -255,8 +255,6 @@
 }
 
 TEST_F(ToastManagerTest, PositionWithUnifiedDesktop) {
-  if (!SupportsMultipleDisplays())
-    return;
   display_manager()->SetUnifiedDesktopEnabled(true);
   UpdateDisplay("1000x500,0+600-100x500");
 
diff --git a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
index 3ae5f22f..e4ac1a1 100644
--- a/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
+++ b/ash/system/web_notification/ash_popup_alignment_delegate_unittest.cc
@@ -196,9 +196,6 @@
 }
 
 TEST_F(AshPopupAlignmentDelegateTest, DockedMode) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   const gfx::Rect toast_size(0, 0, 10, 10);
   UpdateDisplay("600x600");
   int origin_x = alignment_delegate()->GetToastOriginX(toast_size);
@@ -233,8 +230,6 @@
 }
 
 TEST_F(AshPopupAlignmentDelegateTest, Extended) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("600x600,800x800");
   SetAlignmentDelegate(
       base::MakeUnique<AshPopupAlignmentDelegate>(GetPrimaryShelf()));
@@ -253,8 +248,6 @@
 }
 
 TEST_F(AshPopupAlignmentDelegateTest, Unified) {
-  if (!SupportsMultipleDisplays())
-    return;
   display_manager()->SetUnifiedDesktopEnabled(true);
 
   // Reset the delegate as the primary display's shelf will be destroyed during
diff --git a/ash/system/web_notification/web_notification_tray_unittest.cc b/ash/system/web_notification/web_notification_tray_unittest.cc
index d41035b4..262a17f8 100644
--- a/ash/system/web_notification/web_notification_tray_unittest.cc
+++ b/ash/system/web_notification/web_notification_tray_unittest.cc
@@ -266,9 +266,6 @@
 
 // Verifies if the notification appears on both displays when extended mode.
 TEST_P(WebNotificationTrayTest, PopupShownOnBothDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   Shell::GetInstance()
       ->screen_layout_observer()
       ->set_show_notifications_for_testing(true);
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index a0ad32b..69f5942 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -198,11 +198,6 @@
 }
 
 // static
-bool AshTestBase::SupportsMultipleDisplays() {
-  return AshTestHelper::SupportsMultipleDisplays();
-}
-
-// static
 void AshTestBase::UpdateDisplay(const std::string& display_specs) {
   display::test::DisplayManagerTestApi(Shell::GetInstance()->display_manager())
       .UpdateDisplay(display_specs);
diff --git a/ash/test/ash_test_base.h b/ash/test/ash_test_base.h
index 9d7bca1..8b81b2be 100644
--- a/ash/test/ash_test_base.h
+++ b/ash/test/ash_test_base.h
@@ -138,9 +138,6 @@
   // Returns the rotation currently active for the internal display.
   static display::Display::Rotation GetCurrentInternalDisplayRotation();
 
-  // Proxy to AshTestHelper::SupportsMultipleDisplays().
-  static bool SupportsMultipleDisplays();
-
   void set_start_session(bool start_session) { start_session_ = start_session; }
 
   // Sets material mode for the test. This will override material mode set via
diff --git a/ash/test/ash_test_helper.cc b/ash/test/ash_test_helper.cc
index 2e0dd8c..a5a177e 100644
--- a/ash/test/ash_test_helper.cc
+++ b/ash/test/ash_test_helper.cc
@@ -206,15 +206,5 @@
   return root_window;
 }
 
-// static
-bool AshTestHelper::SupportsMultipleDisplays() {
-  // TODO(jamescook): Figure out if we want SupportsMultipleDisplays() to return
-  // false on mustash. If not, remove this function and the AshTestBase version
-  // and remove calls from all the tests. For now just leave the ifdef strings
-  // OS_CHROMEOS and OS_WIN in this comment as a reminder to clean up.
-  // http://crbug.com/682990
-  return true;
-}
-
 }  // namespace test
 }  // namespace ash
diff --git a/ash/test/ash_test_helper.h b/ash/test/ash_test_helper.h
index 73086777..eb6657c 100644
--- a/ash/test/ash_test_helper.h
+++ b/ash/test/ash_test_helper.h
@@ -70,10 +70,6 @@
 
   AshTestEnvironment* ash_test_environment() { return ash_test_environment_; }
 
-  // True if the running environment supports multiple displays,
-  // or false otherwise (e.g. win8 bot).
-  static bool SupportsMultipleDisplays();
-
  private:
   AshTestEnvironment* ash_test_environment_;  // Not owned.
   TestShellDelegate* test_shell_delegate_;  // Owned by ash::Shell.
diff --git a/ash/test/ash_test_impl_aura.cc b/ash/test/ash_test_impl_aura.cc
index 2a19c3f..ec4fa78 100644
--- a/ash/test/ash_test_impl_aura.cc
+++ b/ash/test/ash_test_impl_aura.cc
@@ -51,10 +51,6 @@
   ash_test_base_->TearDown();
 }
 
-bool AshTestImplAura::SupportsMultipleDisplays() const {
-  return ash_test_base_->SupportsMultipleDisplays();
-}
-
 void AshTestImplAura::UpdateDisplay(const std::string& display_spec) {
   ash_test_base_->UpdateDisplay(display_spec);
 }
diff --git a/ash/test/ash_test_impl_aura.h b/ash/test/ash_test_impl_aura.h
index 2740ba1..54a9c99 100644
--- a/ash/test/ash_test_impl_aura.h
+++ b/ash/test/ash_test_impl_aura.h
@@ -22,7 +22,6 @@
   // AshTestImpl:
   void SetUp() override;
   void TearDown() override;
-  bool SupportsMultipleDisplays() const override;
   void UpdateDisplay(const std::string& display_spec) override;
   std::unique_ptr<WindowOwner> CreateTestWindow(
       const gfx::Rect& bounds_in_screen,
diff --git a/ash/tooltips/tooltip_controller_unittest.cc b/ash/tooltips/tooltip_controller_unittest.cc
index 8e9e224..3807957 100644
--- a/ash/tooltips/tooltip_controller_unittest.cc
+++ b/ash/tooltips/tooltip_controller_unittest.cc
@@ -127,9 +127,6 @@
 }
 
 TEST_F(TooltipControllerTest, TooltipsOnMultiDisplayShouldNotCrash) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<views::Widget> widget1(
diff --git a/ash/touch/touch_observer_hud_unittest.cc b/ash/touch/touch_observer_hud_unittest.cc
index f5a3b7d..b7f7235d 100644
--- a/ash/touch/touch_observer_hud_unittest.cc
+++ b/ash/touch/touch_observer_hud_unittest.cc
@@ -310,9 +310,6 @@
 
 // Checks if debug touch HUDs are correctly initialized for two displays.
 TEST_F(TouchHudDebugTest, DualDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a dual display setting.
   SetupDualDisplays();
 
@@ -325,9 +322,6 @@
 // Checks if debug touch HUDs are correctly handled when primary display is
 // changed.
 TEST_F(TouchHudDebugTest, SwapPrimaryDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a dual display setting.
   SetupDualDisplays();
 
@@ -354,9 +348,6 @@
 
 // Checks if debug touch HUDs are correctly handled when displays are mirrored.
 TEST_F(TouchHudDebugTest, MirrorDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a dual display setting.
   SetupDualDisplays();
 
@@ -381,9 +372,6 @@
 // Checks if debug touch HUDs are correctly handled when displays are mirrored
 // after setting the external display as the primary one.
 TEST_F(TouchHudDebugTest, SwapPrimaryThenMirrorDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a dual display setting.
   SetupDualDisplays();
 
@@ -412,9 +400,6 @@
 // Checks if debug touch HUDs are correctly handled when the external display,
 // which is the secondary one, is removed.
 TEST_F(TouchHudDebugTest, RemoveSecondaryDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a dual display setting.
   SetupDualDisplays();
 
@@ -439,9 +424,6 @@
 // Checks if debug touch HUDs are correctly handled when the external display,
 // which is set as the primary display, is removed.
 TEST_F(TouchHudDebugTest, RemovePrimaryDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a dual display setting.
   SetupDualDisplays();
 
@@ -470,9 +452,6 @@
 // Checks if debug touch HUDs are correctly handled when all displays are
 // removed.
 TEST_F(TouchHudDebugTest, Headless) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Setup a single display setting.
   SetupSingleDisplay();
 
diff --git a/ash/utility/screenshot_controller_unittest.cc b/ash/utility/screenshot_controller_unittest.cc
index 77ef0a1..3b65da59b 100644
--- a/ash/utility/screenshot_controller_unittest.cc
+++ b/ash/utility/screenshot_controller_unittest.cc
@@ -256,9 +256,6 @@
 // across multiple monitors
 // cursor. See http://crbug.com/462229
 TEST_F(PartialScreenshotControllerTest, MouseWarpTest) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Create two displays.
   Shell* shell = Shell::GetInstance();
   UpdateDisplay("500x500,500x500");
@@ -418,9 +415,6 @@
 }
 
 TEST_F(WindowScreenshotControllerTest, MultiDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,500x500");
 
   ui::test::EventGenerator& generator(GetEventGenerator());
@@ -450,9 +444,6 @@
 }
 
 TEST_F(ScreenshotControllerTest, MultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   StartPartialScreenshotSession();
   EXPECT_TRUE(IsActive());
   UpdateDisplay("400x400,500x500");
diff --git a/ash/wm/dock/docked_window_layout_manager_unittest.cc b/ash/wm/dock/docked_window_layout_manager_unittest.cc
index d3c24f9c..6fcd020f 100644
--- a/ash/wm/dock/docked_window_layout_manager_unittest.cc
+++ b/ash/wm/dock/docked_window_layout_manager_unittest.cc
@@ -323,9 +323,6 @@
 // RearrangeVisibleWindowOnShow places windows flush with work area edges.
 // Test case for the secondary screen.
 TEST_P(DockedWindowLayoutManagerTest, AutoPlacingRightSecondScreen) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Create a dual screen layout.
   UpdateDisplay("600x600,600x600");
 
@@ -499,9 +496,6 @@
 
 // Adds three windows in bottom display and tests layout after a drag.
 TEST_P(DockedWindowLayoutManagerTest, ThreeWindowsDraggingSecondScreen) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Create two screen vertical layout.
   UpdateDisplay("600x1000,600x1000");
   // Layout the secondary display to the bottom of the primary.
@@ -776,9 +770,6 @@
 // Tests that a docked window is moved to primary display when secondary display
 // is disconnected and that it stays docked and properly positioned.
 TEST_P(DockedWindowLayoutManagerTest, DisplayDisconnectionMovesDocked) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Create a dual screen layout.
   UpdateDisplay("600x700,800x600");
 
diff --git a/ash/wm/dock/docked_window_resizer_unittest.cc b/ash/wm/dock/docked_window_resizer_unittest.cc
index 4e5361e..a09e167 100644
--- a/ash/wm/dock/docked_window_resizer_unittest.cc
+++ b/ash/wm/dock/docked_window_resizer_unittest.cc
@@ -653,9 +653,6 @@
 
 // Move a docked window to the second display
 TEST_P(DockedWindowResizerTest, DragAcrossDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x800,800x800");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   EXPECT_EQ(2, static_cast<int>(root_windows.size()));
diff --git a/ash/wm/drag_window_resizer_unittest.cc b/ash/wm/drag_window_resizer_unittest.cc
index de17018..5041d96 100644
--- a/ash/wm/drag_window_resizer_unittest.cc
+++ b/ash/wm/drag_window_resizer_unittest.cc
@@ -179,8 +179,6 @@
 
 // Verifies a window can be moved from the primary display to another.
 TEST_P(DragWindowResizerTest, WindowDragWithMultiDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
   const int height_offset = GetMdMaximizedWindowHeightOffset();
 
   // The secondary display is logically on the right, but on the system (e.g. X)
@@ -304,9 +302,6 @@
 // Verifies that dragging the active window to another display makes the new
 // root window the active root window.
 TEST_P(DragWindowResizerTest, WindowDragWithMultiDisplaysActiveRoot) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // The secondary display is logically on the right, but on the system (e.g. X)
   // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc.
   UpdateDisplay("800x600,800x600");
@@ -343,9 +338,6 @@
 
 // Verifies a window can be moved from the secondary display to primary.
 TEST_P(DragWindowResizerTest, WindowDragWithMultiDisplaysRightToLeft) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   ASSERT_EQ(2U, root_windows.size());
@@ -370,9 +362,6 @@
 
 // Verifies the drag window is shown correctly.
 TEST_P(DragWindowResizerTest, DragWindowController) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   ASSERT_EQ(2U, root_windows.size());
@@ -463,9 +452,6 @@
 }
 
 TEST_P(DragWindowResizerTest, DragWindowControllerAcrossThreeDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x600,400x600,800x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -610,9 +596,6 @@
 // Verifies cursor's device scale factor is updated whe a window is moved across
 // root windows with different device scale factors (http://crbug.com/154183).
 TEST_P(DragWindowResizerTest, CursorDeviceScaleFactor) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // The secondary display is logically on the right, but on the system (e.g. X)
   // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc.
   UpdateDisplay("400x400,800x800*2");
@@ -667,9 +650,6 @@
 
 // Verifies several kinds of windows can be moved across displays.
 TEST_P(DragWindowResizerTest, MoveWindowAcrossDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // The secondary display is logically on the right, but on the system (e.g. X)
   // layer, it's below the primary one. See UpdateDisplay() in ash_test_base.cc.
   UpdateDisplay("400x400,400x400");
diff --git a/ash/wm/immersive_fullscreen_controller_unittest.cc b/ash/wm/immersive_fullscreen_controller_unittest.cc
index 7adb754..a9665e5 100644
--- a/ash/wm/immersive_fullscreen_controller_unittest.cc
+++ b/ash/wm/immersive_fullscreen_controller_unittest.cc
@@ -496,9 +496,6 @@
 // has a vertical display layout (primary display above/below secondary display)
 // and the immersive fullscreen window is on the bottom display.
 TEST_F(ImmersiveFullscreenControllerTest, MouseEventsVerticalDisplayLayout) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Set up initial state.
   UpdateDisplay("800x600,800x600");
   ash::Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
diff --git a/ash/wm/lock_layout_manager_unittest.cc b/ash/wm/lock_layout_manager_unittest.cc
index c1db3cb..ca2bbf98 100644
--- a/ash/wm/lock_layout_manager_unittest.cc
+++ b/ash/wm/lock_layout_manager_unittest.cc
@@ -244,9 +244,6 @@
 }
 
 TEST_F(LockLayoutManagerTest, MultipleMonitors) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x400,400x500");
   gfx::Rect screen_bounds =
       display::Screen::GetScreen()->GetPrimaryDisplay().bounds();
diff --git a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
index 18f000d..616917d 100644
--- a/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
+++ b/ash/wm/maximize_mode/maximize_mode_controller_unittest.cc
@@ -466,9 +466,6 @@
 
 // Test if this case does not crash. See http://crbug.com/462806
 TEST_F(MaximizeModeControllerTest, DisplayDisconnectionDuringOverview) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   std::unique_ptr<aura::Window> w1(
       CreateTestWindowInShellWithBounds(gfx::Rect(0, 0, 100, 100)));
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index c943534..f114e13f9 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -1110,9 +1110,6 @@
 // Tests that clicking on the close button on a secondary display effectively
 // closes the window.
 TEST_F(WindowSelectorTest, CloseButtonOnMultipleDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
@@ -1437,9 +1434,6 @@
 // Tests that windows remain on the display they are currently on in overview
 // mode, and that the close buttons are on matching displays.
 TEST_F(WindowSelectorTest, MultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   gfx::Rect bounds1(0, 0, 400, 400);
@@ -1514,9 +1508,6 @@
 
 // Tests removing a display during overview.
 TEST_F(WindowSelectorTest, RemoveDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   gfx::Rect bounds1(0, 0, 100, 100);
   gfx::Rect bounds2(450, 0, 100, 100);
@@ -1697,9 +1688,6 @@
 
 // Tests basic selection across multiple monitors.
 TEST_F(WindowSelectorTest, BasicMultiMonitorArrowKeyNavigation) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   gfx::Rect bounds1(0, 0, 100, 100);
   gfx::Rect bounds2(450, 0, 100, 100);
@@ -1731,9 +1719,6 @@
 // Tests first monitor when display order doesn't match left to right screen
 // positions.
 TEST_F(WindowSelectorTest, MultiMonitorReversedOrder) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400");
   Shell::GetInstance()->display_manager()->SetLayoutForCurrentDisplays(
       display::test::CreateDisplayLayout(display_manager(),
@@ -1764,9 +1749,6 @@
 
 // Tests three monitors where the grid becomes empty on one of the monitors.
 TEST_F(WindowSelectorTest, ThreeMonitor) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,400x400,400x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   gfx::Rect bounds1(0, 0, 100, 100);
diff --git a/ash/wm/panels/panel_layout_manager_unittest.cc b/ash/wm/panels/panel_layout_manager_unittest.cc
index d9ee44ab..5c8c445 100644
--- a/ash/wm/panels/panel_layout_manager_unittest.cc
+++ b/ash/wm/panels/panel_layout_manager_unittest.cc
@@ -386,9 +386,6 @@
 }
 
 TEST_F(PanelLayoutManagerTest, PanelAlignsToHiddenLauncherIconSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Keep the displays wide so that shelves have enough space for shelves
   // buttons.
   UpdateDisplay("400x400,600x400");
@@ -651,9 +648,6 @@
 }
 
 TEST_F(PanelLayoutManagerTest, PanelMoveBetweenMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Keep the displays wide so that shelves have enough space for launcher
   // buttons.
   UpdateDisplay("600x400,600x400");
@@ -734,9 +728,6 @@
 }
 
 TEST_F(PanelLayoutManagerTest, PanelAttachPositionMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Keep the displays wide so that shelves have enough space for shelf buttons.
   // Use differently sized displays so the shelf is in a different
   // position on second display.
@@ -758,9 +749,6 @@
 }
 
 TEST_F(PanelLayoutManagerTest, PanelAlignmentSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
 
diff --git a/ash/wm/panels/panel_window_resizer_unittest.cc b/ash/wm/panels/panel_window_resizer_unittest.cc
index 692949f..987cb27b 100644
--- a/ash/wm/panels/panel_window_resizer_unittest.cc
+++ b/ash/wm/panels/panel_window_resizer_unittest.cc
@@ -270,9 +270,6 @@
 }
 
 TEST_F(PanelWindowResizerTest, PanelDetachReattachMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(600, 0)));
@@ -281,9 +278,6 @@
 }
 
 TEST_F(PanelWindowResizerTest, DetachThenDragAcrossDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
@@ -309,9 +303,6 @@
 }
 
 TEST_F(PanelWindowResizerTest, DetachAcrossDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
@@ -328,9 +319,6 @@
 }
 
 TEST_F(PanelWindowResizerTest, DetachThenAttachToSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
@@ -360,9 +348,6 @@
 }
 
 TEST_F(PanelWindowResizerTest, AttachToSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
@@ -385,9 +370,6 @@
 }
 
 TEST_F(PanelWindowResizerTest, AttachToSecondFullscreenDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("600x400,600x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   std::unique_ptr<aura::Window> window(CreatePanelWindow(gfx::Point(0, 0)));
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index 7f9d7b51..ede38a7 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -584,9 +584,6 @@
 }
 
 TEST_F(SystemModalContainerLayoutManagerTest, MultiDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500,500x500");
 
   std::unique_ptr<aura::Window> normal(OpenToplevelTestWindow(false));
@@ -893,9 +890,6 @@
 
 // Make sure that events are properly blocked in multi displays environment.
 TEST_F(SystemModalContainerLayoutManagerTest, BlockEventsInMultiDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x500, 500x500");
   InputTestDelegate delegate;
   delegate.RunTest(this);
diff --git a/ash/wm/toplevel_window_event_handler_unittest.cc b/ash/wm/toplevel_window_event_handler_unittest.cc
index 45e20807..23aa801 100644
--- a/ash/wm/toplevel_window_event_handler_unittest.cc
+++ b/ash/wm/toplevel_window_event_handler_unittest.cc
@@ -814,9 +814,6 @@
 // Tests that dragging a snapped window to another display updates the window's
 // bounds correctly.
 TEST_F(ToplevelWindowEventHandlerTest, DragSnappedWindowToExternalDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("940x550,940x550");
   int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
   int64_t secondary_id = display_manager()->GetSecondaryDisplay().id();
diff --git a/ash/wm/video_detector_unittest.cc b/ash/wm/video_detector_unittest.cc
index e0b384d..33a5c95 100644
--- a/ash/wm/video_detector_unittest.cc
+++ b/ash/wm/video_detector_unittest.cc
@@ -252,9 +252,6 @@
 }
 
 TEST_F(VideoDetectorTest, ReportFullscreen) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("1024x768,1024x768");
 
   std::unique_ptr<aura::Window> window =
diff --git a/ash/wm/window_cycle_controller_unittest.cc b/ash/wm/window_cycle_controller_unittest.cc
index 1694d15..1d758c3 100644
--- a/ash/wm/window_cycle_controller_unittest.cc
+++ b/ash/wm/window_cycle_controller_unittest.cc
@@ -394,9 +394,6 @@
 }
 
 TEST_F(WindowCycleControllerTest, AlwaysOnTopMultipleRootWindows) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Set up a second root window
   UpdateDisplay("1000x600,600x400");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
diff --git a/ash/wm/window_positioner_unittest.cc b/ash/wm/window_positioner_unittest.cc
index 72ba0f2..c1272114 100644
--- a/ash/wm/window_positioner_unittest.cc
+++ b/ash/wm/window_positioner_unittest.cc
@@ -34,8 +34,6 @@
                     MaterialDesignController::MATERIAL_EXPERIMENTAL));
 
 TEST_P(WindowPositionerTest, OpenMaximizedWindowOnSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
   const int height_offset = GetMdMaximizedWindowHeightOffset();
   // Tests that for a screen that is narrower than kForceMaximizeWidthLimit
   // a new window gets maximized.
@@ -51,9 +49,6 @@
 }
 
 TEST_P(WindowPositionerTest, OpenDefaultWindowOnSecondDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x400,1400x900");
   WmWindow* second_root_window = WmShell::Get()->GetAllRootWindows()[1];
   ScopedRootWindowForNewWindows root_for_new_windows(second_root_window);
diff --git a/ash/wm/window_state_unittest.cc b/ash/wm/window_state_unittest.cc
index c5eff75..c37d8c2 100644
--- a/ash/wm/window_state_unittest.cc
+++ b/ash/wm/window_state_unittest.cc
@@ -65,9 +65,6 @@
 // Test that a window gets properly snapped to the display's edges in a
 // multi monitor environment.
 TEST_P(WindowStateTest, SnapWindowBasic) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("0+0-500x400, 0+500-600x400");
   const gfx::Rect kPrimaryDisplayWorkAreaBounds =
       display::Screen::GetScreen()->GetPrimaryDisplay().work_area();
diff --git a/ash/wm/window_util_unittest.cc b/ash/wm/window_util_unittest.cc
index 0ce54364..719bb26c 100644
--- a/ash/wm/window_util_unittest.cc
+++ b/ash/wm/window_util_unittest.cc
@@ -27,9 +27,6 @@
 typedef test::AshTestBase WindowUtilTest;
 
 TEST_F(WindowUtilTest, CenterWindow) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("500x400, 600x400");
   std::unique_ptr<aura::Window> window(
       CreateTestWindowInShellWithBounds(gfx::Rect(12, 20, 100, 100)));
diff --git a/ash/wm/workspace/workspace_layout_manager_unittest.cc b/ash/wm/workspace/workspace_layout_manager_unittest.cc
index f7e23e4..426e7bc 100644
--- a/ash/wm/workspace/workspace_layout_manager_unittest.cc
+++ b/ash/wm/workspace/workspace_layout_manager_unittest.cc
@@ -118,9 +118,6 @@
   EXPECT_EQ("0,0 100x100", window_state->GetRestoreBoundsInScreen().ToString());
   EXPECT_EQ("10,15 25x35", window->GetBounds().ToString());
 
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("400x300,500x400");
   window->SetBoundsInScreen(gfx::Rect(600, 0, 100, 100), GetSecondaryDisplay());
   EXPECT_EQ(WmShell::Get()->GetAllRootWindows()[1], window->GetRootWindow());
@@ -141,9 +138,6 @@
 }
 
 TEST_F(WorkspaceLayoutManagerTest, KeepMinimumVisibilityInDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("300x400,400x500");
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
 
@@ -219,8 +213,6 @@
 }
 
 TEST_F(WorkspaceLayoutManagerTest, MaximizeInDisplayToBeRestored) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("300x400,400x500");
 
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
@@ -281,8 +273,6 @@
 }
 
 TEST_F(WorkspaceLayoutManagerTest, FullscreenInDisplayToBeRestored) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("300x400,400x500");
 
   WmWindow::Windows root_windows = WmShell::Get()->GetAllRootWindows();
diff --git a/ash/wm/workspace/workspace_window_resizer_unittest.cc b/ash/wm/workspace/workspace_window_resizer_unittest.cc
index 5cb6db0..fd7d30b1 100644
--- a/ash/wm/workspace/workspace_window_resizer_unittest.cc
+++ b/ash/wm/workspace/workspace_window_resizer_unittest.cc
@@ -586,13 +586,10 @@
               window_state->GetRestoreBoundsInScreen().ToString());
   }
 
-  // Test if the restore bounds is correct in multiple displays.
-  if (!SupportsMultipleDisplays())
-    return;
-
   // Restore the window to clear snapped state.
   window_state->Restore();
 
+  // Test if the restore bounds is correct in multiple displays.
   UpdateDisplay("800x600,500x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   EXPECT_EQ(root_windows[0], window_->GetRootWindow());
@@ -635,9 +632,6 @@
 }
 
 TEST_P(WorkspaceWindowResizerTest, CancelSnapPhantom) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   aura::Window::Windows root_windows = Shell::GetAllRootWindows();
   ASSERT_EQ(2U, root_windows.size());
@@ -810,9 +804,6 @@
 
 // Makes sure we don't allow dragging on the work area with multidisplay.
 TEST_P(WorkspaceWindowResizerTest, DontDragOffBottomWithMultiDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("800x600,800x600");
   ASSERT_EQ(2, display::Screen::GetScreen()->GetNumDisplays());
 
@@ -977,9 +968,6 @@
                 base::IntToString(window_width) + "x380",
             window_->bounds().ToString());
 
-  if (!SupportsMultipleDisplays())
-    return;
-
   // With secondary display.  Operation itself is same but doesn't change
   // the position because the window is still within the secondary display.
   UpdateDisplay("1000x600,600x400");
diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc
index f47dbd7..75832654 100644
--- a/base/metrics/field_trial.cc
+++ b/base/metrics/field_trial.cc
@@ -75,14 +75,15 @@
 // TrialName, GroupName, ParamKey1, ParamValue1, ParamKey2, ParamValue2, ...
 // If there are no parameters, then it just ends at GroupName.
 bool PickleFieldTrial(const FieldTrial::State& trial_state, Pickle* pickle) {
-  if (!WriteStringPair(pickle, trial_state.trial_name, trial_state.group_name))
+  if (!WriteStringPair(pickle, *trial_state.trial_name,
+                       *trial_state.group_name)) {
     return false;
+  }
 
   // Get field trial params.
   std::map<std::string, std::string> params;
   FieldTrialParamAssociator::GetInstance()->GetFieldTrialParamsWithoutFallback(
-      trial_state.trial_name.as_string(), trial_state.group_name.as_string(),
-      &params);
+      *trial_state.trial_name, *trial_state.group_name, &params);
 
   // Write params to pickle.
   for (const auto& param : params) {
@@ -138,11 +139,18 @@
   return std::min(result, divisor - 1);
 }
 
+// Separate type from FieldTrial::State so that it can use StringPieces.
+struct FieldTrialStringEntry {
+  StringPiece trial_name;
+  StringPiece group_name;
+  bool activated = false;
+};
+
 // Parses the --force-fieldtrials string |trials_string| into |entries|.
 // Returns true if the string was parsed correctly. On failure, the |entries|
 // array may end up being partially filled.
 bool ParseFieldTrialsString(const std::string& trials_string,
-                            std::vector<FieldTrial::State>* entries) {
+                            std::vector<FieldTrialStringEntry>* entries) {
   const StringPiece trials_string_piece(trials_string);
 
   size_t next_item = 0;
@@ -157,7 +165,7 @@
     if (group_name_end == trials_string.npos)
       group_name_end = trials_string.length();
 
-    FieldTrial::State entry;
+    FieldTrialStringEntry entry;
     // Verify if the trial should be activated or not.
     if (trials_string[next_item] == kActivationMarker) {
       // Name cannot be only the indicator.
@@ -242,7 +250,7 @@
 FieldTrial::EntropyProvider::~EntropyProvider() {
 }
 
-FieldTrial::State::State() : activated(false) {}
+FieldTrial::State::State() {}
 
 FieldTrial::State::State(const State& other) = default;
 
@@ -456,8 +464,8 @@
   if (!enable_field_trial_)
     return false;
   FinalizeGroupChoice();
-  field_trial_state->trial_name = trial_name_;
-  field_trial_state->group_name = group_name_;
+  field_trial_state->trial_name = &trial_name_;
+  field_trial_state->group_name = &group_name_;
   field_trial_state->activated = group_reported_;
   return true;
 }
@@ -466,8 +474,8 @@
   if (!enable_field_trial_)
     return false;
   FinalizeGroupChoiceImpl(true);
-  field_trial_state->trial_name = trial_name_;
-  field_trial_state->group_name = group_name_;
+  field_trial_state->trial_name = &trial_name_;
+  field_trial_state->group_name = &group_name_;
   field_trial_state->activated = group_reported_;
   return true;
 }
@@ -655,14 +663,14 @@
     if (!registered.second->GetStateWhileLocked(&trial))
       continue;
     DCHECK_EQ(std::string::npos,
-              trial.trial_name.find(kPersistentStringSeparator));
+              trial.trial_name->find(kPersistentStringSeparator));
     DCHECK_EQ(std::string::npos,
-              trial.group_name.find(kPersistentStringSeparator));
+              trial.group_name->find(kPersistentStringSeparator));
     if (trial.activated)
       output->append(1, kActivationMarker);
-    trial.trial_name.AppendToString(output);
+    output->append(*trial.trial_name);
     output->append(1, kPersistentStringSeparator);
-    trial.group_name.AppendToString(output);
+    output->append(*trial.group_name);
     output->append(1, kPersistentStringSeparator);
   }
 }
@@ -687,7 +695,7 @@
 void FieldTrialList::GetActiveFieldTrialGroupsFromString(
     const std::string& trials_string,
     FieldTrial::ActiveGroups* active_groups) {
-  std::vector<FieldTrial::State> entries;
+  std::vector<FieldTrialStringEntry> entries;
   if (!ParseFieldTrialsString(trials_string, &entries))
     return;
 
@@ -739,7 +747,7 @@
   if (trials_string.empty() || !global_)
     return true;
 
-  std::vector<FieldTrial::State> entries;
+  std::vector<FieldTrialStringEntry> entries;
   if (!ParseFieldTrialsString(trials_string, &entries))
     return false;
 
diff --git a/base/metrics/field_trial.h b/base/metrics/field_trial.h
index b2e9bf1e..60a6592 100644
--- a/base/metrics/field_trial.h
+++ b/base/metrics/field_trial.h
@@ -124,11 +124,13 @@
   };
 
   // A triplet representing a FieldTrial, its selected group and whether it's
-  // active.
+  // active. String members are pointers to the underlying strings owned by the
+  // FieldTrial object. Does not use StringPiece to avoid conversions back to
+  // std::string.
   struct BASE_EXPORT State {
-    StringPiece trial_name;
-    StringPiece group_name;
-    bool activated;
+    const std::string* trial_name = nullptr;
+    const std::string* group_name = nullptr;
+    bool activated = false;
 
     State();
     State(const State& other);
diff --git a/base/metrics/field_trial_unittest.cc b/base/metrics/field_trial_unittest.cc
index 7dcbf659..54672e6 100644
--- a/base/metrics/field_trial_unittest.cc
+++ b/base/metrics/field_trial_unittest.cc
@@ -342,12 +342,12 @@
   std::string winner("Winner");
   trial->AppendGroup(winner, 10);
   EXPECT_TRUE(trial->GetState(&field_trial_state));
-  EXPECT_EQ(one_winner, field_trial_state.trial_name);
-  EXPECT_EQ(winner, field_trial_state.group_name);
+  EXPECT_EQ(one_winner, *field_trial_state.trial_name);
+  EXPECT_EQ(winner, *field_trial_state.group_name);
   trial->group();
   EXPECT_TRUE(trial->GetState(&field_trial_state));
-  EXPECT_EQ(one_winner, field_trial_state.trial_name);
-  EXPECT_EQ(winner, field_trial_state.group_name);
+  EXPECT_EQ(one_winner, *field_trial_state.trial_name);
+  EXPECT_EQ(winner, *field_trial_state.group_name);
 
   std::string multi_group("MultiGroup");
   scoped_refptr<FieldTrial> multi_group_trial =
@@ -360,8 +360,8 @@
   // Finalize the group selection by accessing the selected group.
   multi_group_trial->group();
   EXPECT_TRUE(multi_group_trial->GetState(&field_trial_state));
-  EXPECT_EQ(multi_group, field_trial_state.trial_name);
-  EXPECT_EQ(multi_group_trial->group_name(), field_trial_state.group_name);
+  EXPECT_EQ(multi_group, *field_trial_state.trial_name);
+  EXPECT_EQ(multi_group_trial->group_name(), *field_trial_state.group_name);
 }
 
 TEST_F(FieldTrialTest, ActiveGroupsNotFinalized) {
diff --git a/base/metrics/histogram.h b/base/metrics/histogram.h
index 34eb7e3..8a7c3a1 100644
--- a/base/metrics/histogram.h
+++ b/base/metrics/histogram.h
@@ -9,13 +9,11 @@
 // It supports calls to accumulate either time intervals (which are processed
 // as integral number of milliseconds), or arbitrary integral units.
 
-// For Histogram(exponential histogram), LinearHistogram and CustomHistogram,
+// For Histogram (exponential histogram), LinearHistogram and CustomHistogram,
 // the minimum for a declared range is 1 (instead of 0), while the maximum is
-// (HistogramBase::kSampleType_MAX - 1). Currently you can declare histograms
-// with ranges exceeding those limits (e.g. 0 as minimal or
-// HistogramBase::kSampleType_MAX as maximal), but those excesses will be
-// silently clamped to those limits (for backwards compatibility with existing
-// code). Best practice is to not exceed the limits.
+// (HistogramBase::kSampleType_MAX - 1). However, there will always be underflow
+// and overflow buckets added automatically, so a 0 bucket will always exist
+// even when a minimum value of 1 is specified.
 
 // Each use of a histogram with the same name will reference the same underlying
 // data, so it is safe to record to the same histogram from multiple locations
@@ -41,7 +39,7 @@
 // are also counted by the constructor in the user supplied "bucket_count"
 // argument.
 // The above example has an exponential ratio of 2 (doubling the bucket width
-// in each consecutive bucket.  The Histogram class automatically calculates
+// in each consecutive bucket).  The Histogram class automatically calculates
 // the smallest ratio that it can use to construct the number of buckets
 // selected in the constructor.  An another example, if you had 50 buckets,
 // and millisecond time values from 1 to 10000, then the ratio between
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc
index ac83ec60..011d883 100644
--- a/base/metrics/persistent_histogram_allocator.cc
+++ b/base/metrics/persistent_histogram_allocator.cc
@@ -6,6 +6,7 @@
 
 #include <memory>
 
+#include "base/atomicops.h"
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/files/important_file_writer.h"
@@ -44,8 +45,10 @@
 // but that's best since PersistentMemoryAllocator objects (that underlie
 // GlobalHistogramAllocator objects) are explicitly forbidden from doing
 // anything essential at exit anyway due to the fact that they depend on data
-// managed elsewhere and which could be destructed first.
-GlobalHistogramAllocator* g_allocator = nullptr;
+// managed elsewhere and which could be destructed first. An AtomicWord is
+// used instead of std::atomic because the latter can create global ctors
+// and dtors.
+subtle::AtomicWord g_allocator = 0;
 
 // Take an array of range boundaries and create a proper BucketRanges object
 // which is returned to the caller. A return of nullptr indicates that the
@@ -502,7 +505,7 @@
     static bool initialized = false;
     if (!initialized) {
       initialized = true;
-      if (g_allocator) {
+      if (GlobalHistogramAllocator::Get()) {
         DVLOG(1) << "Creating the results-histogram inside persistent"
                  << " memory can cause future allocations to crash if"
                  << " that memory is ever released (for testing).";
@@ -650,7 +653,7 @@
     const HistogramBase* histogram) {
   // This should never be called on the global histogram allocator as objects
   // created there are already within the global statistics recorder.
-  DCHECK_NE(g_allocator, this);
+  DCHECK_NE(GlobalHistogramAllocator::Get(), this);
   DCHECK(histogram);
 
   HistogramBase* existing =
@@ -821,8 +824,9 @@
   // Releasing or changing an allocator is extremely dangerous because it
   // likely has histograms stored within it. If the backing memory is also
   // also released, future accesses to those histograms will seg-fault.
-  CHECK(!g_allocator);
-  g_allocator = allocator.release();
+  CHECK(!subtle::NoBarrier_Load(&g_allocator));
+  subtle::NoBarrier_Store(&g_allocator,
+                          reinterpret_cast<uintptr_t>(allocator.release()));
   size_t existing = StatisticsRecorder::GetHistogramCount();
 
   DVLOG_IF(1, existing)
@@ -831,13 +835,14 @@
 
 // static
 GlobalHistogramAllocator* GlobalHistogramAllocator::Get() {
-  return g_allocator;
+  return reinterpret_cast<GlobalHistogramAllocator*>(
+      subtle::NoBarrier_Load(&g_allocator));
 }
 
 // static
 std::unique_ptr<GlobalHistogramAllocator>
 GlobalHistogramAllocator::ReleaseForTesting() {
-  GlobalHistogramAllocator* histogram_allocator = g_allocator;
+  GlobalHistogramAllocator* histogram_allocator = Get();
   if (!histogram_allocator)
     return nullptr;
   PersistentMemoryAllocator* memory_allocator =
@@ -861,7 +866,7 @@
     DCHECK_NE(kResultHistogram, data->name);
   }
 
-  g_allocator = nullptr;
+  subtle::NoBarrier_Store(&g_allocator, 0);
   return WrapUnique(histogram_allocator);
 };
 
diff --git a/cc/layers/nine_patch_layer.cc b/cc/layers/nine_patch_layer.cc
index 84aaee54..03d3c8f 100644
--- a/cc/layers/nine_patch_layer.cc
+++ b/cc/layers/nine_patch_layer.cc
@@ -70,11 +70,8 @@
   TRACE_EVENT0("cc", "NinePatchLayer::PushPropertiesTo");
   NinePatchLayerImpl* layer_impl = static_cast<NinePatchLayerImpl*>(layer);
 
-  if (!ui_resource_holder_) {
-    layer_impl->SetUIResourceId(0);
-  } else {
+  if (resource_id()) {
     DCHECK(layer_tree_host());
-
     layer_impl->SetLayout(image_aperture_, border_, layer_occlusion_,
                           fill_center_, nearest_neighbor_);
   }
diff --git a/cc/layers/ui_resource_layer.cc b/cc/layers/ui_resource_layer.cc
index b3efe1c..3ec7af8 100644
--- a/cc/layers/ui_resource_layer.cc
+++ b/cc/layers/ui_resource_layer.cc
@@ -14,47 +14,6 @@
 
 namespace cc {
 
-
-namespace {
-
-class ScopedUIResourceHolder : public UIResourceLayer::UIResourceHolder {
- public:
-  static std::unique_ptr<ScopedUIResourceHolder> Create(
-      UIResourceManager* ui_resource_manager,
-      const SkBitmap& skbitmap) {
-    return base::WrapUnique(
-        new ScopedUIResourceHolder(ui_resource_manager, skbitmap));
-  }
-  UIResourceId id() override { return resource_->id(); }
-
- private:
-  ScopedUIResourceHolder(UIResourceManager* ui_resource_manager,
-                         const SkBitmap& skbitmap) {
-    resource_ = ScopedUIResource::Create(ui_resource_manager,
-                                         UIResourceBitmap(skbitmap));
-  }
-
-  std::unique_ptr<ScopedUIResource> resource_;
-};
-
-class SharedUIResourceHolder : public UIResourceLayer::UIResourceHolder {
- public:
-  static std::unique_ptr<SharedUIResourceHolder> Create(UIResourceId id) {
-    return base::WrapUnique(new SharedUIResourceHolder(id));
-  }
-
-  UIResourceId id() override { return id_; }
-
- private:
-  explicit SharedUIResourceHolder(UIResourceId id) : id_(id) {}
-
-  UIResourceId id_;
-};
-
-}  // anonymous namespace
-
-UIResourceLayer::UIResourceHolder::~UIResourceHolder() {}
-
 scoped_refptr<UIResourceLayer> UIResourceLayer::Create() {
   return make_scoped_refptr(new UIResourceLayer());
 }
@@ -110,47 +69,31 @@
   Layer::SetLayerTreeHost(host);
 
   // Recreate the resource held against the new LTH.
-  RecreateUIResourceHolder();
+  RecreateUIResourceIdFromBitmap();
 
   UpdateDrawsContent(HasDrawableContent());
 }
 
-void UIResourceLayer::RecreateUIResourceHolder() {
-  if (!bitmap_.empty())
-    SetBitmap(bitmap_);
-}
-
-void UIResourceLayer::SetBitmap(const SkBitmap& skbitmap) {
-  bitmap_ = skbitmap;
-  if (GetLayerTree() && !bitmap_.empty()) {
-    ui_resource_holder_ = ScopedUIResourceHolder::Create(
-        layer_tree_host()->GetUIResourceManager(), bitmap_);
-  } else {
-    ui_resource_holder_ = nullptr;
-  }
-  UpdateDrawsContent(HasDrawableContent());
-  SetNeedsCommit();
+void UIResourceLayer::SetBitmap(const SkBitmap& bitmap) {
+  bitmap_ = bitmap;
+  if (!GetLayerTree())
+    return;
+  SetUIResourceIdInternal(
+      layer_tree_host()->GetUIResourceManager()->GetOrCreateUIResource(bitmap));
 }
 
 void UIResourceLayer::SetUIResourceId(UIResourceId resource_id) {
-  if (ui_resource_holder_ && ui_resource_holder_->id() == resource_id)
+  // Even if the ID is not changing we should drop the bitmap. The ID is 0 when
+  // there's no layer tree. When setting an id (even if to 0), we should no
+  // longer keep the bitmap.
+  bitmap_.reset();
+  if (resource_id_ == resource_id)
     return;
-
-  if (!bitmap_.isNull())
-    bitmap_.reset();
-
-  if (resource_id)
-    ui_resource_holder_ = SharedUIResourceHolder::Create(resource_id);
-  else
-    ui_resource_holder_ = nullptr;
-
-  UpdateDrawsContent(HasDrawableContent());
-  SetNeedsCommit();
+  SetUIResourceIdInternal(resource_id);
 }
 
 bool UIResourceLayer::HasDrawableContent() const {
-  return ui_resource_holder_ && ui_resource_holder_->id() &&
-         Layer::HasDrawableContent();
+  return resource_id_ && Layer::HasDrawableContent();
 }
 
 void UIResourceLayer::PushPropertiesTo(LayerImpl* layer) {
@@ -158,19 +101,28 @@
   TRACE_EVENT0("cc", "UIResourceLayer::PushPropertiesTo");
   UIResourceLayerImpl* layer_impl = static_cast<UIResourceLayerImpl*>(layer);
 
-  if (!ui_resource_holder_) {
-    layer_impl->SetUIResourceId(0);
-  } else {
+  layer_impl->SetUIResourceId(resource_id_);
+  if (resource_id_) {
     DCHECK(GetLayerTree());
 
     gfx::Size image_size =
         layer_tree_host()->GetUIResourceManager()->GetUIResourceSize(
-            ui_resource_holder_->id());
-    layer_impl->SetUIResourceId(ui_resource_holder_->id());
+            resource_id_);
     layer_impl->SetImageBounds(image_size);
     layer_impl->SetUV(uv_top_left_, uv_bottom_right_);
     layer_impl->SetVertexOpacity(vertex_opacity_);
   }
 }
 
+void UIResourceLayer::RecreateUIResourceIdFromBitmap() {
+  if (!bitmap_.empty())
+    SetBitmap(bitmap_);
+}
+
+void UIResourceLayer::SetUIResourceIdInternal(UIResourceId resource_id) {
+  resource_id_ = resource_id;
+  UpdateDrawsContent(HasDrawableContent());
+  SetNeedsCommit();
+}
+
 }  // namespace cc
diff --git a/cc/layers/ui_resource_layer.h b/cc/layers/ui_resource_layer.h
index c97c60c..0dbe6d0 100644
--- a/cc/layers/ui_resource_layer.h
+++ b/cc/layers/ui_resource_layer.h
@@ -25,11 +25,14 @@
 
   void SetLayerTreeHost(LayerTreeHost* host) override;
 
+  // Sets the resource. If they don't exist already, the shared UI resource and
+  // ID are generated and cached in a map in the associated UIResourceManager.
+  // Currently, this resource will never be released by the UIResourceManager.
   void SetBitmap(const SkBitmap& skbitmap);
 
-  // An alternative way of setting the resource to allow for sharing. If you use
-  // this method, you are responsible for updating the ID if the layer moves
-  // between compositors.
+  // An alternative way of setting the resource where an ID is used directly. If
+  // you use this method, you are responsible for updating the ID if the layer
+  // moves between compositors.
   void SetUIResourceId(UIResourceId resource_id);
 
   // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1).
@@ -42,29 +45,28 @@
                         float top_right,
                         float bottom_right);
 
-  class UIResourceHolder {
-   public:
-    virtual UIResourceId id() = 0;
-    virtual ~UIResourceHolder();
-  };
-
  protected:
   UIResourceLayer();
   ~UIResourceLayer() override;
 
   bool HasDrawableContent() const override;
 
-  std::unique_ptr<UIResourceHolder> ui_resource_holder_;
+  UIResourceId resource_id() const { return resource_id_; }
+
+ private:
+  std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
+  void RecreateUIResourceIdFromBitmap();
+  void SetUIResourceIdInternal(UIResourceId resource_id);
+
+  // The resource ID will be zero when it's unset or when there's no associated
+  // LayerTreeHost.
+  UIResourceId resource_id_ = 0;
   SkBitmap bitmap_;
 
   gfx::PointF uv_top_left_;
   gfx::PointF uv_bottom_right_;
   float vertex_opacity_[4];
 
- private:
-  std::unique_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
-  void RecreateUIResourceHolder();
-
   DISALLOW_COPY_AND_ASSIGN(UIResourceLayer);
 };
 
diff --git a/cc/layers/ui_resource_layer_unittest.cc b/cc/layers/ui_resource_layer_unittest.cc
index a018e716..17dc4da 100644
--- a/cc/layers/ui_resource_layer_unittest.cc
+++ b/cc/layers/ui_resource_layer_unittest.cc
@@ -9,13 +9,9 @@
 #include "cc/resources/resource_provider.h"
 #include "cc/resources/scoped_ui_resource.h"
 #include "cc/test/fake_layer_tree_host.h"
-#include "cc/test/fake_layer_tree_host_client.h"
-#include "cc/test/fake_output_surface.h"
-#include "cc/test/fake_output_surface_client.h"
 #include "cc/test/geometry_test_utils.h"
+#include "cc/test/layer_test_common.h"
 #include "cc/test/stub_layer_tree_host_single_thread_client.h"
-#include "cc/test/test_task_graph_runner.h"
-#include "cc/trees/layer_tree_host.h"
 #include "cc/trees/single_thread_proxy.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -35,11 +31,8 @@
     return make_scoped_refptr(new TestUIResourceLayer());
   }
 
-  UIResourceId GetUIResourceId() {
-    if (ui_resource_holder_)
-      return ui_resource_holder_->id();
-    return 0;
-  }
+  using UIResourceLayer::resource_id;
+  using UIResourceLayer::HasDrawableContent;
 
  protected:
   TestUIResourceLayer() : UIResourceLayer() { SetIsDrawable(true); }
@@ -48,23 +41,14 @@
 
 class UIResourceLayerTest : public testing::Test {
  protected:
-  void SetUp() override {
-    animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN);
-    layer_tree_host_ = FakeLayerTreeHost::Create(
-        &fake_client_, &task_graph_runner_, animation_host_.get());
-    layer_tree_host_->InitializeSingleThreaded(
-        &single_thread_client_, base::ThreadTaskRunnerHandle::Get());
-  }
-
   void TearDown() override {
-    Mock::VerifyAndClearExpectations(layer_tree_host_.get());
+    Mock::VerifyAndClearExpectations(layer_tree_host());
   }
 
-  FakeLayerTreeHostClient fake_client_;
-  StubLayerTreeHostSingleThreadClient single_thread_client_;
-  TestTaskGraphRunner task_graph_runner_;
-  std::unique_ptr<AnimationHost> animation_host_;
-  std::unique_ptr<FakeLayerTreeHost> layer_tree_host_;
+  FakeLayerTreeHost* layer_tree_host() { return layer_impl_test_.host(); }
+
+ private:
+  LayerTestCommon::LayerImplTest layer_impl_test_;
 };
 
 TEST_F(UIResourceLayerTest, SetBitmap) {
@@ -72,9 +56,9 @@
   ASSERT_TRUE(test_layer.get());
   test_layer->SetBounds(gfx::Size(100, 100));
 
-  layer_tree_host_->SetRootLayer(test_layer);
-  Mock::VerifyAndClearExpectations(layer_tree_host_.get());
-  EXPECT_EQ(test_layer->GetLayerTreeHostForTesting(), layer_tree_host_.get());
+  layer_tree_host()->SetRootLayer(test_layer);
+  Mock::VerifyAndClearExpectations(layer_tree_host());
+  EXPECT_EQ(test_layer->GetLayerTreeHostForTesting(), layer_tree_host());
 
   test_layer->SavePaintProperties();
   test_layer->Update();
@@ -96,9 +80,9 @@
   ASSERT_TRUE(test_layer.get());
   test_layer->SetBounds(gfx::Size(100, 100));
 
-  layer_tree_host_->SetRootLayer(test_layer);
-  Mock::VerifyAndClearExpectations(layer_tree_host_.get());
-  EXPECT_EQ(test_layer->GetLayerTreeHostForTesting(), layer_tree_host_.get());
+  layer_tree_host()->SetRootLayer(test_layer);
+  Mock::VerifyAndClearExpectations(layer_tree_host());
+  EXPECT_EQ(test_layer->GetLayerTreeHostForTesting(), layer_tree_host());
 
   test_layer->SavePaintProperties();
   test_layer->Update();
@@ -107,7 +91,7 @@
 
   bool is_opaque = false;
   std::unique_ptr<ScopedUIResource> resource =
-      ScopedUIResource::Create(layer_tree_host_->GetUIResourceManager(),
+      ScopedUIResource::Create(layer_tree_host()->GetUIResourceManager(),
                                UIResourceBitmap(gfx::Size(10, 10), is_opaque));
   test_layer->SetUIResourceId(resource->id());
   test_layer->Update();
@@ -115,20 +99,21 @@
   EXPECT_TRUE(test_layer->DrawsContent());
 
   // ID is preserved even when you set ID first and attach it to the tree.
-  layer_tree_host_->SetRootLayer(nullptr);
+  layer_tree_host()->SetRootLayer(nullptr);
   std::unique_ptr<ScopedUIResource> shared_resource =
-      ScopedUIResource::Create(layer_tree_host_->GetUIResourceManager(),
+      ScopedUIResource::Create(layer_tree_host()->GetUIResourceManager(),
                                UIResourceBitmap(gfx::Size(5, 5), is_opaque));
   test_layer->SetUIResourceId(shared_resource->id());
-  layer_tree_host_->SetRootLayer(test_layer);
-  EXPECT_EQ(shared_resource->id(), test_layer->GetUIResourceId());
+  layer_tree_host()->SetRootLayer(test_layer);
+  EXPECT_EQ(shared_resource->id(), test_layer->resource_id());
   EXPECT_TRUE(test_layer->DrawsContent());
 }
 
 TEST_F(UIResourceLayerTest, BitmapClearedOnSetUIResourceId) {
-  scoped_refptr<UIResourceLayer> test_layer = TestUIResourceLayer::Create();
+  scoped_refptr<TestUIResourceLayer> test_layer = TestUIResourceLayer::Create();
   ASSERT_TRUE(test_layer.get());
   test_layer->SetBounds(gfx::Size(100, 100));
+  EXPECT_FALSE(test_layer->HasDrawableContent());
 
   SkBitmap bitmap;
   bitmap.allocN32Pixels(10, 10);
@@ -136,11 +121,82 @@
   ASSERT_FALSE(bitmap.isNull());
   ASSERT_TRUE(bitmap.pixelRef()->unique());
 
+  // Without a layer tree, the only additional reference is in UIResourceLayer.
   test_layer->SetBitmap(bitmap);
   ASSERT_FALSE(bitmap.pixelRef()->unique());
+  // Also, there's no drawable content due to the lack of a LTH.
+  EXPECT_FALSE(test_layer->HasDrawableContent());
 
   test_layer->SetUIResourceId(0);
   EXPECT_TRUE(bitmap.pixelRef()->unique());
+  EXPECT_FALSE(test_layer->HasDrawableContent());
+
+  // Add to a layer tree; now the UIResourceManager holds onto a ref
+  // indefinitely.
+  {
+    LayerTestCommon::LayerImplTest impl;
+    impl.host()->SetRootLayer(test_layer);
+
+    test_layer->SetBitmap(bitmap);
+    EXPECT_FALSE(bitmap.pixelRef()->unique());
+    EXPECT_TRUE(test_layer->HasDrawableContent());
+    test_layer->SetUIResourceId(0);
+    EXPECT_FALSE(bitmap.pixelRef()->unique());
+    EXPECT_FALSE(test_layer->HasDrawableContent());
+  }
+
+  // After the layer tree/resource manager are destroyed, refs are back to 1.
+  test_layer->SetUIResourceId(0);
+  EXPECT_TRUE(bitmap.pixelRef()->unique());
+  EXPECT_FALSE(test_layer->HasDrawableContent());
+}
+
+TEST_F(UIResourceLayerTest, SharedBitmap) {
+  SkBitmap bitmap;
+  bitmap.allocN32Pixels(10, 10);
+  bitmap.setImmutable();
+  // The SkPixelRef is what's important, not the SkBitmap itself.
+  SkBitmap bitmap_copy = bitmap;
+
+  scoped_refptr<TestUIResourceLayer> layer1 = TestUIResourceLayer::Create();
+  layer_tree_host()->SetRootLayer(layer1);
+  layer1->SetBitmap(bitmap);
+  bitmap.reset();
+  layer1->SavePaintProperties();
+  layer1->Update();
+  EXPECT_TRUE(layer1->DrawsContent());
+  const auto resource_id = layer1->resource_id();
+
+  // Second layer, same LTH. Resource is shared (has same ID).
+  scoped_refptr<TestUIResourceLayer> layer2 = TestUIResourceLayer::Create();
+  layer_tree_host()->SetRootLayer(layer2);
+  layer2->SetBitmap(bitmap_copy);
+  layer2->SavePaintProperties();
+  layer2->Update();
+  EXPECT_TRUE(layer2->DrawsContent());
+  EXPECT_EQ(resource_id, layer2->resource_id());
+
+  // Change bitmap, different resource id.
+  SkBitmap other_bitmap;
+  other_bitmap.allocN32Pixels(12, 12);
+  other_bitmap.setImmutable();
+  layer2->SetBitmap(other_bitmap);
+  EXPECT_NE(resource_id, layer2->resource_id());
+
+  // Switch layer to different LTH. ID is in a new namespace (LTH), so it may
+  // still be the same. We can make sure it's using the same shared bitmap by
+  // verifying that whatever ID it has, it changes away from and back to when we
+  // change the shared bitmap to something else then back to the original.
+  LayerTestCommon::LayerImplTest impl;
+  impl.host()->SetRootLayer(layer1);
+  layer1->SavePaintProperties();
+  layer1->Update();
+  EXPECT_TRUE(layer1->DrawsContent());
+  const auto other_lth_resource_id = layer1->resource_id();
+  layer1->SetBitmap(other_bitmap);
+  EXPECT_NE(other_lth_resource_id, layer1->resource_id());
+  layer1->SetBitmap(bitmap_copy);
+  EXPECT_EQ(other_lth_resource_id, layer1->resource_id());
 }
 
 }  // namespace
diff --git a/cc/resources/ui_resource_manager.cc b/cc/resources/ui_resource_manager.cc
index e726e11..aadb2558 100644
--- a/cc/resources/ui_resource_manager.cc
+++ b/cc/resources/ui_resource_manager.cc
@@ -2,9 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "cc/resources/ui_resource_manager.h"
+
 #include <algorithm>
 
-#include "cc/resources/ui_resource_manager.h"
+#include "cc/resources/scoped_ui_resource.h"
 
 namespace cc {
 
@@ -33,7 +35,7 @@
 }
 
 void UIResourceManager::DeleteUIResource(UIResourceId uid) {
-  UIResourceClientMap::iterator iter = ui_resource_client_map_.find(uid);
+  const auto iter = ui_resource_client_map_.find(uid);
   if (iter == ui_resource_client_map_.end())
     return;
 
@@ -43,10 +45,9 @@
 }
 
 void UIResourceManager::RecreateUIResources() {
-  for (UIResourceClientMap::iterator iter = ui_resource_client_map_.begin();
-       iter != ui_resource_client_map_.end(); ++iter) {
-    UIResourceId uid = iter->first;
-    const UIResourceClientData& data = iter->second;
+  for (const auto& resource : ui_resource_client_map_) {
+    UIResourceId uid = resource.first;
+    const UIResourceClientData& data = resource.second;
     bool resource_lost = true;
     auto it = std::find_if(ui_resource_request_queue_.begin(),
                            ui_resource_request_queue_.end(),
@@ -62,7 +63,7 @@
 }
 
 gfx::Size UIResourceManager::GetUIResourceSize(UIResourceId uid) const {
-  UIResourceClientMap::const_iterator iter = ui_resource_client_map_.find(uid);
+  const auto iter = ui_resource_client_map_.find(uid);
   if (iter == ui_resource_client_map_.end())
     return gfx::Size();
 
@@ -76,4 +77,17 @@
   return result;
 }
 
+UIResourceId UIResourceManager::GetOrCreateUIResource(const SkBitmap& bitmap) {
+  DCHECK(bitmap.pixelRef()->isImmutable());
+  const auto resource = owned_shared_resources_.find(bitmap.pixelRef());
+  if (resource != owned_shared_resources_.end())
+    return resource->second->id();
+
+  auto scoped_resource =
+      ScopedUIResource::Create(this, UIResourceBitmap(bitmap));
+  auto id = scoped_resource->id();
+  owned_shared_resources_[bitmap.pixelRef()] = std::move(scoped_resource);
+  return id;
+}
+
 }  // namespace cc
diff --git a/cc/resources/ui_resource_manager.h b/cc/resources/ui_resource_manager.h
index 551a285..269929b 100644
--- a/cc/resources/ui_resource_manager.h
+++ b/cc/resources/ui_resource_manager.h
@@ -10,11 +10,10 @@
 
 #include "base/macros.h"
 #include "cc/base/cc_export.h"
-#include "cc/resources/scoped_ui_resource.h"
 #include "cc/resources/ui_resource_request.h"
 
 namespace cc {
-class UIResourceRequest;
+class ScopedUIResource;
 
 class CC_EXPORT UIResourceManager {
  public:
@@ -43,20 +42,30 @@
   // were evicted on the impl thread.
   void RecreateUIResources();
 
+  // Creates a resource given an SkBitmap. Multiple calls with bitmaps that
+  // share the same SkPixelRef will share a single resource ID.
+  UIResourceId GetOrCreateUIResource(const SkBitmap& bitmap);
+
  private:
   struct UIResourceClientData {
     UIResourceClient* client;
     gfx::Size size;
   };
 
-  using UIResourceClientMap =
-      std::unordered_map<UIResourceId, UIResourceClientData>;
-  UIResourceClientMap ui_resource_client_map_;
+  std::unordered_map<UIResourceId, UIResourceClientData>
+      ui_resource_client_map_;
   int next_ui_resource_id_;
 
   using UIResourceRequestQueue = std::vector<UIResourceRequest>;
   UIResourceRequestQueue ui_resource_request_queue_;
 
+  // A map from bitmaps to the ScopedUIResource we've created for them. The
+  // resources are never released over the duration of the lifetime of |this|.
+  // If you want to release a resource added here, add a function (or extend
+  // DeleteUIResource).
+  std::unordered_map<SkPixelRef*, std::unique_ptr<ScopedUIResource>>
+      owned_shared_resources_;
+
   DISALLOW_COPY_AND_ASSIGN(UIResourceManager);
 };
 
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index 8285c7dc..8a76a7f 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -641,12 +641,6 @@
             android:exported="false">
         </activity>
 
-        <!-- Broadcast receiver that will clean up Physical web notifications at scheduled
-             intervals -->
-        <receiver android:name="org.chromium.chrome.browser.physicalweb.ClearNotificationAlarmReceiver"
-            android:exported="false">
-        </receiver>
-
         <!-- Service for handling Nearby Messages -->
         <service android:name="org.chromium.chrome.browser.physicalweb.NearbyMessageIntentService"
             android:exported="false" />
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
index f04c78b..d8c54711 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/DeferredStartupHandler.java
@@ -234,22 +234,20 @@
 
     private void initAsyncDiskTask() {
         new AsyncTask<Void, Void, Void>() {
+            private long mAsyncTaskStartTime;
+
             @Override
             protected Void doInBackground(Void... params) {
                 try {
                     TraceEvent.begin("ChromeBrowserInitializer.onDeferredStartup.doInBackground");
-                    long asyncTaskStartTime = SystemClock.uptimeMillis();
-
-                    // Initialize the WebappRegistry if it's not already initialized. Must be in
-                    // async task due to shared preferences disk access on N.
-                    WebappRegistry.getInstance();
+                    mAsyncTaskStartTime = SystemClock.uptimeMillis();
 
                     boolean crashDumpDisabled = CommandLine.getInstance().hasSwitch(
                             ChromeSwitches.DISABLE_CRASH_DUMP_UPLOAD);
                     if (!crashDumpDisabled) {
                         RecordHistogram.recordLongTimesHistogram(
                                 "UMA.Debug.EnableCrashUpload.Uptime3",
-                                asyncTaskStartTime - UmaUtils.getForegroundStartTime(),
+                                mAsyncTaskStartTime - UmaUtils.getForegroundStartTime(),
                                 TimeUnit.MILLISECONDS);
                         PrivacyPreferencesManager.getInstance().enablePotentialCrashUploading();
                         MinidumpUploadService.tryUploadAllCrashDumps(mAppContext);
@@ -261,6 +259,10 @@
                     MinidumpUploadService.storeBreakpadUploadStatsInUma(
                             ChromePreferenceManager.getInstance(mAppContext));
 
+                    // Initialize the WebappRegistry if it's not already initialized. Must be in
+                    // async task due to shared preferences disk access on N.
+                    WebappRegistry.getInstance();
+
                     // Force a widget refresh in order to wake up any possible zombie widgets.
                     // This is needed to ensure the right behavior when the process is suddenly
                     // killed.
@@ -277,11 +279,6 @@
 
                     cacheIsChromeDefaultBrowser();
 
-                    RecordHistogram.recordLongTimesHistogram(
-                            "UMA.Debug.EnableCrashUpload.DeferredStartUpDurationAsync",
-                            SystemClock.uptimeMillis() - asyncTaskStartTime,
-                            TimeUnit.MILLISECONDS);
-
                     // Warm up all web app shared prefs. This must be run after the WebappRegistry
                     // instance is initialized.
                     WebappRegistry.warmUpSharedPrefs();
@@ -296,6 +293,11 @@
             protected void onPostExecute(Void params) {
                 // Must be run on the UI thread after the WebappRegistry has been completely warmed.
                 WebappRegistry.getInstance().unregisterOldWebapps(System.currentTimeMillis());
+
+                RecordHistogram.recordLongTimesHistogram(
+                        "UMA.Debug.EnableCrashUpload.DeferredStartUpAsyncTaskDuration",
+                        SystemClock.uptimeMillis() - mAsyncTaskStartTime,
+                        TimeUnit.MILLISECONDS);
             }
         }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
     }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ClearNotificationAlarmReceiver.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ClearNotificationAlarmReceiver.java
deleted file mode 100644
index 52a7637..0000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/ClearNotificationAlarmReceiver.java
+++ /dev/null
@@ -1,26 +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.
-
-package org.chromium.chrome.browser.physicalweb;
-
-import android.content.BroadcastReceiver;
-import android.content.Context;
-import android.content.Intent;
-
-import org.chromium.base.Log;
-
-/**
- * A broadcast receiver that clears the UrlManager's notification.
- * This class cannot make native calls because it may not be loaded when the
- * alarm fires.
- */
-public class ClearNotificationAlarmReceiver extends BroadcastReceiver {
-    private static final String TAG = "PhysicalWeb";
-
-    @Override
-    public void onReceive(Context context, Intent intent) {
-        Log.d(TAG, "Running NotificationCleanupAlarmReceiver");
-        UrlManager.getInstance().clearNotification();
-    }
-}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java
index 2c80f0f..e8fe2e3 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebOptInActivity.java
@@ -35,7 +35,6 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.physical_web_optin);
-        PhysicalWebUma.onOptInNotificationPressed();
 
         TextView description = (TextView) findViewById(R.id.physical_web_optin_description);
         description.setMovementMethod(LinkMovementMethod.getInstance());
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
index 35c75e37..f856fcb44 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebUma.java
@@ -32,12 +32,6 @@
             "PhysicalWeb.OptIn.DeclineButtonPressed";
     private static final String OPT_IN_ENABLE_BUTTON_PRESS_COUNT =
             "PhysicalWeb.OptIn.EnableButtonPressed";
-    private static final String OPT_IN_HIGH_PRIORITY_NOTIFICATION_COUNT =
-            "PhysicalWeb.OptIn.HighPriorityNotificationShown";
-    private static final String OPT_IN_MIN_PRIORITY_NOTIFICATION_COUNT =
-            "PhysicalWeb.OptIn.MinPriorityNotificationShown";
-    private static final String OPT_IN_NOTIFICATION_PRESS_COUNT =
-            "PhysicalWeb.OptIn.NotificationPressed";
     private static final String PREFS_FEATURE_DISABLED_COUNT = "PhysicalWeb.Prefs.FeatureDisabled";
     private static final String PREFS_FEATURE_ENABLED_COUNT = "PhysicalWeb.Prefs.FeatureEnabled";
     private static final String PREFS_LOCATION_DENIED_COUNT = "PhysicalWeb.Prefs.LocationDenied";
@@ -45,10 +39,6 @@
     private static final String PWS_BACKGROUND_RESOLVE_TIMES = "PhysicalWeb.ResolveTime.Background";
     private static final String PWS_FOREGROUND_RESOLVE_TIMES = "PhysicalWeb.ResolveTime.Foreground";
     private static final String PWS_REFRESH_RESOLVE_TIMES = "PhysicalWeb.ResolveTime.Refresh";
-    private static final String OPT_IN_NOTIFICATION_PRESS_DELAYS =
-            "PhysicalWeb.ReferralDelay.OptInNotification";
-    private static final String STANDARD_NOTIFICATION_PRESS_DELAYS =
-            "PhysicalWeb.ReferralDelay.StandardNotification";
     private static final String URL_SELECTED_COUNT = "PhysicalWeb.UrlSelected";
     private static final String TOTAL_URLS_INITIAL_COUNTS =
             "PhysicalWeb.TotalUrls.OnInitialDisplay";
@@ -88,27 +78,6 @@
     }
 
     /**
-     * Records a display of a high priority opt-in notification.
-     */
-    public static void onOptInHighPriorityNotificationShown() {
-        handleAction(OPT_IN_HIGH_PRIORITY_NOTIFICATION_COUNT);
-    }
-
-    /**
-     * Records a display of a min priority opt-in notification.
-     */
-    public static void onOptInMinPriorityNotificationShown() {
-        handleAction(OPT_IN_MIN_PRIORITY_NOTIFICATION_COUNT);
-    }
-
-    /**
-     * Records a display of the opt-in activity.
-     */
-    public static void onOptInNotificationPressed() {
-        handleAction(OPT_IN_NOTIFICATION_PRESS_COUNT);
-    }
-
-    /**
      * Records when the user disables the Physical Web fetaure.
      */
     public static void onPrefsFeatureDisabled() {
@@ -196,16 +165,6 @@
     public static void onActivityReferral(int referer) {
         handleEnum(ACTIVITY_REFERRALS, referer, ListUrlsActivity.REFERER_BOUNDARY);
         switch (referer) {
-            case ListUrlsActivity.NOTIFICATION_REFERER:
-                handleTime(STANDARD_NOTIFICATION_PRESS_DELAYS,
-                        UrlManager.getInstance().getTimeSinceNotificationUpdate(),
-                        TimeUnit.MILLISECONDS);
-                break;
-            case ListUrlsActivity.OPTIN_REFERER:
-                handleTime(OPT_IN_NOTIFICATION_PRESS_DELAYS,
-                        UrlManager.getInstance().getTimeSinceNotificationUpdate(),
-                        TimeUnit.MILLISECONDS);
-                break;
             case ListUrlsActivity.PREFERENCE_REFERER:
                 recordPhysicalWebState(LAUNCH_FROM_PREFERENCES);
                 break;
@@ -323,9 +282,6 @@
             uploadActions(URL_SELECTED_COUNT);
             uploadActions(OPT_IN_DECLINE_BUTTON_PRESS_COUNT);
             uploadActions(OPT_IN_ENABLE_BUTTON_PRESS_COUNT);
-            uploadActions(OPT_IN_HIGH_PRIORITY_NOTIFICATION_COUNT);
-            uploadActions(OPT_IN_MIN_PRIORITY_NOTIFICATION_COUNT);
-            uploadActions(OPT_IN_NOTIFICATION_PRESS_COUNT);
             uploadActions(PREFS_FEATURE_DISABLED_COUNT);
             uploadActions(PREFS_FEATURE_ENABLED_COUNT);
             uploadActions(PREFS_LOCATION_DENIED_COUNT);
@@ -333,8 +289,6 @@
             uploadTimes(PWS_BACKGROUND_RESOLVE_TIMES, TimeUnit.MILLISECONDS);
             uploadTimes(PWS_FOREGROUND_RESOLVE_TIMES, TimeUnit.MILLISECONDS);
             uploadTimes(PWS_REFRESH_RESOLVE_TIMES, TimeUnit.MILLISECONDS);
-            uploadTimes(STANDARD_NOTIFICATION_PRESS_DELAYS, TimeUnit.MILLISECONDS);
-            uploadTimes(OPT_IN_NOTIFICATION_PRESS_DELAYS, TimeUnit.MILLISECONDS);
             uploadCounts(TOTAL_URLS_INITIAL_COUNTS);
             uploadCounts(TOTAL_URLS_REFRESH_COUNTS);
             uploadEnums(ACTIVITY_REFERRALS, ListUrlsActivity.REFERER_BOUNDARY);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
index 6205cc43..90c6ced 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/UrlManager.java
@@ -4,21 +4,12 @@
 
 package org.chromium.chrome.browser.physicalweb;
 
-import android.app.AlarmManager;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
 import android.content.Context;
-import android.content.Intent;
 import android.content.SharedPreferences;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
 import android.os.AsyncTask;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.SystemClock;
-import android.support.v4.app.NotificationCompat;
 
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -30,11 +21,6 @@
 import org.chromium.base.VisibleForTesting;
 import org.chromium.base.annotations.CalledByNative;
 import org.chromium.base.library_loader.LibraryProcessType;
-import org.chromium.chrome.R;
-import org.chromium.chrome.browser.ChromeApplication;
-import org.chromium.chrome.browser.notifications.NotificationConstants;
-import org.chromium.chrome.browser.notifications.NotificationManagerProxy;
-import org.chromium.chrome.browser.notifications.NotificationManagerProxyImpl;
 import org.chromium.content.browser.BrowserStartupController;
 import org.chromium.content.browser.BrowserStartupController.StartupCallback;
 
@@ -51,26 +37,19 @@
 import java.util.Set;
 
 /**
- * This class stores URLs which are discovered by scanning for Physical Web beacons, and updates a
- * Notification as the set changes.
+ * This class stores URLs which are discovered by scanning for Physical Web beacons.
  *
  * There are two sets of URLs maintained:
  * - Those which are currently nearby, as tracked by calls to addUrl/removeUrl
  * - Those which have ever resolved through the Physical Web Service (e.g. are known to produce
  *     good results).
- *
- * Whenever either list changes, we update the Physical Web Notification, based on the intersection
- * of currently-nearby and known-resolved URLs.
  */
 class UrlManager {
     private static final String TAG = "PhysicalWeb";
     private static final String PREFS_VERSION_KEY = "physicalweb_version";
     private static final String PREFS_ALL_URLS_KEY = "physicalweb_all_urls";
     private static final String PREFS_PWS_RESULTS_KEY = "physicalweb_pws_results";
-    private static final String PREFS_NOTIFICATION_UPDATE_TIMESTAMP =
-            "physicalweb_notification_update_timestamp";
     private static final int PREFS_VERSION = 4;
-    private static final long STALE_NOTIFICATION_TIMEOUT_MILLIS = 30 * 60 * 1000;  // 30 Minutes
     private static final long MAX_CACHE_TIME = 24 * 60 * 60 * 1000;  // 1 Day
     private static final int MAX_CACHE_SIZE = 100;
     private final ObserverList<Listener> mObservers;
@@ -78,7 +57,6 @@
     private final Map<String, UrlInfo> mUrlInfoMap;
     private final Map<String, PwsResult> mPwsResultMap;
     private final PriorityQueue<String> mUrlsSortedByTimestamp;
-    private NotificationManagerProxy mNotificationManager;
     private PwsClient mPwsClient;
     private long mNativePhysicalWebDataSourceAndroid;
 
@@ -96,13 +74,10 @@
 
     /**
      * Construct the UrlManager.
-     * @param context An instance of android.content.Context
      */
     @VisibleForTesting
     public UrlManager() {
         Context context = ContextUtils.getApplicationContext();
-        mNotificationManager = new NotificationManagerProxyImpl(
-                (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE));
         mPwsClient = new PwsClientImpl(context);
         mObservers = new ObserverList<Listener>();
         mNearbyUrls = new HashSet<>();
@@ -153,7 +128,6 @@
 
     /**
      * Add a URL to the store of URLs.
-     * This method additionally updates the Physical Web notification.
      * @param urlInfo The URL to add.
      */
     @VisibleForTesting
@@ -163,8 +137,6 @@
         garbageCollect();
         putCachedUrlInfoMap();
 
-        recordUpdate();
-
         // In the rare event that our entry is immediately garbage collected from the cache, we
         // should stop here.
         if (!mUrlInfoMap.containsKey(urlInfo.getUrl())) {
@@ -193,12 +165,10 @@
 
     /**
      * Remove a URL from the store of URLs.
-     * This method additionally updates the Physical Web notification.
      * @param urlInfo The URL to remove.
      */
     public void removeUrl(UrlInfo urlInfo) {
         Log.d(TAG, "URL lost: %s", urlInfo);
-        recordUpdate();
 
         if (!mNearbyUrls.contains(urlInfo.getUrl())) {
             return;
@@ -211,11 +181,6 @@
         if (mPwsResultMap.containsKey(urlInfo.getUrl())) {
             safeNotifyNativeListenersOnLost(urlInfo.getUrl());
         }
-
-        // If there are no URLs nearby to display, clear the notification.
-        if (getUrls(PhysicalWeb.isOnboarding()).isEmpty()) {
-            clearNotification();
-        }
     }
 
     /**
@@ -291,7 +256,7 @@
     }
 
     /**
-     * Forget all stored URLs and clear the notification.
+     * Forget all stored URLs.
      */
     public void clearAllUrls() {
         clearNearbyUrls();
@@ -303,7 +268,7 @@
     }
 
     /**
-     * Forget all nearby URLs and clear the notification.
+     * Forget all nearby URLs.
      */
     public void clearNearbyUrls() {
         HashSet<String> intersection = new HashSet<>(mNearbyUrls);
@@ -316,19 +281,6 @@
         for (String url : intersection) {
             safeNotifyNativeListenersOnLost(url);
         }
-
-        clearNotification();
-        cancelClearNotificationAlarm();
-    }
-
-    /**
-     * Clear the URLManager's notification.
-     * Typically, this should not be called except when we want to clear the notification without
-     * modifying the list of URLs, as is the case when we want to remove stale notifications.
-     */
-    public void clearNotification() {
-        mNotificationManager.cancel(NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB);
-        cancelClearNotificationAlarm();
     }
 
     private List<UrlInfo> getUrlInfoList(Set<String> urls) {
@@ -363,11 +315,6 @@
         Log.d(TAG, "PWS unresolved: %s", url);
         mPwsResultMap.remove(url.getUrl());
         putCachedPwsResultMap();
-
-        // If there are no URLs nearby to display, clear the notification.
-        if (getUrls(PhysicalWeb.isOnboarding()).isEmpty()) {
-            clearNotification();
-        }
     }
 
     private void initSharedPreferences() {
@@ -447,21 +394,6 @@
         setStringSetInSharedPreferences(PREFS_PWS_RESULTS_KEY, serializedPwsResults);
     }
 
-    private PendingIntent createListUrlsIntent() {
-        Context appContext = ContextUtils.getApplicationContext();
-        Intent intent = new Intent(appContext, ListUrlsActivity.class);
-        intent.putExtra(ListUrlsActivity.REFERER_KEY, ListUrlsActivity.NOTIFICATION_REFERER);
-        PendingIntent pendingIntent = PendingIntent.getActivity(appContext, 0, intent, 0);
-        return pendingIntent;
-    }
-
-    private PendingIntent createOptInIntent() {
-        Context appContext = ContextUtils.getApplicationContext();
-        Intent intent = new Intent(appContext, PhysicalWebOptInActivity.class);
-        PendingIntent pendingIntent = PendingIntent.getActivity(appContext, 0, intent, 0);
-        return pendingIntent;
-    }
-
     /**
      * Updates a cache entry with new information.
      * When we reencounter a URL, a subset of its metadata should update.  Only distance and
@@ -514,127 +446,6 @@
         });
     }
 
-    /**
-     * Gets the time since the last notification update.
-     * @return the elapsed realtime since the most recent notification update.
-     */
-    public long getTimeSinceNotificationUpdate() {
-        SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
-        long timestamp = prefs.getLong(PREFS_NOTIFICATION_UPDATE_TIMESTAMP, 0);
-        return SystemClock.elapsedRealtime() - timestamp;
-    }
-
-    private void recordUpdate() {
-        // Record a timestamp.
-        // This is useful for tracking whether a notification is pressed soon after an update or
-        // much later.
-        SharedPreferences prefs = ContextUtils.getAppSharedPreferences();
-        SharedPreferences.Editor editor = prefs.edit();
-        editor.putLong(PREFS_NOTIFICATION_UPDATE_TIMESTAMP, SystemClock.elapsedRealtime());
-        editor.apply();
-    }
-
-    private void showNotification() {
-        // We should only show notifications if there's no other notification-based client.
-        if (!PhysicalWeb.shouldIgnoreOtherClients()
-                && PhysicalWebEnvironment
-                        .getInstance((ChromeApplication) ContextUtils.getApplicationContext())
-                        .hasNotificationBasedClient()) {
-            return;
-        }
-
-        if (PhysicalWeb.isOnboarding()) {
-            if (PhysicalWeb.getOptInNotifyCount() < PhysicalWeb.OPTIN_NOTIFY_MAX_TRIES) {
-                // high priority notification
-                createOptInNotification(true);
-                PhysicalWeb.recordOptInNotification();
-                PhysicalWebUma.onOptInHighPriorityNotificationShown();
-            } else {
-                // min priority notification
-                createOptInNotification(false);
-                PhysicalWebUma.onOptInMinPriorityNotificationShown();
-            }
-        } else if (PhysicalWeb.isPhysicalWebPreferenceEnabled()) {
-            createNotification();
-        }
-    }
-
-    private void createNotification() {
-        PendingIntent pendingIntent = createListUrlsIntent();
-
-        // Get values to display.
-        Context appContext = ContextUtils.getApplicationContext();
-        Resources resources = appContext.getResources();
-        String title = resources.getString(R.string.physical_web_notification_title);
-        Bitmap largeIcon = BitmapFactory.decodeResource(resources,
-                R.drawable.physical_web_notification_large);
-
-        // Create the notification.
-        Notification notification = new NotificationCompat.Builder(appContext)
-                .setLargeIcon(largeIcon)
-                .setSmallIcon(R.drawable.ic_chrome)
-                .setContentTitle(title)
-                .setContentIntent(pendingIntent)
-                .setPriority(NotificationCompat.PRIORITY_MIN)
-                .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
-                .setLocalOnly(true)
-                .build();
-        mNotificationManager.notify(NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB,
-                                    notification);
-    }
-
-    private void createOptInNotification(boolean highPriority) {
-        PendingIntent pendingIntent = createOptInIntent();
-
-        int priority = highPriority ? NotificationCompat.PRIORITY_HIGH
-                : NotificationCompat.PRIORITY_MIN;
-
-        // Get values to display.
-        Context appContext = ContextUtils.getApplicationContext();
-        Resources resources = appContext.getResources();
-        String title = resources.getString(R.string.physical_web_optin_notification_title);
-        String text = resources.getString(R.string.physical_web_optin_notification_text);
-        Bitmap largeIcon = BitmapFactory.decodeResource(resources, R.mipmap.app_icon);
-
-        // Create the notification.
-        Notification notification = new NotificationCompat.Builder(appContext)
-                .setLargeIcon(largeIcon)
-                .setSmallIcon(R.drawable.ic_physical_web_notification)
-                .setContentTitle(title)
-                .setContentText(text)
-                .setContentIntent(pendingIntent)
-                .setPriority(priority)
-                .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
-                .setAutoCancel(true)
-                .setLocalOnly(true)
-                .build();
-        mNotificationManager.notify(NotificationConstants.NOTIFICATION_ID_PHYSICAL_WEB,
-                                    notification);
-    }
-
-    private PendingIntent createClearNotificationAlarmIntent() {
-        Context appContext = ContextUtils.getApplicationContext();
-        Intent intent = new Intent(appContext, ClearNotificationAlarmReceiver.class);
-        return PendingIntent.getBroadcast(appContext, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
-    }
-
-    private void scheduleClearNotificationAlarm() {
-        PendingIntent pendingIntent = createClearNotificationAlarmIntent();
-        Context appContext = ContextUtils.getApplicationContext();
-        AlarmManager alarmManager =
-                (AlarmManager) appContext.getSystemService(Context.ALARM_SERVICE);
-        long time = SystemClock.elapsedRealtime() + STALE_NOTIFICATION_TIMEOUT_MILLIS;
-        alarmManager.set(AlarmManager.ELAPSED_REALTIME, time, pendingIntent);
-    }
-
-    private void cancelClearNotificationAlarm() {
-        PendingIntent pendingIntent = createClearNotificationAlarmIntent();
-        Context appContext = ContextUtils.getApplicationContext();
-        AlarmManager alarmManager =
-                (AlarmManager) appContext.getSystemService(Context.ALARM_SERVICE);
-        alarmManager.cancel(pendingIntent);
-    }
-
     private void registerNewDisplayableUrl(UrlInfo urlInfo) {
         // Notify listeners about the new displayable URL.
         Collection<UrlInfo> urlInfos = new ArrayList<>();
@@ -648,18 +459,6 @@
         if (urlInfo.getDistance() >= 0.0) {
             safeNotifyNativeListenersOnDistanceChanged(urlInfo.getUrl(), urlInfo.getDistance());
         }
-
-        // Only trigger the notification if we know we didn't have a notification up already
-        // (i.e., we have exactly 1 displayble URL) or this URL doesn't exist in the cache
-        // (and hence the user hasn't swiped away a notification for this URL recently).
-        if (getUrls(PhysicalWeb.isOnboarding()).size() != 1
-                && urlInfo.hasBeenDisplayed()) {
-            return;
-        }
-
-        // Show a notification and mark the URL as displayed.
-        showNotification();
-        urlInfo.setHasBeenDisplayed();
     }
 
     private void garbageCollect() {
@@ -717,7 +516,7 @@
 
     /**
      * Notify native listeners that a new Physical Web URL was discovered.
-     * No notification will be sent if the feature is in the Onboarding state.
+     * No message will be sent if the feature is in the Onboarding state.
      * @param url The Physical Web URL.
      */
     private void safeNotifyNativeListenersOnFound(final String url) {
@@ -737,7 +536,7 @@
 
     /**
      * Notify native listeners that a previously-discovered Physical Web URL is no longer nearby.
-     * No notification will be sent if the feature is in the Onboarding state.
+     * No message will be sent if the feature is in the Onboarding state.
      * @param url The Physical Web URL.
      */
     private void safeNotifyNativeListenersOnLost(final String url) {
@@ -757,7 +556,7 @@
 
     /**
      * Notify native listeners with an updated estimate of the distance to the broadcasting device.
-     * No notification will be sent if the feature is in the Onboarding state.
+     * No message will be sent if the feature is in the Onboarding state.
      * @param url The Physical Web URL.
      * @param distanceEstimate The updated distance estimate.
      */
@@ -784,17 +583,10 @@
     }
 
     @VisibleForTesting
-    void overrideNotificationManagerForTesting(
-            NotificationManagerProxy notificationManager) {
-        mNotificationManager = notificationManager;
-    }
-
-    @VisibleForTesting
     static void clearPrefsForTesting() {
         ContextUtils.getAppSharedPreferences().edit()
                 .remove(PREFS_VERSION_KEY)
                 .remove(PREFS_ALL_URLS_KEY)
-                .remove(PREFS_NOTIFICATION_UPDATE_TIMESTAMP)
                 .remove(PREFS_PWS_RESULTS_KEY)
                 .apply();
     }
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index 4cac408..9cf15b2 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -731,7 +731,6 @@
   "java/src/org/chromium/chrome/browser/permissions/PermissionDialogController.java",
   "java/src/org/chromium/chrome/browser/permissions/PermissionDialogDelegate.java",
   "java/src/org/chromium/chrome/browser/physicalweb/BitmapHttpRequest.java",
-  "java/src/org/chromium/chrome/browser/physicalweb/ClearNotificationAlarmReceiver.java",
   "java/src/org/chromium/chrome/browser/physicalweb/HttpRequest.java",
   "java/src/org/chromium/chrome/browser/physicalweb/JsonObjectHttpRequest.java",
   "java/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivity.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivityTest.java
index 7f9e911..e735d6a 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/ListUrlsActivityTest.java
@@ -18,7 +18,6 @@
 import org.chromium.base.test.util.RetryOnFailure;
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
-import org.chromium.chrome.test.util.browser.notifications.MockNotificationManagerProxy;
 import org.chromium.content.browser.test.util.Criteria;
 import org.chromium.content.browser.test.util.CriteriaHelper;
 import org.chromium.content.browser.test.util.TestTouchUtils;
@@ -71,7 +70,6 @@
         urlManager.clearAllUrls();
         mMockPwsClient = new MockPwsClient();
         urlManager.overridePwsClientForTesting(mMockPwsClient);
-        urlManager.overrideNotificationManagerForTesting(new MockNotificationManagerProxy());
     }
 
     @SmallTest
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java
index 2021b1b..90d1920 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/physicalweb/UrlManagerTest.java
@@ -10,15 +10,11 @@
 
 import org.chromium.base.ContextUtils;
 import org.chromium.base.test.util.DisabledTest;
-import org.chromium.base.test.util.FlakyTest;
 import org.chromium.base.test.util.RetryOnFailure;
-import org.chromium.chrome.test.util.browser.notifications.MockNotificationManagerProxy;
-import org.chromium.chrome.test.util.browser.notifications.MockNotificationManagerProxy.NotificationEntry;
 import org.chromium.content.browser.test.util.Criteria;
 import org.chromium.content.browser.test.util.CriteriaHelper;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -40,7 +36,6 @@
     private static final int PHYSICAL_WEB_ONBOARDING = 2;
     private UrlManager mUrlManager = null;
     private MockPwsClient mMockPwsClient = null;
-    private MockNotificationManagerProxy mMockNotificationManagerProxy = null;
 
     @Override
     protected void setUp() throws Exception {
@@ -52,8 +47,6 @@
         mUrlManager = new UrlManager();
         mMockPwsClient = new MockPwsClient();
         mUrlManager.overridePwsClientForTesting(mMockPwsClient);
-        mMockNotificationManagerProxy = new MockNotificationManagerProxy();
-        mUrlManager.overrideNotificationManagerForTesting(mMockNotificationManagerProxy);
     }
 
     private void addPwsResult1() {
@@ -123,10 +116,6 @@
         addUrlInfo2();
         getInstrumentation().waitForIdleSync();
 
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-
         mUrlManager.clearNearbyUrls();
 
         // Test that the URLs are not nearby, but do exist in the cache.
@@ -135,10 +124,6 @@
         assertTrue(mUrlManager.containsInAnyCache(URL1));
         assertTrue(mUrlManager.containsInAnyCache(URL2));
 
-        // Make sure no notification is shown.
-        notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(0, notifications.size());
-
         mUrlManager.clearAllUrls();
 
         // Test that cache is empty.
@@ -147,89 +132,7 @@
     }
 
     @SmallTest
-    public void testAddUrlWhileOnboardingMakesNotification() throws Exception {
-        setOnboarding();
-        addPwsResult1();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a resolution was *not* attempted.
-        List<Collection<UrlInfo>> resolveCalls = mMockPwsClient.getResolveCalls();
-        assertEquals(0, resolveCalls.size());
-
-        // Make sure that we have no resolved URLs.
-        List<UrlInfo> urls = mUrlManager.getUrls();
-        assertEquals(0, urls.size());
-
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-    }
-
-    @SmallTest
     @RetryOnFailure
-    public void testAddUrlNoResolutionDoesNothing() throws Exception {
-        addEmptyPwsResult();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a resolution was attempted.
-        List<Collection<UrlInfo>> resolveCalls = mMockPwsClient.getResolveCalls();
-        assertEquals(1, resolveCalls.size());
-
-        // Make sure that we have no resolved URLs.
-        List<UrlInfo> urls = mUrlManager.getUrls();
-        assertEquals(0, urls.size());
-        // Make sure that we do have unresolved URLs.
-        urls = mUrlManager.getUrls(true);
-        assertEquals(1, urls.size());
-
-        // Make sure that a notification was not shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(0, notifications.size());
-    }
-
-    @SmallTest
-    public void testAddUrlWithResolutionMakesNotification() throws Exception {
-        addPwsResult1();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a resolution was attempted.
-        List<Collection<UrlInfo>> resolveCalls = mMockPwsClient.getResolveCalls();
-        assertEquals(1, resolveCalls.size());
-
-        // Make sure that we have our resolved URLs.
-        List<UrlInfo> urls = mUrlManager.getUrls();
-        assertEquals(1, urls.size());
-
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-    }
-
-    @SmallTest
-    @RetryOnFailure
-    public void testAddTwoUrlsMakesOneNotification() throws Exception {
-        addPwsResult1();
-        addPwsResult2();
-
-        // Adding one URL should fire a notification.
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-        assertEquals(1, mMockNotificationManagerProxy.getNotifications().size());
-
-        // Adding a second should not.
-        mMockNotificationManagerProxy.cancelAll();
-        addUrlInfo2();
-        assertEquals(0, mMockNotificationManagerProxy.getNotifications().size());
-    }
-
-    /*
-     * @SmallTest
-     * Bug=crbug.com/683923
-     */
-    @DisabledTest
     public void testAddUrlGarbageCollectsForSize() throws Exception {
         // Add and remove 101 URLs, making sure one is clearly slightly older than the others.
         addEmptyPwsResult();
@@ -315,103 +218,6 @@
     }
 
     @SmallTest
-    @FlakyTest  // crbug.com/622005
-    public void testAddUrlInCacheWithOthersMakesNoNotification() throws Exception {
-        addPwsResult1();
-        addPwsResult2();
-        addPwsResult1();
-        addUrlInfo1();
-        addUrlInfo2();
-        removeUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure the cache is in the appropriate state
-        assertTrue(mUrlManager.containsInAnyCache(URL1));
-
-        mMockNotificationManagerProxy.cancelAll();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that no notification is shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(0, notifications.size());
-    }
-
-    @SmallTest
-    @RetryOnFailure
-    public void testAddUrlInCacheWithNoOthersMakesNotification() throws Exception {
-        addPwsResult1();
-        addPwsResult1();
-        addUrlInfo1();
-        removeUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-        mMockNotificationManagerProxy.cancelAll();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-    }
-
-    @SmallTest
-    public void testAddUrlNotInCacheWithOthersMakesNotification() throws Exception {
-        addPwsResult1();
-        addPwsResult2();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-        mMockNotificationManagerProxy.cancelAll();
-        addUrlInfo2();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-    }
-
-    @SmallTest
-    public void testRemoveOnlyUrlClearsNotification() throws Exception {
-        addPwsResult1();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-
-        removeUrlInfo1();
-
-        // Make sure the URL was removed.
-        List<UrlInfo> urls = mUrlManager.getUrls(true);
-        assertEquals(0, urls.size());
-
-        // Make sure no notification is shown.
-        notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(0, notifications.size());
-    }
-
-    @SmallTest
-    public void testClearAllUrlsClearsNotification() throws Exception {
-        addPwsResult1();
-        addUrlInfo1();
-        getInstrumentation().waitForIdleSync();
-
-        // Make sure that a notification was shown.
-        List<NotificationEntry> notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(1, notifications.size());
-
-        mUrlManager.clearAllUrls();
-
-        // Make sure all URLs were removed.
-        List<UrlInfo> urls = mUrlManager.getUrls(true);
-        assertEquals(0, urls.size());
-
-        // Make sure no notification is shown.
-        notifications = mMockNotificationManagerProxy.getNotifications();
-        assertEquals(0, notifications.size());
-    }
-
-    @SmallTest
     @RetryOnFailure
     public void testGetUrlSorts() throws Exception {
         addEmptyPwsResult();
@@ -436,7 +242,11 @@
         assertEquals(URL1, urlInfos.get(2).getUrl());
     }
 
-    @SmallTest
+    /*
+     * @SmallTest
+     * Bug=crbug.com/684148
+     */
+    @DisabledTest
     public void testSerializationWorksWithPoorlySerializedResult() throws Exception {
         addPwsResult1();
         addPwsResult2();
diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
index 5aebe9eb..472e3b0 100644
--- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
+++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager_browsertest.cc
@@ -9,8 +9,6 @@
 #include "ash/common/wallpaper/wallpaper_controller.h"
 #include "ash/common/wm_shell.h"
 #include "ash/shell.h"
-#include "ash/test/ash_test_base.h"
-#include "ash/test/ash_test_helper.h"
 #include "base/command_line.h"
 #include "base/compiler_specific.h"
 #include "base/files/file_path.h"
@@ -717,9 +715,6 @@
 // Splitting these into separate tests avoids needing to run animations.
 // TODO(derat): Combine these into a single test
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, SmallDefaultWallpaper) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
-
   CreateCmdlineWallpapers();
 
   // At 800x600, the small wallpaper should be loaded.
@@ -732,9 +727,6 @@
 }
 
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, LargeDefaultWallpaper) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
-
   CreateCmdlineWallpapers();
   UpdateDisplay("1600x1200");
   WallpaperManager::Get()->SetDefaultWallpaperNow(EmptyAccountId());
@@ -746,8 +738,6 @@
 
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest,
                        LargeDefaultWallpaperWhenRotated) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
   CreateCmdlineWallpapers();
 
   UpdateDisplay("1200x800/r");
@@ -759,8 +749,6 @@
 }
 
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, SmallGuestWallpaper) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
   CreateCmdlineWallpapers();
   SessionManager::Get()->CreateSession(user_manager::GuestAccountId(),
                                        user_manager::kGuestUserName);
@@ -773,9 +761,6 @@
 }
 
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, LargeGuestWallpaper) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
-
   CreateCmdlineWallpapers();
   SessionManager::Get()->CreateSession(user_manager::GuestAccountId(),
                                        user_manager::kGuestUserName);
@@ -788,8 +773,6 @@
 }
 
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, SmallChildWallpaper) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
   CreateCmdlineWallpapers();
   LogInAsChild(test_account_id1_, kTestUser1Hash);
   UpdateDisplay("800x600");
@@ -801,9 +784,6 @@
 }
 
 IN_PROC_BROWSER_TEST_F(WallpaperManagerBrowserTest, LargeChildWallpaper) {
-  if (!ash::test::AshTestHelper::SupportsMultipleDisplays())
-    return;
-
   CreateCmdlineWallpapers();
   LogInAsChild(test_account_id1_, kTestUser1Hash);
   UpdateDisplay("1600x1200");
diff --git a/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc b/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc
index 4696f1f..49ab7119 100644
--- a/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc
+++ b/chrome/browser/chromeos/ui/accessibility_focus_ring_controller_unittest.cc
@@ -134,8 +134,6 @@
 }
 
 TEST_F(AccessibilityFocusRingControllerTest, CursorWorksOnMultipleDisplays) {
-  if (!SupportsMultipleDisplays())
-    return;
   UpdateDisplay("400x400,500x500");
   aura::Window::Windows root_windows =
       ash::Shell::GetInstance()->GetAllRootWindows();
diff --git a/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc b/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
index 133985d4..7fe0e45 100644
--- a/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/launcher_context_menu_unittest.cc
@@ -288,9 +288,6 @@
 // Tests that fullscreen which makes "Autohide shelf" option disappeared on
 // shelf is a per-display setting (crbug.com/496681).
 TEST_F(LauncherContextMenuTest, AutohideShelfOptionOnExternalDisplay) {
-  if (!SupportsMultipleDisplays())
-    return;
-
   UpdateDisplay("940x550,940x550");
   int64_t primary_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
   int64_t secondary_id = display_manager()->GetSecondaryDisplay().id();
diff --git a/chrome/browser/ui/libgtkui/gtk_ui.cc b/chrome/browser/ui/libgtkui/gtk_ui.cc
index e9dd509f..fc25e5c 100644
--- a/chrome/browser/ui/libgtkui/gtk_ui.cc
+++ b/chrome/browser/ui/libgtkui/gtk_ui.cc
@@ -236,16 +236,6 @@
 // The unknown content type.
 const char* kUnknownContentType = "application/octet-stream";
 
-// TODO(erg): ThemeService has a whole interface just for reading default
-// constants. Figure out what to do with that more long term; for now, just
-// copy the constants themselves here.
-//
-// Default tints.
-const color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2f, 0.35f};
-#if GTK_MAJOR_VERSION == 2
-const color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.3f, 0.6f};
-#endif
-
 // Picks a button tint from a set of background colors. While
 // |accent_color| will usually be the same color through a theme, this
 // function will get called with the normal GtkLabel |text_color|/GtkWindow
@@ -950,7 +940,7 @@
 
 void GtkUi::BuildFrameColors() {
 #if GTK_MAJOR_VERSION == 2
-  color_utils::HSL kDefaultFrameShift = {-1, -1, 0.4};
+  const color_utils::HSL kDefaultFrameShift = {-1, -1, 0.4};
   SkColor frame_color =
       native_theme_->GetSystemColor(ui::NativeTheme::kColorId_WindowBackground);
   frame_color = color_utils::HSLShift(frame_color, kDefaultFrameShift);
@@ -972,7 +962,6 @@
   GetChromeStyleColor("incognito-inactive-frame-color", &temp_color);
   colors_[ThemeProperties::COLOR_FRAME_INCOGNITO_INACTIVE] = temp_color;
 #else
-  // TODO(thomasanderson): Render a GtkHeaderBar directly.
   SkColor color_frame = GetBgColor("#headerbar.header-bar.titlebar");
   SkColor color_frame_inactive =
       GetBgColor("#headerbar.header-bar.titlebar:backdrop");
diff --git a/chrome/browser/ui/libgtkui/gtk_util.cc b/chrome/browser/ui/libgtkui/gtk_util.cc
index 61753c0..543cbda 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.cc
+++ b/chrome/browser/ui/libgtkui/gtk_util.cc
@@ -65,6 +65,12 @@
 
 namespace libgtkui {
 
+// TODO(erg): ThemeService has a whole interface just for reading default
+// constants. Figure out what to do with that more long term; for now, just
+// copy the constants themselves here.
+const color_utils::HSL kDefaultTintFrameIncognito = {-1, 0.2f, 0.35f};
+const color_utils::HSL kDefaultTintFrameIncognitoInactive = {-1, 0.3f, 0.6f};
+
 // Theme colors returned by GetSystemColor().
 const SkColor kInvalidColorIdColor = SkColorSetRGB(255, 0, 128);
 const SkColor kURLTextColor = SkColorSetRGB(0x0b, 0x80, 0x43);
@@ -421,11 +427,13 @@
   cairo_t* cairo_;
 };
 
-void RenderBackground(cairo_t* cr, GtkStyleContext* context) {
+void RenderBackground(const gfx::Size& size,
+                      cairo_t* cr,
+                      GtkStyleContext* context) {
   if (!context)
     return;
-  RenderBackground(cr, gtk_style_context_get_parent(context));
-  gtk_render_background(context, cr, 0, 0, 1, 1);
+  RenderBackground(size, cr, gtk_style_context_get_parent(context));
+  gtk_render_background(context, cr, 0, 0, size.width(), size.height());
 }
 
 SkColor GetBgColor(const char* css_selector) {
@@ -438,7 +446,7 @@
   auto context = GetStyleContextFromCss(css_selector);
   RemoveBorders(context);
   PixelSurface surface;
-  RenderBackground(surface.cairo(), context);
+  RenderBackground(gfx::Size(1, 1), surface.cairo(), context);
   return surface.GetPixelValue();
 }
 
@@ -460,7 +468,7 @@
 
   AddBorders(context);
   PixelSurface surface;
-  RenderBackground(surface.cairo(), context);
+  RenderBackground(gfx::Size(1, 1), surface.cairo(), context);
   gtk_render_frame(context, surface.cairo(), 0, 0, 1, 1);
   return surface.GetPixelValue();
 }
diff --git a/chrome/browser/ui/libgtkui/gtk_util.h b/chrome/browser/ui/libgtkui/gtk_util.h
index 9b1a7dc1..4f9269a 100644
--- a/chrome/browser/ui/libgtkui/gtk_util.h
+++ b/chrome/browser/ui/libgtkui/gtk_util.h
@@ -19,12 +19,20 @@
 class Environment;
 }
 
+namespace color_utils {
+struct HSL;
+}
+
 namespace ui {
 class Accelerator;
 }
 
 namespace libgtkui {
 
+// Default frame tints
+extern const color_utils::HSL kDefaultTintFrameIncognito;
+extern const color_utils::HSL kDefaultTintFrameIncognitoInactive;
+
 extern const SkColor kInvalidColorIdColor;
 extern const SkColor kURLTextColor;
 
@@ -131,10 +139,19 @@
 // must g_object_unref() the returned context.
 ScopedStyleContext GetStyleContextFromCss(const char* css_selector);
 
+// Removes all border-type properties on |context| and all of its parents.
+void RemoveBorders(GtkStyleContext* context);
+
 // Get the 'color' property from the style context created by
 // GetStyleContextFromCss(|css_selector|).
 SkColor GetFgColor(const char* css_selector);
 
+// Renders the backgrounds of all ancestors of |context|, then renders
+// the background for |context| itself.
+void RenderBackground(const gfx::Size& size,
+                      cairo_t* cr,
+                      GtkStyleContext* context);
+
 // Renders a background from the style context created by
 // GetStyleContextFromCss(|css_selector|) into a single pixel and
 // returns the color.
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
index 54c0307..74399f0 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk3.cc
@@ -13,34 +13,36 @@
 #include "ui/gfx/color_palette.h"
 #include "ui/gfx/color_utils.h"
 #include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/skbitmap_operations.h"
 #include "ui/native_theme/native_theme_dark_aura.h"
 
 namespace libgtkui {
 
 namespace {
 
-void PaintWidget(SkCanvas* canvas,
-                 const gfx::Rect& rect,
-                 const char* css_selector,
-                 GtkStateFlags state) {
+SkBitmap GetWidgetBitmap(const gfx::Size& size,
+                         GtkStyleContext* context) {
   SkBitmap bitmap;
-  bitmap.allocN32Pixels(rect.width(), rect.height());
+  bitmap.allocN32Pixels(size.width(), size.height());
   bitmap.eraseColor(0);
 
   cairo_surface_t* surface = cairo_image_surface_create_for_data(
       static_cast<unsigned char*>(bitmap.getAddr(0, 0)), CAIRO_FORMAT_ARGB32,
-      rect.width(), rect.height(),
-      cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, rect.width()));
+      size.width(), size.height(),
+      cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, size.width()));
   cairo_t* cr = cairo_create(surface);
 
-  auto context = GetStyleContextFromCss(css_selector);
-  gtk_style_context_set_state(context, state);
-
-  gtk_render_background(context, cr, 0, 0, rect.width(), rect.height());
-  gtk_render_frame(context, cr, 0, 0, rect.width(), rect.height());
+  RenderBackground(size, cr, context);
+  gtk_render_frame(context, cr, 0, 0, size.width(), size.height());
   cairo_destroy(cr);
   cairo_surface_destroy(surface);
-  canvas->drawBitmap(bitmap, rect.x(), rect.y());
+  return bitmap;
+}
+
+void PaintWidget(SkCanvas* canvas,
+                 const gfx::Rect& rect,
+                 GtkStyleContext* context) {
+  canvas->drawBitmap(GetWidgetBitmap(rect.size(), context), rect.x(), rect.y());
 }
 
 GtkStateFlags StateToStateFlags(NativeThemeGtk3::State state) {
@@ -339,6 +341,7 @@
   g_type_class_unref(g_type_class_ref(gtk_toolbar_get_type()));
   g_type_class_unref(g_type_class_ref(gtk_text_view_get_type()));
   g_type_class_unref(g_type_class_ref(gtk_separator_get_type()));
+  g_type_class_unref(g_type_class_ref(gtk_menu_bar_get_type()));
 
   g_signal_connect_after(gtk_settings_get_default(), "notify::gtk-theme-name",
                          G_CALLBACK(OnThemeChanged), this);
@@ -365,7 +368,7 @@
     SkCanvas* canvas,
     const gfx::Size& size,
     const MenuBackgroundExtraParams& menu_background) const {
-  PaintWidget(canvas, gfx::Rect(size), "GtkMenu#menu", GTK_STATE_FLAG_NORMAL);
+  PaintWidget(canvas, gfx::Rect(size), GetStyleContextFromCss("GtkMenu#menu"));
 }
 
 void NativeThemeGtk3::PaintMenuItemBackground(
@@ -373,8 +376,33 @@
     State state,
     const gfx::Rect& rect,
     const MenuItemExtraParams& menu_item) const {
-  PaintWidget(canvas, rect, "GtkMenu#menu GtkMenuItem#menuitem",
-              StateToStateFlags(state));
+  auto context = GetStyleContextFromCss("GtkMenu#menu GtkMenuItem#menuitem");
+  gtk_style_context_set_state(context, StateToStateFlags(state));
+  PaintWidget(canvas, rect, context);
+}
+
+void NativeThemeGtk3::PaintFrameTopArea(
+    SkCanvas* canvas,
+    State state,
+    const gfx::Rect& rect,
+    const FrameTopAreaExtraParams& frame_top_area) const {
+  auto context = GetStyleContextFromCss(frame_top_area.use_custom_frame
+                                            ? "#headerbar.header-bar.titlebar"
+                                            : "GtkMenuBar#menubar");
+  RemoveBorders(context);
+  gtk_style_context_set_state(context,
+                              frame_top_area.is_active
+                                  ? GTK_STATE_FLAG_NORMAL
+                              : GTK_STATE_FLAG_BACKDROP);
+
+  SkBitmap bitmap = GetWidgetBitmap(rect.size(), context);
+
+  if (frame_top_area.incognito) {
+    bitmap = SkBitmapOperations::CreateHSLShiftedBitmap(
+        bitmap, kDefaultTintFrameIncognito);
+  }
+
+  canvas->drawBitmap(bitmap, rect.x(), rect.y());
 }
 
 }  // namespace libgtkui
diff --git a/chrome/browser/ui/libgtkui/native_theme_gtk3.h b/chrome/browser/ui/libgtkui/native_theme_gtk3.h
index 577375ce..1946f72b 100644
--- a/chrome/browser/ui/libgtkui/native_theme_gtk3.h
+++ b/chrome/browser/ui/libgtkui/native_theme_gtk3.h
@@ -30,6 +30,11 @@
       State state,
       const gfx::Rect& rect,
       const MenuItemExtraParams& menu_item) const override;
+  void PaintFrameTopArea(
+      SkCanvas* canvas,
+      State state,
+      const gfx::Rect& rect,
+      const FrameTopAreaExtraParams& frame_top_area) const override;
 
  private:
   NativeThemeGtk3();
diff --git a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
index c3623f8..76520637 100644
--- a/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/ui/views/frame/opaque_browser_frame_view.cc
@@ -412,6 +412,14 @@
   if (frame()->IsFullscreen())
     return;  // Nothing is visible, so don't bother to paint.
 
+  frame_background_->set_frame_color(GetFrameColor());
+  frame_background_->set_use_custom_frame(frame()->UseCustomFrame());
+  frame_background_->set_is_active(ShouldPaintAsActive());
+  frame_background_->set_incognito(browser_view()->IsIncognito());
+  frame_background_->set_theme_image(GetFrameImage());
+  frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
+  frame_background_->set_top_area_height(GetTopAreaHeight());
+
   if (layout_->IsTitleBarCondensed())
     PaintMaximizedFrameBorder(canvas);
   else
@@ -501,11 +509,8 @@
 }
 
 int OpaqueBrowserFrameView::GetTopAreaHeight() const {
-  // The top area height in dp (only used when there's no frame image).
-  // TODO(pkasting): investigate removing this constant. See crbug.com/590301
-  const int kHeight = 64;
   const gfx::ImageSkia frame_image = GetFrameImage();
-  int top_area_height = frame_image.isNull() ? kHeight : frame_image.height();
+  int top_area_height = frame_image.height();  // Returns 0 if isNull().
   if (browser_view()->IsTabStripVisible()) {
     top_area_height =
         std::max(top_area_height,
@@ -516,11 +521,6 @@
 
 void OpaqueBrowserFrameView::PaintRestoredFrameBorder(
     gfx::Canvas* canvas) const {
-  frame_background_->set_frame_color(GetFrameColor());
-  frame_background_->set_theme_image(GetFrameImage());
-  frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
-  frame_background_->set_top_area_height(GetTopAreaHeight());
-
   const ui::ThemeProvider* tp = GetThemeProvider();
   frame_background_->SetSideImages(
       tp->GetImageSkiaNamed(IDR_WINDOW_LEFT_SIDE),
@@ -542,10 +542,6 @@
 
 void OpaqueBrowserFrameView::PaintMaximizedFrameBorder(
     gfx::Canvas* canvas) const {
-  frame_background_->set_frame_color(GetFrameColor());
-  frame_background_->set_theme_image(GetFrameImage());
-  frame_background_->set_theme_overlay_image(GetFrameOverlayImage());
-  frame_background_->set_top_area_height(GetTopAreaHeight());
   frame_background_->set_maximized_top_inset(
       GetTopInset(true) - GetTopInset(false));
   frame_background_->PaintMaximized(canvas, this);
diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc
index 9e49e2ba..0c58be47 100644
--- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
+++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
@@ -192,7 +192,7 @@
       use_generic_button
           ? gfx::ShadowValues()
           : gfx::ShadowValues(
-                10, gfx::ShadowValue(gfx::Vector2d(), 1.0f, SK_ColorDKGRAY)));
+                10, gfx::ShadowValue(gfx::Vector2d(), 2.0f, SK_ColorDKGRAY)));
 
   // We want the button to resize if the new text is shorter.
   SetMinSize(gfx::Size());
diff --git a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
index ce27761a..f50dc75f 100644
--- a/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.cc
@@ -687,10 +687,11 @@
   screen_data.SetBoolean("attestationBased", config_.is_mode_attestation());
   screen_data.SetString("management_domain", config_.management_domain);
 
-  const bool cfm = g_browser_process->platform_part()
-                       ->browser_policy_connector_chromeos()
-                       ->GetDeviceCloudPolicyManager()
-                       ->IsRemoraRequisition();
+  policy::DeviceCloudPolicyManagerChromeOS* policy_manager =
+      g_browser_process->platform_part()
+          ->browser_policy_connector_chromeos()
+          ->GetDeviceCloudPolicyManager();
+  const bool cfm = policy_manager && policy_manager->IsRemoraRequisition();
   screen_data.SetString("flow", cfm ? "cfm" : "enterprise");
 
   ShowScreenWithData(OobeScreen::SCREEN_OOBE_ENROLLMENT, &screen_data);
diff --git a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
index 373fa8b7..60ac090 100644
--- a/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
+++ b/chrome/browser/ui/window_sizer/window_sizer_ash_unittest.cc
@@ -818,7 +818,7 @@
 // in that this uses real ash shell implementations + StateProvider
 // TargetDisplayProvider, rather than mocks.
 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) {
-  if (!SupportsMultipleDisplays() || !chrome::ShouldOpenAshOnStartup())
+  if (!chrome::ShouldOpenAshOnStartup())
     return;
   UpdateDisplay("500x500,600x600");
 
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index de57921..a956b85f 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -502,38 +502,38 @@
   if (render_frame()->IsFTPDirectoryListing())
     return true;
 
-  WebFrame* web_frame = render_frame()->GetWebFrame();
-  return IsWhitelistedForContentSettings(
-      web_frame->document().getSecurityOrigin(), web_frame->document().url());
+  const WebDocument& document = render_frame()->GetWebFrame()->document();
+  return IsWhitelistedForContentSettings(document.getSecurityOrigin(),
+                                         document.url());
 }
 
 bool ContentSettingsObserver::IsWhitelistedForContentSettings(
     const WebSecurityOrigin& origin,
-    const GURL& document_url) {
-  if (document_url == content::kUnreachableWebDataURL)
+    const WebURL& document_url) {
+  if (document_url.string() == content::kUnreachableWebDataURL)
     return true;
 
   if (origin.isUnique())
     return false;  // Uninitialized document?
 
-  base::string16 protocol = origin.protocol();
-  if (base::EqualsASCII(protocol, content::kChromeUIScheme))
+  blink::WebString protocol = origin.protocol();
+
+  if (protocol == content::kChromeUIScheme)
     return true;  // Browser UI elements should still work.
 
-  if (base::EqualsASCII(protocol, content::kChromeDevToolsScheme))
+  if (protocol == content::kChromeDevToolsScheme)
     return true;  // DevTools UI elements should still work.
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
-  if (base::EqualsASCII(protocol, extensions::kExtensionScheme))
+  if (protocol == extensions::kExtensionScheme)
     return true;
 #endif
 
   // If the scheme is file:, an empty file name indicates a directory listing,
   // which requires JavaScript to function properly.
-  if (base::EqualsASCII(protocol, url::kFileScheme)) {
-    return document_url.SchemeIs(url::kFileScheme) &&
-           document_url.ExtractFileName().empty();
+  if (protocol == url::kFileScheme &&
+      document_url.protocolIs(url::kFileScheme)) {
+    return GURL(document_url).ExtractFileName().empty();
   }
-
   return false;
 }
diff --git a/chrome/renderer/content_settings_observer.h b/chrome/renderer/content_settings_observer.h
index dac71682..29325c1 100644
--- a/chrome/renderer/content_settings_observer.h
+++ b/chrome/renderer/content_settings_observer.h
@@ -124,7 +124,7 @@
   bool IsWhitelistedForContentSettings() const;
   static bool IsWhitelistedForContentSettings(
       const blink::WebSecurityOrigin& origin,
-      const GURL& document_url);
+      const blink::WebURL& document_url);
 
 #if BUILDFLAG(ENABLE_EXTENSIONS)
   // Owned by ChromeContentRendererClient and outlive us.
diff --git a/components/captive_portal/BUILD.gn b/components/captive_portal/BUILD.gn
index c534db8..12551f9 100644
--- a/components/captive_portal/BUILD.gn
+++ b/components/captive_portal/BUILD.gn
@@ -15,6 +15,7 @@
 
   deps = [
     "//base",
+    "//components/data_use_measurement/core",
     "//net",
     "//url",
   ]
diff --git a/components/captive_portal/DEPS b/components/captive_portal/DEPS
index d97699df..a07acff 100644
--- a/components/captive_portal/DEPS
+++ b/components/captive_portal/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/data_use_measurement/core",
   "+net",
   "+url",
 ]
diff --git a/components/captive_portal/captive_portal_detector.cc b/components/captive_portal/captive_portal_detector.cc
index 7188c34..04eb56643 100644
--- a/components/captive_portal/captive_portal_detector.cc
+++ b/components/captive_portal/captive_portal_detector.cc
@@ -6,6 +6,7 @@
 
 #include "base/logging.h"
 #include "base/strings/string_number_conversions.h"
+#include "components/data_use_measurement/core/data_use_user_data.h"
 #include "net/base/load_flags.h"
 #include "net/http/http_response_headers.h"
 #include "net/http/http_util.h"
@@ -37,6 +38,9 @@
   url_fetcher_ = net::URLFetcher::Create(0, url, net::URLFetcher::GET, this);
   url_fetcher_->SetAutomaticallyRetryOn5xx(false);
   url_fetcher_->SetRequestContext(request_context_.get());
+  data_use_measurement::DataUseUserData::AttachToFetcher(
+      url_fetcher_.get(),
+      data_use_measurement::DataUseUserData::CAPTIVE_PORTAL);
 
   // Can't safely use net::LOAD_DISABLE_CERT_REVOCATION_CHECKING here,
   // since then the connection may be reused without checking the cert.
diff --git a/components/data_use_measurement/core/data_use_user_data.cc b/components/data_use_measurement/core/data_use_user_data.cc
index b467a3c..ef6a601 100644
--- a/components/data_use_measurement/core/data_use_user_data.cc
+++ b/components/data_use_measurement/core/data_use_user_data.cc
@@ -112,6 +112,12 @@
       return "ImageFetcherUntagged";
     case GAIA:
       return "GAIA";
+    case CAPTIVE_PORTAL:
+      return "CaptivePortal";
+    case WEB_RESOURCE_SERVICE:
+      return "WebResourceService";
+    case SIGNIN:
+      return "Signin";
   }
   return "INVALID";
 }
diff --git a/components/data_use_measurement/core/data_use_user_data.h b/components/data_use_measurement/core/data_use_user_data.h
index c60cdbf..8a46e7a 100644
--- a/components/data_use_measurement/core/data_use_user_data.h
+++ b/components/data_use_measurement/core/data_use_user_data.h
@@ -56,6 +56,9 @@
     SUPERVISED_USER,
     IMAGE_FETCHER_UNTAGGED,
     GAIA,
+    CAPTIVE_PORTAL,
+    WEB_RESOURCE_SERVICE,
+    SIGNIN,
   };
 
   // Data use broken by content type. This enum must remain synchronized
diff --git a/components/display_compositor/compositor_overlay_candidate_validator_ozone.cc b/components/display_compositor/compositor_overlay_candidate_validator_ozone.cc
index 3c0cfb1..a8f12b7 100644
--- a/components/display_compositor/compositor_overlay_candidate_validator_ozone.cc
+++ b/components/display_compositor/compositor_overlay_candidate_validator_ozone.cc
@@ -8,13 +8,25 @@
 
 #include <utility>
 
+#include "base/bind.h"
 #include "base/memory/ptr_util.h"
+#include "base/strings/string_split.h"
 #include "cc/output/overlay_strategy_fullscreen.h"
 #include "cc/output/overlay_strategy_single_on_top.h"
 #include "cc/output/overlay_strategy_underlay.h"
 #include "ui/ozone/public/overlay_candidates_ozone.h"
 
 namespace display_compositor {
+namespace {
+// Templated function used to create an OverlayProcessor::Strategy
+// of type |S|.
+template <typename S>
+std::unique_ptr<cc::OverlayProcessor::Strategy> MakeOverlayStrategy(
+    CompositorOverlayCandidateValidatorOzone* capability_checker) {
+  return base::MakeUnique<S>(capability_checker);
+}
+
+}  // namespace
 
 static gfx::BufferFormat GetBufferFormat(cc::ResourceFormat overlay_format) {
   switch (overlay_format) {
@@ -28,27 +40,46 @@
   }
 }
 
+// |overlay_candidates| is an object used to answer questions about possible
+// overlays configuarations.
+// |strategies_string| is a comma-separated string containing all the overaly
+// strategies that should be returned by GetStrategies.
+// If |strategies_string| is empty "single-on-top,underlay" will be used as
+// default.
 CompositorOverlayCandidateValidatorOzone::
     CompositorOverlayCandidateValidatorOzone(
         std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates,
-        bool single_fullscreen)
+        std::string strategies_string)
     : overlay_candidates_(std::move(overlay_candidates)),
-      single_fullscreen_(single_fullscreen),
-      software_mirror_active_(false) {}
+      software_mirror_active_(false) {
+  if (!strategies_string.length())
+    strategies_string = "single-on-top,underlay";
+
+  for (const auto& strategy_name :
+       base::SplitStringPiece(strategies_string, ",", base::TRIM_WHITESPACE,
+                              base::SPLIT_WANT_NONEMPTY)) {
+    if (strategy_name == "single-fullscreen") {
+      strategies_instantiators.push_back(
+          base::Bind(MakeOverlayStrategy<cc::OverlayStrategyFullscreen>));
+    } else if (strategy_name == "single-on-top") {
+      strategies_instantiators.push_back(
+          base::Bind(MakeOverlayStrategy<cc::OverlayStrategySingleOnTop>));
+    } else if (strategy_name == "underlay") {
+      strategies_instantiators.push_back(
+          base::Bind(MakeOverlayStrategy<cc::OverlayStrategyUnderlay>));
+    } else {
+      LOG(WARNING) << "Unrecognized overlay strategy " << strategy_name;
+    }
+  }
+}
 
 CompositorOverlayCandidateValidatorOzone::
     ~CompositorOverlayCandidateValidatorOzone() {}
 
 void CompositorOverlayCandidateValidatorOzone::GetStrategies(
     cc::OverlayProcessor::StrategyList* strategies) {
-  if (single_fullscreen_) {
-    strategies->push_back(
-        base::MakeUnique<cc::OverlayStrategyFullscreen>(this));
-  } else {
-    strategies->push_back(
-        base::MakeUnique<cc::OverlayStrategySingleOnTop>(this));
-    strategies->push_back(base::MakeUnique<cc::OverlayStrategyUnderlay>(this));
-  }
+  for (auto& instantiator : strategies_instantiators)
+    strategies->push_back(instantiator.Run(this));
 }
 
 bool CompositorOverlayCandidateValidatorOzone::AllowCALayerOverlays() {
@@ -66,10 +97,6 @@
     return;
   }
 
-  if (single_fullscreen_) {
-    return;  // No need for validation for single fullscreen.
-  }
-
   DCHECK_GE(2U, surfaces->size());
   ui::OverlayCandidatesOzone::OverlaySurfaceCandidateList ozone_surface_list;
   ozone_surface_list.resize(surfaces->size());
diff --git a/components/display_compositor/compositor_overlay_candidate_validator_ozone.h b/components/display_compositor/compositor_overlay_candidate_validator_ozone.h
index 3e2c9e38..8f697c8 100644
--- a/components/display_compositor/compositor_overlay_candidate_validator_ozone.h
+++ b/components/display_compositor/compositor_overlay_candidate_validator_ozone.h
@@ -7,6 +7,7 @@
 
 #include <memory>
 
+#include "base/callback.h"
 #include "base/macros.h"
 #include "components/display_compositor/compositor_overlay_candidate_validator.h"
 #include "components/display_compositor/display_compositor_export.h"
@@ -23,7 +24,7 @@
  public:
   CompositorOverlayCandidateValidatorOzone(
       std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates,
-      bool single_fullscreen);
+      std::string strategies_string);
   ~CompositorOverlayCandidateValidatorOzone() override;
 
   // cc::OverlayCandidateValidator implementation.
@@ -36,7 +37,13 @@
 
  private:
   std::unique_ptr<ui::OverlayCandidatesOzone> overlay_candidates_;
-  bool single_fullscreen_;
+  // Callback declaration to allocate a new OverlayProcessor::Strategy.
+  using StrategyInstantiator =
+      base::Callback<std::unique_ptr<cc::OverlayProcessor::Strategy>(
+          CompositorOverlayCandidateValidatorOzone*)>;
+  // List callbacks used to instantiate OverlayProcessor::Strategy
+  // as defined by |strategies_string| paramter in the constructor.
+  std::vector<StrategyInstantiator> strategies_instantiators;
   bool software_mirror_active_;
 
   DISALLOW_COPY_AND_ASSIGN(CompositorOverlayCandidateValidatorOzone);
diff --git a/components/dom_distiller/content/browser/distillability_driver.cc b/components/dom_distiller/content/browser/distillability_driver.cc
index ad97854..8d5b06e6 100644
--- a/components/dom_distiller/content/browser/distillability_driver.cc
+++ b/components/dom_distiller/content/browser/distillability_driver.cc
@@ -5,6 +5,7 @@
 #include "components/dom_distiller/content/browser/distillability_driver.h"
 
 #include "base/memory/ptr_util.h"
+#include "content/public/browser/navigation_handle.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_observer.h"
@@ -88,10 +89,10 @@
   SetupMojoService(new_host);
 }
 
-void DistillabilityDriver::DidStartProvisionalLoadForFrame(
-    content::RenderFrameHost* render_frame_host, const GURL& validated_url,
-    bool is_error_page) {
-  SetupMojoService(render_frame_host);
+void DistillabilityDriver::ReadyToCommitNavigation(
+      content::NavigationHandle* navigation_handle) {
+  if (!navigation_handle->IsSamePage())
+    SetupMojoService(navigation_handle->GetRenderFrameHost());
 }
 
 void DistillabilityDriver::SetupMojoService(
diff --git a/components/dom_distiller/content/browser/distillability_driver.h b/components/dom_distiller/content/browser/distillability_driver.h
index f547e6a..68d98ea 100644
--- a/components/dom_distiller/content/browser/distillability_driver.h
+++ b/components/dom_distiller/content/browser/distillability_driver.h
@@ -26,10 +26,8 @@
   void SetDelegate(const base::Callback<void(bool, bool)>& delegate);
 
   // content::WebContentsObserver implementation.
-  void DidStartProvisionalLoadForFrame(
-      content::RenderFrameHost* render_frame_host,
-      const GURL& validated_url,
-      bool is_error_page) override;
+  void ReadyToCommitNavigation(
+      content::NavigationHandle* navigation_handle) override;
   void RenderFrameHostChanged(
       content::RenderFrameHost* old_host,
       content::RenderFrameHost* new_host) override;
diff --git a/components/exo/BUILD.gn b/components/exo/BUILD.gn
index 227501d3..1250c40 100644
--- a/components/exo/BUILD.gn
+++ b/components/exo/BUILD.gn
@@ -72,6 +72,10 @@
     "//ui/wm",
   ]
 
+  if (use_ozone) {
+    deps += [ "//ui/ozone" ]
+  }
+
   if (is_chromeos) {
     deps += [ "//chromeos" ]
   }
diff --git a/components/exo/display.cc b/components/exo/display.cc
index 505a7a7..e3554d0 100644
--- a/components/exo/display.cc
+++ b/components/exo/display.cc
@@ -27,17 +27,50 @@
 #include "gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h"
 #include "third_party/khronos/GLES2/gl2.h"
 #include "third_party/khronos/GLES2/gl2ext.h"
+#include "ui/ozone/public/ozone_switches.h"
 #endif
 
 namespace exo {
+namespace {
+#if defined(USE_OZONE)
+// TODO(dcastagna): The following formats should be determined at runtime
+// querying kms (via ozone).
+const gfx::BufferFormat kOverlayFormats[] = {
+// TODO(dcastagna): Remove RGBX/RGBA once all the platforms using the fullscreen
+// optimization will have switched to atomic.
+#if defined(ARCH_CPU_ARM_FAMILY)
+    gfx::BufferFormat::RGBX_8888, gfx::BufferFormat::RGBA_8888,
+#endif
+    gfx::BufferFormat::BGRX_8888, gfx::BufferFormat::BGRA_8888};
+
+const gfx::BufferFormat kOverlayFormatsForDrmAtomic[] = {
+    gfx::BufferFormat::RGBX_8888, gfx::BufferFormat::RGBA_8888,
+    gfx::BufferFormat::BGR_565};
+#endif
+
+}  // namespace
 
 ////////////////////////////////////////////////////////////////////////////////
 // Display, public:
 
-Display::Display() : notification_surface_manager_(nullptr) {}
+Display::Display() : Display(nullptr) {}
 
 Display::Display(NotificationSurfaceManager* notification_surface_manager)
-    : notification_surface_manager_(notification_surface_manager) {}
+    : notification_surface_manager_(notification_surface_manager)
+#if defined(USE_OZONE)
+      ,
+      overlay_formats_(std::begin(kOverlayFormats), std::end(kOverlayFormats))
+#endif
+{
+#if defined(USE_OZONE)
+  if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+          switches::kEnableDrmAtomic)) {
+    overlay_formats_.insert(overlay_formats_.end(),
+                            std::begin(kOverlayFormatsForDrmAtomic),
+                            std::end(kOverlayFormatsForDrmAtomic));
+  }
+#endif
+}
 
 Display::~Display() {}
 
@@ -87,13 +120,9 @@
   // Using zero-copy for optimal performance.
   bool use_zero_copy = true;
 
-  // List of overlay formats that are known to be supported.
-  // TODO(reveman): Determine this at runtime.
-  const gfx::BufferFormat kOverlayFormats[] = {gfx::BufferFormat::RGBA_8888,
-                                               gfx::BufferFormat::RGBX_8888};
   bool is_overlay_candidate =
-      std::find(std::begin(kOverlayFormats), std::end(kOverlayFormats),
-                format) != std::end(kOverlayFormats);
+      std::find(overlay_formats_.begin(), overlay_formats_.end(), format) !=
+      overlay_formats_.end();
 
   return base::MakeUnique<Buffer>(
       std::move(gpu_memory_buffer), GL_TEXTURE_EXTERNAL_OES,
diff --git a/components/exo/display.h b/components/exo/display.h
index d4f3b3d..dd9098a 100644
--- a/components/exo/display.h
+++ b/components/exo/display.h
@@ -90,6 +90,10 @@
  private:
   NotificationSurfaceManager* const notification_surface_manager_;
 
+#if defined(USE_OZONE)
+  std::vector<gfx::BufferFormat> overlay_formats_;
+#endif
+
   DISALLOW_COPY_AND_ASSIGN(Display);
 };
 
diff --git a/components/ntp_tiles/field_trial.cc b/components/ntp_tiles/field_trial.cc
index 39f4b725..ce421dc 100644
--- a/components/ntp_tiles/field_trial.cc
+++ b/components/ntp_tiles/field_trial.cc
@@ -14,6 +14,7 @@
 #include "components/ntp_tiles/constants.h"
 #include "components/ntp_tiles/field_trial.h"
 #include "components/ntp_tiles/switches.h"
+#include "components/variations/variations_associated_data.h"
 
 #if defined(OS_ANDROID)
 #include "base/android/jni_android.h"
@@ -65,7 +66,13 @@
                        kTotalProbability);
   } else {
     trial->AppendGroup(kPopularSiteControlGroup, kEnabledAndControlProbability);
+    AssociateGoogleVariationID(variations::GOOGLE_WEB_PROPERTIES,
+                               kPopularSitesFieldTrialName,
+                               kPopularSiteControlGroup, 3312959);
     trial->AppendGroup(kPopularSiteEnabledGroup, kEnabledAndControlProbability);
+    AssociateGoogleVariationID(variations::GOOGLE_WEB_PROPERTIES,
+                               kPopularSitesFieldTrialName,
+                               kPopularSiteEnabledGroup, 3312958);
   }
 }
 
diff --git a/components/plugins/renderer/webview_plugin.cc b/components/plugins/renderer/webview_plugin.cc
index 0e57baa5..075515a0 100644
--- a/components/plugins/renderer/webview_plugin.cc
+++ b/components/plugins/renderer/webview_plugin.cc
@@ -254,7 +254,7 @@
   // consistent view of our preferences.
   content::RenderView::ApplyWebPreferences(preferences, web_view_);
   WebLocalFrame* web_frame = WebLocalFrame::create(
-      blink::WebTreeScopeType::Document, this);
+      blink::WebTreeScopeType::Document, this, nullptr, nullptr);
   web_view_->setMainFrame(web_frame);
   // TODO(dcheng): The main frame widget currently has a special case.
   // Eliminate this once WebView is no longer a WebWidget.
diff --git a/components/policy/proto/device_management_backend.proto b/components/policy/proto/device_management_backend.proto
index 7b79425..acae921 100644
--- a/components/policy/proto/device_management_backend.proto
+++ b/components/policy/proto/device_management_backend.proto
@@ -1186,6 +1186,37 @@
   optional DeviceRegisterRequest device_register_request = 3;
 }
 
+// Gets an enrollment token to a managed Google Play account for using it with
+// Active Directory. Sent when a new user logs in with Active Directory and
+// opens Play Store for the first time.
+message ActiveDirectoryEnrollPlayUserRequest {}
+
+// The result when a new user logs in to Play Store with Active Directory.
+// 903 Arc Disabled HTTP error code is returned if the reason of the failure is
+//     that ARC is not enabled for the domain.
+// 403 Forbidden HTTP error code is returned if the device can't get Managed
+//     Google Play accounts.
+message ActiveDirectoryEnrollPlayUserResponse {
+  // The enrollment token which can be used to fetch a Managed Google Play
+  // account.
+  optional string enrollment_token = 1;
+  // The user id which identifies the user enrolled by this token. This user id
+  // is opaque to the client and is only used in the ActiveDirectoryPlayActivity
+  // requests.
+  optional string user_id = 2;
+}
+
+// Reports that a managed Google Play account is used. This makes the garbage
+// collection of accounts possible by reporting the ones which are still in use.
+message ActiveDirectoryPlayActivityRequest {
+  // The user id received in ActiveDirectoryEnrollPlayUserResponse which
+  // identifies the user.
+  optional string user_id = 1;
+}
+
+// Response to the Play account activity request.
+message ActiveDirectoryPlayActivityResponse {}
+
 // Request from the DMAgent on the device to the DMServer.  This is
 // container for all requests from device to server.  The overall HTTP
 // request MUST be in the following format:
@@ -1212,6 +1243,8 @@
 //     * gcm_id_update
 //     * check_android_management
 //     * certificate_based_register
+//     * active_directory_enroll_play_user
+//     * active_directory_play_activity
 //
 //   * devicetype: MUST BE "1" for Android or "2" for Chrome OS.
 //   * apptype: MUST BE Android or Chrome.
@@ -1221,8 +1254,9 @@
 //   * For register, ping and check_android_management requests
 //     Authorization: GoogleLogin auth=<auth cookie for Mobile Sync>
 //
-//   * For unregister, policy, status, cert_upload, remote commands requests,
-//     and gcm id update requests
+//   * For unregister, policy, status, cert_upload, remote_commands,
+//     gcm_id_update, active_directory_enroll_play_user and
+//     active_directory_play_activity requests
 //      Authorization: GoogleDMToken token=<dm token from register>
 //
 //   * The Authorization header isn't used for enterprise_check or for
@@ -1306,6 +1340,14 @@
   optional CertificateBasedDeviceRegisterRequest
       certificate_based_register_request = 18;
 
+  // Gets an enrollment token to a Managed Google Play Account for using it with
+  // Active Directory.
+  optional ActiveDirectoryEnrollPlayUserRequest
+      active_directory_enroll_play_user_request = 19;
+
+  // Reports that a Play account is used.
+  optional ActiveDirectoryPlayActivityRequest
+      active_directory_play_activity_request = 20;
 }
 
 // Response from server to device.
@@ -1327,6 +1369,7 @@
 // 500 Internal Server Error: most likely a bug in DM server.
 // 503 Service Unavailable: most likely a backend error.
 // 902 Policy Not Found: the policy is not found.
+// 903 Arc Disabled: ARC is not enabled on the domain.
 message DeviceManagementResponse {
   // TODO(hong): move error handling to HTTP level.
   // Error code to client.
@@ -1409,4 +1452,12 @@
   // Response to check Android management request.
   optional CheckAndroidManagementResponse
       check_android_management_response = 18;
+
+  // Response to an Active Directory Play user enrollment request.
+  optional ActiveDirectoryEnrollPlayUserResponse
+      active_directory_enroll_play_user_response = 19;
+
+  // Response to a Play activity request.
+  optional ActiveDirectoryPlayActivityResponse
+      active_directory_play_activity_response = 20;
 }
diff --git a/components/printing/renderer/print_web_view_helper.cc b/components/printing/renderer/print_web_view_helper.cc
index 3144c40..b54f114 100644
--- a/components/printing/renderer/print_web_view_helper.cc
+++ b/components/printing/renderer/print_web_view_helper.cc
@@ -587,7 +587,7 @@
 
   blink::WebFrameClient frame_client;
   blink::WebLocalFrame* frame = blink::WebLocalFrame::create(
-      blink::WebTreeScopeType::Document, &frame_client);
+      blink::WebTreeScopeType::Document, &frame_client, nullptr, nullptr);
   web_view->setMainFrame(frame);
   blink::WebFrameWidget::create(nullptr, web_view, frame);
 
@@ -809,8 +809,8 @@
       blink::WebView::create(this, blink::WebPageVisibilityStateVisible);
   owns_web_view_ = true;
   content::RenderView::ApplyWebPreferences(prefs, web_view);
-  blink::WebLocalFrame* main_frame =
-      blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, this);
+  blink::WebLocalFrame* main_frame = blink::WebLocalFrame::create(
+      blink::WebTreeScopeType::Document, this, nullptr, nullptr);
   web_view->setMainFrame(main_frame);
   blink::WebFrameWidget::create(this, web_view, main_frame);
   frame_.Reset(web_view->mainFrame()->toWebLocalFrame());
@@ -842,7 +842,8 @@
     const blink::WebString& unique_name,
     blink::WebSandboxFlags sandbox_flags,
     const blink::WebFrameOwnerProperties& frame_owner_properties) {
-  blink::WebLocalFrame* frame = blink::WebLocalFrame::create(scope, this);
+  blink::WebLocalFrame* frame =
+      blink::WebLocalFrame::create(scope, this, nullptr, nullptr);
   parent->appendChild(frame);
   return frame;
 }
diff --git a/components/signin/core/browser/BUILD.gn b/components/signin/core/browser/BUILD.gn
index a381719..798d314 100644
--- a/components/signin/core/browser/BUILD.gn
+++ b/components/signin/core/browser/BUILD.gn
@@ -83,6 +83,7 @@
     "//base:i18n",
     "//components/content_settings/core/browser",
     "//components/content_settings/core/common",
+    "//components/data_use_measurement/core",
     "//components/google/core/browser",
     "//components/invalidation/public",
     "//components/keyed_service/core",
diff --git a/components/signin/core/browser/DEPS b/components/signin/core/browser/DEPS
index 2619fdc..8ca3732 100644
--- a/components/signin/core/browser/DEPS
+++ b/components/signin/core/browser/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/data_use_measurement/core",
   "+components/invalidation/public",
   "+components/metrics",
   "+google/cacheinvalidation",
diff --git a/components/signin/core/browser/gaia_cookie_manager_service.cc b/components/signin/core/browser/gaia_cookie_manager_service.cc
index 6d648ef0..569c233b 100644
--- a/components/signin/core/browser/gaia_cookie_manager_service.cc
+++ b/components/signin/core/browser/gaia_cookie_manager_service.cc
@@ -15,6 +15,7 @@
 #include "base/strings/stringprintf.h"
 #include "base/time/time.h"
 #include "base/values.h"
+#include "components/data_use_measurement/core/data_use_user_data.h"
 #include "components/signin/core/browser/account_tracker_service.h"
 #include "components/signin/core/browser/signin_metrics.h"
 #include "google_apis/gaia/gaia_auth_fetcher.h"
@@ -215,6 +216,8 @@
   fetcher->SetRequestContext(helper_->request_context());
   fetcher->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
                         net::LOAD_DO_NOT_SAVE_COOKIES);
+  data_use_measurement::DataUseUserData::AttachToFetcher(
+      fetcher.get(), data_use_measurement::DataUseUserData::SIGNIN);
 
   // Fetchers are sometimes cancelled because a network change was detected,
   // especially at startup and after sign-in on ChromeOS.
diff --git a/components/sync/syncable/directory.cc b/components/sync/syncable/directory.cc
index d8f708ed..981e2e4 100644
--- a/components/sync/syncable/directory.cc
+++ b/components/sync/syncable/directory.cc
@@ -919,6 +919,7 @@
       base::StringPrintf("sync/0x%" PRIXPTR, reinterpret_cast<uintptr_t>(this));
 
   size_t kernel_memory_usage;
+  size_t model_type_entry_count[MODEL_TYPE_COUNT] = {0};
   {
     using base::trace_event::EstimateMemoryUsage;
 
@@ -938,6 +939,31 @@
         EstimateMemoryUsage(kernel_->metahandles_to_purge) +
         EstimateMemoryUsage(kernel_->persisted_info) +
         EstimateMemoryUsage(kernel_->cache_guid);
+
+    for (const auto& handle_and_kernel : kernel_->metahandles_map) {
+      const EntryKernel* kernel = handle_and_kernel.second.get();
+      // Counting logic from DirectoryBackingStore::LoadEntries()
+      ModelType model_type = kernel->GetModelType();
+      if (!IsRealDataType(model_type)) {
+        model_type = kernel->GetServerModelType();
+      }
+      ++model_type_entry_count[model_type];
+    }
+  }
+
+  // Similar to UploadModelTypeEntryCount()
+  for (size_t i = FIRST_REAL_MODEL_TYPE; i != MODEL_TYPE_COUNT; ++i) {
+    ModelType model_type = static_cast<ModelType>(i);
+    std::string notification_type;
+    if (RealModelTypeToNotificationType(model_type, &notification_type)) {
+      std::string dump_name =
+          base::StringPrintf("%s/model_type/%s", dump_name_base.c_str(),
+                             notification_type.c_str());
+      pmd->CreateAllocatorDump(dump_name)->AddScalar(
+          base::trace_event::MemoryAllocatorDump::kNameObjectCount,
+          base::trace_event::MemoryAllocatorDump::kUnitsObjects,
+          model_type_entry_count[i]);
+    }
   }
 
   {
diff --git a/components/web_resource/BUILD.gn b/components/web_resource/BUILD.gn
index 7d4f5f4d..a80ee8d2 100644
--- a/components/web_resource/BUILD.gn
+++ b/components/web_resource/BUILD.gn
@@ -16,6 +16,7 @@
 
   deps = [
     "//base",
+    "//components/data_use_measurement/core",
     "//components/google/core/browser",
     "//components/pref_registry",
     "//components/prefs",
diff --git a/components/web_resource/DEPS b/components/web_resource/DEPS
index 71127972..7140ec9d 100644
--- a/components/web_resource/DEPS
+++ b/components/web_resource/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/data_use_measurement/core",
   "+components/google/core",
   "+components/pref_registry",
   "+components/prefs",
diff --git a/components/web_resource/web_resource_service.cc b/components/web_resource/web_resource_service.cc
index 544b9d8..9d2e5d7 100644
--- a/components/web_resource/web_resource_service.cc
+++ b/components/web_resource/web_resource_service.cc
@@ -14,6 +14,7 @@
 #include "base/threading/thread_task_runner_handle.h"
 #include "base/time/time.h"
 #include "base/values.h"
+#include "components/data_use_measurement/core/data_use_user_data.h"
 #include "components/google/core/browser/google_util.h"
 #include "components/prefs/pref_service.h"
 #include "net/base/load_flags.h"
@@ -129,6 +130,9 @@
   DVLOG(1) << "WebResourceService StartFetch " << web_resource_server;
   url_fetcher_ =
       net::URLFetcher::Create(web_resource_server, net::URLFetcher::GET, this);
+  data_use_measurement::DataUseUserData::AttachToFetcher(
+      url_fetcher_.get(),
+      data_use_measurement::DataUseUserData::WEB_RESOURCE_SERVICE);
   // Do not let url fetcher affect existing state in system context
   // (by setting cookies, for example).
   url_fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE |
diff --git a/content/browser/cache_storage/cache_storage_cache.h b/content/browser/cache_storage/cache_storage_cache.h
index 9564d71..2b9dbeb1 100644
--- a/content/browser/cache_storage/cache_storage_cache.h
+++ b/content/browser/cache_storage/cache_storage_cache.h
@@ -33,7 +33,6 @@
 }
 
 namespace content {
-class CacheMetadata;
 class CacheStorage;
 class CacheStorageBlobToDiskCache;
 class CacheStorageCacheHandle;
diff --git a/content/browser/cache_storage/cache_storage_index.h b/content/browser/cache_storage/cache_storage_index.h
index 3665ec6..4d4f64d 100644
--- a/content/browser/cache_storage/cache_storage_index.h
+++ b/content/browser/cache_storage/cache_storage_index.h
@@ -14,8 +14,6 @@
 
 namespace content {
 
-class CacheMetadata;
-
 // CacheStorageIndex maintains an ordered list of metadata (CacheMetadata)
 // for each cache owned by a CacheStorage object. This class is not thread safe,
 // and is owned by the CacheStorage.
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 3bed7574..8a0995a4 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -243,8 +243,7 @@
             ->CreateOverlayCandidates(widget);
     validator.reset(
         new display_compositor::CompositorOverlayCandidateValidatorOzone(
-            std::move(overlay_candidates),
-            enable_overlay_flag == "single-fullscreen"));
+            std::move(overlay_candidates), enable_overlay_flag));
   }
 #elif defined(OS_MACOSX)
   // Overlays are only supported through the remote layer API.
diff --git a/content/browser/compositor/reflector_impl_unittest.cc b/content/browser/compositor/reflector_impl_unittest.cc
index cbc0ec0..3e41a4b 100644
--- a/content/browser/compositor/reflector_impl_unittest.cc
+++ b/content/browser/compositor/reflector_impl_unittest.cc
@@ -68,7 +68,7 @@
       new display_compositor::CompositorOverlayCandidateValidatorOzone(
           std::unique_ptr<ui::OverlayCandidatesOzone>(
               new TestOverlayCandidatesOzone()),
-          false));
+          ""));
 #else
   return nullptr;
 #endif  // defined(USE_OZONE)
diff --git a/content/browser/renderer_host/media/media_devices_manager.cc b/content/browser/renderer_host/media/media_devices_manager.cc
index ccc3b4d..e8d7f7de 100644
--- a/content/browser/renderer_host/media/media_devices_manager.cc
+++ b/content/browser/renderer_host/media/media_devices_manager.cc
@@ -385,8 +385,7 @@
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   MediaDeviceInfoArray snapshot;
   for (const auto& descriptor : descriptors) {
-    snapshot.emplace_back(descriptor.device_id, descriptor.GetNameAndModel(),
-                          std::string());
+    snapshot.emplace_back(descriptor);
   }
   DevicesEnumerated(MEDIA_DEVICE_TYPE_VIDEO_INPUT, snapshot);
 }
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index fd9241227..9dbd3a3e 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -254,8 +254,8 @@
   if (command_line.HasSwitch(switches::kEnableSlimmingPaintV2))
     WebRuntimeFeatures::enableSlimmingPaintV2(true);
 
-  if (base::FeatureList::IsEnabled(features::kSlimmingPaintInvalidation))
-    WebRuntimeFeatures::enableSlimmingPaintInvalidation(true);
+  WebRuntimeFeatures::enableSlimmingPaintInvalidation(
+      base::FeatureList::IsEnabled(features::kSlimmingPaintInvalidation));
 
   if (command_line.HasSwitch(switches::kEnableSlimmingPaintInvalidation))
     WebRuntimeFeatures::enableSlimmingPaintInvalidation(true);
diff --git a/content/common/media/media_devices.cc b/content/common/media/media_devices.cc
index a18349b8..8066191 100644
--- a/content/common/media/media_devices.cc
+++ b/content/common/media/media_devices.cc
@@ -4,9 +4,16 @@
 
 #include "content/common/media/media_devices.h"
 #include "media/audio/audio_device_description.h"
+#include "media/capture/video/video_capture_device_descriptor.h"
 
 namespace content {
 
+MediaDeviceInfo::MediaDeviceInfo() = default;
+
+MediaDeviceInfo::MediaDeviceInfo(const MediaDeviceInfo& other) = default;
+
+MediaDeviceInfo::MediaDeviceInfo(MediaDeviceInfo&& other) = default;
+
 MediaDeviceInfo::MediaDeviceInfo(const std::string& device_id,
                                  const std::string& label,
                                  const std::string& group_id)
@@ -18,6 +25,17 @@
       label(device_description.device_name),
       group_id(device_description.group_id) {}
 
+MediaDeviceInfo::MediaDeviceInfo(
+    const media::VideoCaptureDeviceDescriptor& descriptor)
+    : device_id(descriptor.device_id), label(descriptor.GetNameAndModel()) {}
+
+MediaDeviceInfo::~MediaDeviceInfo() = default;
+
+MediaDeviceInfo& MediaDeviceInfo::operator=(const MediaDeviceInfo& other) =
+    default;
+
+MediaDeviceInfo& MediaDeviceInfo::operator=(MediaDeviceInfo&& other) = default;
+
 bool operator==(const MediaDeviceInfo& first, const MediaDeviceInfo& second) {
   return first.device_id == second.device_id && first.label == second.label;
 }
diff --git a/content/common/media/media_devices.h b/content/common/media/media_devices.h
index 6ac1e2c5..a7bf705 100644
--- a/content/common/media/media_devices.h
+++ b/content/common/media/media_devices.h
@@ -12,6 +12,7 @@
 
 namespace media {
 struct AudioDeviceDescription;
+struct VideoCaptureDeviceDescriptor;
 }
 
 namespace content {
@@ -24,12 +25,18 @@
 };
 
 struct CONTENT_EXPORT MediaDeviceInfo {
-  MediaDeviceInfo() = default;
+  MediaDeviceInfo();
+  MediaDeviceInfo(const MediaDeviceInfo& other);
+  MediaDeviceInfo(MediaDeviceInfo&& other);
   MediaDeviceInfo(const std::string& device_id,
                   const std::string& label,
                   const std::string& group_id);
+  explicit MediaDeviceInfo(const media::AudioDeviceDescription& description);
   explicit MediaDeviceInfo(
-      const media::AudioDeviceDescription& device_description);
+      const media::VideoCaptureDeviceDescriptor& descriptor);
+  ~MediaDeviceInfo();
+  MediaDeviceInfo& operator=(const MediaDeviceInfo& other);
+  MediaDeviceInfo& operator=(MediaDeviceInfo&& other);
 
   std::string device_id;
   std::string label;
diff --git a/content/common/media/media_devices_unittest.cc b/content/common/media/media_devices_unittest.cc
new file mode 100644
index 0000000..d6fd624
--- /dev/null
+++ b/content/common/media/media_devices_unittest.cc
@@ -0,0 +1,35 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/common/media/media_devices.h"
+#include "media/audio/audio_device_description.h"
+#include "media/capture/video/video_capture_device_descriptor.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace content {
+
+TEST(MediaDevicesTest, MediaDeviceInfoFromAudioDescription) {
+  const std::string kFakeDeviceID = "fake_device_id";
+  const std::string kFakeLabel = "fake_label";
+  const std::string kFakeGroupID = "fake_group_id";
+
+  media::AudioDeviceDescription description(kFakeLabel, kFakeDeviceID,
+                                            kFakeGroupID);
+  MediaDeviceInfo device_info(description);
+  EXPECT_EQ(kFakeDeviceID, device_info.device_id);
+  EXPECT_EQ(kFakeLabel, device_info.label);
+  EXPECT_EQ(kFakeGroupID, device_info.group_id);
+}
+
+TEST(MediaDevicesTest, MediaDeviceInfoFromVideoDescriptor) {
+  media::VideoCaptureDeviceDescriptor descriptor(
+      "display_name", "device_id", "model_id", media::VideoCaptureApi::UNKNOWN);
+
+  // TODO(guidou): Add test for group ID when supported. See crbug.com/627793.
+  MediaDeviceInfo device_info(descriptor);
+  EXPECT_EQ(descriptor.device_id, device_info.device_id);
+  EXPECT_EQ(descriptor.GetNameAndModel(), device_info.label);
+}
+
+}  // namespace content
diff --git a/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java b/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
index fde50c8..0deff1f 100644
--- a/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
+++ b/content/public/android/java/src/org/chromium/content/app/ChildProcessServiceImpl.java
@@ -53,7 +53,12 @@
 public class ChildProcessServiceImpl {
     private static final String MAIN_THREAD_NAME = "ChildProcessMain";
     private static final String TAG = "ChildProcessService";
+
+    // Lock that protects the following members.
+    private final Object mBinderLock = new Object();
     private IChildProcessCallback mCallback;
+    // PID of the client of this service, set in bindToCaller().
+    private int mBoundCallingPid;
 
     // This is the native "Main" thread for the renderer / utility process.
     private Thread mMainThread;
@@ -97,10 +102,38 @@
     private final IChildProcessService.Stub mBinder = new IChildProcessService.Stub() {
         // NOTE: Implement any IChildProcessService methods here.
         @Override
+        public boolean bindToCaller() {
+            synchronized (mBinderLock) {
+                int callingPid = Binder.getCallingPid();
+                if (mBoundCallingPid == 0) {
+                    mBoundCallingPid = callingPid;
+                } else if (mBoundCallingPid != callingPid) {
+                    Log.e(TAG, "Service is already bound by pid %d, cannot bind for pid %d",
+                            mBoundCallingPid, callingPid);
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        @Override
         public int setupConnection(Bundle args, IChildProcessCallback callback) {
-            mCallback = callback;
-            getServiceInfo(args);
-            return Process.myPid();
+            int callingPid = Binder.getCallingPid();
+            synchronized (mBinderLock) {
+                if (mBoundCallingPid != callingPid) {
+                    if (mBoundCallingPid == 0) {
+                        Log.e(TAG, "Service has not been bound with bindToCaller()");
+                    } else {
+                        Log.e(TAG, "Client pid %d does not match the bound pid %d", callingPid,
+                                mBoundCallingPid);
+                    }
+                    return -1;
+                }
+
+                mCallback = callback;
+                getServiceInfo(args);
+                return Process.myPid();
+            }
         }
 
         @Override
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java
index 8f935906..5010aa96 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnection.java
@@ -27,6 +27,24 @@
     }
 
     /**
+     * Used to notify the consumer about the process start. These callbacks will be invoked before
+     * the ConnectionCallbacks.
+     */
+    interface StartCallback {
+        /**
+         * Called when the child process has successfully started and is ready for connection
+         * setup.
+         */
+        void onChildStarted();
+
+        /**
+         * Called when the child process failed to start. This can happen if the process is already
+         * in use by another client.
+         */
+        void onChildStartFailed();
+    }
+
+    /**
      * Used to notify the consumer about the connection being established.
      */
     interface ConnectionCallback {
@@ -57,8 +75,9 @@
      * remainder later while reducing the connection setup latency.
      * @param commandLine (optional) command line for the child process. If omitted, then
      *                    the command line parameters must instead be passed to setupConnection().
+     * @param startCallback (optional) callback when the child process starts or fails to start.
      */
-    void start(String[] commandLine);
+    void start(String[] commandLine, StartCallback startCallback);
 
     /**
      * Setups the connection after it was started with start().
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
index 9dac1747..d15a9ca 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessConnectionImpl.java
@@ -97,6 +97,9 @@
         }
     }
 
+    // This is set in start() and is used in onServiceConnected().
+    private ChildProcessConnection.StartCallback mStartCallback;
+
     // This is set in setupConnection() and is later used in doConnectionSetupLocked(), after which
     // the variable is cleared. Therefore this is only valid while the connection is being set up.
     private ConnectionParams mConnectionParams;
@@ -168,6 +171,21 @@
                             "ChildProcessConnectionImpl.ChildServiceConnection.onServiceConnected");
                     mServiceConnectComplete = true;
                     mService = IChildProcessService.Stub.asInterface(service);
+
+                    boolean boundToUs = false;
+                    try {
+                        boundToUs = mService.bindToCaller();
+                    } catch (RemoteException ex) {
+                    }
+                    if (!boundToUs) {
+                        if (mStartCallback != null) {
+                            mStartCallback.onChildStartFailed();
+                        }
+                        return;
+                    } else if (mStartCallback != null) {
+                        mStartCallback.onChildStarted();
+                    }
+
                     // Run the setup if the connection parameters have already been provided. If
                     // not, doConnectionSetupLocked() will be called from setupConnection().
                     if (mConnectionParams != null) {
@@ -289,7 +307,7 @@
     }
 
     @Override
-    public void start(String[] commandLine) {
+    public void start(String[] commandLine, ChildProcessConnection.StartCallback startCallback) {
         try {
             TraceEvent.begin("ChildProcessConnectionImpl.start");
             synchronized (mLock) {
@@ -297,6 +315,8 @@
                 assert mConnectionParams == null :
                         "setupConnection() called before start() in ChildProcessConnectionImpl.";
 
+                mStartCallback = startCallback;
+
                 if (!mInitialBinding.bind(commandLine)) {
                     Log.e(TAG, "Failed to establish the service connection.");
                     // We have to notify the caller so that they can free-up associated resources.
diff --git a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
index aed55c3..3ae8def 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ChildProcessLauncher.java
@@ -8,6 +8,7 @@
 import android.content.Context;
 import android.content.pm.ApplicationInfo;
 import android.content.pm.PackageManager;
+import android.os.AsyncTask;
 import android.os.Bundle;
 import android.os.ParcelFileDescriptor;
 import android.os.RemoteException;
@@ -413,12 +414,13 @@
 
     private static ChildProcessConnection allocateBoundConnection(Context context,
             String[] commandLine, boolean inSandbox, boolean alwaysInForeground,
-            ChildProcessCreationParams creationParams) {
+            ChildProcessCreationParams creationParams,
+            ChildProcessConnection.StartCallback startCallback) {
         ChromiumLinkerParams chromiumLinkerParams = getLinkerParamsForNewConnection();
         ChildProcessConnection connection = allocateConnection(
                 context, inSandbox, chromiumLinkerParams, alwaysInForeground, creationParams);
         if (connection != null) {
-            connection.start(commandLine);
+            connection.start(commandLine, startCallback);
 
             String packageName = creationParams != null ? creationParams.getPackageName()
                     : context.getPackageName();
@@ -436,7 +438,7 @@
     private static final long FREE_CONNECTION_DELAY_MILLIS = 1;
 
     private static void freeConnection(ChildProcessConnection connection) {
-        synchronized (ChildProcessLauncher.class) {
+        synchronized (sSpareConnectionLock) {
             if (connection.equals(sSpareSandboxedConnection)) sSpareSandboxedConnection = null;
         }
 
@@ -483,8 +485,16 @@
     private static Map<Integer, ChildProcessConnection> sServiceMap =
             new ConcurrentHashMap<Integer, ChildProcessConnection>();
 
+    // Lock and monitor for these members {{{
+    private static final Object sSpareConnectionLock = new Object();
     // A pre-allocated and pre-bound connection ready for connection setup, or null.
     private static ChildProcessConnection sSpareSandboxedConnection;
+    // If sSpareSandboxedConnection is not null, this indicates whether the service is
+    // ready for connection setup. Wait on the monitor lock to be notified when this
+    // state changes. sSpareSandboxedConnection may be null after waiting, if starting
+    // the service failed.
+    private static boolean sSpareConnectionStarting;
+    // }}}
 
     // Manages oom bindings used to bind chind services.
     private static BindingManager sBindingManager = BindingManagerImpl.createBindingManager();
@@ -567,15 +577,38 @@
      * @param context the application context used for the connection.
      */
     public static void warmUp(Context context) {
-        synchronized (ChildProcessLauncher.class) {
+        synchronized (sSpareConnectionLock) {
             assert !ThreadUtils.runningOnUiThread();
             if (sSpareSandboxedConnection == null) {
                 ChildProcessCreationParams params = ChildProcessCreationParams.get();
                 if (params != null) {
                     params = params.copy();
                 }
+
+                sSpareConnectionStarting = true;
+
+                ChildProcessConnection.StartCallback startCallback =
+                        new ChildProcessConnection.StartCallback() {
+                            @Override
+                            public void onChildStarted() {
+                                synchronized (sSpareConnectionLock) {
+                                    sSpareConnectionStarting = false;
+                                    sSpareConnectionLock.notify();
+                                }
+                            }
+
+                            @Override
+                            public void onChildStartFailed() {
+                                Log.e(TAG, "Failed to warm up the spare sandbox service");
+                                synchronized (sSpareConnectionLock) {
+                                    sSpareSandboxedConnection = null;
+                                    sSpareConnectionStarting = false;
+                                    sSpareConnectionLock.notify();
+                                }
+                            }
+                        };
                 sSpareSandboxedConnection = allocateBoundConnection(context, null, true, false,
-                        params);
+                        params, startCallback);
             }
         }
     }
@@ -653,24 +686,30 @@
                 callbackType, inSandbox, params);
     }
 
-    private static void startInternal(
-            Context context,
+    private static ChildProcessConnection startInternal(
+            final Context context,
             final String[] commandLine,
-            int childProcessId,
-            FileDescriptorInfo[] filesToBeMapped,
-            long clientContext,
-            int callbackType,
-            boolean inSandbox,
-            ChildProcessCreationParams creationParams) {
+            final int childProcessId,
+            final FileDescriptorInfo[] filesToBeMapped,
+            final long clientContext,
+            final int callbackType,
+            final boolean inSandbox,
+            final ChildProcessCreationParams creationParams) {
         try {
             TraceEvent.begin("ChildProcessLauncher.startInternal");
 
             ChildProcessConnection allocatedConnection = null;
             String packageName = creationParams != null ? creationParams.getPackageName()
                     : context.getPackageName();
-            synchronized (ChildProcessLauncher.class) {
+            synchronized (sSpareConnectionLock) {
                 if (inSandbox && sSpareSandboxedConnection != null
                         && sSpareSandboxedConnection.getPackageName().equals(packageName)) {
+                    while (sSpareConnectionStarting) {
+                        try {
+                            sSpareConnectionLock.wait();
+                        } catch (InterruptedException ex) {
+                        }
+                    }
                     allocatedConnection = sSpareSandboxedConnection;
                     sSpareSandboxedConnection = null;
                 }
@@ -680,15 +719,39 @@
                 if (callbackType == CALLBACK_FOR_GPU_PROCESS) alwaysInForeground = true;
                 PendingSpawnQueue pendingSpawnQueue = getPendingSpawnQueue(
                         context, packageName, inSandbox);
+                ChildProcessConnection.StartCallback startCallback =
+                        new ChildProcessConnection.StartCallback() {
+                            @Override
+                            public void onChildStarted() {}
+
+                            @Override
+                            public void onChildStartFailed() {
+                                Log.e(TAG, "ChildProcessConnection.start failed, trying again");
+                                AsyncTask.THREAD_POOL_EXECUTOR.execute(new Runnable() {
+                                    @Override
+                                    public void run() {
+                                        // The child process may already be bound to another client
+                                        // (this can happen if multi-process WebView is used in more
+                                        // than one process), so try starting the process again.
+                                        // This connection that failed to start has not been freed,
+                                        // so a new bound connection will be allocated.
+                                        startInternal(context, commandLine, childProcessId,
+                                                filesToBeMapped, clientContext, callbackType,
+                                                inSandbox, creationParams);
+                                    }
+                                });
+                            }
+                        };
                 synchronized (pendingSpawnQueue.mPendingSpawnsLock) {
                     allocatedConnection = allocateBoundConnection(
-                            context, commandLine, inSandbox, alwaysInForeground, creationParams);
+                            context, commandLine, inSandbox, alwaysInForeground, creationParams,
+                            startCallback);
                     if (allocatedConnection == null) {
                         Log.d(TAG, "Allocation of new service failed. Queuing up pending spawn.");
                         pendingSpawnQueue.enqueueLocked(new PendingSpawnData(context, commandLine,
                                 childProcessId, filesToBeMapped, clientContext,
                                 callbackType, inSandbox, creationParams));
-                        return;
+                        return null;
                     }
                 }
             }
@@ -697,6 +760,7 @@
                     allocatedConnection.getServiceNumber());
             triggerConnectionSetup(allocatedConnection, commandLine, childProcessId,
                     filesToBeMapped, callbackType, clientContext);
+            return allocatedConnection;
         } finally {
             TraceEvent.end("ChildProcessLauncher.startInternal");
         }
@@ -834,9 +898,16 @@
     }
 
     @VisibleForTesting
+    public static ChildProcessConnection startForTesting(Context context, String[] commandLine,
+            FileDescriptorInfo[] filesToMap, ChildProcessCreationParams params) {
+        return startInternal(context, commandLine, 0, filesToMap, 0,
+                CALLBACK_FOR_RENDERER_PROCESS, true, params);
+    }
+
+    @VisibleForTesting
     static ChildProcessConnection allocateBoundConnectionForTesting(Context context,
             ChildProcessCreationParams creationParams) {
-        return allocateBoundConnection(context, null, true, false, creationParams);
+        return allocateBoundConnection(context, null, true, false, creationParams, null);
     }
 
     @VisibleForTesting
@@ -874,6 +945,14 @@
                 .allocatedConnectionsCountForTesting();
     }
 
+    /**
+     * @return the service map of connected services
+     */
+    @VisibleForTesting
+    static Map<Integer, ChildProcessConnection> getServiceMapForTesting() {
+        return sServiceMap;
+    }
+
     /** @return the count of services set up and working */
     @VisibleForTesting
     static int connectedServicesCountForTesting() {
diff --git a/content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl b/content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl
index dffe3adc..1f5ec5c38 100644
--- a/content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl
+++ b/content/public/android/java/src/org/chromium/content/common/IChildProcessService.aidl
@@ -10,6 +10,11 @@
 import android.os.Bundle;
 
 interface IChildProcessService {
+  // On the first call to this method, the service will record the calling PID
+  // and return true. Subsequent calls will only return true if the calling PID
+  // is the same as the recorded one.
+  boolean bindToCaller();
+
   // Sets up the initial IPC channel and returns the pid of the child process.
   int setupConnection(in Bundle args, IChildProcessCallback callback);
 
diff --git a/content/public/android/java/src/org/chromium/content/common/OWNERS b/content/public/android/java/src/org/chromium/content/common/OWNERS
new file mode 100644
index 0000000..8f094e0
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/common/OWNERS
@@ -0,0 +1,2 @@
+per-file *.aidl=set noparent
+per-file *.aidl=file://ipc/SECURITY_OWNERS
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
index 6e2ae99..d6ae7c6 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ChildProcessLauncherTest.java
@@ -4,7 +4,15 @@
 
 package org.chromium.content.browser;
 
+import android.content.ComponentName;
 import android.content.Context;
+import android.content.Intent;
+import android.content.ServiceConnection;
+import android.os.Handler;
+import android.os.IBinder;
+import android.os.Looper;
+import android.os.Message;
+import android.os.Messenger;
 import android.os.RemoteException;
 import android.support.test.filters.MediumTest;
 import android.test.InstrumentationTestCase;
@@ -17,7 +25,9 @@
 import org.chromium.content.browser.test.util.Criteria;
 import org.chromium.content.browser.test.util.CriteriaHelper;
 import org.chromium.content.common.FileDescriptorInfo;
+import org.chromium.content_shell_apk.ChildProcessLauncherTestHelperService;
 
+import java.util.Map;
 import java.util.concurrent.Callable;
 
 /**
@@ -296,6 +306,143 @@
         assertNotNull(tabConnection);
     }
 
+    /**
+     * Tests binding to the same sandboxed service process from multiple processes in the
+     * same package. This uses the ChildProcessLauncherTestHelperService declared in
+     * ContentShell.apk as a separate android:process to bind the first (slot 0) service. The
+     * instrumentation test then tries to bind the same slot, which fails, so the
+     * ChildProcessLauncher retries on a new connection.
+     */
+    @MediumTest
+    @Feature({"ProcessManagement"})
+    public void testBindServiceFromMultipleProcesses() throws RemoteException {
+        final Context context = getInstrumentation().getTargetContext();
+
+        // Start the Helper service.
+        class HelperConnection implements ServiceConnection {
+            Messenger mMessenger = null;
+
+            @Override
+            public void onServiceConnected(ComponentName name, IBinder service) {
+                mMessenger = new Messenger(service);
+            }
+
+            @Override
+            public void onServiceDisconnected(ComponentName name) {}
+        }
+        final HelperConnection serviceConn = new HelperConnection();
+
+        Intent intent = new Intent();
+        intent.setComponent(new ComponentName(context.getPackageName(),
+                context.getPackageName() + ".ChildProcessLauncherTestHelperService"));
+        assertTrue(context.bindService(intent, serviceConn, Context.BIND_AUTO_CREATE));
+
+        // Wait for the Helper service to connect.
+        CriteriaHelper.pollInstrumentationThread(
+                new Criteria("Failed to get helper service Messenger") {
+                    @Override
+                    public boolean isSatisfied() {
+                        return serviceConn.mMessenger != null;
+                    }
+                });
+
+        assertNotNull(serviceConn.mMessenger);
+
+        class ReplyHandler implements Handler.Callback {
+            Message mMessage;
+
+            @Override
+            public boolean handleMessage(Message msg) {
+                // Copy the message so its contents outlive this Binder transaction.
+                mMessage = Message.obtain();
+                mMessage.copyFrom(msg);
+                return true;
+            }
+        }
+        final ReplyHandler replyHandler = new ReplyHandler();
+
+        // Send a message to the Helper and wait for the reply. This will cause the slot 0
+        // sandboxed service connection to be bound by a different PID (i.e., not this
+        // process).
+        Message msg = Message.obtain(null, ChildProcessLauncherTestHelperService.MSG_BIND_SERVICE);
+        msg.replyTo = new Messenger(new Handler(Looper.getMainLooper(), replyHandler));
+        serviceConn.mMessenger.send(msg);
+
+        CriteriaHelper.pollInstrumentationThread(
+                new Criteria("Failed waiting for helper service reply") {
+                    @Override
+                    public boolean isSatisfied() {
+                        return replyHandler.mMessage != null;
+                    }
+                });
+
+        // Verify that the Helper was able to launch the sandboxed service.
+        assertNotNull(replyHandler.mMessage);
+        assertEquals(ChildProcessLauncherTestHelperService.MSG_BIND_SERVICE_REPLY,
+                replyHandler.mMessage.what);
+        assertEquals("Connection slot from helper service is not 0", 0, replyHandler.mMessage.arg2);
+
+        final int helperConnPid = replyHandler.mMessage.arg1;
+        assertTrue(helperConnPid > 0);
+
+        // Launch a service from this process. Since slot 0 is already bound by the Helper, it
+        // will fail to start and the ChildProcessLauncher will retry.
+        final ChildProcessConnection conn = ChildProcessLauncher.startForTesting(context,
+                sProcessWaitArguments, new FileDescriptorInfo[0],
+                getDefaultChildProcessCreationParams(context.getPackageName()));
+
+        CriteriaHelper.pollInstrumentationThread(
+                new Criteria("Failed waiting for instrumentation-bound service") {
+                    @Override
+                    public boolean isSatisfied() {
+                        return conn.getService() != null;
+                    }
+                });
+
+        assertEquals(0, conn.getServiceNumber());
+        assertEquals(-1, conn.getPid());  // PID gets set to -1 if service is already bound.
+
+        final Map<Integer, ChildProcessConnection> serviceMap =
+                ChildProcessLauncher.getServiceMapForTesting();
+
+        // Wait for the retry to succeed.
+        CriteriaHelper.pollInstrumentationThread(
+                new Criteria("Failed waiting for both child process services") {
+                    @Override
+                    public boolean isSatisfied() {
+                        boolean allChildrenConnected = serviceMap.size() == 2;
+                        for (ChildProcessConnection conn : serviceMap.values()) {
+                            allChildrenConnected &= conn.getService() != null;
+                        }
+                        return allChildrenConnected;
+                    }
+                });
+
+        assertEquals(2, serviceMap.size());
+
+        boolean testedSlot0 = false, testedSlot1 = false;
+
+        for (ChildProcessConnection childProcess : serviceMap.values()) {
+            if (childProcess == conn) {
+                assertFalse(testedSlot0);
+                assertEquals(0, childProcess.getServiceNumber());
+                assertEquals(-1, childProcess.getPid());
+                assertFalse(childProcess.getService().bindToCaller());
+                testedSlot0 = true;
+            } else {
+                assertFalse(testedSlot1);
+                assertEquals(1, childProcess.getServiceNumber());
+                assertTrue(childProcess.getPid() > 0);
+                assertTrue(childProcess.getPid() != helperConnPid);
+                assertTrue(childProcess.getService().bindToCaller());
+                testedSlot1 = true;
+            }
+        }
+
+        assertTrue(testedSlot0);
+        assertTrue(testedSlot1);
+    }
+
     private ChildProcessConnectionImpl startConnection() {
         // Allocate a new connection.
         Context context = getInstrumentation().getTargetContext();
diff --git a/content/public/android/junit/src/org/chromium/content/browser/BindingManagerImplTest.java b/content/public/android/junit/src/org/chromium/content/browser/BindingManagerImplTest.java
index d5a33882..d2fd2df 100644
--- a/content/public/android/junit/src/org/chromium/content/browser/BindingManagerImplTest.java
+++ b/content/public/android/junit/src/org/chromium/content/browser/BindingManagerImplTest.java
@@ -13,18 +13,20 @@
 import android.os.Bundle;
 import android.util.Pair;
 
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.robolectric.Robolectric;
+import org.robolectric.annotation.Config;
+import org.robolectric.shadows.ShadowLooper;
+
 import org.chromium.base.test.util.Feature;
 import org.chromium.content.common.FileDescriptorInfo;
 import org.chromium.content.common.IChildProcessCallback;
 import org.chromium.content.common.IChildProcessService;
 import org.chromium.testing.local.LocalRobolectricTestRunner;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.Robolectric;
-import org.robolectric.annotation.Config;
-import org.robolectric.shadows.ShadowLooper;
 
 import java.util.ArrayList;
 
@@ -118,7 +120,7 @@
         }
 
         @Override
-        public void start(String[] commandLine) {
+        public void start(String[] commandLine, StartCallback startCallback) {
             throw new UnsupportedOperationException();
         }
 
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
index d8f9795..0ed1944 100644
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -208,7 +208,7 @@
 
 // Paint invalidation based on slimming paint. See https://goo.gl/eQczQW
 const base::Feature kSlimmingPaintInvalidation{
-    "SlimmingPaintInvalidation", base::FEATURE_DISABLED_BY_DEFAULT};
+    "SlimmingPaintInvalidation", base::FEATURE_ENABLED_BY_DEFAULT};
 
 // Speculatively launches Service Workers on mouse/touch events.
 const base::Feature kSpeculativeLaunchServiceWorker{
diff --git a/content/renderer/input/render_widget_input_handler.cc b/content/renderer/input/render_widget_input_handler.cc
index f6f161d..b0db53de 100644
--- a/content/renderer/input/render_widget_input_handler.cc
+++ b/content/renderer/input/render_widget_input_handler.cc
@@ -282,7 +282,7 @@
         static_cast<const WebKeyboardEvent&>(input_event);
     if (key_event.nativeKeyCode == AKEYCODE_DPAD_CENTER &&
         widget_->GetTextInputType() != ui::TEXT_INPUT_TYPE_NONE) {
-      widget_->showVirtualKeyboard();
+      widget_->showVirtualKeyboardOnElementFocus();
       prevent_default = true;
     }
 #endif
diff --git a/content/renderer/media/android/media_info_loader_unittest.cc b/content/renderer/media/android/media_info_loader_unittest.cc
index 59fa38e..5b30914 100644
--- a/content/renderer/media/android/media_info_loader_unittest.cc
+++ b/content/renderer/media/android/media_info_loader_unittest.cc
@@ -41,8 +41,8 @@
  public:
   MediaInfoLoaderTest()
       : view_(WebView::create(nullptr, blink::WebPageVisibilityStateVisible)) {
-    view_->setMainFrame(
-        WebLocalFrame::create(blink::WebTreeScopeType::Document, &client_));
+    view_->setMainFrame(WebLocalFrame::create(blink::WebTreeScopeType::Document,
+                                              &client_, nullptr, nullptr));
   }
 
   virtual ~MediaInfoLoaderTest() {
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 320fa37..f226816477 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -941,7 +941,9 @@
       RenderFrameImpl::Create(render_view, routing_id);
   render_frame->InitializeBlameContext(nullptr);
   WebLocalFrame* web_frame = WebLocalFrame::create(
-      blink::WebTreeScopeType::Document, render_frame, opener);
+      blink::WebTreeScopeType::Document, render_frame,
+      render_frame->blink_interface_provider_.get(),
+      render_frame->blink_interface_registry_.get(), opener);
   render_frame->BindToWebFrame(web_frame);
   render_view->webview()->setMainFrame(web_frame);
   render_frame->render_widget_ = RenderWidget::CreateForFrame(
@@ -988,6 +990,8 @@
         replicated_state.scope, WebString::fromUTF8(replicated_state.name),
         WebString::fromUTF8(replicated_state.unique_name),
         replicated_state.sandbox_flags, render_frame,
+        render_frame->blink_interface_provider_.get(),
+        render_frame->blink_interface_registry_.get(),
         previous_sibling_web_frame,
         frame_owner_properties.ToWebFrameOwnerProperties(),
         ResolveOpener(opener_routing_id));
@@ -1010,7 +1014,9 @@
     render_frame->proxy_routing_id_ = proxy_routing_id;
     proxy->set_provisional_frame_routing_id(routing_id);
     web_frame = blink::WebLocalFrame::createProvisional(
-        render_frame, proxy->web_frame(), replicated_state.sandbox_flags);
+        render_frame, render_frame->blink_interface_provider_.get(),
+        render_frame->blink_interface_registry_.get(), proxy->web_frame(),
+        replicated_state.sandbox_flags);
   }
   render_frame->BindToWebFrame(web_frame);
   CHECK(parent_routing_id != MSG_ROUTING_NONE || !web_frame->parent());
@@ -3049,8 +3055,10 @@
   RenderFrameImpl* child_render_frame =
       RenderFrameImpl::Create(render_view_, child_routing_id);
   child_render_frame->InitializeBlameContext(this);
-  blink::WebLocalFrame* web_frame =
-      WebLocalFrame::create(scope, child_render_frame);
+  blink::WebLocalFrame* web_frame = WebLocalFrame::create(
+      scope, child_render_frame,
+      child_render_frame->blink_interface_provider_.get(),
+      child_render_frame->blink_interface_registry_.get());
   child_render_frame->BindToWebFrame(web_frame);
 
   // Add the frame to the frame tree and initialize it.
@@ -6705,14 +6713,6 @@
                    .device_status());
 }
 
-blink::InterfaceProvider* RenderFrameImpl::interfaceProvider() {
-  return blink_interface_provider_.get();
-}
-
-blink::InterfaceRegistry* RenderFrameImpl::interfaceRegistry() {
-  return blink_interface_registry_.get();
-}
-
 blink::WebPageVisibilityState RenderFrameImpl::visibilityState() const {
   const RenderFrameImpl* local_root = GetLocalRoot();
   blink::WebPageVisibilityState current_state =
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
index 9bd4612..37293ac5 100644
--- a/content/renderer/render_frame_impl.h
+++ b/content/renderer/render_frame_impl.h
@@ -84,7 +84,6 @@
 struct FrameMsg_TextTrackSettings_Params;
 
 namespace blink {
-class InterfaceRegistry;
 class WebContentDecryptionModule;
 class WebPresentationClient;
 class WebPushClient;
@@ -660,8 +659,6 @@
       const blink::WebString& sink_id,
       const blink::WebSecurityOrigin& security_origin,
       blink::WebSetSinkIdCallbacks* web_callbacks) override;
-  blink::InterfaceProvider* interfaceProvider() override;
-  blink::InterfaceRegistry* interfaceRegistry() override;
   blink::WebPageVisibilityState visibilityState() const override;
 
   // WebFrameSerializerClient implementation:
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 1dd307d..e157b37 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1900,8 +1900,8 @@
   RenderWidget::setTouchAction(touchAction);
 }
 
-void RenderViewImpl::showVirtualKeyboard() {
-  RenderWidget::showVirtualKeyboard();
+void RenderViewImpl::showVirtualKeyboardOnElementFocus() {
+  RenderWidget::showVirtualKeyboardOnElementFocus();
 }
 
 void RenderViewImpl::showUnhandledTapUIIfNeeded(
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index aac4377..96b6012 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -281,7 +281,7 @@
   void setToolTipText(const blink::WebString&,
                       blink::WebTextDirection hint) override;
   void setTouchAction(blink::WebTouchAction touchAction) override;
-  void showVirtualKeyboard() override;
+  void showVirtualKeyboardOnElementFocus() override;
   void showUnhandledTapUIIfNeeded(const blink::WebPoint& tappedPosition,
                                   const blink::WebNode& tappedNode,
                                   bool pageChanged) override;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 9ceb7970..90a1550 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1750,7 +1750,7 @@
   static_cast<WebFrameWidget*>(GetWebWidget())->dragSourceSystemDragEnded();
 }
 
-void RenderWidget::showVirtualKeyboard() {
+void RenderWidget::showVirtualKeyboardOnElementFocus() {
   ShowVirtualKeyboard();
 
 // TODO(rouslan): Fix ChromeOS and Windows 8 behavior of autofill popup with
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index f85af22..5abe3ce2 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -299,7 +299,7 @@
                      const blink::WebFloatSize& accumulatedOverscroll,
                      const blink::WebFloatPoint& position,
                      const blink::WebFloatSize& velocity) override;
-  void showVirtualKeyboard() override;
+  void showVirtualKeyboardOnElementFocus() override;
   void convertViewportToWindow(blink::WebRect* rect) override;
   void convertWindowToViewport(blink::WebFloatRect* rect) override;
   bool requestPointerLock() override;
diff --git a/content/shell/android/BUILD.gn b/content/shell/android/BUILD.gn
index 0504f9e..1dfcd4e 100644
--- a/content/shell/android/BUILD.gn
+++ b/content/shell/android/BUILD.gn
@@ -94,6 +94,7 @@
   android_manifest = content_shell_manifest
 
   java_files = [
+    "shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java",
     "shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java",
     "shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java",
   ]
diff --git a/content/shell/android/shell_apk/AndroidManifest.xml.jinja2 b/content/shell/android/shell_apk/AndroidManifest.xml.jinja2
index f2e149f4..ed0e153 100644
--- a/content/shell/android/shell_apk/AndroidManifest.xml.jinja2
+++ b/content/shell/android/shell_apk/AndroidManifest.xml.jinja2
@@ -61,5 +61,7 @@
         <meta-data android:name="org.chromium.content.browser.SMART_CLIP_PROVIDER"
                    android:value="org.chromium.content.browser.SmartClipProvider" />
 
+        <service android:name="org.chromium.content_shell_apk.ChildProcessLauncherTestHelperService"
+            android:process=":ChildProcessLauncherHelper" />
     </application>
 </manifest>
diff --git a/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java
new file mode 100644
index 0000000..9da9eb38
--- /dev/null
+++ b/content/shell/android/shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java
@@ -0,0 +1,99 @@
+// 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_shell_apk;
+
+import android.app.Service;
+import android.content.Intent;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.IBinder;
+import android.os.Message;
+import android.os.Messenger;
+import android.os.RemoteException;
+
+import org.chromium.base.BaseSwitches;
+import org.chromium.base.CommandLine;
+import org.chromium.base.library_loader.LibraryLoader;
+import org.chromium.base.library_loader.LibraryProcessType;
+import org.chromium.base.library_loader.ProcessInitException;
+import org.chromium.content.browser.ChildProcessConnection;
+import org.chromium.content.browser.ChildProcessCreationParams;
+import org.chromium.content.browser.ChildProcessLauncher;
+import org.chromium.content.common.FileDescriptorInfo;
+
+/**
+ * A Service that assists the ChildProcessLauncherTest that responds to one message, which
+ * starts a sandboxed service process via the ChildProcessLauncher. This is required to test
+ * the behavior when two independent processes in the same package try and bind to the same
+ * sandboxed service process.
+ */
+public class ChildProcessLauncherTestHelperService extends Service {
+    public static final int MSG_BIND_SERVICE = IBinder.FIRST_CALL_TRANSACTION + 1;
+    public static final int MSG_BIND_SERVICE_REPLY = MSG_BIND_SERVICE + 1;
+
+    private final Handler.Callback mHandlerCallback = new Handler.Callback() {
+        @Override
+        public boolean handleMessage(Message msg) {
+            switch (msg.what) {
+                case MSG_BIND_SERVICE:
+                    doBindService(msg);
+                    return true;
+            }
+            return false;
+        }
+    };
+
+    private final HandlerThread mHandlerThread = new HandlerThread("Helper Service Handler");
+
+    @Override
+    public void onCreate() {
+        CommandLine.init(null);
+        try {
+            LibraryLoader.get(LibraryProcessType.PROCESS_CHILD).ensureInitialized();
+        } catch (ProcessInitException ex) {
+            throw new RuntimeException(ex);
+        }
+
+        mHandlerThread.start();
+    }
+
+    @Override
+    public IBinder onBind(Intent intent) {
+        Messenger messenger =
+                new Messenger(new Handler(mHandlerThread.getLooper(), mHandlerCallback));
+        return messenger.getBinder();
+    }
+
+    private void doBindService(final Message msg) {
+        String[] commandLine = { "_", "--" + BaseSwitches.RENDERER_WAIT_FOR_JAVA_DEBUGGER };
+        ChildProcessCreationParams params = new ChildProcessCreationParams(getPackageName(), false,
+                LibraryProcessType.PROCESS_CHILD);
+        final ChildProcessConnection conn = ChildProcessLauncher.startForTesting(this, commandLine,
+                new FileDescriptorInfo[0], params);
+
+        // Poll the connection until it is set up. The main test in ChildProcessLauncherTest, which
+        // has bound the connection to this service, manages the timeout via the lifetime of this
+        // service.
+        final Handler handler = new Handler();
+        final Runnable task = new Runnable() {
+            final Messenger mReplyTo = msg.replyTo;
+
+            @Override
+            public void run() {
+                if (conn.getPid() != 0) {
+                    try {
+                        mReplyTo.send(Message.obtain(null, MSG_BIND_SERVICE_REPLY, conn.getPid(),
+                                    conn.getServiceNumber()));
+                    } catch (RemoteException ex) {
+                        throw new RuntimeException(ex);
+                    }
+                } else {
+                    handler.postDelayed(this, 10 /* milliseconds */);
+                }
+            }
+        };
+        handler.postDelayed(task, 10);
+    }
+}
diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
index 08439095..ef35711a 100644
--- a/content/test/BUILD.gn
+++ b/content/test/BUILD.gn
@@ -1317,6 +1317,7 @@
     "../common/mac/attributed_string_coder_unittest.mm",
     "../common/mac/font_descriptor_unittest.mm",
     "../common/manifest_util_unittest.cc",
+    "../common/media/media_devices_unittest.cc",
     "../common/navigation_params_unittest.cc",
     "../common/origin_trials/trial_token_unittest.cc",
     "../common/origin_trials/trial_token_validator_unittest.cc",
diff --git a/extensions/renderer/scoped_web_frame.cc b/extensions/renderer/scoped_web_frame.cc
index 60066b3..2a7e37a2 100644
--- a/extensions/renderer/scoped_web_frame.cc
+++ b/extensions/renderer/scoped_web_frame.cc
@@ -11,7 +11,7 @@
 ScopedWebFrame::ScopedWebFrame() : view_(nullptr), frame_(nullptr) {
   view_ = blink::WebView::create(nullptr, blink::WebPageVisibilityStateVisible);
   frame_ = blink::WebLocalFrame::create(blink::WebTreeScopeType::Document,
-                                        &frame_client_);
+                                        &frame_client_, nullptr, nullptr);
   view_->setMainFrame(frame_);
 }
 
diff --git a/ios/chrome/browser/payments/js_payment_request_manager.h b/ios/chrome/browser/payments/js_payment_request_manager.h
index ef4164f..3e95970 100644
--- a/ios/chrome/browser/payments/js_payment_request_manager.h
+++ b/ios/chrome/browser/payments/js_payment_request_manager.h
@@ -5,10 +5,13 @@
 #ifndef IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_
 #define IOS_CHROME_BROWSER_PAYMENTS_JS_PAYMENT_REQUEST_MANAGER_H_
 
+#include "base/strings/string16.h"
 #import "ios/web/public/web_state/js/crw_js_injection_manager.h"
 
 namespace web {
+class PaymentAddress;
 class PaymentResponse;
+class PaymentShippingOption;
 }
 
 // Injects the JavaScript that implements the Payment Request API and provides
@@ -20,25 +23,36 @@
 - (void)executeNoop;
 
 // Resolves the JavaScript promise associated with the current PaymentRequest
-// with the a JSON serialization of |paymentResponse|. |completionHandler| will
-// be invoked after the operation has completed with YES if successful.
-- (void)resolveRequestPromise:(const web::PaymentResponse&)paymentResponse
-            completionHandler:(void (^)(BOOL))completionHandler;
+// with the a JSON serialization of |paymentResponse|. If |completionHandler| is
+// not nil, it will be invoked with YES after the operation has completed
+// successfully or with NO otherwise.
+- (void)resolveRequestPromiseWithPaymentResponse:
+            (const web::PaymentResponse&)paymentResponse
+                               completionHandler:
+                                   (void (^)(BOOL))completionHandler;
 
 // Rejects the JavaScript promise associated with the current PaymentRequest
-// with the supplied |errorMessage|. |completionHandler| will be invoked after
-// the operation has completed with YES if successful.
-- (void)rejectRequestPromise:(NSString*)errorMessage
-           completionHandler:(void (^)(BOOL))completionHandler;
+// with the supplied |errorMessage|. If |completionHandler| is not nil, it will
+// be invoked with YES after the operation has completed successfully or with NO
+// otherwise.
+- (void)rejectRequestPromiseWithErrorMessage:(NSString*)errorMessage
+                           completionHandler:(void (^)(BOOL))completionHandler;
 
 // Resolves the JavaScript promise associated with the current PaymentResponse.
-// |completionHandler| will be invoked after the operation has completed with
-// YES if successful.
-- (void)resolveResponsePromise:(void (^)(BOOL))completionHandler;
+// If |completionHandler| is not nil, it will be invoked with YES after the
+// operation has completed successfully or with NO otherwise.
+- (void)resolveResponsePromiseWithCompletionHandler:
+    (void (^)(BOOL))completionHandler;
 
-// Note that there is no rejectResponsePromise method because the spec includes
-// no provision for rejecting the response promise. User agents are directed to
-// always resolve the promise.
+// Updates the shippingAddress property on the PaymentRequest object and
+// dispatches a shippingaddresschange event.
+- (void)updateShippingAddress:(const web::PaymentAddress&)shippingAddress
+            completionHandler:(void (^)(BOOL))completionHanlder;
+
+// Updates the shippingOption property on the PaymentRequest object and
+// dispatches a shippingoptionchange event.
+- (void)updateShippingOption:(const web::PaymentShippingOption&)shippingOption
+           completionHandler:(void (^)(BOOL))completionHanlder;
 
 @end
 
diff --git a/ios/chrome/browser/payments/js_payment_request_manager.mm b/ios/chrome/browser/payments/js_payment_request_manager.mm
index ca70a47..cd8cb5c1 100644
--- a/ios/chrome/browser/payments/js_payment_request_manager.mm
+++ b/ios/chrome/browser/payments/js_payment_request_manager.mm
@@ -37,34 +37,59 @@
   [self executeScript:@"Function.prototype()" completionHandler:nil];
 }
 
-- (void)resolveRequestPromise:(const web::PaymentResponse&)paymentResponse
-            completionHandler:(void (^)(BOOL))completionHandler {
+- (void)resolveRequestPromiseWithPaymentResponse:
+            (const web::PaymentResponse&)paymentResponse
+                               completionHandler:
+                                   (void (^)(BOOL))completionHandler {
   std::unique_ptr<base::DictionaryValue> paymentResponseData =
       paymentResponse.ToDictionaryValue();
   std::string paymentResponseDataJSON;
   base::JSONWriter::Write(*paymentResponseData, &paymentResponseDataJSON);
   NSString* script = [NSString
       stringWithFormat:
-          @"__gCrWeb['paymentRequestManager'].pendingRequest.resolve(%@)",
+          @"__gCrWeb['paymentRequestManager'].resolveRequestPromise(%@)",
           base::SysUTF8ToNSString(paymentResponseDataJSON)];
   [self executeScript:script completionHandler:completionHandler];
 }
 
-- (void)rejectRequestPromise:(NSString*)errorMessage
-           completionHandler:(void (^)(BOOL))completionHandler {
+- (void)rejectRequestPromiseWithErrorMessage:(NSString*)errorMessage
+                           completionHandler:(void (^)(BOOL))completionHandler {
   NSString* script = [NSString
       stringWithFormat:
-          @"__gCrWeb['paymentRequestManager'].pendingRequest.reject(%@)",
+          @"__gCrWeb['paymentRequestManager'].rejectRequestPromise(%@)",
           JSONEscape(errorMessage)];
   [self executeScript:script completionHandler:completionHandler];
 }
 
-- (void)resolveResponsePromise:(void (^)(BOOL))completionHandler {
+- (void)resolveResponsePromiseWithCompletionHandler:
+    (void (^)(BOOL))completionHandler {
   NSString* script =
-      @"__gCrWeb['paymentRequestManager'].pendingResponse.resolve()";
+      @"__gCrWeb['paymentRequestManager'].resolveResponsePromise()";
   [self executeScript:script completionHandler:completionHandler];
 }
 
+- (void)updateShippingAddress:(const web::PaymentAddress&)shippingAddress
+            completionHandler:(void (^)(BOOL))completionHanlder {
+  std::unique_ptr<base::DictionaryValue> shippingAddressData =
+      shippingAddress.ToDictionaryValue();
+  std::string shippingAddressDataJSON;
+  base::JSONWriter::Write(*shippingAddressData, &shippingAddressDataJSON);
+  NSString* script = [NSString
+      stringWithFormat:@"__gCrWeb['paymentRequestManager']."
+                       @"updateShippingAddressAndDispatchEvent(%@)",
+                       base::SysUTF8ToNSString(shippingAddressDataJSON)];
+  [self executeScript:script completionHandler:completionHanlder];
+}
+
+- (void)updateShippingOption:(const web::PaymentShippingOption&)shippingOption
+           completionHandler:(void (^)(BOOL))completionHanlder {
+  NSString* script =
+      [NSString stringWithFormat:@"__gCrWeb['paymentRequestManager']."
+                                 @"updateShippingOptionAndDispatchEvent('%@')",
+                                 base::SysUTF16ToNSString(shippingOption.id)];
+  [self executeScript:script completionHandler:completionHanlder];
+}
+
 - (void)executeScript:(NSString*)script
     completionHandler:(void (^)(BOOL))completionHandler {
   [self executeJavaScript:script
diff --git a/ios/chrome/browser/payments/payment_items_display_coordinator.h b/ios/chrome/browser/payments/payment_items_display_coordinator.h
index 9cfd0ee8..4018fb1 100644
--- a/ios/chrome/browser/payments/payment_items_display_coordinator.h
+++ b/ios/chrome/browser/payments/payment_items_display_coordinator.h
@@ -13,8 +13,7 @@
 
 @class PaymentItemsDisplayCoordinator;
 
-// Protocol for communicating with the delegate supplied to
-// PaymentItemsDisplayCoordinator.
+// Delegate protocol for PaymentItemsDisplayCoordinator.
 @protocol PaymentItemsDisplayCoordinatorDelegate<NSObject>
 
 // Notifies the delegate that the user has chosen to return to the previous
diff --git a/ios/chrome/browser/payments/payment_items_display_view_controller.h b/ios/chrome/browser/payments/payment_items_display_view_controller.h
index e6e23362..26d62a6 100644
--- a/ios/chrome/browser/payments/payment_items_display_view_controller.h
+++ b/ios/chrome/browser/payments/payment_items_display_view_controller.h
@@ -16,8 +16,7 @@
 
 @class PaymentItemsDisplayViewController;
 
-// Protocol for communicating with the delegate supplied to
-// PaymentItemsDisplayViewController.
+// Delegate protocol for PaymentItemsDisplayViewController.
 @protocol PaymentItemsDisplayViewControllerDelegate<NSObject>
 
 // Notifies the delegate that the user has chosen to return to the previous
diff --git a/ios/chrome/browser/payments/payment_method_selection_coordinator.h b/ios/chrome/browser/payments/payment_method_selection_coordinator.h
index d526e401f..abef3ca 100644
--- a/ios/chrome/browser/payments/payment_method_selection_coordinator.h
+++ b/ios/chrome/browser/payments/payment_method_selection_coordinator.h
@@ -17,12 +17,13 @@
 
 @class PaymentMethodSelectionCoordinator;
 
+// Delegate protocol for PaymentMethodSelectionCoordinator.
 @protocol PaymentMethodSelectionCoordinatorDelegate<NSObject>
 
 // Notifies the delegate that the user has selected a payment method.
 - (void)paymentMethodSelectionCoordinator:
             (PaymentMethodSelectionCoordinator*)coordinator
-                    selectedPaymentMethod:(autofill::CreditCard*)paymentMethod;
+                   didSelectPaymentMethod:(autofill::CreditCard*)paymentMethod;
 
 // Notifies the delegate that the user has chosen to return to the previous
 // screen without making a selection.
diff --git a/ios/chrome/browser/payments/payment_method_selection_coordinator.mm b/ios/chrome/browser/payments/payment_method_selection_coordinator.mm
index ba5add4..5927870d 100644
--- a/ios/chrome/browser/payments/payment_method_selection_coordinator.mm
+++ b/ios/chrome/browser/payments/payment_method_selection_coordinator.mm
@@ -51,11 +51,11 @@
 
 - (void)paymentMethodSelectionViewController:
             (PaymentMethodSelectionViewController*)controller
-                       selectedPaymentMethod:
-                           (autofill::CreditCard*)paymentMethod {
+                      didSelectPaymentMethod:
+                          (autofill::CreditCard*)paymentMethod {
   _selectedPaymentMethod = paymentMethod;
   [_delegate paymentMethodSelectionCoordinator:self
-                         selectedPaymentMethod:paymentMethod];
+                        didSelectPaymentMethod:paymentMethod];
 }
 
 - (void)paymentMethodSelectionViewControllerDidReturn:
diff --git a/ios/chrome/browser/payments/payment_method_selection_view_controller.h b/ios/chrome/browser/payments/payment_method_selection_view_controller.h
index a70386b..6a1c4f64 100644
--- a/ios/chrome/browser/payments/payment_method_selection_view_controller.h
+++ b/ios/chrome/browser/payments/payment_method_selection_view_controller.h
@@ -16,12 +16,17 @@
 
 @class PaymentMethodSelectionViewController;
 
+// Delegate protocol for PaymentMethodSelectionViewController.
 @protocol PaymentMethodSelectionViewControllerDelegate<NSObject>
 
+// Notifies the delegate that the user has selected a payment method.
 - (void)paymentMethodSelectionViewController:
             (PaymentMethodSelectionViewController*)controller
-                       selectedPaymentMethod:
-                           (autofill::CreditCard*)paymentMethod;
+                      didSelectPaymentMethod:
+                          (autofill::CreditCard*)paymentMethod;
+
+// Notifies the delegate that the user has chosen to return to the previous
+// screen without making a selection.
 - (void)paymentMethodSelectionViewControllerDidReturn:
     (PaymentMethodSelectionViewController*)controller;
 
diff --git a/ios/chrome/browser/payments/payment_method_selection_view_controller.mm b/ios/chrome/browser/payments/payment_method_selection_view_controller.mm
index f3a1694..6819fab 100644
--- a/ios/chrome/browser/payments/payment_method_selection_view_controller.mm
+++ b/ios/chrome/browser/payments/payment_method_selection_view_controller.mm
@@ -143,7 +143,7 @@
     DCHECK(indexPath.item < (NSInteger)_paymentMethods.size());
     [_delegate
         paymentMethodSelectionViewController:self
-                       selectedPaymentMethod:_paymentMethods[indexPath.item]];
+                      didSelectPaymentMethod:_paymentMethods[indexPath.item]];
   }
   // TODO(crbug.com/602666): Present a credit card addition UI when
   //     itemType == ItemAddMethod.
diff --git a/ios/chrome/browser/payments/payment_request_coordinator.h b/ios/chrome/browser/payments/payment_request_coordinator.h
index e3a7ceb..59e102e 100644
--- a/ios/chrome/browser/payments/payment_request_coordinator.h
+++ b/ios/chrome/browser/payments/payment_request_coordinator.h
@@ -21,10 +21,26 @@
 class PersonalDataManager;
 }
 
+@class PaymentRequestCoordinator;
+
+// Delegate protocol for PaymentRequestCoordinator.
 @protocol PaymentRequestCoordinatorDelegate<NSObject>
-- (void)paymentRequestCoordinatorDidCancel;
-- (void)paymentRequestCoordinatorDidConfirm:
-    (web::PaymentResponse)paymentResponse;
+
+// Notifies the delegate that the user has canceled the payment request.
+- (void)paymentRequestCoordinatorDidCancel:
+    (PaymentRequestCoordinator*)coordinator;
+
+// Notifies the delegate that the user has confirmed the payment request.
+- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
+    didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse;
+
+// Notifies the delegate that the user has selected a shipping address.
+- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
+         didSelectShippingAddress:(web::PaymentAddress)shippingAddress;
+
+// Notifies the delegate that the user has selected a shipping option.
+- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
+          didSelectShippingOption:(web::PaymentShippingOption)shippingOption;
 
 @end
 
@@ -78,6 +94,9 @@
 // The delegate to be notified when the user confirms or cancels the request.
 @property(nonatomic, weak) id<PaymentRequestCoordinatorDelegate> delegate;
 
+// Updates the payment details of the PaymentRequest and updates the UI.
+- (void)updatePaymentDetails:(web::PaymentDetails)paymentDetails;
+
 @end
 
 #endif  // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_COORDINATOR_H_
diff --git a/ios/chrome/browser/payments/payment_request_coordinator.mm b/ios/chrome/browser/payments/payment_request_coordinator.mm
index 0ee26c6..ed09e527 100644
--- a/ios/chrome/browser/payments/payment_request_coordinator.mm
+++ b/ios/chrome/browser/payments/payment_request_coordinator.mm
@@ -17,6 +17,7 @@
 #include "components/autofill/core/browser/field_types.h"
 #include "components/autofill/core/browser/personal_data_manager.h"
 #include "ios/chrome/browser/application_context.h"
+#include "ios/chrome/browser/payments/payment_request_utils.h"
 
 @interface PaymentRequestCoordinator () {
   autofill::PersonalDataManager* _personalDataManager;  // weak
@@ -168,50 +169,35 @@
     autofill::AutofillProfile* address = _personalDataManager->GetProfileByGUID(
         _selectedPaymentMethod->billing_address_id());
     if (address) {
-      paymentResponse.details.billing_address.country =
-          address->GetRawInfo(autofill::ADDRESS_HOME_COUNTRY);
-      paymentResponse.details.billing_address.address_line.push_back(
-          address->GetRawInfo(autofill::ADDRESS_HOME_LINE1));
-      paymentResponse.details.billing_address.address_line.push_back(
-          address->GetRawInfo(autofill::ADDRESS_HOME_LINE2));
-      paymentResponse.details.billing_address.address_line.push_back(
-          address->GetRawInfo(autofill::ADDRESS_HOME_LINE3));
-      paymentResponse.details.billing_address.region =
-          address->GetRawInfo(autofill::ADDRESS_HOME_STATE);
-      paymentResponse.details.billing_address.city =
-          address->GetRawInfo(autofill::ADDRESS_HOME_CITY);
-      paymentResponse.details.billing_address.dependent_locality =
-          address->GetRawInfo(autofill::ADDRESS_HOME_DEPENDENT_LOCALITY);
-      paymentResponse.details.billing_address.postal_code =
-          address->GetRawInfo(autofill::ADDRESS_HOME_ZIP);
-      paymentResponse.details.billing_address.sorting_code =
-          address->GetRawInfo(autofill::ADDRESS_HOME_SORTING_CODE);
-      paymentResponse.details.billing_address.language_code =
-          base::UTF8ToUTF16(address->language_code());
-      paymentResponse.details.billing_address.organization =
-          address->GetRawInfo(autofill::COMPANY_NAME);
-      paymentResponse.details.billing_address.recipient =
-          address->GetInfo(autofill::AutofillType(autofill::NAME_FULL),
-                           GetApplicationContext()->GetApplicationLocale());
-      paymentResponse.details.billing_address.phone =
-          address->GetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER);
+      paymentResponse.details.billing_address =
+          payment_request_utils::PaymentAddressFromAutofillProfile(address);
     }
   }
 
-  [_delegate paymentRequestCoordinatorDidConfirm:paymentResponse];
+  [_delegate paymentRequestCoordinator:self
+         didConfirmWithPaymentResponse:paymentResponse];
+}
+
+- (void)updatePaymentDetails:(web::PaymentDetails)paymentDetails {
+  _paymentRequest.details = paymentDetails;
+  [_viewController setPaymentRequest:_paymentRequest];
+  [_viewController updatePaymentSummarySection];
 }
 
 #pragma mark - PaymentRequestViewControllerDelegate
 
-- (void)paymentRequestViewControllerDidCancel {
-  [_delegate paymentRequestCoordinatorDidCancel];
+- (void)paymentRequestViewControllerDidCancel:
+    (PaymentRequestViewController*)controller {
+  [_delegate paymentRequestCoordinatorDidCancel:self];
 }
 
-- (void)paymentRequestViewControllerDidConfirm {
+- (void)paymentRequestViewControllerDidConfirm:
+    (PaymentRequestViewController*)controller {
   [self sendPaymentResponse];
 }
 
-- (void)paymentRequestViewControllerDisplayPaymentItems {
+- (void)paymentRequestViewControllerDidSelectPaymentSummaryItem:
+    (PaymentRequestViewController*)controller {
   _itemsDisplayCoordinator.reset([[PaymentItemsDisplayCoordinator alloc]
       initWithBaseViewController:_viewController]);
   [_itemsDisplayCoordinator setTotal:_paymentRequest.details.total];
@@ -224,7 +210,8 @@
   [_itemsDisplayCoordinator start];
 }
 
-- (void)paymentRequestViewControllerSelectShippingAddress {
+- (void)paymentRequestViewControllerDidSelectShippingAddressItem:
+    (PaymentRequestViewController*)controller {
   _shippingAddressSelectionCoordinator.reset(
       [[ShippingAddressSelectionCoordinator alloc]
           initWithBaseViewController:_viewController]);
@@ -238,7 +225,8 @@
   [_shippingAddressSelectionCoordinator start];
 }
 
-- (void)paymentRequestViewControllerSelectShippingOption {
+- (void)paymentRequestViewControllerDidSelectShippingOptionItem:
+    (PaymentRequestViewController*)controller {
   _shippingOptionSelectionCoordinator.reset(
       [[ShippingOptionSelectionCoordinator alloc]
           initWithBaseViewController:_viewController]);
@@ -258,7 +246,8 @@
   [_shippingOptionSelectionCoordinator start];
 }
 
-- (void)paymentRequestViewControllerSelectPaymentMethod {
+- (void)paymentRequestViewControllerDidSelectPaymentMethodItem:
+    (PaymentRequestViewController*)controller {
   _methodSelectionCoordinator.reset([[PaymentMethodSelectionCoordinator alloc]
       initWithBaseViewController:_viewController]);
   [_methodSelectionCoordinator setPaymentMethods:[self supportedMethods]];
@@ -285,11 +274,15 @@
 
 - (void)shippingAddressSelectionCoordinator:
             (ShippingAddressSelectionCoordinator*)coordinator
-                    selectedShippingAddress:
-                        (autofill::AutofillProfile*)shippingAddress {
+                   didSelectShippingAddress:
+                       (autofill::AutofillProfile*)shippingAddress {
   _selectedShippingAddress = shippingAddress;
   [_viewController updateSelectedShippingAddress:shippingAddress];
 
+  web::PaymentAddress address =
+      payment_request_utils::PaymentAddressFromAutofillProfile(shippingAddress);
+  [_delegate paymentRequestCoordinator:self didSelectShippingAddress:address];
+
   [_shippingAddressSelectionCoordinator stop];
   _shippingAddressSelectionCoordinator.reset();
 }
@@ -304,11 +297,14 @@
 
 - (void)shippingOptionSelectionCoordinator:
             (ShippingOptionSelectionCoordinator*)coordinator
-                    selectedShippingOption:
-                        (web::PaymentShippingOption*)shippingOption {
+                   didSelectShippingOption:
+                       (web::PaymentShippingOption*)shippingOption {
   _selectedShippingOption = shippingOption;
   [_viewController updateSelectedShippingOption:shippingOption];
 
+  [_delegate paymentRequestCoordinator:self
+               didSelectShippingOption:*shippingOption];
+
   [_shippingOptionSelectionCoordinator stop];
   _shippingOptionSelectionCoordinator.reset();
 }
@@ -323,7 +319,7 @@
 
 - (void)paymentMethodSelectionCoordinator:
             (PaymentMethodSelectionCoordinator*)coordinator
-                    selectedPaymentMethod:(autofill::CreditCard*)creditCard {
+                   didSelectPaymentMethod:(autofill::CreditCard*)creditCard {
   _selectedPaymentMethod = creditCard;
 
   [_viewController setSelectedPaymentMethod:creditCard];
diff --git a/ios/chrome/browser/payments/payment_request_manager.mm b/ios/chrome/browser/payments/payment_request_manager.mm
index 7fc45a6..98f4e0d9 100644
--- a/ios/chrome/browser/payments/payment_request_manager.mm
+++ b/ios/chrome/browser/payments/payment_request_manager.mm
@@ -100,6 +100,21 @@
 // invocation was successful.
 - (BOOL)handleResponseComplete;
 
+// Handles invocations of PaymentRequestUpdateEvent.updateWith(). Returns YES if
+// the invocation was successful.
+- (BOOL)handleUpdatePaymentDetails:(const base::DictionaryValue&)message;
+
+// Establishes a timer that periodically prompts the JS manager to execute a
+// noop. This works around an issue where the JS event queue is blocked while
+// presenting the Payment Request UI.
+- (void)setUnblockEventQueueTimer;
+
+// Establishes a timer that calls handleResponseComplete when it times out. Per
+// the spec, if the page does not call PaymentResponse.complete() within some
+// timeout period, user agents may behave as if the complete() method was
+// called with no arguments.
+- (void)setPaymentResponseTimeoutTimer;
+
 @end
 
 @implementation PaymentRequestManager
@@ -163,8 +178,9 @@
 
 - (void)cancelRequest {
   [self dismissUI];
-  [_paymentRequestJsManager rejectRequestPromise:@"Request cancelled by user."
-                               completionHandler:nil];
+  [_paymentRequestJsManager
+      rejectRequestPromiseWithErrorMessage:@"Request cancelled by user."
+                         completionHandler:nil];
 }
 
 - (void)close {
@@ -243,6 +259,9 @@
   if (command == "paymentRequest.responseComplete") {
     return [self handleResponseComplete];
   }
+  if (command == "paymentRequest.updatePaymentDetails") {
+    return [self handleUpdatePaymentDetails:JSONCommand];
+  }
   return NO;
 }
 
@@ -294,11 +313,50 @@
 
   [self dismissUI];
 
-  [_paymentRequestJsManager resolveResponsePromise:nil];
+  [_paymentRequestJsManager resolveResponsePromiseWithCompletionHandler:nil];
 
   return YES;
 }
 
+- (BOOL)handleUpdatePaymentDetails:(const base::DictionaryValue&)message {
+  // TODO(crbug.com/602666): Check that there is already a pending request.
+
+  [_unblockEventQueueTimer invalidate];
+
+  const base::DictionaryValue* paymentDetailsData = nullptr;
+  web::PaymentDetails paymentDetails;
+  if (!message.GetDictionary("payment_details", &paymentDetailsData)) {
+    DLOG(ERROR) << "JS message parameter 'payment_details' is missing";
+    return NO;
+  }
+  if (!paymentDetails.FromDictionaryValue(*paymentDetailsData)) {
+    DLOG(ERROR) << "JS message parameter 'payment_details' is invalid";
+    return NO;
+  }
+
+  [_paymentRequestCoordinator updatePaymentDetails:paymentDetails];
+
+  return YES;
+}
+
+- (void)setUnblockEventQueueTimer {
+  _unblockEventQueueTimer.reset(
+      [[NSTimer scheduledTimerWithTimeInterval:kNoopInterval
+                                        target:_paymentRequestJsManager
+                                      selector:@selector(executeNoop)
+                                      userInfo:nil
+                                       repeats:YES] retain]);
+}
+
+- (void)setPaymentResponseTimeoutTimer {
+  _paymentResponseTimeoutTimer.reset(
+      [[NSTimer scheduledTimerWithTimeInterval:kTimeoutInterval
+                                        target:self
+                                      selector:@selector(handleResponseComplete)
+                                      userInfo:nil
+                                       repeats:NO] retain]);
+}
+
 - (void)dismissUI {
   [_paymentRequestCoordinator stop];
   _paymentRequestCoordinator.reset();
@@ -323,34 +381,33 @@
 
 #pragma mark - PaymentRequestCoordinatorDelegate methods
 
-- (void)paymentRequestCoordinatorDidCancel {
+- (void)paymentRequestCoordinatorDidCancel:
+    (PaymentRequestCoordinator*)coordinator {
   [self cancelRequest];
 }
 
-- (void)paymentRequestCoordinatorDidConfirm:
-    (web::PaymentResponse)paymentResponse {
-  [_paymentRequestJsManager resolveRequestPromise:paymentResponse
+- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
+    didConfirmWithPaymentResponse:(web::PaymentResponse)paymentResponse {
+  [_paymentRequestJsManager
+      resolveRequestPromiseWithPaymentResponse:paymentResponse
+                             completionHandler:nil];
+
+  [self setUnblockEventQueueTimer];
+  [self setPaymentResponseTimeoutTimer];
+}
+
+- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
+         didSelectShippingAddress:(web::PaymentAddress)shippingAddress {
+  [_paymentRequestJsManager updateShippingAddress:shippingAddress
                                 completionHandler:nil];
+  [self setUnblockEventQueueTimer];
+}
 
-  // Establish a timer that periodically prompts the JS manager to execute a
-  // noop. This works around an issue where the JS event queue is blocked while
-  // presenting the Payment Request UI.
-  _unblockEventQueueTimer.reset(
-      [[NSTimer scheduledTimerWithTimeInterval:kNoopInterval
-                                        target:_paymentRequestJsManager
-                                      selector:@selector(executeNoop)
-                                      userInfo:nil
-                                       repeats:YES] retain]);
-
-  // Per the spec, if the page does not call PaymentResponse.complete() within
-  // some timeout period, user agents may behave as if the complete() method was
-  // called with no arguments.
-  _paymentResponseTimeoutTimer.reset(
-      [[NSTimer scheduledTimerWithTimeInterval:kTimeoutInterval
-                                        target:self
-                                      selector:@selector(handleResponseComplete)
-                                      userInfo:nil
-                                       repeats:NO] retain]);
+- (void)paymentRequestCoordinator:(PaymentRequestCoordinator*)coordinator
+          didSelectShippingOption:(web::PaymentShippingOption)shippingOption {
+  [_paymentRequestJsManager updateShippingOption:shippingOption
+                               completionHandler:nil];
+  [self setUnblockEventQueueTimer];
 }
 
 #pragma mark - CRWWebStateObserver methods
diff --git a/ios/chrome/browser/payments/payment_request_utils.h b/ios/chrome/browser/payments/payment_request_utils.h
index 9a6493a..e8b9841 100644
--- a/ios/chrome/browser/payments/payment_request_utils.h
+++ b/ios/chrome/browser/payments/payment_request_utils.h
@@ -7,6 +7,8 @@
 
 #import <Foundation/Foundation.h>
 
+#include "ios/web/public/payments/payment_request.h"
+
 namespace autofill {
 class AutofillProfile;
 }  // namespace autofill
@@ -28,6 +30,11 @@
 NSString* PhoneNumberLabelFromAutofillProfile(
     autofill::AutofillProfile* profile);
 
+// Helper function to get an instance of web::PaymentAddress from an autofill
+// profile.
+web::PaymentAddress PaymentAddressFromAutofillProfile(
+    autofill::AutofillProfile* profile);
+
 }  // namespace payment_request_utils
 
 #endif  // IOS_CHROME_BROWSER_PAYMENTS_PAYMENT_REQUEST_UTILS_H_
diff --git a/ios/chrome/browser/payments/payment_request_utils.mm b/ios/chrome/browser/payments/payment_request_utils.mm
index d81ba69..873fc3d2 100644
--- a/ios/chrome/browser/payments/payment_request_utils.mm
+++ b/ios/chrome/browser/payments/payment_request_utils.mm
@@ -5,6 +5,7 @@
 #import "ios/chrome/browser/payments/payment_request_utils.h"
 
 #include "base/strings/sys_string_conversions.h"
+#include "base/strings/utf_string_conversions.h"
 #include "components/autofill/core/browser/autofill_profile.h"
 #include "components/autofill/core/browser/field_types.h"
 #include "ios/chrome/browser/application_context.h"
@@ -49,4 +50,31 @@
       GetApplicationContext()->GetApplicationLocale()));
 }
 
+web::PaymentAddress PaymentAddressFromAutofillProfile(
+    autofill::AutofillProfile* profile) {
+  web::PaymentAddress address;
+  address.country = profile->GetRawInfo(autofill::ADDRESS_HOME_COUNTRY);
+  address.address_line.push_back(
+      profile->GetRawInfo(autofill::ADDRESS_HOME_LINE1));
+  address.address_line.push_back(
+      profile->GetRawInfo(autofill::ADDRESS_HOME_LINE2));
+  address.address_line.push_back(
+      profile->GetRawInfo(autofill::ADDRESS_HOME_LINE3));
+  address.region = profile->GetRawInfo(autofill::ADDRESS_HOME_STATE);
+  address.city = profile->GetRawInfo(autofill::ADDRESS_HOME_CITY);
+  address.dependent_locality =
+      profile->GetRawInfo(autofill::ADDRESS_HOME_DEPENDENT_LOCALITY);
+  address.postal_code = profile->GetRawInfo(autofill::ADDRESS_HOME_ZIP);
+  address.sorting_code =
+      profile->GetRawInfo(autofill::ADDRESS_HOME_SORTING_CODE);
+  address.language_code = base::UTF8ToUTF16(profile->language_code());
+  address.organization = profile->GetRawInfo(autofill::COMPANY_NAME);
+  address.recipient =
+      profile->GetInfo(autofill::AutofillType(autofill::NAME_FULL),
+                       GetApplicationContext()->GetApplicationLocale());
+  address.phone = profile->GetRawInfo(autofill::PHONE_HOME_WHOLE_NUMBER);
+
+  return address;
+}
+
 }  // namespace payment_request_utils
diff --git a/ios/chrome/browser/payments/payment_request_view_controller.h b/ios/chrome/browser/payments/payment_request_view_controller.h
index 6407441b..8427eae 100644
--- a/ios/chrome/browser/payments/payment_request_view_controller.h
+++ b/ios/chrome/browser/payments/payment_request_view_controller.h
@@ -17,13 +17,34 @@
 
 extern NSString* const kPaymentRequestCollectionViewId;
 
+@class PaymentRequestViewController;
+
+// Delegate protocol for PaymentRequestViewController.
 @protocol PaymentRequestViewControllerDelegate<NSObject>
-- (void)paymentRequestViewControllerDidCancel;
-- (void)paymentRequestViewControllerDidConfirm;
-- (void)paymentRequestViewControllerDisplayPaymentItems;
-- (void)paymentRequestViewControllerSelectShippingAddress;
-- (void)paymentRequestViewControllerSelectShippingOption;
-- (void)paymentRequestViewControllerSelectPaymentMethod;
+
+// Notifies the delegate that the user has canceled the payment request.
+- (void)paymentRequestViewControllerDidCancel:
+    (PaymentRequestViewController*)controller;
+
+// Notifies the delegate that the user has confirmed the payment request.
+- (void)paymentRequestViewControllerDidConfirm:
+    (PaymentRequestViewController*)controller;
+
+// Notifies the delegate that the user has selected the payment summary item.
+- (void)paymentRequestViewControllerDidSelectPaymentSummaryItem:
+    (PaymentRequestViewController*)controller;
+
+// Notifies the delegate that the user has selected the shipping address item.
+- (void)paymentRequestViewControllerDidSelectShippingAddressItem:
+    (PaymentRequestViewController*)controller;
+
+// Notifies the delegate that the user has selected the shipping option item.
+- (void)paymentRequestViewControllerDidSelectShippingOptionItem:
+    (PaymentRequestViewController*)controller;
+
+// Notifies the delegate that the user has selected the payment method item.
+- (void)paymentRequestViewControllerDidSelectPaymentMethodItem:
+    (PaymentRequestViewController*)controller;
 
 @end
 
@@ -56,6 +77,9 @@
 // The delegate to be notified when the user confirms or cancels the request.
 @property(nonatomic, weak) id<PaymentRequestViewControllerDelegate> delegate;
 
+// Updates the payment summary section UI.
+- (void)updatePaymentSummarySection;
+
 // Sets the selected shipping address and updates the UI.
 - (void)updateSelectedShippingAddress:
     (autofill::AutofillProfile*)shippingAddress;
diff --git a/ios/chrome/browser/payments/payment_request_view_controller.mm b/ios/chrome/browser/payments/payment_request_view_controller.mm
index 2be5dc7..acef1f7 100644
--- a/ios/chrome/browser/payments/payment_request_view_controller.mm
+++ b/ios/chrome/browser/payments/payment_request_view_controller.mm
@@ -73,6 +73,7 @@
   base::scoped_nsobject<UIBarButtonItem> _cancelButton;
   base::scoped_nsobject<MDCFlatButton> _payButton;
 
+  CollectionViewDetailItem* _paymentSummaryItem;
   ShippingAddressItem* _selectedShippingAddressItem;
   CollectionViewTextItem* _selectedShippingOptionItem;
 
@@ -179,14 +180,14 @@
   [_cancelButton setEnabled:NO];
   [_payButton setEnabled:NO];
 
-  [_delegate paymentRequestViewControllerDidCancel];
+  [_delegate paymentRequestViewControllerDidCancel:self];
 }
 
 - (void)onConfirm {
   [_cancelButton setEnabled:NO];
   [_payButton setEnabled:NO];
 
-  [_delegate paymentRequestViewControllerDidConfirm];
+  [_delegate paymentRequestViewControllerDidConfirm:self];
 }
 
 #pragma mark - CollectionViewController methods
@@ -205,21 +206,17 @@
   pageInfo.pageHost = _pageHost;
   [model setHeader:pageInfo forSectionWithIdentifier:SectionIdentifierSummary];
 
-  CollectionViewDetailItem* total = [[[CollectionViewDetailItem alloc]
+  _paymentSummaryItem = [[[CollectionViewDetailItem alloc]
       initWithType:ItemTypeSummaryTotal] autorelease];
-  total.text = l10n_util::GetNSString(IDS_IOS_PAYMENT_REQUEST_TOTAL_HEADER);
-  NSString* currencyCode =
-      base::SysUTF16ToNSString(_paymentRequest.details.total.amount.currency);
-  NSDecimalNumber* value = [NSDecimalNumber
-      decimalNumberWithString:SysUTF16ToNSString(
-                                  _paymentRequest.details.total.amount.value)];
-  total.detailText =
-      payment_request_utils::FormattedCurrencyString(value, currencyCode);
+  [self fillPaymentSummaryItem:_paymentSummaryItem
+               withPaymentItem:_paymentRequest.details.total];
   if (!_paymentRequest.details.display_items.empty()) {
-    total.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator;
-    total.accessibilityTraits |= UIAccessibilityTraitButton;
+    _paymentSummaryItem.accessoryType =
+        MDCCollectionViewCellAccessoryDisclosureIndicator;
+    _paymentSummaryItem.accessibilityTraits |= UIAccessibilityTraitButton;
   }
-  [model addItem:total toSectionWithIdentifier:SectionIdentifierSummary];
+  [model addItem:_paymentSummaryItem
+      toSectionWithIdentifier:SectionIdentifierSummary];
 
   // Shipping section.
   [model addSectionWithIdentifier:SectionIdentifierShipping];
@@ -329,6 +326,15 @@
       UIEdgeInsetsMake(0, kSeparatorEdgeInset, 0, kSeparatorEdgeInset);
 }
 
+- (void)updatePaymentSummarySection {
+  [self fillPaymentSummaryItem:_paymentSummaryItem
+               withPaymentItem:_paymentRequest.details.total];
+  NSIndexPath* indexPath =
+      [self.collectionViewModel indexPathForItem:_paymentSummaryItem
+                         inSectionWithIdentifier:SectionIdentifierSummary];
+  [self.collectionView reloadItemsAtIndexPaths:@[ indexPath ]];
+}
+
 - (void)updateSelectedShippingAddress:
     (autofill::AutofillProfile*)shippingAddress {
   [self setSelectedShippingAddress:shippingAddress];
@@ -353,6 +359,18 @@
 
 #pragma mark - Helper methods
 
+- (void)fillPaymentSummaryItem:(CollectionViewDetailItem*)item
+               withPaymentItem:(web::PaymentItem)paymentItem {
+  item.text = l10n_util::GetNSString(IDS_IOS_PAYMENT_REQUEST_TOTAL_HEADER);
+  NSString* currencyCode =
+      base::SysUTF16ToNSString(_paymentRequest.details.total.amount.currency);
+  NSDecimalNumber* value = [NSDecimalNumber
+      decimalNumberWithString:SysUTF16ToNSString(
+                                  _paymentRequest.details.total.amount.value)];
+  item.detailText =
+      payment_request_utils::FormattedCurrencyString(value, currencyCode);
+}
+
 - (void)fillShippingAddressItem:(ShippingAddressItem*)item
                     withAddress:(autofill::AutofillProfile*)address {
   item.name = NameLabelFromAutofillProfile(address);
@@ -414,18 +432,19 @@
   switch (itemType) {
     case ItemTypeSummaryTotal:
       if (!_paymentRequest.details.display_items.empty())
-        [_delegate paymentRequestViewControllerDisplayPaymentItems];
+        [_delegate
+            paymentRequestViewControllerDidSelectPaymentSummaryItem:self];
       break;
     case ItemTypeShippingAddress:
     case ItemTypeAddShippingAddress:
-      [_delegate paymentRequestViewControllerSelectShippingAddress];
+      [_delegate paymentRequestViewControllerDidSelectShippingAddressItem:self];
       break;
     case ItemTypeShippingOption:
     case ItemTypeSelectShippingOption:
-      [_delegate paymentRequestViewControllerSelectShippingOption];
+      [_delegate paymentRequestViewControllerDidSelectShippingOptionItem:self];
       break;
     case ItemTypePaymentMethod:
-      [_delegate paymentRequestViewControllerSelectPaymentMethod];
+      [_delegate paymentRequestViewControllerDidSelectPaymentMethodItem:self];
       break;
     default:
       NOTREACHED();
diff --git a/ios/chrome/browser/payments/resources/payment_request_manager.js b/ios/chrome/browser/payments/resources/payment_request_manager.js
index b97cafba4..2bf82bd 100644
--- a/ios/chrome/browser/payments/resources/payment_request_manager.js
+++ b/ios/chrome/browser/payments/resources/payment_request_manager.js
@@ -3,52 +3,386 @@
 // found in the LICENSE file.
 
 /**
- * @fileoverview JavaScript implementation of the Payment Request API. Conforms
- * to the 18 July 2016 editor's draft at
- * https://w3c.github.io/browser-payment-api/.
- *
- * This is a minimal implementation that sends data to the app side to present
- * the user interface. When loaded, installs the API onto the window object.
+ * @fileoverview JavaScript implementation of the Payment Request API. When
+ * loaded, installs the API onto the window object. Conforms
+ * to https://www.w3.org/TR/payment-request/. Note: This is a work in progress.
  */
 
-// Namespace for all PaymentRequest implementations. __gCrWeb must have already
-// been defined.
-__gCrWeb.paymentRequestManager = {
+/**
+ * This class implements the DOM level 2 EventTarget interface. The
+ * Implementation is copied form src/ui/webui/resources/js/cr/event_target.js.
+ * This code should be removed once there is a plan to move event_target.js out
+ * of WebUI and reuse in iOS.
+ * @constructor
+ * @implements {EventTarget}
+ */
+__gCrWeb.EventTarget =
+    function() {
+  this.listeners_ = null;
+}
+
+// Store EventTarget namespace object in a global __gCrWeb object referenced
+// by a string, so it does not get renamed by closure compiler during the
+// minification.
+__gCrWeb['EventTarget'] = __gCrWeb.EventTarget;
+
+/* Beginning of anonymous object. */
+(function() {
+  __gCrWeb.EventTarget.prototype = {
+    /** @override */
+    addEventListener: function(type, handler) {
+      if (!this.listeners_)
+        this.listeners_ = Object.create(null);
+      if (!(type in this.listeners_)) {
+        this.listeners_[type] = [handler];
+      } else {
+        var handlers = this.listeners_[type];
+        if (handlers.indexOf(handler) < 0)
+          handlers.push(handler);
+      }
+    },
+
+    /** @override */
+    removeEventListener: function(type, handler) {
+      if (!this.listeners_)
+        return;
+      if (type in this.listeners_) {
+        var handlers = this.listeners_[type];
+        var index = handlers.indexOf(handler);
+        if (index >= 0) {
+          // Clean up if this was the last listener.
+          if (handlers.length == 1)
+            delete this.listeners_[type];
+          else
+            handlers.splice(index, 1);
+        }
+      }
+    },
+
+    /** @override */
+    dispatchEvent: function(event) {
+      var type = event.type;
+      var prevented = 0;
+
+      if (!this.listeners_)
+        return true;
+
+      // Override the DOM Event's 'target' property.
+      Object.defineProperty(event, 'target', {value: this});
+
+      if (type in this.listeners_) {
+        // Clone to prevent removal during dispatch
+        var handlers = this.listeners_[type].concat();
+        for (var i = 0, handler; handler = handlers[i]; i++) {
+          if (handler.handleEvent)
+            prevented |= handler.handleEvent.call(handler, event) === false;
+          else
+            prevented |= handler.call(this, event) === false;
+        }
+      }
+
+      return !prevented && !event.defaultPrevented;
+    }
+  };
+}());  // End of anonymous object
+
+/**
+ * PromiseResolver is a helper class that allows creating a Promise that will be
+ * fulfilled (resolved or rejected) some time later. The implementation is
+ * copied from src/ui/webui/resources/js/promise_resolver.js. This code should
+ * be removed once there is a plan to move promise_resolver.js out of WebUI and
+ * reuse in iOS.
+ * @constructor
+ * @template T
+ */
+__gCrWeb.PromiseResolver =
+    function() {
+  /** @private {function(T=): void} */
+  this.resolve_;
+
+  /** @private {function(*=): void} */
+  this.reject_;
+
+  /** @private {!Promise<T>} */
+  this.promise_ = new Promise(function(resolve, reject) {
+    this.resolve_ = resolve;
+    this.reject_ = reject;
+  }.bind(this));
+}
+
+// Store PromiseResolver namespace object in a global __gCrWeb object referenced
+// by a string, so it does not get renamed by closure compiler during the
+// minification.
+__gCrWeb['PromiseResolver'] = __gCrWeb.PromiseResolver;
+
+/* Beginning of anonymous object. */
+(function() {
+  __gCrWeb.PromiseResolver.prototype = {
+    /** @return {!Promise<T>} */
+    get promise() { return this.promise_; },
+    /** @return {function(T=): void} */
+    get resolve() { return this.resolve_; },
+    /** @return {function(*=): void} */
+    get reject() { return this.reject_; },
+  };
+}());  // End of anonymous object
+
+/**
+ * A simple object representation of |window.PaymentRequest| meant for
+ * communication to the app side.
+ * @typedef {{
+ *   methodData: !Array<!window.PaymentMethodData>,
+ *   details: !window.PaymentDetails,
+ *   options: (window.PaymentOptions|undefined)
+ * }}
+ */
+var SerializedPaymentRequest;
+
+/**
+ * A simple object representation of |window.PaymentResponse| meant for
+ * communication to the app side.
+ * @typedef {{
+ *   methodName: string,
+ *   details: Object
+ * }}
+ */
+var SerializedPaymentResponse;
+
+/* Beginning of anonymous object. */
+(function() {
+  // Namespace for all PaymentRequest implementations. __gCrWeb must have
+  // already
+  // been defined.
+  __gCrWeb.paymentRequestManager = {};
+
+  // Store paymentRequestManager namespace object in a global __gCrWeb object
+  // referenced by a string, so it does not get renamed by closure compiler
+  // during
+  // the minification.
+  __gCrWeb['paymentRequestManager'] = __gCrWeb.paymentRequestManager;
+
   /**
-   * The pending PaymentRequest, if any. Used by the app side to invoke the
-   * associated resolve or reject function.
+   * The PaymentRequest object, if any. This object is provided by the page and
+   * only updated by the app side.
    * @type {window.PaymentRequest}
    */
-  pendingRequest: null,
+  __gCrWeb['paymentRequestManager'].pendingRequest = null;
 
   /**
-   * The pending PaymentResponse, if any. Used by the app side to invoke the
-   * associated resolve function.
-   * @type {window.PaymentResponse}
+   * The PromiseResolver object used to resolve or reject the promise returned
+   * by PaymentRequest.prototype.show, if any.
+   * @type {__gCrWeb.PromiseResolver}
    */
-  pendingResponse: null
-};
-__gCrWeb['paymentRequestManager'] = __gCrWeb.paymentRequestManager;
+  __gCrWeb['paymentRequestManager'].requestPromiseResolver = null;
 
-/** @typedef {{
- *     methodData: !Array.<window.PaymentMethodData>,
- *     details: !window.PaymentDetails,
- *     options: (window.PaymentOptions|undefined)
- * }}
- */
-__gCrWeb.paymentRequestManager.SerializedPaymentRequest;
+  /**
+   * The PromiseResolver object used to resolve the promise returned by
+   * PaymentResponse.prototype.complete, if any.
+   * @type {window.PaymentRequest}
+   */
+  __gCrWeb['paymentRequestManager'].responsePromiseResolver = null;
 
-/** @typedef {{
- *     methodName: string,
- *     details: Object
- * }}
- */
-__gCrWeb.paymentRequestManager.SerializedPaymentResponse;
+  /**
+   * Parses |paymentResponseData| into a window.PaymentResponse object.
+   * @param {!SerializedPaymentResponse} paymentResponseData
+   * @return {window.PaymentResponse}
+   */
+  var parsePaymentResponseData = function(paymentResponseData) {
+    return new window.PaymentResponse(
+        paymentResponseData['methodName'], paymentResponseData['details']);
+  };
+
+  /**
+   * The event that enables the web page to update the details of the payment
+   * request in response to a user interaction.
+   * @type {Event}
+   */
+  var updateEvent = null;
+
+  /**
+   * Handles invocation of updateWith() on the updateEvent object. Updates the
+   * payment details when the |updateWithPromise| is resolved. Throws an error
+   * if |updateWithPromise| is not a valid instance of Promise or if it fulfills
+   * with an invalid instance of window.PaymentDetails.
+   * @param {?Promise<?window.PaymentDetails|undefined>|undefined}
+   *     updateWithPromise
+   */
+  var updateWith = function(updateWithPromise) {
+    // Check to see |updateWithPromise| is an instance of Promise.
+    if (!updateWithPromise || !(updateWithPromise.then instanceof Function) ||
+        !(updateWithPromise.catch instanceof Function)) {
+      throw new TypeError('An instance of Promise must be provided');
+    }
+
+    updateWithPromise
+        .then(function(paymentDetails) {
+          if (!paymentDetails)
+            throw new TypeError(
+                'An instance of PaymentDetails must be provided.');
+
+          var message = {
+            'command': 'paymentRequest.updatePaymentDetails',
+            'payment_details': paymentDetails,
+          };
+          __gCrWeb.message.invokeOnHost(message);
+
+          updateEvent = null;
+        })
+        .catch(function() {
+          // TODO(crbug.com/602666): Handle the reject scenario.
+          updateEvent = null;
+        });
+  };
+
+  /**
+   * Resolves the pending PaymentRequest.
+   * @param {!SerializedPaymentResponse} paymentResponseData The response to
+   *     provide to the resolve function of the Promise.
+   */
+  __gCrWeb['paymentRequestManager'].resolveRequestPromise = function(
+      paymentResponseData) {
+    if (!__gCrWeb['paymentRequestManager'].requestPromiseResolver) {
+      throw new Error('Internal PaymentRequest error: No Promise to resolve.');
+    }
+
+    if (!paymentResponseData) {
+      __gCrWeb['paymentRequestManager'].rejectRequestPromise(
+          'Internal PaymentRequest error: PaymentResponse missing.');
+    }
+
+    var paymentResponse = null;
+    try {
+      paymentResponse = parsePaymentResponseData(paymentResponseData);
+    } catch (e) {
+      __gCrWeb['paymentRequestManager'].rejectRequestPromise(
+          'Internal PaymentRequest error: failed to parse PaymentResponse.');
+    }
+
+    __gCrWeb['paymentRequestManager'].responsePromiseResolver =
+        new __gCrWeb.PromiseResolver();
+    __gCrWeb['paymentRequestManager'].requestPromiseResolver.resolve(
+        paymentResponse);
+    __gCrWeb['paymentRequestManager'].requestPromiseResolver = null;
+    __gCrWeb['paymentRequestManager'].pendingRequest = null;
+  };
+
+  /**
+   * Rejects the pending PaymentRequest.
+   * @param {!string} message An error message explaining why the Promise is
+   * being rejected.
+   */
+  __gCrWeb['paymentRequestManager'].rejectRequestPromise = function(message) {
+    if (!__gCrWeb['paymentRequestManager'].requestPromiseResolver) {
+      throw new Error(
+          'Internal PaymentRequest error: No Promise to reject. ',
+          'Message was: ', message);
+    }
+
+    __gCrWeb['paymentRequestManager'].requestPromiseResolver.reject(message);
+    __gCrWeb['paymentRequestManager'].requestPromiseResolver = null;
+    __gCrWeb['paymentRequestManager'].pendingRequest = null;
+  };
+
+  /**
+   * Serializes |paymentRequest| to a SerializedPaymentRequest object.
+   * @param {window.PaymentRequest} paymentRequest
+   * @return {SerializedPaymentRequest}
+   */
+  __gCrWeb['paymentRequestManager'].serializePaymentRequest = function(
+      paymentRequest) {
+    var serialized = {
+      'methodData': paymentRequest.methodData,
+      'details': paymentRequest.details,
+    };
+    if (paymentRequest.options)
+      serialized['options'] = paymentRequest.options;
+    return serialized;
+  };
+
+  /**
+   * Resolves the pending PaymentResponse.
+   */
+  __gCrWeb['paymentRequestManager'].resolveResponsePromise = function() {
+    if (!__gCrWeb['paymentRequestManager'].responsePromiseResolver) {
+      throw new Error('Internal PaymentRequest error: No Promise to resolve.');
+    }
+
+    __gCrWeb['paymentRequestManager'].responsePromiseResolver.resolve();
+    __gCrWeb['paymentRequestManager'].responsePromiseResolver = null;
+  };
+
+  /**
+   * Updates the shipping_option property of the PaymentRequest object to
+   * |shippingOptionID| and dispatches a shippingoptionchange event.
+   * @param {string} shippingOptionID
+   */
+  __gCrWeb['paymentRequestManager'].updateShippingOptionAndDispatchEvent =
+      function(shippingOptionID) {
+    if (!__gCrWeb['paymentRequestManager'].pendingRequest) {
+      __gCrWeb['paymentRequestManager'].rejectRequestPromise(
+          'Internal PaymentRequest error: No pending request.');
+    }
+
+    var pendingRequest = __gCrWeb['paymentRequestManager'].pendingRequest;
+
+    if (updateEvent) {
+      __gCrWeb['paymentRequestManager'].rejectRequestPromise(
+          'Internal PaymentRequest error: Only one update may take ' +
+          'place at a time.');
+    }
+
+    pendingRequest.shippingOption = shippingOptionID;
+
+    updateEvent = new Event(
+        'shippingoptionchange', {'bubbles': true, 'cancelable': false});
+    Object.defineProperty(updateEvent, 'updateWith', {value: updateWith});
+
+    // setTimeout() is used in order to return immediately. Otherwise the
+    // dispatchEvent call waits for all event handlers to return, which could
+    // cause a ReentryGuard failure.
+    window.setTimeout(function() {
+      pendingRequest.dispatchEvent(updateEvent);
+    }, 0);
+  };
+
+  /**
+   * Updates the shipping_address property of the PaymentRequest object to
+   * |shippingAddress| and dispatches a shippingaddresschange event.
+   * @param {!window.PaymentAddress} shippingAddress
+   */
+  __gCrWeb['paymentRequestManager'].updateShippingAddressAndDispatchEvent =
+      function(shippingAddress) {
+    if (!__gCrWeb['paymentRequestManager'].pendingRequest) {
+      __gCrWeb['paymentRequestManager'].rejectRequestPromise(
+          'Internal PaymentRequest error: No pending request.');
+    }
+
+    var pendingRequest = __gCrWeb['paymentRequestManager'].pendingRequest;
+
+    if (updateEvent) {
+      __gCrWeb['paymentRequestManager'].rejectRequestPromise(
+          'Internal PaymentRequest error: Only one update may take ' +
+          'place at a time.');
+    }
+
+    pendingRequest.shippingAddress = shippingAddress;
+
+    updateEvent = new Event(
+        'shippingaddresschange', {'bubbles': true, 'cancelable': false});
+    Object.defineProperty(updateEvent, 'updateWith', {value: updateWith});
+
+    // setTimeout() is used in order to return immediately. Otherwise the
+    // dispatchEvent call waits for all event handlers to return, which could
+    // cause a ReentryGuard failure.
+    window.setTimeout(function() {
+      pendingRequest.dispatchEvent(updateEvent);
+    }, 0);
+  };
+}());  // End of anonymous object
 
 /**
  * A request to make a payment.
- *
- * @param {!Array.<window.PaymentMethodData>} methodData Payment method
+ * @param {!Array<!window.PaymentMethodData>} methodData Payment method
  *     identifiers for the payment methods that the web site accepts and any
  *     associated payment method specific data.
  * @param {!window.PaymentDetails} details Information about the transaction
@@ -58,8 +392,11 @@
  *     options the web page wishes to use from the payment request system.
  * @constructor
  * @implements {EventTarget}
+ * @extends {__gCrWeb.EventTarget}
  */
 window.PaymentRequest = function(methodData, details, opt_options) {
+  __gCrWeb.EventTarget.call(this);
+
   if (window.top != window.self) {
     throw new Error(
         'PaymentRequest can only be used in the top-level context.');
@@ -77,7 +414,7 @@
   // TODO(crbug.com/602666): Perform other validation per spec.
 
   /**
-   * @type {!Array.<window.PaymentMethodData>}
+   * @type {!Array<!window.PaymentMethodData>}
    */
   this.methodData = methodData;
 
@@ -110,30 +447,10 @@
    * @private
    */
   this.state = 'created';
-
-  /**
-   * The pending resolve function provided to the Promise returned by show().
-   * @type {?function(window.PaymentResponse)}
-   * @private
-   */
-  this.resolve_ = null;
-
-  /**
-   * The pending reject function provided to the Promise returned by show().
-   * @type {?function(string)}
-   * @private
-   */
-  this.reject_ = null;
 };
 
-// TODO(crbug.com/602666): Add the event handling logic.
-window.PaymentRequest.prototype.addEventListener = function(type, listener) {
-};
-
-window.PaymentRequest.prototype.removeEventListener = function(type, listener) {
-};
-
-window.PaymentRequest.prototype.dispatchEvent = function(event) {
+window.PaymentRequest.prototype = {
+  __proto__: __gCrWeb.EventTarget.prototype
 };
 
 /**
@@ -149,147 +466,92 @@
 
   var message = {
     'command': 'paymentRequest.requestShow',
-    'payment_request': this.serialize()
+    'payment_request':
+        __gCrWeb['paymentRequestManager'].serializePaymentRequest(this),
   };
   __gCrWeb.message.invokeOnHost(message);
 
-  var self = this;
-  return new Promise(function(resolve, reject) {
-    self.resolve_ = resolve;
-    self.reject_ = reject;
-  });
+  __gCrWeb['paymentRequestManager'].requestPromiseResolver =
+      new __gCrWeb.PromiseResolver();
+  return __gCrWeb['paymentRequestManager'].requestPromiseResolver.promise;
 };
 
 /**
- * Resolves the pending Promise. Should only be called by the app-side logic.
- * @param {!__gCrWeb.paymentRequestManager.SerializedPaymentResponse}
- *     paymentResponseData The response to provide to the resolve function of
- *     the Promise.
- */
-window.PaymentRequest.prototype.resolve = function(paymentResponseData) {
-  if (!paymentResponseData) {
-    throw new Error("Internal PaymentRequest error: PaymentResponse missing.");
-  }
-
-  if (!this.resolve_) {
-    throw new Error("Internal PaymentRequest error: resolve function missing.");
-  }
-
-  var paymentResponse = null;
-  try {
-    paymentResponse = window.PaymentResponse.parse(paymentResponseData);
-  } catch (e) {
-    throw new Error(
-        "Internal PaymentRequest error: failed to parse PaymentResponse data.");
-  }
-  this.resolve_(paymentResponse);
-
-  this.resolve_ = null;
-  this.reject_ = null;
-  __gCrWeb['paymentRequestManager'].pendingRequest = null;
-  __gCrWeb['paymentRequestManager'].pendingResponse = paymentResponse;
-}
-
-/**
- * Rejects the pending Promise. Should only be called by the app-side logic.
- * @param {!string} message An error message explaining why the Promise is being
- *     rejected.
- */
-window.PaymentRequest.prototype.reject = function(message) {
-  if (!this.reject_) {
-    throw new Error("Internal PaymentRequest error: reject function missing.");
-  }
-
-  this.reject_(message);
-
-  this.resolve_ = null;
-  this.reject_ = null;
-  __gCrWeb['paymentRequestManager'].pendingRequest = null;
-}
-
-/**
- * Returns a simple object representation of this payment request suitable for
- * sending to the app side.
- * @return {__gCrWeb.paymentRequestManager.SerializedPaymentRequest}
- */
-window.PaymentRequest.prototype.serialize = function() {
-  var serialized = {
-    'methodData': this.methodData,
-    'details': this.details,
-  };
-  if (this.options)
-    serialized['options'] = this.options;
-  return serialized;
-};
-
-/** @typedef {{
- *     supportedMethods: Array<string>,
- *     data: (Object|undefined)
+ * @typedef {{
+ *   supportedMethods: !Array<string>,
+ *   data: (Object|undefined)
  * }}
  */
 window.PaymentMethodData;
 
-/** @typedef {{
- *     currency: string,
- *     value: string
+/**
+ * @typedef {{
+ *   currency: string,
+ *   value: string
  * }}
  */
 window.PaymentCurrencyAmount;
 
-/** @typedef {{
- *     total: (window.PaymentItem|undefined),
- *     displayItems: (Array<window.PaymentItem>|undefined),
- *     shippingOptions: (Array<window.PaymentShippingOption>|undefined),
- *     modifiers: (Array<window.PaymentDetailsModifier>|undefined)
+/**
+ * @typedef {{
+ *   total: (window.PaymentItem|undefined),
+ *   displayItems: (!Array<!window.PaymentItem>|undefined),
+ *   shippingOptions: (!Array<!window.PaymentShippingOption>|undefined),
+ *   modifiers: (!Array<!window.PaymentDetailsModifier>|undefined)
  * }}
  */
 window.PaymentDetails;
 
-/** @typedef {{
- *     supportedMethods: Array<string>,
- *     total: (window.PaymentItem|undefined),
- *     additionalDisplayItems: (Array<window.PaymentItem>|undefined)
+/**
+ * @typedef {{
+ *   supportedMethods: !Array<string>,
+ *   total: (window.PaymentItem|undefined),
+ *   additionalDisplayItems: (!Array<!window.PaymentItem>|undefined)
  * }}
  */
 window.PaymentDetailsModifier;
 
-/** @typedef {{
- *     requestPayerEmail: (boolean|undefined),
- *     requestPayerPhone: (boolean|undefined),
- *     requestShipping: (boolean|undefined)
+/**
+ * @typedef {{
+ *   requestPayerEmail: (boolean|undefined),
+ *   requestPayerPhone: (boolean|undefined),
+ *   requestShipping: (boolean|undefined)
  * }}
  */
 window.PaymentOptions;
 
-/** @typedef {{
- *     label: string,
- *     amount: window.PaymentCurrencyAmount
+/**
+ * @typedef {{
+ *   label: string,
+ *   amount: window.PaymentCurrencyAmount
  * }}
  */
 window.PaymentItem;
 
 // TODO(crbug.com/602666): Convert this to a class with readonly properties.
-/** @typedef {{
- *     country: string,
- *     addressLine: Array<string>,
- *     region: string,
- *     city: string,
- *     dependentLocality: string,
- *     postalCode: string,
- *     sortingCode: string,
- *     languageCode: string,
- *     organization: string,
- *     recipient: string,
- *     phone: string
+/**
+ * @typedef {{
+ *   country: string,
+ *   addressLine: !Array<string>,
+ *   region: string,
+ *   city: string,
+ *   dependentLocality: string,
+ *   postalCode: string,
+ *   sortingCode: string,
+ *   languageCode: string,
+ *   organization: string,
+ *   recipient: string,
+ *   phone: string
  * }}
  */
 window.PaymentAddress;
 
-/** @typedef {{
- *     id: string,
- *     label: string,
- *     amount: window.PaymentCurrencyAmount,
- *     selected: boolean
+/**
+ * @typedef {{
+ *   id: string,
+ *   label: string,
+ *   amount: window.PaymentCurrencyAmount,
+ *   selected: boolean
  * }}
  */
 window.PaymentShippingOption;
@@ -298,7 +560,6 @@
  * A response to a request to make a payment. Represents the choices made by the
  * user and provided to the web page through the resolve function of the Promise
  * returned by PaymentRequest.show().
- *
  * @param {string} methodName The payment method identifier for the payment
  *     method that the user selected to fulfil the transaction.
  * @param {Object} details An object that provides a payment method specific
@@ -317,14 +578,6 @@
    * @type {Object}
    */
   this.details = details;
-
-  /**
-   * The pending resolve function provided to the Promise returned by
-   * complete().
-   * @type {?function()}
-   * @private
-   */
-  this.resolve_ = null;
 };
 
 /**
@@ -334,44 +587,14 @@
  *     been closed.
  */
 window.PaymentResponse.prototype.complete = function(success) {
+  if (!__gCrWeb['paymentRequestManager'].responsePromiseResolver) {
+    throw new Error('Internal PaymentRequest error: No Promise to return.');
+  }
+
   var message = {
     'command': 'paymentRequest.responseComplete'
   };
   __gCrWeb.message.invokeOnHost(message);
 
-  var self = this;
-  return new Promise(function(resolve, reject) {
-    self.resolve_ = resolve;
-    // Any reject function provided is ignored because the spec includes no
-    // provision for rejecting the response promise. User agents are directed to
-    // always resolve the promise.
-  });
-};
-
-/**
- * Resolves the pending Promise. Should only be called by the app-side logic.
- */
-window.PaymentResponse.prototype.resolve = function() {
-  // If the page has not yet provided a resolve function, do nothing. This can
-  // happen in the case where the UI times out while waiting for the page to
-  // call complete().
-  if (!this.resolve_) {
-    return;
-  }
-
-  this.resolve_();
-
-  this.resolve_ = null;
-  __gCrWeb['paymentRequestManager'].pendingResponse = null;
-}
-
-/**
- * Parses |paymentResponseData| into a PaymentResponse object.
- * @param {!__gCrWeb.paymentRequestManager.SerializedPaymentResponse}
- *     paymentResponseData A simple object representation of a PaymentResponse.
- * @return {window.PaymentResponse} A PaymentResponse object.
- */
-window.PaymentResponse.parse = function(paymentResponseData) {
-  return new window.PaymentResponse(paymentResponseData['methodName'],
-                                    paymentResponseData['details']);
+  return __gCrWeb['paymentRequestManager'].responsePromiseResolver.promise;
 };
diff --git a/ios/chrome/browser/payments/shipping_address_selection_coordinator.h b/ios/chrome/browser/payments/shipping_address_selection_coordinator.h
index a739a24..e19b69c6 100644
--- a/ios/chrome/browser/payments/shipping_address_selection_coordinator.h
+++ b/ios/chrome/browser/payments/shipping_address_selection_coordinator.h
@@ -16,13 +16,14 @@
 
 @class ShippingAddressSelectionCoordinator;
 
+// Delegate protocol for ShippingAddressSelectionCoordinator.
 @protocol ShippingAddressSelectionCoordinatorDelegate<NSObject>
 
 // Notifies the delegate that the user has selected a shipping address.
 - (void)shippingAddressSelectionCoordinator:
             (ShippingAddressSelectionCoordinator*)coordinator
-                    selectedShippingAddress:
-                        (autofill::AutofillProfile*)shippingAddress;
+                   didSelectShippingAddress:
+                       (autofill::AutofillProfile*)shippingAddress;
 
 // Notifies the delegate that the user has chosen to return to the previous
 // screen without making a selection.
diff --git a/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm b/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm
index f31fa5a..27780c7a 100644
--- a/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm
+++ b/ios/chrome/browser/payments/shipping_address_selection_coordinator.mm
@@ -85,7 +85,7 @@
         _viewController.get().view.userInteractionEnabled = YES;
         [_delegate
             shippingAddressSelectionCoordinator:self
-                        selectedShippingAddress:_selectedShippingAddress];
+                       didSelectShippingAddress:_selectedShippingAddress];
       });
 }
 
diff --git a/ios/chrome/browser/payments/shipping_address_selection_view_controller.h b/ios/chrome/browser/payments/shipping_address_selection_view_controller.h
index cc6b7a6..0e55925 100644
--- a/ios/chrome/browser/payments/shipping_address_selection_view_controller.h
+++ b/ios/chrome/browser/payments/shipping_address_selection_view_controller.h
@@ -16,12 +16,17 @@
 
 @class ShippingAddressSelectionViewController;
 
+// Delegate protocol for ShippingAddressSelectionViewController.
 @protocol ShippingAddressSelectionViewControllerDelegate<NSObject>
 
+// Notifies the delegate that the user has selected a shipping address.
 - (void)shippingAddressSelectionViewController:
             (ShippingAddressSelectionViewController*)controller
                        selectedShippingAddress:
                            (autofill::AutofillProfile*)shippingAddress;
+
+// Notifies the delegate that the user has chosen to return to the previous
+// screen without making a selection.
 - (void)shippingAddressSelectionViewControllerDidReturn:
     (ShippingAddressSelectionViewController*)controller;
 
diff --git a/ios/chrome/browser/payments/shipping_option_selection_coordinator.h b/ios/chrome/browser/payments/shipping_option_selection_coordinator.h
index 416710b..b407ecb 100644
--- a/ios/chrome/browser/payments/shipping_option_selection_coordinator.h
+++ b/ios/chrome/browser/payments/shipping_option_selection_coordinator.h
@@ -13,13 +13,14 @@
 
 @class ShippingOptionSelectionCoordinator;
 
+// Delegate protocol for ShippingOptionSelectionCoordinator.
 @protocol ShippingOptionSelectionCoordinatorDelegate<NSObject>
 
 // Notifies the delegate that the user has selected a shipping option.
 - (void)shippingOptionSelectionCoordinator:
             (ShippingOptionSelectionCoordinator*)coordinator
-                    selectedShippingOption:
-                        (web::PaymentShippingOption*)shippingOption;
+                   didSelectShippingOption:
+                       (web::PaymentShippingOption*)shippingOption;
 
 // Notifies the delegate that the user has chosen to return to the previous
 // screen without making a selection.
diff --git a/ios/chrome/browser/payments/shipping_option_selection_coordinator.mm b/ios/chrome/browser/payments/shipping_option_selection_coordinator.mm
index 65ec7fb..849201a 100644
--- a/ios/chrome/browser/payments/shipping_option_selection_coordinator.mm
+++ b/ios/chrome/browser/payments/shipping_option_selection_coordinator.mm
@@ -83,7 +83,7 @@
 
         _viewController.get().view.userInteractionEnabled = YES;
         [_delegate shippingOptionSelectionCoordinator:self
-                               selectedShippingOption:_selectedShippingOption];
+                              didSelectShippingOption:_selectedShippingOption];
       });
 }
 
diff --git a/ios/chrome/browser/payments/shipping_option_selection_view_controller.h b/ios/chrome/browser/payments/shipping_option_selection_view_controller.h
index 85dc1714..073ef4e 100644
--- a/ios/chrome/browser/payments/shipping_option_selection_view_controller.h
+++ b/ios/chrome/browser/payments/shipping_option_selection_view_controller.h
@@ -12,12 +12,17 @@
 
 @class ShippingOptionSelectionViewController;
 
+// Delegate protocol for ShippingOptionSelectionViewController.
 @protocol ShippingOptionSelectionViewControllerDelegate<NSObject>
 
+// Notifies the delegate that the user has selected a shipping option.
 - (void)shippingOptionSelectionViewController:
             (ShippingOptionSelectionViewController*)controller
                        selectedShippingOption:
                            (web::PaymentShippingOption*)shippingOption;
+
+// Notifies the delegate that the user has chosen to return to the previous
+// screen without making a selection.
 - (void)shippingOptionSelectionViewControllerDidReturn:
     (ShippingOptionSelectionViewController*)controller;
 
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index f49bced..dcfed57 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -1264,18 +1264,6 @@
   [self.webController dismissModals];
 }
 
-- (void)updateDesktopUserAgentForEntry:(CRWSessionEntry*)entry
-                             fromEntry:(CRWSessionEntry*)fromEntry {
-  web::NavigationItemImpl* item = entry.navigationItemImpl;
-  web::NavigationItemImpl* fromItem = fromEntry.navigationItemImpl;
-  if (!item || !fromItem)
-    return;
-  bool useDesktopUserAgent = item->IsOverridingUserAgent();
-  if (useDesktopUserAgent != fromItem->IsOverridingUserAgent()) {
-    [self.webController requirePageReconstruction];
-  }
-}
-
 - (CRWSessionEntry*)currentSessionEntry {
   if (![self navigationManager])
     return nil;
@@ -1391,9 +1379,6 @@
 }
 
 - (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry {
-  DCHECK(fromEntry);
-  [self updateDesktopUserAgentForEntry:self.currentSessionEntry
-                             fromEntry:fromEntry];
   [parentTabModel_ notifyTabChanged:self];
 }
 
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index da9d243..6340958 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -435,8 +435,7 @@
   std::unique_ptr<InfoBarContainerDelegateIOS> _infoBarContainerDelegate;
 
   // Voice search bar at the bottom of the view overlayed on |_contentArea|
-  // when displaying voice search results. Implementation is not complete.
-  // See b/7998125.
+  // when displaying voice search results.
   base::scoped_nsprotocol<UIView<VoiceSearchBar>*> _voiceSearchBar;
 
   // The image fetcher used to save images and perform image-based searches.
@@ -2290,9 +2289,9 @@
   CGFloat width = CGRectGetWidth([[self view] bounds]);
   CGFloat y = CGRectGetHeight([[self view] bounds]) - kVoiceSearchBarHeight;
   CGRect frame = CGRectMake(0.0, y, width, kVoiceSearchBarHeight);
-  _voiceSearchBar.reset(ios::GetChromeBrowserProvider()
-                            ->GetVoiceSearchProvider()
-                            ->CreateVoiceSearchBar(frame));
+  _voiceSearchBar.reset([ios::GetChromeBrowserProvider()
+                             ->GetVoiceSearchProvider()
+                             ->BuildVoiceSearchBar(frame) retain]);
   [_voiceSearchBar setVoiceSearchBarDelegate:self];
   [_voiceSearchBar setHidden:YES];
   [_voiceSearchBar setAutoresizingMask:UIViewAutoresizingFlexibleTopMargin |
diff --git a/ios/chrome/browser/ui/settings/settings_egtest.mm b/ios/chrome/browser/ui/settings/settings_egtest.mm
index 55ccaaf..0e73624 100644
--- a/ios/chrome/browser/ui/settings/settings_egtest.mm
+++ b/ios/chrome/browser/ui/settings/settings_egtest.mm
@@ -145,6 +145,27 @@
                     grey_accessibilityTrait(UIAccessibilityTraitButton), nil);
 }
 
+// Matcher for the Preload Webpages button on the bandwidth UI.
+id<GREYMatcher> BandwidthPreloadWebpagesButton() {
+  return buttonWithAccessibilityLabelId(IDS_IOS_OPTIONS_PRELOAD_WEBPAGES);
+}
+
+// Matcher for the Privacy Handoff button on the privacy UI.
+id<GREYMatcher> PrivacyHandoffButton() {
+  return buttonWithAccessibilityLabelId(
+      IDS_IOS_OPTIONS_ENABLE_HANDOFF_TO_OTHER_DEVICES);
+}
+
+// Matcher for the Privacy Block Popups button on the privacy UI.
+id<GREYMatcher> BlockPopupsButton() {
+  return buttonWithAccessibilityLabelId(IDS_IOS_BLOCK_POPUPS);
+}
+
+// Matcher for the Privacy Translate Settings button on the privacy UI.
+id<GREYMatcher> TranslateSettingsButton() {
+  return buttonWithAccessibilityLabelId(IDS_IOS_TRANSLATE_SETTING);
+}
+
 // Asserts that there is no cookie in current web state.
 void AssertNoCookieExists() {
   NSError* error = nil;
@@ -252,6 +273,8 @@
 @implementation SettingsTestCase
 
 // Opens the a submenu from the settings page.  Must be called from the NTP.
+// TODO(crbug.com/684619): Investigate why usingSearchAction doesn't scroll
+// until the bottom.
 - (void)openSubSettingMenu:(id<GREYMatcher>)settingToTap {
   const CGFloat kScrollDisplacement = 150.0;
   id<GREYMatcher> toolsMenuTableViewMatcher =
@@ -770,7 +793,7 @@
   chrome_test_util::CloseAllIncognitoTabs();
 }
 
-// Verifies the UI elements are accessibile on the Settings page.
+// Verifies the UI elements are accessible on the Settings page.
 - (void)testAccessibilityOnSettingsPage {
   [ChromeEarlGreyUI openToolsMenu];
   [[EarlGrey selectElementWithMatcher:settingsButton()]
@@ -782,7 +805,7 @@
       performAction:grey_tap()];
 }
 
-// Verifies the UI elements are accessibile on the Content Settings page.
+// Verifies the UI elements are accessible on the Content Settings page.
 - (void)testAccessibilityOnContentSettingsPage {
   [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
                                IDS_IOS_CONTENT_SETTINGS_TITLE)];
@@ -790,7 +813,29 @@
   [self closeSubSettingsMenu];
 }
 
-// Verifies the UI elements are accessibile on the Privacy Settings page.
+// Verifies the UI elements are accessible on the Content Settings
+// Block Popups page.
+- (void)testAccessibilityOnContentSettingsBlockPopupsPage {
+  [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
+                               IDS_IOS_CONTENT_SETTINGS_TITLE)];
+  [[EarlGrey selectElementWithMatcher:BlockPopupsButton()]
+      performAction:grey_tap()];
+  chrome_test_util::VerifyAccessibilityForCurrentScreen();
+  [self closeSubSettingsMenu];
+}
+
+// Verifies the UI elements are accessible on the Content Translations Settings
+// page.
+- (void)testAccessibilityOnContentSettingsTranslatePage {
+  [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
+                               IDS_IOS_CONTENT_SETTINGS_TITLE)];
+  [[EarlGrey selectElementWithMatcher:TranslateSettingsButton()]
+      performAction:grey_tap()];
+  chrome_test_util::VerifyAccessibilityForCurrentScreen();
+  [self closeSubSettingsMenu];
+}
+
+// Verifies the UI elements are accessible on the Privacy Settings page.
 - (void)testAccessibilityOnPrivacySettingsPage {
   [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
                                IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY)];
@@ -798,7 +843,29 @@
   [self closeSubSettingsMenu];
 }
 
-// Verifies the UI elements are accessibile on the Bandwidth Management Settings
+// Verifies the UI elements are accessible on the Privacy Handoff Settings
+// page.
+- (void)testAccessibilityOnPrivacyHandoffSettingsPage {
+  [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
+                               IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY)];
+  [[EarlGrey selectElementWithMatcher:PrivacyHandoffButton()]
+      performAction:grey_tap()];
+  chrome_test_util::VerifyAccessibilityForCurrentScreen();
+  [self closeSubSettingsMenu];
+}
+
+// Verifies the UI elements are accessible on the Privacy Clear Browsing Data
+// Settings page.
+- (void)testAccessibilityOnPrivacyClearBrowsingHistoryPage {
+  [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
+                               IDS_OPTIONS_ADVANCED_SECTION_TITLE_PRIVACY)];
+  [[EarlGrey selectElementWithMatcher:clearBrowsingDataButton()]
+      performAction:grey_tap()];
+  chrome_test_util::VerifyAccessibilityForCurrentScreen();
+  [self closeSubSettingsMenu];
+}
+
+// Verifies the UI elements are accessible on the Bandwidth Management Settings
 // page.
 - (void)testAccessibilityOnBandwidthManagementSettingsPage {
   [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
@@ -807,6 +874,17 @@
   [self closeSubSettingsMenu];
 }
 
+// Verifies the UI elements are accessible on the Bandwidth Preload Webpages
+// Settings page.
+- (void)testAccessibilityOnBandwidthPreloadWebpagesSettingsPage {
+  [self openSubSettingMenu:chrome_test_util::buttonWithAccessibilityLabelId(
+                               IDS_IOS_BANDWIDTH_MANAGEMENT_SETTINGS)];
+  [[EarlGrey selectElementWithMatcher:BandwidthPreloadWebpagesButton()]
+      performAction:grey_tap()];
+  chrome_test_util::VerifyAccessibilityForCurrentScreen();
+  [self closeSubSettingsMenu];
+}
+
 // Verifies the UI elements are accessible on the Save Passwords page.
 - (void)testAccessibilityOnSavePasswords {
   [ChromeEarlGreyUI openToolsMenu];
diff --git a/ios/public/provider/chrome/browser/voice/voice_search_provider.h b/ios/public/provider/chrome/browser/voice/voice_search_provider.h
index 05be8e6..0e7eeea 100644
--- a/ios/public/provider/chrome/browser/voice/voice_search_provider.h
+++ b/ios/public/provider/chrome/browser/voice/voice_search_provider.h
@@ -40,9 +40,8 @@
   virtual scoped_refptr<VoiceSearchController> CreateVoiceSearchController(
       ios::ChromeBrowserState* browser_state) const;
 
-  // Creates a new VoiceSearchBar.  The caller assumes ownership.
-  virtual UIView<VoiceSearchBar>* CreateVoiceSearchBar(CGRect frame) const
-      NS_RETURNS_RETAINED;
+  // Creates a new VoiceSearchBar.  Returns an autoreleased view.
+  virtual UIView<VoiceSearchBar>* BuildVoiceSearchBar(CGRect frame) const;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(VoiceSearchProvider);
diff --git a/ios/public/provider/chrome/browser/voice/voice_search_provider.mm b/ios/public/provider/chrome/browser/voice/voice_search_provider.mm
index d3a13287..ef64e5b 100644
--- a/ios/public/provider/chrome/browser/voice/voice_search_provider.mm
+++ b/ios/public/provider/chrome/browser/voice/voice_search_provider.mm
@@ -24,7 +24,7 @@
   return scoped_refptr<VoiceSearchController>(nullptr);
 }
 
-UIView<VoiceSearchBar>* VoiceSearchProvider::CreateVoiceSearchBar(
+UIView<VoiceSearchBar>* VoiceSearchProvider::BuildVoiceSearchBar(
     CGRect frame) const {
   return nil;
 }
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index d0950fbc..8413d95 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -503,6 +503,14 @@
 // Facade for Mojo API.
 @property(nonatomic, readonly) web::MojoFacade* mojoFacade;
 
+// Updates Desktop User Agent and calls webWillFinishHistoryNavigationFromEntry:
+// on CRWWebDelegate. TODO(crbug.com/684098): Remove this method and inline its
+// content.
+- (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry;
+// Recreates web view if |entry| and |fromEntry| have different value for
+// IsOverridingUserAgent() flag.
+- (void)updateDesktopUserAgentForEntry:(CRWSessionEntry*)entry
+                             fromEntry:(CRWSessionEntry*)fromEntry;
 // Removes the container view from the hierarchy and resets the ivar.
 - (void)resetContainerView;
 // Called when the web page has changed document and/or URL, and so the page
@@ -2180,25 +2188,17 @@
                                                        andEntry:entries[index]];
     if (sameDocumentNavigation) {
       [self.sessionController goToEntryAtIndex:index];
-
-      // Implementation of |webWillFinishHistoryNavigationFromEntry:| expects
-      // that NavigationManager has either a pending item or already made the
-      // navigation. Hence this delegate must be called after changing current
-      // navigation item. TODO(crbug.com/670149): Remove this delegate method as
-      // CRWWebController does not need to delegate setting Desktop User Agent.
-      [_delegate webWillFinishHistoryNavigationFromEntry:fromEntry];
+      // TODO(crbug.com/684098): move this call out this block to avoid code
+      // duplication.
+      [self webWillFinishHistoryNavigationFromEntry:fromEntry];
       [self updateHTML5HistoryState];
     } else {
       [sessionController discardNonCommittedEntries];
       [sessionController setPendingEntryIndex:index];
 
-      // Implementation of |webWillFinishHistoryNavigationFromEntry:| expects
-      // that NavigationManager has either a pending item or already made the
-      // navigation. Hence this delegate must be called after changing pending
-      // navigation index. TODO(crbug.com/670149): Remove this delegate method
-      // as CRWWebController does not need to delegate setting Desktop User
-      // Agent.
-      [_delegate webWillFinishHistoryNavigationFromEntry:fromEntry];
+      // TODO(crbug.com/684098): move this call out this block to avoid code
+      // duplication.
+      [self webWillFinishHistoryNavigationFromEntry:fromEntry];
 
       web::NavigationItemImpl* pendingItem =
           sessionController.pendingEntry.navigationItemImpl;
@@ -2306,7 +2306,7 @@
 }
 
 - (void)finishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry {
-  [_delegate webWillFinishHistoryNavigationFromEntry:fromEntry];
+  [self webWillFinishHistoryNavigationFromEntry:fromEntry];
 
   // Only load the new URL if it has a different document than |fromEntry| to
   // prevent extra page loads from NavigationItems created by hash changes or
@@ -2429,6 +2429,25 @@
   return _passKitDownloader.get();
 }
 
+- (void)webWillFinishHistoryNavigationFromEntry:(CRWSessionEntry*)fromEntry {
+  DCHECK(fromEntry);
+  [self updateDesktopUserAgentForEntry:self.currentSessionEntry
+                             fromEntry:fromEntry];
+  [_delegate webWillFinishHistoryNavigationFromEntry:fromEntry];
+}
+
+- (void)updateDesktopUserAgentForEntry:(CRWSessionEntry*)entry
+                             fromEntry:(CRWSessionEntry*)fromEntry {
+  web::NavigationItemImpl* item = entry.navigationItemImpl;
+  web::NavigationItemImpl* fromItem = fromEntry.navigationItemImpl;
+  if (!item || !fromItem)
+    return;
+  bool useDesktopUserAgent = item->IsOverridingUserAgent();
+  if (useDesktopUserAgent != fromItem->IsOverridingUserAgent()) {
+    [self requirePageReconstruction];
+  }
+}
+
 #pragma mark -
 #pragma mark CRWWebControllerContainerViewDelegate
 
diff --git a/ipc/ipc_mojo_bootstrap.cc b/ipc/ipc_mojo_bootstrap.cc
index 256f394..7489ded 100644
--- a/ipc/ipc_mojo_bootstrap.cc
+++ b/ipc/ipc_mojo_bootstrap.cc
@@ -484,8 +484,17 @@
       Endpoint* endpoint = iter->second.get();
       ++iter;
 
-      DCHECK(endpoint->closed());
-      MarkPeerClosedAndMaybeRemove(endpoint);
+      if (!endpoint->closed()) {
+        // This happens when a NotifyPeerEndpointClosed message been received,
+        // but (1) the interface ID hasn't been used to create local endpoint
+        // handle; and (2) a NotifyEndpointClosedBeforeSent hasn't been
+        // received.
+        DCHECK(!endpoint->client());
+        DCHECK(endpoint->peer_closed());
+        MarkClosedAndMaybeRemove(endpoint);
+      } else {
+        MarkPeerClosedAndMaybeRemove(endpoint);
+      }
     }
 
     DCHECK(endpoints_.empty());
diff --git a/media/blink/multibuffer_data_source_unittest.cc b/media/blink/multibuffer_data_source_unittest.cc
index 3e1cc77..993aa921 100644
--- a/media/blink/multibuffer_data_source_unittest.cc
+++ b/media/blink/multibuffer_data_source_unittest.cc
@@ -227,8 +227,8 @@
   MultibufferDataSourceTest()
       : view_(WebView::create(nullptr, blink::WebPageVisibilityStateVisible)),
         preload_(MultibufferDataSource::AUTO) {
-    WebLocalFrame* frame =
-        WebLocalFrame::create(blink::WebTreeScopeType::Document, &client_);
+    WebLocalFrame* frame = WebLocalFrame::create(
+        blink::WebTreeScopeType::Document, &client_, nullptr, nullptr);
     view_->setMainFrame(frame);
     url_index_ = make_linked_ptr(new TestUrlIndex(frame));
   }
diff --git a/media/blink/resource_multibuffer_data_provider_unittest.cc b/media/blink/resource_multibuffer_data_provider_unittest.cc
index af0b3f5..17f5aef 100644
--- a/media/blink/resource_multibuffer_data_provider_unittest.cc
+++ b/media/blink/resource_multibuffer_data_provider_unittest.cc
@@ -72,8 +72,8 @@
  public:
   ResourceMultiBufferDataProviderTest()
       : view_(WebView::create(nullptr, blink::WebPageVisibilityStateVisible)) {
-    WebLocalFrame* frame =
-        WebLocalFrame::create(blink::WebTreeScopeType::Document, &client_);
+    WebLocalFrame* frame = WebLocalFrame::create(
+        blink::WebTreeScopeType::Document, &client_, nullptr, nullptr);
     view_->setMainFrame(frame);
     url_index_.reset(new UrlIndex(frame, 0));
 
diff --git a/media/blink/webmediaplayer_impl_unittest.cc b/media/blink/webmediaplayer_impl_unittest.cc
index ca664355..7e293fac 100644
--- a/media/blink/webmediaplayer_impl_unittest.cc
+++ b/media/blink/webmediaplayer_impl_unittest.cc
@@ -188,7 +188,9 @@
                                          blink::WebPageVisibilityStateVisible)),
         web_local_frame_(
             blink::WebLocalFrame::create(blink::WebTreeScopeType::Document,
-                                         &web_frame_client_)),
+                                         &web_frame_client_,
+                                         nullptr,
+                                         nullptr)),
         media_log_(new MediaLog()),
         audio_parameters_(TestAudioParameters::Normal()) {
     web_view_->setMainFrame(web_local_frame_);
diff --git a/mojo/public/js/codec.js b/mojo/public/js/codec.js
index 06a62436..ff5d31a 100644
--- a/mojo/public/js/codec.js
+++ b/mojo/public/js/codec.js
@@ -304,8 +304,12 @@
   };
 
   Encoder.prototype.encodeHandle = function(handle) {
-    this.handles.push(handle);
-    this.writeUint32(this.handles.length - 1);
+    if (handle) {
+      this.handles.push(handle);
+      this.writeUint32(this.handles.length - 1);
+    } else {
+      this.writeUint32(kEncodedInvalidHandleValue);
+    }
   };
 
   Encoder.prototype.encodeString = function(val) {
diff --git a/mojo/public/js/tests/connection_unittest.js b/mojo/public/js/tests/connection_unittest.js
index 2e8fc97f..feba87d7 100644
--- a/mojo/public/js/tests/connection_unittest.js
+++ b/mojo/public/js/tests/connection_unittest.js
@@ -80,6 +80,7 @@
     var service = new sample_service.ServicePtr();
     // Discard the interface request.
     bindings.makeRequest(service);
+    gc.collectGarbage();
 
     var promise = service.frobinate(
         null, sample_service.Service.BazOptions.REGULAR, null)
diff --git a/net/quic/core/quic_headers_stream_test.cc b/net/quic/core/quic_headers_stream_test.cc
index 889547d3..117de38 100644
--- a/net/quic/core/quic_headers_stream_test.cc
+++ b/net/quic/core/quic_headers_stream_test.cc
@@ -38,10 +38,6 @@
 using testing::StrictMock;
 using testing::WithArgs;
 
-// TODO(bnc): Merge these correctly.
-bool FLAGS_use_http2_frame_decoder_adapter;
-bool FLAGS_spdy_framer_use_new_methods4;
-
 namespace net {
 namespace test {
 
@@ -189,7 +185,6 @@
         FLAGS_use_http2_frame_decoder_adapter = true;
         // Http2FrameDecoderAdapter needs the new header methods, else
         // --use_http2_frame_decoder_adapter=true will be ignored.
-        FLAGS_spdy_framer_use_new_methods4 = true;
         break;
     }
     switch (hpack_decoder) {
diff --git a/net/socket/ssl_server_socket_unittest.cc b/net/socket/ssl_server_socket_unittest.cc
index d99008c..79fab9e2 100644
--- a/net/socket/ssl_server_socket_unittest.cc
+++ b/net/socket/ssl_server_socket_unittest.cc
@@ -1081,8 +1081,8 @@
       0xc014,  // ECDHE_RSA_WITH_AES_256_CBC_SHA
       0xc02b,  // ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
       0xc02f,  // ECDHE_RSA_WITH_AES_128_GCM_SHA256
-      0xcc13,  // ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
-      0xcc14,  // ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
+      0xcca8,  // ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256
+      0xcca9,  // ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256
   };
   client_ssl_config_.disabled_cipher_suites.assign(
       kEcdheCiphers, kEcdheCiphers + arraysize(kEcdheCiphers));
diff --git a/services/ui/manifest.json b/services/ui/manifest.json
index 882c740..2a7e7ea 100644
--- a/services/ui/manifest.json
+++ b/services/ui/manifest.json
@@ -28,6 +28,9 @@
         "discardable_memory": [
           "discardable_memory::mojom::DiscardableSharedMemoryManager"
         ],
+        "display_test": [
+          "display::mojom::TestDisplayController"
+        ],
         "gpu_client": [
           "ui::mojom::Gpu"
         ],
@@ -40,7 +43,6 @@
         "window_manager": [
           "discardable_memory::mojom::DiscardableSharedMemoryManager",
           "display::mojom::DisplayController",
-          "display::mojom::TestDisplayController",
           "ui::mojom::AccessibilityManager",
           "ui::mojom::Clipboard",
           "ui::mojom::DisplayCompositor",
diff --git a/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.cc b/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
index efff978..d981ba1 100644
--- a/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
+++ b/services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.cc
@@ -78,6 +78,14 @@
     gfx::GpuMemoryBufferHandle* handle,
     base::WaitableEvent* wait) {
   DCHECK(thread_.task_runner()->BelongsToCurrentThread());
+
+  if (!gpu_) {
+    // The Gpu interface may have been disconnected, in which case we can't
+    // fulfill the request.
+    wait->Signal();
+    return;
+  }
+
   // |handle| and |wait| are both on the stack, and will be alive until |wait|
   // is signaled. So it is safe for OnGpuMemoryBufferAllocated() to operate on
   // these.
@@ -111,7 +119,9 @@
                    base::Unretained(this), id, sync_token));
     return;
   }
-  gpu_->DestroyGpuMemoryBuffer(id, sync_token);
+
+  if (gpu_)
+    gpu_->DestroyGpuMemoryBuffer(id, sync_token);
 }
 
 std::unique_ptr<gfx::GpuMemoryBuffer>
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h
index 8eb1a3e4..def01542 100644
--- a/skia/config/SkUserConfig.h
+++ b/skia/config/SkUserConfig.h
@@ -124,9 +124,6 @@
 #define SK_REF_CNT_MIXIN_INCLUDE "sk_ref_cnt_ext_release.h"
 #endif
 
-#define SK_SCALAR_IS_FLOAT
-#undef SK_SCALAR_IS_FIXED
-
 #define SK_MSCALAR_IS_FLOAT
 #undef SK_MSCALAR_IS_DOUBLE
 
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index bb9d032..bf8035f 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -28,6 +28,8 @@
 #  transforms
 # Some additional bugs that are caused by painting problems are also within this section.
 
+crbug.com/646176 virtual/stable/paint/invalidation [ Skip ]
+
 # Failures due to SPV2, that don't also fail without SPV2. DO NOT REBASELINE.
 # SPv2 paint properties are still being implemented.
 #
@@ -142,8 +144,6 @@
 crbug.com/664852 virtual/gpu/fast/canvas/canvas-lost-gpu-context.html [ Pass Failure ]
 crbug.com/664852 virtual/gpu/fast/canvas/OffscreenCanvas-2d-drawImage.html [ Pass Failure ]
 
-crbug.com/669693 svg/text/combining-character-queries.html [ Pass Failure ]
-
 # Added 2016-12-14
 crbug.com/674396 [ Win ] compositing/reflections/nested-reflection-transition.html [ Pass Failure ]
 
@@ -2336,4 +2336,3 @@
 crbug.com/681471 virtual/stable/paint/invalidation/media-audio-no-spurious-repaints.html [ Failure Pass Timeout ]
 
 crbug.com/683800 [ Win7 Debug ] external/wpt/selection/ [ Failure Pass ]
-
diff --git a/third_party/WebKit/LayoutTests/animations/animations-responsive-to-color-change.html b/third_party/WebKit/LayoutTests/animations/animations-responsive-to-color-change.html
index 42b231c..f0840bf 100644
--- a/third_party/WebKit/LayoutTests/animations/animations-responsive-to-color-change.html
+++ b/third_party/WebKit/LayoutTests/animations/animations-responsive-to-color-change.html
@@ -65,7 +65,7 @@
     player.pause();
     player.currentTime = 3;
     element.style.color = 'rgba(160, 190, 180, 0.980392157)';
-    assert_equals(getComputedStyle(element).backgroundColor, 'rgba(206, 215, 200, 0.596078)');
+    assert_equals(getComputedStyle(element).backgroundColor, 'rgba(206, 215, 200, 0.596)');
 }, 'Color interpolation uses pre-multiplied colors');
 
 test(function() {
diff --git a/third_party/WebKit/LayoutTests/animations/composition/box-shadow-composition.html b/third_party/WebKit/LayoutTests/animations/composition/box-shadow-composition.html
index 58d53d31..1805c13 100644
--- a/third_party/WebKit/LayoutTests/animations/composition/box-shadow-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/composition/box-shadow-composition.html
@@ -62,7 +62,7 @@
   {at: 0, is: 'rgb(110, 120, 130) 11px 22px 33px 44px, rgb(120, 140, 160) 12px 24px 36px 48px'},
   {at: 0.5, is: 'rgb(155, 160, 165) 15.5px 31px 46.5px 62px, rgb(160, 170, 180) 16px 32px 48px 64px'},
   {at: 1, is: 'rgb(200, 200, 200) 20px 40px 60px 80px'},
-  {at: 1.5, is: 'rgba(255, 255, 255, 0.501961) 24.5px 49px 73.5px 98px, rgba(255, 255, 255, 0.501961) 24px 48px 72px 96px'},
+  {at: 1.5, is: 'rgba(255, 255, 255, 0.5) 24.5px 49px 73.5px 98px, rgba(255, 255, 255, 0.5) 24px 48px 72px 96px'},
 ]);
 
 assertComposition({
@@ -88,7 +88,7 @@
   {at: 0, is: 'rgb(110, 120, 130) 11px 22px 33px 44px, rgb(220, 240, 255) 22px 44px 66px 88px, rgb(140, 180, 220) 14px 28px 42px 56px, rgb(210, 220, 230) 21px 42px 63px 84px, rgb(120, 140, 160) 12px 24px 36px 48px, rgb(240, 255, 255) 24px 48px 72px 96px'},
   {at: 0.5, is: 'rgb(155, 160, 165) 15.5px 31px 46.5px 62px, rgb(210, 220, 230) 21px 42px 63px 84px, rgb(170, 190, 210) 17px 34px 51px 68px, rgb(205, 210, 215) 20.5px 41px 61.5px 82px, rgb(160, 170, 180) 16px 32px 48px 64px, rgb(220, 240, 255) 22px 44px 66px 88px'},
   {at: 1, is: 'rgb(200, 200, 200) 20px 40px 60px 80px'},
-  {at: 1.5, is: 'rgba(255, 255, 255, 0.501961) 24.5px 49px 73.5px 98px, rgba(255, 255, 255, 0.501961) 19px 38px 57px 76px, rgba(255, 255, 255, 0.501961) 23px 46px 69px 92px, rgba(255, 255, 255, 0.501961) 19.5px 39px 58.5px 78px, rgba(255, 255, 255, 0.501961) 24px 48px 72px 96px, rgba(255, 255, 255, 0.501961) 18px 36px 54px 72px'},
+  {at: 1.5, is: 'rgba(255, 255, 255, 0.5) 24.5px 49px 73.5px 98px, rgba(255, 255, 255, 0.5) 19px 38px 57px 76px, rgba(255, 255, 255, 0.5) 23px 46px 69px 92px, rgba(255, 255, 255, 0.5) 19.5px 39px 58.5px 78px, rgba(255, 255, 255, 0.5) 24px 48px 72px 96px, rgba(255, 255, 255, 0.5) 18px 36px 54px 72px'},
 ]);
 </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/animations/composition/text-shadow-composition.html b/third_party/WebKit/LayoutTests/animations/composition/text-shadow-composition.html
index 2525555a..843ee7f0 100644
--- a/third_party/WebKit/LayoutTests/animations/composition/text-shadow-composition.html
+++ b/third_party/WebKit/LayoutTests/animations/composition/text-shadow-composition.html
@@ -49,7 +49,7 @@
   {at: 0, is: 'rgb(110, 120, 130) 11px 22px 33px, rgb(120, 140, 160) 12px 24px 36px'},
   {at: 0.5, is: 'rgb(155, 160, 165) 15.5px 31px 46.5px, rgb(160, 170, 180) 16px 32px 48px'},
   {at: 1, is: 'rgb(200, 200, 200) 20px 40px 60px'},
-  {at: 1.5, is: 'rgba(255, 255, 255, 0.501961) 24.5px 49px 73.5px, rgba(255, 255, 255, 0.501961) 24px 48px 72px'},
+  {at: 1.5, is: 'rgba(255, 255, 255, 0.5) 24.5px 49px 73.5px, rgba(255, 255, 255, 0.5) 24px 48px 72px'},
 ]);
 
 assertComposition({
@@ -75,7 +75,7 @@
   {at: 0, is: 'rgb(110, 120, 130) 11px 22px 33px, rgb(220, 240, 255) 22px 44px 66px, rgb(140, 180, 220) 14px 28px 42px, rgb(210, 220, 230) 21px 42px 63px, rgb(120, 140, 160) 12px 24px 36px, rgb(240, 255, 255) 24px 48px 72px'},
   {at: 0.5, is: 'rgb(155, 160, 165) 15.5px 31px 46.5px, rgb(210, 220, 230) 21px 42px 63px, rgb(170, 190, 210) 17px 34px 51px, rgb(205, 210, 215) 20.5px 41px 61.5px, rgb(160, 170, 180) 16px 32px 48px, rgb(220, 240, 255) 22px 44px 66px'},
   {at: 1, is: 'rgb(200, 200, 200) 20px 40px 60px'},
-  {at: 1.5, is: 'rgba(255, 255, 255, 0.501961) 24.5px 49px 73.5px, rgba(255, 255, 255, 0.501961) 19px 38px 57px, rgba(255, 255, 255, 0.501961) 23px 46px 69px, rgba(255, 255, 255, 0.501961) 19.5px 39px 58.5px, rgba(255, 255, 255, 0.501961) 24px 48px 72px, rgba(255, 255, 255, 0.501961) 18px 36px 54px'},
+  {at: 1.5, is: 'rgba(255, 255, 255, 0.5) 24.5px 49px 73.5px, rgba(255, 255, 255, 0.5) 19px 38px 57px, rgba(255, 255, 255, 0.5) 23px 46px 69px, rgba(255, 255, 255, 0.5) 19.5px 39px 58.5px, rgba(255, 255, 255, 0.5) 24px 48px 72px, rgba(255, 255, 255, 0.5) 18px 36px 54px'},
 ]);
 </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/backdrop-filter-interpolation-expected.txt b/third_party/WebKit/LayoutTests/animations/interpolation/backdrop-filter-interpolation-expected.txt
index 92c7167..1d49e70 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/backdrop-filter-interpolation-expected.txt
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/backdrop-filter-interpolation-expected.txt
@@ -84,7 +84,7 @@
 PASS CSS Transitions: property <backdrop-filter> from [contrast(0)] to [none] at (1.5) is [contrast(1.5)] 
 PASS CSS Transitions: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgba(0, 0, 0, 0) -20px -10px 0px)] 
 PASS CSS Transitions: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0) is [none] 
-FAIL CSS Transitions: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 127, 0, 0.501961) 10px 5px 0px)] assert_equals: expected "drop - shadow ( rgba ( 0 , 128 , 0 , 0.5 ) 10px 5px 0px ) " but got "drop - shadow ( rgba ( 0 , 127 , 0 , 0.5 ) 10px 5px 0px ) "
+FAIL CSS Transitions: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 127, 0, 0.5) 10px 5px 0px)] assert_equals: expected "drop - shadow ( rgba ( 0 , 128 , 0 , 0.5 ) 10px 5px 0px ) " but got "drop - shadow ( rgba ( 0 , 127 , 0 , 0.5 ) 10px 5px 0px ) "
 PASS CSS Transitions: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (1) is [drop-shadow(rgb(0, 128, 0) 20px 10px 0px)] 
 PASS CSS Transitions: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (1.5) is [drop-shadow(rgb(0, 192, 0) 30px 15px 0px)] 
 PASS CSS Transitions: property <backdrop-filter> from [drop-shadow(0px 0px 0px currentcolor)] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgb(255, 255, 255) -20px -10px 0px)] 
@@ -225,7 +225,7 @@
 PASS CSS Animations: property <backdrop-filter> from [contrast(0)] to [none] at (1.5) is [contrast(1.5)] 
 PASS CSS Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgba(0, 0, 0, 0) -20px -10px 0px)] 
 PASS CSS Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0) is [none] 
-PASS CSS Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 128, 0, 0.501961) 10px 5px 0px)] 
+PASS CSS Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 128, 0, 0.5) 10px 5px 0px)] 
 PASS CSS Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (1) is [drop-shadow(rgb(0, 128, 0) 20px 10px 0px)] 
 PASS CSS Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (1.5) is [drop-shadow(rgb(0, 192, 0) 30px 15px 0px)] 
 PASS CSS Animations: property <backdrop-filter> from [drop-shadow(0px 0px 0px currentcolor)] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgb(255, 255, 255) -20px -10px 0px)] 
@@ -366,7 +366,7 @@
 PASS Web Animations: property <backdrop-filter> from [contrast(0)] to [none] at (1.5) is [contrast(1.5)] 
 PASS Web Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgba(0, 0, 0, 0) -20px -10px 0px)] 
 PASS Web Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0) is [none] 
-PASS Web Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 128, 0, 0.501961) 10px 5px 0px)] 
+PASS Web Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 128, 0, 0.5) 10px 5px 0px)] 
 PASS Web Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (1) is [drop-shadow(rgb(0, 128, 0) 20px 10px 0px)] 
 PASS Web Animations: property <backdrop-filter> from [none] to [drop-shadow(20px 10px green)] at (1.5) is [drop-shadow(rgb(0, 192, 0) 30px 15px 0px)] 
 PASS Web Animations: property <backdrop-filter> from [drop-shadow(0px 0px 0px currentcolor)] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgb(255, 255, 255) -20px -10px 0px)] 
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/background-color-interpolation.html b/third_party/WebKit/LayoutTests/animations/interpolation/background-color-interpolation.html
index 68f67fd..692d6042 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/background-color-interpolation.html
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/background-color-interpolation.html
@@ -103,13 +103,13 @@
   from: 'currentcolor',
   to: 'rgba(0, 255, 0, 0.75)',
 }, [
-  {at: -0.5, is: 'rgba(0, 0, 255, 0.37)'},
+  {at: -0.5, is: 'rgba(0, 0, 255, 0.38)'},
   {at: 0, is: 'rgba(0, 0, 255, 0.5)'},
   {at: 0.25, is: 'rgba(0, 85, 170, 0.56)'},
-  {at: 0.5, is: 'rgba(0, 153, 102, 0.62)'},
-  {at: 0.75, is: 'rgba(0, 209, 46, 0.69)'},
+  {at: 0.5, is: 'rgba(0, 153, 102, 0.63)'},
+  {at: 0.75, is: 'rgba(0, 208, 47, 0.69)'},
   {at: 1, is: 'rgba(0, 255, 0, 0.75)'},
-  {at: 1.5, is: 'rgba(0, 255, 0, 0.87)'},
+  {at: 1.5, is: 'rgba(0, 255, 0, 0.88)'},
 ]);
 </script>
 </body>
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/box-shadow-interpolation-expected.txt b/third_party/WebKit/LayoutTests/animations/interpolation/box-shadow-interpolation-expected.txt
index 80f105f..4dc5acf 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/box-shadow-interpolation-expected.txt
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/box-shadow-interpolation-expected.txt
@@ -8,7 +8,7 @@
 PASS CSS Transitions: property <box-shadow> from neutral to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 25px 15px 25px 15px] 
 PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px -6px] 
 PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0) is [none] 
-PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.301961) 6px 6px 6px 6px] 
+PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.3) 6px 6px 6px 6px] 
 PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.6) is [rgba(0, 0, 0, 0.6) 12px 12px 12px 12px] 
 PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (1) is [rgb(0, 0, 0) 20px 20px 20px 20px] 
 PASS CSS Transitions: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 30px 30px 30px 30px] 
@@ -20,7 +20,7 @@
 PASS CSS Transitions: property <box-shadow> from [inherit] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 15px 25px 15px 25px] 
 PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px -6px] 
 PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0) is [none] 
-PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.301961) 6px 6px 6px 6px] 
+PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.3) 6px 6px 6px 6px] 
 PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.6) is [rgba(0, 0, 0, 0.6) 12px 12px 12px 12px] 
 PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (1) is [rgb(0, 0, 0) 20px 20px 20px 20px] 
 PASS CSS Transitions: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 30px 30px 30px 30px] 
@@ -48,9 +48,9 @@
 PASS CSS Transitions: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (0.6) is [rgb(0, 77, 0) 10px 10px 10px 10px] 
 PASS CSS Transitions: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1) is [rgb(0, 128, 0) 10px 10px 10px 10px] 
 PASS CSS Transitions: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1.5) is [rgb(0, 192, 0) 10px 10px 10px 10px] 
-PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) is [rgba(255, 255, 0, 0.647059) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] 
-PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) is [rgba(255, 255, 0, 0.498039) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] 
-PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) is [rgba(255, 255, 0, 0.34902) 7px 14px 0px 0px, rgba(0, 128, 0, 0.701961) 3.5px 21px 0px 0px inset] 
+PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) is [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] 
+PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) is [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] 
+PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) is [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] 
 FAIL CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) is [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 127, 0, 0.4) 2px 12px 0px 0px inset] assert_equals: expected "rgba ( 255 , 255 , 0 , 0.2 ) 4px 8px 0px 0px , rgba ( 0 , 128 , 0 , 0.4 ) 2px 12px 0px 0px inset " but got "rgba ( 255 , 255 , 0 , 0.2 ) 4px 8px 0px 0px , rgba ( 0 , 127 , 0 , 0.4 ) 2px 12px 0px 0px inset "
 PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) is [none] 
 PASS CSS Transitions: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) is [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] 
@@ -69,7 +69,7 @@
 PASS CSS Animations: property <box-shadow> from neutral to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 25px 15px 25px 15px] 
 PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px -6px] 
 PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0) is [none] 
-PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.301961) 6px 6px 6px 6px] 
+PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.3) 6px 6px 6px 6px] 
 PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.6) is [rgba(0, 0, 0, 0.6) 12px 12px 12px 12px] 
 PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (1) is [rgb(0, 0, 0) 20px 20px 20px 20px] 
 PASS CSS Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 30px 30px 30px 30px] 
@@ -81,7 +81,7 @@
 PASS CSS Animations: property <box-shadow> from [inherit] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 15px 25px 15px 25px] 
 PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px -6px] 
 PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0) is [none] 
-PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.301961) 6px 6px 6px 6px] 
+PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.3) 6px 6px 6px 6px] 
 PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.6) is [rgba(0, 0, 0, 0.6) 12px 12px 12px 12px] 
 PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (1) is [rgb(0, 0, 0) 20px 20px 20px 20px] 
 PASS CSS Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 30px 30px 30px 30px] 
@@ -109,9 +109,9 @@
 PASS CSS Animations: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (0.6) is [rgb(0, 77, 0) 10px 10px 10px 10px] 
 PASS CSS Animations: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1) is [rgb(0, 128, 0) 10px 10px 10px 10px] 
 PASS CSS Animations: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1.5) is [rgb(0, 192, 0) 10px 10px 10px 10px] 
-PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) is [rgba(255, 255, 0, 0.647059) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] 
-PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) is [rgba(255, 255, 0, 0.498039) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] 
-PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) is [rgba(255, 255, 0, 0.34902) 7px 14px 0px 0px, rgba(0, 128, 0, 0.701961) 3.5px 21px 0px 0px inset] 
+PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) is [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] 
+PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) is [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] 
+PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) is [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] 
 PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) is [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 128, 0, 0.4) 2px 12px 0px 0px inset] 
 PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) is [none] 
 PASS CSS Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) is [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] 
@@ -130,7 +130,7 @@
 PASS Web Animations: property <box-shadow> from neutral to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 25px 15px 25px 15px] 
 PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px -6px] 
 PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0) is [none] 
-PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.301961) 6px 6px 6px 6px] 
+PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.3) 6px 6px 6px 6px] 
 PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (0.6) is [rgba(0, 0, 0, 0.6) 12px 12px 12px 12px] 
 PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (1) is [rgb(0, 0, 0) 20px 20px 20px 20px] 
 PASS Web Animations: property <box-shadow> from [initial] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 30px 30px 30px 30px] 
@@ -142,7 +142,7 @@
 PASS Web Animations: property <box-shadow> from [inherit] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 15px 25px 15px 25px] 
 PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px -6px] 
 PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0) is [none] 
-PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.301961) 6px 6px 6px 6px] 
+PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.3) is [rgba(0, 0, 0, 0.3) 6px 6px 6px 6px] 
 PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (0.6) is [rgba(0, 0, 0, 0.6) 12px 12px 12px 12px] 
 PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (1) is [rgb(0, 0, 0) 20px 20px 20px 20px] 
 PASS Web Animations: property <box-shadow> from [unset] to [20px 20px 20px 20px black] at (1.5) is [rgb(0, 0, 0) 30px 30px 30px 30px] 
@@ -170,9 +170,9 @@
 PASS Web Animations: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (0.6) is [rgb(0, 77, 0) 10px 10px 10px 10px] 
 PASS Web Animations: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1) is [rgb(0, 128, 0) 10px 10px 10px 10px] 
 PASS Web Animations: property <box-shadow> from [10px 10px 10px 10px black] to [10px 10px 10px 10px currentColor] at (1.5) is [rgb(0, 192, 0) 10px 10px 10px 10px] 
-PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) is [rgba(255, 255, 0, 0.647059) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] 
-PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) is [rgba(255, 255, 0, 0.498039) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] 
-PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) is [rgba(255, 255, 0, 0.34902) 7px 14px 0px 0px, rgba(0, 128, 0, 0.701961) 3.5px 21px 0px 0px inset] 
+PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (-0.3) is [rgba(255, 255, 0, 0.65) 13px 26px 0px 0px, rgb(0, 166, 0) 6.5px 39px 0px 0px inset] 
+PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0) is [rgba(255, 255, 0, 0.5) 10px 20px 0px 0px, rgb(0, 128, 0) 5px 30px 0px 0px inset] 
+PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.3) is [rgba(255, 255, 0, 0.353) 7px 14px 0px 0px, rgba(0, 128, 0, 0.7) 3.5px 21px 0px 0px inset] 
 PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (0.6) is [rgba(255, 255, 0, 0.2) 4px 8px 0px 0px, rgba(0, 128, 0, 0.4) 2px 12px 0px 0px inset] 
 PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1) is [none] 
 PASS Web Animations: property <box-shadow> from [10px 20px rgba(255, 255, 0, 0.5), inset 5px 10em #008000] to [none] at (1.5) is [rgba(0, 0, 0, 0) -5px -10px 0px 0px, rgba(0, 0, 0, 0) -2.5px -15px 0px 0px inset] 
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/filter-interpolation-expected.txt b/third_party/WebKit/LayoutTests/animations/interpolation/filter-interpolation-expected.txt
index eff0c38..44bd7f128 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/filter-interpolation-expected.txt
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/filter-interpolation-expected.txt
@@ -84,7 +84,7 @@
 PASS CSS Transitions: property <-webkit-filter> from [contrast(0)] to [none] at (1.5) is [contrast(1.5)] 
 PASS CSS Transitions: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgba(0, 0, 0, 0) -20px -10px 0px)] 
 PASS CSS Transitions: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (0) is [none] 
-FAIL CSS Transitions: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 127, 0, 0.501961) 10px 5px 0px)] assert_equals: expected "drop - shadow ( rgba ( 0 , 128 , 0 , 0.5 ) 10px 5px 0px ) " but got "drop - shadow ( rgba ( 0 , 127 , 0 , 0.5 ) 10px 5px 0px ) "
+FAIL CSS Transitions: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 127, 0, 0.5) 10px 5px 0px)] assert_equals: expected "drop - shadow ( rgba ( 0 , 128 , 0 , 0.5 ) 10px 5px 0px ) " but got "drop - shadow ( rgba ( 0 , 127 , 0 , 0.5 ) 10px 5px 0px ) "
 PASS CSS Transitions: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (1) is [drop-shadow(rgb(0, 128, 0) 20px 10px 0px)] 
 PASS CSS Transitions: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (1.5) is [drop-shadow(rgb(0, 192, 0) 30px 15px 0px)] 
 PASS CSS Transitions: property <-webkit-filter> from [drop-shadow(0px 0px 0px currentcolor)] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgb(255, 255, 255) -20px -10px 0px)] 
@@ -225,7 +225,7 @@
 PASS CSS Animations: property <-webkit-filter> from [contrast(0)] to [none] at (1.5) is [contrast(1.5)] 
 PASS CSS Animations: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgba(0, 0, 0, 0) -20px -10px 0px)] 
 PASS CSS Animations: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (0) is [none] 
-PASS CSS Animations: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 128, 0, 0.501961) 10px 5px 0px)] 
+PASS CSS Animations: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (0.5) is [drop-shadow(rgba(0, 128, 0, 0.5) 10px 5px 0px)] 
 PASS CSS Animations: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (1) is [drop-shadow(rgb(0, 128, 0) 20px 10px 0px)] 
 PASS CSS Animations: property <-webkit-filter> from [none] to [drop-shadow(20px 10px green)] at (1.5) is [drop-shadow(rgb(0, 192, 0) 30px 15px 0px)] 
 PASS CSS Animations: property <-webkit-filter> from [drop-shadow(0px 0px 0px currentcolor)] to [drop-shadow(20px 10px green)] at (-1) is [drop-shadow(rgb(255, 255, 255) -20px -10px 0px)] 
diff --git a/third_party/WebKit/LayoutTests/animations/interpolation/text-shadow-interpolation-expected.txt b/third_party/WebKit/LayoutTests/animations/interpolation/text-shadow-interpolation-expected.txt
index 5277838..c1ed75f3 100644
--- a/third_party/WebKit/LayoutTests/animations/interpolation/text-shadow-interpolation-expected.txt
+++ b/third_party/WebKit/LayoutTests/animations/interpolation/text-shadow-interpolation-expected.txt
@@ -8,7 +8,7 @@
 PASS CSS Transitions: property <text-shadow> from neutral to [20px 20px 20px green] at (1.5) is [rgb(0, 110, 0) 25px 15px 25px] 
 PASS CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px] 
 PASS CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (0) is [none] 
-FAIL CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.3) is [rgba(0, 125, 0, 0.301961) 6px 6px 6px] assert_equals: expected "rgba ( 0 , 128 , 0 , 0.3 ) 6px 6px 6px " but got "rgba ( 0 , 125 , 0 , 0.3 ) 6px 6px 6px "
+FAIL CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.3) is [rgba(0, 125, 0, 0.3) 6px 6px 6px] assert_equals: expected "rgba ( 0 , 128 , 0 , 0.3 ) 6px 6px 6px " but got "rgba ( 0 , 125 , 0 , 0.3 ) 6px 6px 6px "
 PASS CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.6) is [rgba(0, 128, 0, 0.6) 12px 12px 12px] 
 PASS CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (1) is [rgb(0, 128, 0) 20px 20px 20px] 
 PASS CSS Transitions: property <text-shadow> from [initial] to [20px 20px 20px green] at (1.5) is [rgb(0, 192, 0) 30px 30px 30px] 
@@ -44,7 +44,7 @@
 PASS CSS Animations: property <text-shadow> from neutral to [20px 20px 20px green] at (1.5) is [rgb(0, 110, 0) 25px 15px 25px] 
 PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px] 
 PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0) is [none] 
-PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.3) is [rgba(0, 128, 0, 0.301961) 6px 6px 6px] 
+PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.3) is [rgba(0, 128, 0, 0.3) 6px 6px 6px] 
 PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.6) is [rgba(0, 128, 0, 0.6) 12px 12px 12px] 
 PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (1) is [rgb(0, 128, 0) 20px 20px 20px] 
 PASS CSS Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (1.5) is [rgb(0, 192, 0) 30px 30px 30px] 
@@ -80,7 +80,7 @@
 PASS Web Animations: property <text-shadow> from neutral to [20px 20px 20px green] at (1.5) is [rgb(0, 110, 0) 25px 15px 25px] 
 PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (-0.3) is [rgba(0, 0, 0, 0) -6px -6px 0px] 
 PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0) is [none] 
-PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.3) is [rgba(0, 128, 0, 0.301961) 6px 6px 6px] 
+PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.3) is [rgba(0, 128, 0, 0.3) 6px 6px 6px] 
 PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (0.6) is [rgba(0, 128, 0, 0.6) 12px 12px 12px] 
 PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (1) is [rgb(0, 128, 0) 20px 20px 20px] 
 PASS Web Animations: property <text-shadow> from [initial] to [20px 20px 20px green] at (1.5) is [rgb(0, 192, 0) 30px 30px 30px] 
diff --git a/third_party/WebKit/LayoutTests/compositing/contents-opaque/background-color-expected.txt b/third_party/WebKit/LayoutTests/compositing/contents-opaque/background-color-expected.txt
index 667e811..24add97 100644
--- a/third_party/WebKit/LayoutTests/compositing/contents-opaque/background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/contents-opaque/background-color-expected.txt
@@ -16,7 +16,7 @@
       "position": [8, 108],
       "bounds": [100, 100],
       "drawsContent": true,
-      "backgroundColor": "#00FF007F"
+      "backgroundColor": "#00FF0080"
     },
     {
       "name": "LayoutBlockFlow DIV class='box opaque composited'",
diff --git a/third_party/WebKit/LayoutTests/compositing/draws-content/canvas-background-layer-expected.txt b/third_party/WebKit/LayoutTests/compositing/draws-content/canvas-background-layer-expected.txt
index 2531d0d..0ec9d9e 100644
--- a/third_party/WebKit/LayoutTests/compositing/draws-content/canvas-background-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/draws-content/canvas-background-layer-expected.txt
@@ -19,7 +19,7 @@
       "position": [13, 73],
       "bounds": [50, 50],
       "drawsContent": true,
-      "backgroundColor": "#00FF007F"
+      "backgroundColor": "#00FF0080"
     },
     {
       "name": "LayoutHTMLCanvas CANVAS id='canvas-padding'",
diff --git a/third_party/WebKit/LayoutTests/compositing/draws-content/webgl-background-layer-expected.txt b/third_party/WebKit/LayoutTests/compositing/draws-content/webgl-background-layer-expected.txt
index 53ea0970..2f3c662 100644
--- a/third_party/WebKit/LayoutTests/compositing/draws-content/webgl-background-layer-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/draws-content/webgl-background-layer-expected.txt
@@ -40,7 +40,7 @@
       "position": [13, 268],
       "bounds": [50, 50],
       "drawsContent": true,
-      "backgroundColor": "#00FF007F"
+      "backgroundColor": "#00FF0080"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/compositing/fixed-body-background-positioned-expected.png b/third_party/WebKit/LayoutTests/compositing/fixed-body-background-positioned-expected.png
index 04759d1..4c739d5 100644
--- a/third_party/WebKit/LayoutTests/compositing/fixed-body-background-positioned-expected.png
+++ b/third_party/WebKit/LayoutTests/compositing/fixed-body-background-positioned-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt b/third_party/WebKit/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt
index deb35b6..ba05ce15 100644
--- a/third_party/WebKit/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/iframes/overlapped-nested-iframes-expected.txt
@@ -138,7 +138,7 @@
       "position": [0, 100],
       "bounds": [785, 120],
       "drawsContent": true,
-      "backgroundColor": "#0000007F"
+      "backgroundColor": "#00000080"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.png b/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.png
index 4fb6748f..8e90d0c 100644
--- a/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.png
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.txt b/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.txt
index 47100f7f..dfc87a8 100644
--- a/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/border-radius-styles-with-composited-child-expected.txt
@@ -8,7 +8,7 @@
 layer at (18,128) size 108x108 clip at (22,132) size 100x100
   LayoutBlockFlow {DIV} at (10,118) size 108x108 [bgcolor=#ADD8E6] [border: (4px dashed #000000)]
 layer at (18,246) size 108x108 clip at (22,250) size 100x100
-  LayoutBlockFlow {DIV} at (10,236) size 108x108 [bgcolor=#ADD8E6] [border: (4px solid #FF00007F)]
+  LayoutBlockFlow {DIV} at (10,236) size 108x108 [bgcolor=#ADD8E6] [border: (4px solid #FF000080)]
 layer at (22,14) size 96x96
   LayoutBlockFlow {DIV} at (4,4) size 96x96 [bgcolor=#008000]
 layer at (22,132) size 96x96
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/clear-scroll-parent-expected.txt b/third_party/WebKit/LayoutTests/compositing/overflow/clear-scroll-parent-expected.txt
index 3dcfc7b..86a7938 100644
--- a/third_party/WebKit/LayoutTests/compositing/overflow/clear-scroll-parent-expected.txt
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/clear-scroll-parent-expected.txt
@@ -12,7 +12,7 @@
       "bounds": [308, 208],
       "shouldFlattenTransform": false,
       "drawsContent": true,
-      "backgroundColor": "#00FF007F"
+      "backgroundColor": "#00FF0080"
     },
     {
       "name": "Scrolling Layer",
@@ -60,7 +60,7 @@
       "position": [10, 10],
       "bounds": [100, 100],
       "drawsContent": true,
-      "backgroundColor": "#FF00007F"
+      "backgroundColor": "#FF000080"
     },
     {
       "name": "Squashing Containment Layer",
@@ -72,7 +72,7 @@
       "position": [22, 102],
       "bounds": [100, 100],
       "drawsContent": true,
-      "backgroundColor": "#0000FF7F"
+      "backgroundColor": "#0000FF80"
     },
     {
       "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV class='box')",
diff --git a/third_party/WebKit/LayoutTests/compositing/overflow/clip-content-under-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/compositing/overflow/clip-content-under-overflow-controls-expected.png
new file mode 100644
index 0000000..797fa6c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/compositing/overflow/clip-content-under-overflow-controls-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/compositing/scrollbar-painting-expected.png b/third_party/WebKit/LayoutTests/compositing/scrollbar-painting-expected.png
new file mode 100644
index 0000000..797fa6c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/compositing/scrollbar-painting-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list-expected.png b/third_party/WebKit/LayoutTests/compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list-expected.png
index 2ecafb6..2a92c830 100644
--- a/third_party/WebKit/LayoutTests/compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list-expected.png
+++ b/third_party/WebKit/LayoutTests/compositing/z-order/collect-layers-does-not-initialize-pos-z-order-list-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/css-parser/color3-expected.txt b/third_party/WebKit/LayoutTests/css-parser/color3-expected.txt
index 491a0f9..3f92af96 100644
--- a/third_party/WebKit/LayoutTests/css-parser/color3-expected.txt
+++ b/third_party/WebKit/LayoutTests/css-parser/color3-expected.txt
@@ -68,21 +68,21 @@
 PASS colorTest.parseColor("rgb(0%, 0%, 0%, 0%)") is "parse error"
 PASS colorTest.parseColor("rgb(0%, 0%, 0%, 0)") is "parse error"
 PASS colorTest.parseColor("rgba(0, 0, 0, 0)") is "rgba(0, 0, 0, 0)"
-FAIL colorTest.parseColor("rgba(204, 0, 102, 0.3)") should be rgba(204, 0, 102, 0.3). Was rgba(204, 0, 102, 0.298039).
+PASS colorTest.parseColor("rgba(204, 0, 102, 0.3)") is "rgba(204, 0, 102, 0.3)"
 PASS colorTest.parseColor("RGBA(255, 255, 255, 0)") is "rgba(255, 255, 255, 0)"
 PASS colorTest.parseColor("rgBA(0, 51, 255, 1)") is "rgb(0, 51, 255)"
 PASS colorTest.parseColor("rgba(0, 51, 255, 1.1)") is "rgb(0, 51, 255)"
 PASS colorTest.parseColor("rgba(0, 51, 255, 37)") is "rgb(0, 51, 255)"
-FAIL colorTest.parseColor("rgba(0, 51, 255, 0.42)") should be rgba(0, 51, 255, 0.42). Was rgba(0, 51, 255, 0.419608).
+PASS colorTest.parseColor("rgba(0, 51, 255, 0.42)") is "rgba(0, 51, 255, 0.42)"
 PASS colorTest.parseColor("rgba(0, 51, 255, 0)") is "rgba(0, 51, 255, 0)"
 PASS colorTest.parseColor("rgba(0, 51, 255, -0.1)") is "rgba(0, 51, 255, 0)"
 PASS colorTest.parseColor("rgba(0, 51, 255, -139)") is "rgba(0, 51, 255, 0)"
-FAIL colorTest.parseColor("rgba(42%, 3%, 50%, 0.3)") should be rgba(107, 7, 127, 0.3). Was rgba(107, 7, 128, 0.298039).
+FAIL colorTest.parseColor("rgba(42%, 3%, 50%, 0.3)") should be rgba(107, 7, 127, 0.3). Was rgba(107, 7, 128, 0.3).
 PASS colorTest.parseColor("RGBA(100%, 100%, 100%, 0)") is "rgba(255, 255, 255, 0)"
 PASS colorTest.parseColor("rgBA(0%, 20%, 100%, 1)") is "rgb(0, 51, 255)"
 PASS colorTest.parseColor("rgba(0%, 20%, 100%, 1.1)") is "rgb(0, 51, 255)"
 PASS colorTest.parseColor("rgba(0%, 20%, 100%, 37)") is "rgb(0, 51, 255)"
-FAIL colorTest.parseColor("rgba(0%, 20%, 100%, 0.42)") should be rgba(0, 51, 255, 0.42). Was rgba(0, 51, 255, 0.419608).
+PASS colorTest.parseColor("rgba(0%, 20%, 100%, 0.42)") is "rgba(0, 51, 255, 0.42)"
 PASS colorTest.parseColor("rgba(0%, 20%, 100%, 0)") is "rgba(0, 51, 255, 0)"
 PASS colorTest.parseColor("rgba(0%, 20%, 100%, -0.1)") is "rgba(0, 51, 255, 0)"
 PASS colorTest.parseColor("rgba(0%, 20%, 100%, -139)") is "rgba(0, 51, 255, 0)"
diff --git a/third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html b/third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html
new file mode 100644
index 0000000..b2e0ae2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<body>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+test(function() {
+    for (var i = 0.0; i <= 1.0; i += 0.01) {
+        var rgba = 'rgba(0, 0, 0, ' + parseFloat(i.toFixed(2)) + ')';
+        document.body.style.color = rgba;
+        assert_equals(document.body.style.color, rgba);
+        assert_equals(getComputedStyle(document.body).color, rgba);
+    }
+}, 'Alpha values should parse and serialize to the same value to 2 decimal places');
+
+test(function() {
+    var testCases = [
+      ['rgba(0, 0, 0, 0.501)', 'rgba(0, 0, 0, 0.5)'],
+      ['rgba(0, 0, 0, 0.011)', 'rgba(0, 0, 0, 0.01)'],
+      ['rgba(0, 0, 0, 0.0041)', 'rgba(0, 0, 0, 0.004)'],
+      ['rgba(0, 0, 0, 0.01601)', 'rgba(0, 0, 0, 0.016)']
+    ];
+    for (var i = 0; i < testCases.length; ++i) {
+        var rgba = testCases[i][0];
+        var expected = testCases[i][1];
+        document.body.style.color = rgba;
+        assert_equals(document.body.style.color, expected);
+        assert_equals(getComputedStyle(document.body).color, expected);
+    }
+}, 'Alpha values with three or more decimals should parse and serialize to ' +
+   '1, 2, or 3 decimal places according to w3c spec');
+</script>
+
diff --git a/third_party/WebKit/LayoutTests/css3/calc/color-hsl-expected.txt b/third_party/WebKit/LayoutTests/css3/calc/color-hsl-expected.txt
index 920f1f3..b00efa07 100644
--- a/third_party/WebKit/LayoutTests/css3/calc/color-hsl-expected.txt
+++ b/third_party/WebKit/LayoutTests/css3/calc/color-hsl-expected.txt
@@ -4,7 +4,7 @@
 
 
 PASS getComputedStyle(document.getElementById("simple"), null).color is "rgb(31, 223, 31)"
-PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(31, 223, 31, 0.701961)"
+PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(31, 223, 31, 0.7)"
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/css3/calc/color-rgb-expected.txt b/third_party/WebKit/LayoutTests/css3/calc/color-rgb-expected.txt
index 66f4ac7..afbd9f9c 100644
--- a/third_party/WebKit/LayoutTests/css3/calc/color-rgb-expected.txt
+++ b/third_party/WebKit/LayoutTests/css3/calc/color-rgb-expected.txt
@@ -6,9 +6,9 @@
 PASS getComputedStyle(document.getElementById("simple"), null).color is "rgb(10, 180, 30)"
 PASS getComputedStyle(document.getElementById("percentsimple"), null).color is "rgb(25, 243, 76)"
 FAIL getComputedStyle(document.getElementById("percentnumber"), null).color should be rgb(26, 240, 80). Was rgb(0, 0, 0).
-PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(10, 180, 30, 0.701961)"
-PASS getComputedStyle(document.getElementById("percentalpha"), null).color is "rgba(25, 243, 76, 0.701961)"
-FAIL getComputedStyle(document.getElementById("percentnumberalpha"), null).color should be rgba(26, 240, 80, 0.498039). Was rgb(0, 0, 0).
+PASS getComputedStyle(document.getElementById("alpha"), null).color is "rgba(10, 180, 30, 0.7)"
+PASS getComputedStyle(document.getElementById("percentalpha"), null).color is "rgba(25, 243, 76, 0.7)"
+FAIL getComputedStyle(document.getElementById("percentnumberalpha"), null).color should be rgba(26, 240, 80, 0.5). Was rgb(0, 0, 0).
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt
index 949b092..7adb845 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color-expected.txt
@@ -8,6 +8,6 @@
 PASS rgb(0, 128, 0) for <div style='background: green;' id=selected><span style='background-color: yellow'>hello</span><span style='background-color: blue'> world</span></div>
 PASS rgb(255, 255, 0) for <div style='background: green;'><span style='background-color: yellow' id=selected>hello world</span></div>
 PASS rgb(0, 128, 0) for <div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0);' id=selected>hello world</span></div>
-PASS rgba(255, 255, 0, 0.498039) for <div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>
+PASS rgba(255, 255, 0, 0.5) for <div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>
 
 
diff --git a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color.html b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color.html
index 4a4ba18..9900f47 100644
--- a/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color.html
+++ b/third_party/WebKit/LayoutTests/editing/execCommand/query-command-value-background-color.html
@@ -55,6 +55,6 @@
 test("<div style='background: green;' id=selected><span style='background-color: yellow'>hello</span><span style='background-color: blue'> world</span></div>", 'rgb(0, 128, 0)');
 test("<div style='background: green;'><span style='background-color: yellow' id=selected>hello world</span></div>", 'rgb(255, 255, 0)');
 test("<div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0);' id=selected>hello world</span></div>", 'rgb(0, 128, 0)');
-test("<div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>", 'rgba(255, 255, 0, 0.498039)');
+test("<div style='background: green;'><span style='background-color: rgba(255, 255, 0, 0.5);' id=selected>hello world</span></div>", 'rgba(255, 255, 0, 0.5)');
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/fast/backgrounds/background-leakage-expected.png b/third_party/WebKit/LayoutTests/fast/backgrounds/background-leakage-expected.png
index 04509d3..73f23d78 100644
--- a/third_party/WebKit/LayoutTests/fast/backgrounds/background-leakage-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/backgrounds/background-leakage-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/block/basic/fieldset-stretch-to-legend-expected.txt b/third_party/WebKit/LayoutTests/fast/block/basic/fieldset-stretch-to-legend-expected.txt
index f7628e6..1d58e23 100644
--- a/third_party/WebKit/LayoutTests/fast/block/basic/fieldset-stretch-to-legend-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/block/basic/fieldset-stretch-to-legend-expected.txt
@@ -4,27 +4,27 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x898.31
     LayoutBlockFlow {BODY} at (8,8) size 769x880.31
       LayoutFieldset {FIELDSET} at (2,0) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (20,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (20,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,45.59) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (20,0) size 112x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (20,0) size 112x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,91.19) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (20,0) size 116x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (20,0) size 116x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,136.78) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (20,0) size 121x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (20,0) size 121x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,182.38) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (8,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (8,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,227.97) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (4,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (4,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,273.56) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (-1,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (-1,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,319.16) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (-49,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (-49,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,364.75) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (-54,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (-54,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,410.34) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (135,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (135,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,455.94) size 140x35.59 [border: (8px double #000000)]
-        LayoutBlockFlow {LEGEND} at (140,0) size 54x12 [bgcolor=#0080004C]
+        LayoutBlockFlow {LEGEND} at (140,0) size 54x12 [bgcolor=#0080004D]
       LayoutFieldset {FIELDSET} at (2,501.53) size 184x29.59 [border: (2px groove #C0C0C0)]
         LayoutBlockFlow {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
       LayoutFieldset {FIELDSET} at (2,541.13) size 184x59.59 [border: (2px groove #C0C0C0)]
diff --git a/third_party/WebKit/LayoutTests/fast/block/float/relative-painted-twice-expected.txt b/third_party/WebKit/LayoutTests/fast/block/float/relative-painted-twice-expected.txt
index 4718095..299ade92 100644
--- a/third_party/WebKit/LayoutTests/fast/block/float/relative-painted-twice-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/block/float/relative-painted-twice-expected.txt
@@ -7,5 +7,5 @@
       LayoutBlockFlow {DIV} at (0,150) size 769x0
 layer at (8,58) size 769x0
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 769x0
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 100x100 [bgcolor=#0000007F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 100x100 [bgcolor=#00000080]
 caret: position 0 of child 1 {DIV} of child 1 {DIV} of child 1 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-image-trumps-radius-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/border-image-trumps-radius-expected.txt
index f23c2fcc..331ac5d5 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-image-trumps-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-image-trumps-radius-expected.txt
@@ -4,4 +4,4 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
-      LayoutBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#FF0000] [border: (10px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#FF0000] [border: (10px solid #0000FF80)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.png b/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.png
index 8e147de..f526a44 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.txt
index 789308de..c236b74 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-left-right-same-bottom-different-color-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x176
   LayoutBlockFlow {HTML} at (0,0) size 800x176
     LayoutBlockFlow {BODY} at (8,8) size 784x160
-      LayoutBlockFlow {DIV} at (0,0) size 260x160 [bgcolor=#AAAAAA] [border: (30px solid #00A1007F) (30px solid #CCCCCC) (30px solid #00A100) (30px solid #CCCCCC)]
+      LayoutBlockFlow {DIV} at (0,0) size 260x160 [bgcolor=#AAAAAA] [border: (30px solid #00A10080) (30px solid #CCCCCC) (30px solid #00A100) (30px solid #CCCCCC)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha-expected.png b/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha-expected.png
index f05e11d..043ecf3b 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha2-expected.png b/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha2-expected.png
index 49bee9da..3c3aae5 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha2-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-mixed-alpha2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.png b/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.png
index 6c63fab..2bae425 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.txt
index 69ea46b5..3635148 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-radius-groove-03-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (26px groove #FF0000) (52px groove #0080007F) (26px groove #0080007F) (52px groove #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (26px groove #FF0000) (52px groove #00800080) (26px groove #00800080) (52px groove #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.png b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.png
index 3e5800b..9c469c9 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.txt
index 4f1d18d..66c22bc 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-03-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (94px solid #FF0000) (80px solid #0080007F) (94px solid #0080007F) (80px solid #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (94px solid #FF0000) (80px solid #00800080) (94px solid #00800080) (80px solid #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.png b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.png
index 8aa16444..c43996c9 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.txt
index d3d2c56..327a1db 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/border-radius-wide-border-04-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (90px solid #FF0000) (180px solid #0080007F) (90px solid #0080007F) (180px solid #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (90px solid #FF0000) (180px solid #00800080) (90px solid #00800080) (180px solid #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.png b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.png
index 9acf7f8..a81bd462 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.txt
index 87ade259..3d5566c 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDashed05-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (12px dashed #FF0000) (4px dashed #0080007F) (12px dashed #0080007F) (4px dashed #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (12px dashed #FF0000) (4px dashed #00800080) (12px dashed #00800080) (4px dashed #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.png b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.png
index e9374fe..3493b51 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.txt
index 3b21d069..0468eb6 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted05-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (84px dotted #FF0000) (84px dotted #0080007F) (84px dotted #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (84px dotted #FF0000) (84px dotted #00800080) (84px dotted #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.png b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.png
index ba2b701..08baa374 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.txt
index 8579e8b..09a41f8 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDotted06-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (20px dotted #FF0000) (20px dotted #0080007F) (20px dotted #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (20px dotted #FF0000) (20px dotted #00800080) (20px dotted #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.png b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.png
index 6951d9b2..a70d10a 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.txt
index 6dfcaef..53a67b2 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble05-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (94px double #FF0000) (80px double #0080007F) (94px double #0080007F) (80px double #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (94px double #FF0000) (80px double #00800080) (94px double #00800080) (80px double #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.png b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.png
index adfdb6c..95e01cd6 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.txt
index 30186edd..417c2a3 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/borderRadiusDouble09-expected.txt
@@ -3,4 +3,4 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x560
-      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (100px double #FF0000) (81px double #0080007F) (100px double #0080007F) (81px double #0000FF)]
+      LayoutBlockFlow {DIV} at (20,0) size 400x400 [border: (100px double #FF0000) (81px double #00800080) (100px double #00800080) (81px double #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.png b/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.png
index 20565063..dd9778e 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.txt b/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.txt
index c46c845..779710e 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/borders/fieldsetBorderRadius-expected.txt
@@ -5,32 +5,32 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x582
       LayoutBlockFlow (floating) {DIV} at (0,0) size 158x459.16
         LayoutFieldset {FIELDSET} at (2,0) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (20,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (20,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,61.59) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (20,0) size 112x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (20,0) size 112x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,123.19) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (20,0) size 116x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (20,0) size 116x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,184.78) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (20,0) size 121x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (20,0) size 121x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,246.38) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (8,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (8,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,307.97) size 154x65.59 [border: (15px solid #000000)]
-          LayoutBlockFlow {LEGEND} at (15,1.50) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (15,1.50) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,383.56) size 154x65.59 [border: (15px solid #000000)]
-          LayoutBlockFlow {LEGEND} at (15,1.50) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (15,1.50) size 54x12 [bgcolor=#0080004D]
       LayoutBlockFlow (floating) {DIV} at (228,0) size 144x369.56
         LayoutFieldset {FIELDSET} at (2,0) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (4,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (4,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,61.59) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (-1,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (-1,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,123.19) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (-49,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (-49,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,184.78) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (-54,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (-54,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,246.38) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (135,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (135,0) size 54x12 [bgcolor=#0080004D]
         LayoutFieldset {FIELDSET} at (2,307.97) size 140x51.59 [border: (8px double #000000)]
-          LayoutBlockFlow {LEGEND} at (140,0) size 54x12 [bgcolor=#0080004C]
+          LayoutBlockFlow {LEGEND} at (140,0) size 54x12 [bgcolor=#0080004D]
       LayoutBlockFlow {DIV} at (450,0) size 334x388.78
         LayoutFieldset {FIELDSET} at (2,0) size 184x39.59 [border: (2px groove #C0C0C0)]
           LayoutBlockFlow {LEGEND} at (14,0) size 156x12 [border: (1px solid #0000FF)]
diff --git a/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-expected.png b/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-expected.png
index 878c6a9..122bb43 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius-expected.png b/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius-expected.png
index 8a24712e..7e0fb55 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius2-expected.png b/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius2-expected.png
index ecf4d2d..3162fb7 100644
--- a/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius2-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/borders/mixed-border-styles-radius2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/box-shadow/box-shadow-radius-expected.png b/third_party/WebKit/LayoutTests/fast/box-shadow/box-shadow-radius-expected.png
index 484579df..3df19ce6 100644
--- a/third_party/WebKit/LayoutTests/fast/box-shadow/box-shadow-radius-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/box-shadow/box-shadow-radius-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/box-shadow/inset-box-shadow-radius-expected.png b/third_party/WebKit/LayoutTests/fast/box-shadow/inset-box-shadow-radius-expected.png
index 858389fa..d8bb4dfd 100644
--- a/third_party/WebKit/LayoutTests/fast/box-shadow/inset-box-shadow-radius-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/box-shadow/inset-box-shadow-radius-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/box-shadow/shadow-tiling-artifact-expected.png b/third_party/WebKit/LayoutTests/fast/box-shadow/shadow-tiling-artifact-expected.png
index e43ba3d..a5030b5 100644
--- a/third_party/WebKit/LayoutTests/fast/box-shadow/shadow-tiling-artifact-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/box-shadow/shadow-tiling-artifact-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-expected.png b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-expected.png
index e927fcd5..949c0252c 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-fill-expected.png b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-fill-expected.png
index a7e92f45..a742135 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-arc-circumference-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-blend-image-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/canvas-blend-image-expected.txt
index 8a2726db..410ccb9 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-blend-image-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-blend-image-expected.txt
@@ -974,7 +974,7 @@
 PASS pixelDataAtPoint(1)[1] is within 5 of 85
 PASS pixelDataAtPoint(1)[2] is within 5 of 167
 PASS pixelDataAtPoint(1)[3] is within 5 of 191
-PASS pixelDataAtPoint(2)[0] is within 5 of 0
+PASS pixelDataAtPoint(2)[0] is within 5 of 4
 PASS pixelDataAtPoint(2)[1] is within 5 of 48
 PASS pixelDataAtPoint(2)[2] is within 5 of 130
 PASS pixelDataAtPoint(2)[3] is within 5 of 191
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-transformclip-expected.png b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-transformclip-expected.png
index e87f440..7afd803 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-transformclip-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-composite-transformclip-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.png b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.png
index 961031a..392a4a0d 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-fill-expected.png b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-fill-expected.png
index b0ac807..2f53772 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-ellipse-circumference-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/rgba-parsing-expected.txt b/third_party/WebKit/LayoutTests/fast/canvas/rgba-parsing-expected.txt
index 15a9a62..cbe35c6 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/rgba-parsing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/canvas/rgba-parsing-expected.txt
@@ -30,63 +30,63 @@
 PASS parse('rgba(0, 0, 0, 0.0)') is 'RGBA[0, 0, 0, 0]'
 PASS parse('rgba(0, 0, 0, 00.0)') is 'RGBA[0, 0, 0, 0]'
 PASS parse('rgba(0, 0, 0, 0.00)') is 'RGBA[0, 0, 0, 0]'
-PASS parse('rgba(0, 0, 0, .1)') is 'RGBA[0, 0, 0, 25]'
+PASS parse('rgba(0, 0, 0, .1)') is 'RGBA[0, 0, 0, 26]'
 PASS parse('rgba(0, 0, 0, .2)') is 'RGBA[0, 0, 0, 51]'
-PASS parse('rgba(0, 0, 0, .3)') is 'RGBA[0, 0, 0, 76]'
+PASS parse('rgba(0, 0, 0, .3)') is 'RGBA[0, 0, 0, 77]'
 PASS parse('rgba(0, 0, 0, .4)') is 'RGBA[0, 0, 0, 102]'
-PASS parse('rgba(0, 0, 0, .5)') is 'RGBA[0, 0, 0, 127]'
+PASS parse('rgba(0, 0, 0, .5)') is 'RGBA[0, 0, 0, 128]'
 PASS parse('rgba(0, 0, 0, .6)') is 'RGBA[0, 0, 0, 153]'
 PASS parse('rgba(0, 0, 0, .7)') is 'RGBA[0, 0, 0, 179]'
 PASS parse('rgba(0, 0, 0, .8)') is 'RGBA[0, 0, 0, 204]'
 PASS parse('rgba(0, 0, 0, .9)') is 'RGBA[0, 0, 0, 230]'
-PASS parse('rgba(0, 0, 0, 0.1)') is 'RGBA[0, 0, 0, 25]'
+PASS parse('rgba(0, 0, 0, 0.1)') is 'RGBA[0, 0, 0, 26]'
 PASS parse('rgba(0, 0, 0, 0.2)') is 'RGBA[0, 0, 0, 51]'
-PASS parse('rgba(0, 0, 0, 0.3)') is 'RGBA[0, 0, 0, 76]'
+PASS parse('rgba(0, 0, 0, 0.3)') is 'RGBA[0, 0, 0, 77]'
 PASS parse('rgba(0, 0, 0, 0.4)') is 'RGBA[0, 0, 0, 102]'
-PASS parse('rgba(0, 0, 0, 0.5)') is 'RGBA[0, 0, 0, 127]'
+PASS parse('rgba(0, 0, 0, 0.5)') is 'RGBA[0, 0, 0, 128]'
 PASS parse('rgba(0, 0, 0, 0.6)') is 'RGBA[0, 0, 0, 153]'
 PASS parse('rgba(0, 0, 0, 0.7)') is 'RGBA[0, 0, 0, 179]'
 PASS parse('rgba(0, 0, 0, 0.8)') is 'RGBA[0, 0, 0, 204]'
 PASS parse('rgba(0, 0, 0, 0.9)') is 'RGBA[0, 0, 0, 230]'
 PASS parse('rgba(0, 0, 0, 1.0)') is 'RGBA[0, 0, 0, 255]'
-PASS parse('rgba(0, 0, 0, 0.10)') is 'RGBA[0, 0, 0, 25]'
+PASS parse('rgba(0, 0, 0, 0.10)') is 'RGBA[0, 0, 0, 26]'
 PASS parse('rgba(0, 0, 0, 0.20)') is 'RGBA[0, 0, 0, 51]'
-PASS parse('rgba(0, 0, 0, 0.30)') is 'RGBA[0, 0, 0, 76]'
+PASS parse('rgba(0, 0, 0, 0.30)') is 'RGBA[0, 0, 0, 77]'
 PASS parse('rgba(0, 0, 0, 0.40)') is 'RGBA[0, 0, 0, 102]'
-PASS parse('rgba(0, 0, 0, 0.50)') is 'RGBA[0, 0, 0, 127]'
+PASS parse('rgba(0, 0, 0, 0.50)') is 'RGBA[0, 0, 0, 128]'
 PASS parse('rgba(0, 0, 0, 0.60)') is 'RGBA[0, 0, 0, 153]'
 PASS parse('rgba(0, 0, 0, 0.70)') is 'RGBA[0, 0, 0, 179]'
 PASS parse('rgba(0, 0, 0, 0.80)') is 'RGBA[0, 0, 0, 204]'
 PASS parse('rgba(0, 0, 0, 0.90)') is 'RGBA[0, 0, 0, 230]'
 PASS parse('rgba(0, 0, 0, 1.00)') is 'RGBA[0, 0, 0, 255]'
-PASS parse('rgba(0, 0, 0, .10)') is 'RGBA[0, 0, 0, 25]'
+PASS parse('rgba(0, 0, 0, .10)') is 'RGBA[0, 0, 0, 26]'
 PASS parse('rgba(0, 0, 0, .20)') is 'RGBA[0, 0, 0, 51]'
-PASS parse('rgba(0, 0, 0, .30)') is 'RGBA[0, 0, 0, 76]'
+PASS parse('rgba(0, 0, 0, .30)') is 'RGBA[0, 0, 0, 77]'
 PASS parse('rgba(0, 0, 0, .40)') is 'RGBA[0, 0, 0, 102]'
-PASS parse('rgba(0, 0, 0, .50)') is 'RGBA[0, 0, 0, 127]'
+PASS parse('rgba(0, 0, 0, .50)') is 'RGBA[0, 0, 0, 128]'
 PASS parse('rgba(0, 0, 0, .60)') is 'RGBA[0, 0, 0, 153]'
 PASS parse('rgba(0, 0, 0, .70)') is 'RGBA[0, 0, 0, 179]'
 PASS parse('rgba(0, 0, 0, .80)') is 'RGBA[0, 0, 0, 204]'
 PASS parse('rgba(0, 0, 0, .90)') is 'RGBA[0, 0, 0, 230]'
-PASS parse('rgba(0, 0, 0, 0.10000000000000000000000)') is 'RGBA[0, 0, 0, 25]'
+PASS parse('rgba(0, 0, 0, 0.10000000000000000000000)') is 'RGBA[0, 0, 0, 26]'
 PASS parse('rgba(0, 0, 0, 0.20000000000000000000000)') is 'RGBA[0, 0, 0, 51]'
-PASS parse('rgba(0, 0, 0, 0.30000000000000000000000)') is 'RGBA[0, 0, 0, 76]'
+PASS parse('rgba(0, 0, 0, 0.30000000000000000000000)') is 'RGBA[0, 0, 0, 77]'
 PASS parse('rgba(0, 0, 0, 0.40000000000000000000000)') is 'RGBA[0, 0, 0, 102]'
-PASS parse('rgba(0, 0, 0, 0.50000000000000000000000)') is 'RGBA[0, 0, 0, 127]'
+PASS parse('rgba(0, 0, 0, 0.50000000000000000000000)') is 'RGBA[0, 0, 0, 128]'
 PASS parse('rgba(0, 0, 0, 0.60000000000000000000000)') is 'RGBA[0, 0, 0, 153]'
 PASS parse('rgba(0, 0, 0, 0.70000000000000000000000)') is 'RGBA[0, 0, 0, 179]'
 PASS parse('rgba(0, 0, 0, 0.80000000000000000000000)') is 'RGBA[0, 0, 0, 204]'
 PASS parse('rgba(0, 0, 0, 0.90000000000000000000000)') is 'RGBA[0, 0, 0, 230]'
 PASS parse('rgba(0, 0, 0, 1.00000000000000000000000)') is 'RGBA[0, 0, 0, 255]'
-PASS parse('rgba(0, 0, 0, 0.990)') is 'RGBA[0, 0, 0, 253]'
+PASS parse('rgba(0, 0, 0, 0.990)') is 'RGBA[0, 0, 0, 252]'
 PASS parse('rgba(0, 0, 0, 0.991)') is 'RGBA[0, 0, 0, 253]'
 PASS parse('rgba(0, 0, 0, 0.992)') is 'RGBA[0, 0, 0, 253]'
-PASS parse('rgba(0, 0, 0, 0.993)') is 'RGBA[0, 0, 0, 254]'
-PASS parse('rgba(0, 0, 0, 0.994)') is 'RGBA[0, 0, 0, 254]'
+PASS parse('rgba(0, 0, 0, 0.993)') is 'RGBA[0, 0, 0, 253]'
+PASS parse('rgba(0, 0, 0, 0.994)') is 'RGBA[0, 0, 0, 253]'
 PASS parse('rgba(0, 0, 0, 0.995)') is 'RGBA[0, 0, 0, 254]'
 PASS parse('rgba(0, 0, 0, 0.996)') is 'RGBA[0, 0, 0, 254]'
-PASS parse('rgba(0, 0, 0, 0.997)') is 'RGBA[0, 0, 0, 255]'
-PASS parse('rgba(0, 0, 0, 0.998)') is 'RGBA[0, 0, 0, 255]'
+PASS parse('rgba(0, 0, 0, 0.997)') is 'RGBA[0, 0, 0, 254]'
+PASS parse('rgba(0, 0, 0, 0.998)') is 'RGBA[0, 0, 0, 254]'
 PASS parse('rgba(0, 0, 0, 0.999)') is 'RGBA[0, 0, 0, 255]'
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js
index e0698ce..e2bc834 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js
+++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-blend-image.js
@@ -105,7 +105,7 @@
 	 [[0, 0, 255, 255],[0, 0, 255, 255],[14, 14, 142, 255],[0, 0, 255, 255]],
 	 [[0, 0, 255, 255],[0, 0, 255, 255],[7, 7, 198, 255],[0, 0, 255, 255]],
 	 [[128, 0, 127, 255],[128, 128, 127, 255],[7, 71, 70, 255],[0, 0, 255, 255]],
-	 [[85, 0, 167, 191],[85, 85, 167, 191],[0, 48, 130, 191],[0, 0, 255, 191]]
+	 [[85, 0, 167, 191],[85, 85, 167, 191],[4, 48, 130, 191],[0, 0, 255, 191]]
   ],
   ['color',
 	 [[93, 0, 0, 255],[31, 31, 0, 255],[0, 47, 0, 255],[0, 0, 255, 255]],
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/rgba-parsing.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/rgba-parsing.js
index e84847a..6123bf0 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/rgba-parsing.js
+++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/rgba-parsing.js
@@ -39,61 +39,61 @@
 shouldBe("parse('rgba(0, 0, 0, 0.0)')", "'RGBA[0, 0, 0, 0]'");
 shouldBe("parse('rgba(0, 0, 0, 00.0)')", "'RGBA[0, 0, 0, 0]'");
 shouldBe("parse('rgba(0, 0, 0, 0.00)')", "'RGBA[0, 0, 0, 0]'");
-shouldBe("parse('rgba(0, 0, 0, .1)')", "'RGBA[0, 0, 0, 25]'");
+shouldBe("parse('rgba(0, 0, 0, .1)')", "'RGBA[0, 0, 0, 26]'");
 shouldBe("parse('rgba(0, 0, 0, .2)')", "'RGBA[0, 0, 0, 51]'");
-shouldBe("parse('rgba(0, 0, 0, .3)')", "'RGBA[0, 0, 0, 76]'");
+shouldBe("parse('rgba(0, 0, 0, .3)')", "'RGBA[0, 0, 0, 77]'");
 shouldBe("parse('rgba(0, 0, 0, .4)')", "'RGBA[0, 0, 0, 102]'");
-shouldBe("parse('rgba(0, 0, 0, .5)')", "'RGBA[0, 0, 0, 127]'");
+shouldBe("parse('rgba(0, 0, 0, .5)')", "'RGBA[0, 0, 0, 128]'");
 shouldBe("parse('rgba(0, 0, 0, .6)')", "'RGBA[0, 0, 0, 153]'");
 shouldBe("parse('rgba(0, 0, 0, .7)')", "'RGBA[0, 0, 0, 179]'");
 shouldBe("parse('rgba(0, 0, 0, .8)')", "'RGBA[0, 0, 0, 204]'");
 shouldBe("parse('rgba(0, 0, 0, .9)')", "'RGBA[0, 0, 0, 230]'");
-shouldBe("parse('rgba(0, 0, 0, 0.1)')", "'RGBA[0, 0, 0, 25]'");
+shouldBe("parse('rgba(0, 0, 0, 0.1)')", "'RGBA[0, 0, 0, 26]'");
 shouldBe("parse('rgba(0, 0, 0, 0.2)')", "'RGBA[0, 0, 0, 51]'");
-shouldBe("parse('rgba(0, 0, 0, 0.3)')", "'RGBA[0, 0, 0, 76]'");
+shouldBe("parse('rgba(0, 0, 0, 0.3)')", "'RGBA[0, 0, 0, 77]'");
 shouldBe("parse('rgba(0, 0, 0, 0.4)')", "'RGBA[0, 0, 0, 102]'");
-shouldBe("parse('rgba(0, 0, 0, 0.5)')", "'RGBA[0, 0, 0, 127]'");
+shouldBe("parse('rgba(0, 0, 0, 0.5)')", "'RGBA[0, 0, 0, 128]'");
 shouldBe("parse('rgba(0, 0, 0, 0.6)')", "'RGBA[0, 0, 0, 153]'");
 shouldBe("parse('rgba(0, 0, 0, 0.7)')", "'RGBA[0, 0, 0, 179]'");
 shouldBe("parse('rgba(0, 0, 0, 0.8)')", "'RGBA[0, 0, 0, 204]'");
 shouldBe("parse('rgba(0, 0, 0, 0.9)')", "'RGBA[0, 0, 0, 230]'");
 shouldBe("parse('rgba(0, 0, 0, 1.0)')", "'RGBA[0, 0, 0, 255]'");
-shouldBe("parse('rgba(0, 0, 0, 0.10)')", "'RGBA[0, 0, 0, 25]'");
+shouldBe("parse('rgba(0, 0, 0, 0.10)')", "'RGBA[0, 0, 0, 26]'");
 shouldBe("parse('rgba(0, 0, 0, 0.20)')", "'RGBA[0, 0, 0, 51]'");
-shouldBe("parse('rgba(0, 0, 0, 0.30)')", "'RGBA[0, 0, 0, 76]'");
+shouldBe("parse('rgba(0, 0, 0, 0.30)')", "'RGBA[0, 0, 0, 77]'");
 shouldBe("parse('rgba(0, 0, 0, 0.40)')", "'RGBA[0, 0, 0, 102]'");
-shouldBe("parse('rgba(0, 0, 0, 0.50)')", "'RGBA[0, 0, 0, 127]'");
+shouldBe("parse('rgba(0, 0, 0, 0.50)')", "'RGBA[0, 0, 0, 128]'");
 shouldBe("parse('rgba(0, 0, 0, 0.60)')", "'RGBA[0, 0, 0, 153]'");
 shouldBe("parse('rgba(0, 0, 0, 0.70)')", "'RGBA[0, 0, 0, 179]'");
 shouldBe("parse('rgba(0, 0, 0, 0.80)')", "'RGBA[0, 0, 0, 204]'");
 shouldBe("parse('rgba(0, 0, 0, 0.90)')", "'RGBA[0, 0, 0, 230]'");
 shouldBe("parse('rgba(0, 0, 0, 1.00)')", "'RGBA[0, 0, 0, 255]'");
-shouldBe("parse('rgba(0, 0, 0, .10)')", "'RGBA[0, 0, 0, 25]'");
+shouldBe("parse('rgba(0, 0, 0, .10)')", "'RGBA[0, 0, 0, 26]'");
 shouldBe("parse('rgba(0, 0, 0, .20)')", "'RGBA[0, 0, 0, 51]'");
-shouldBe("parse('rgba(0, 0, 0, .30)')", "'RGBA[0, 0, 0, 76]'");
+shouldBe("parse('rgba(0, 0, 0, .30)')", "'RGBA[0, 0, 0, 77]'");
 shouldBe("parse('rgba(0, 0, 0, .40)')", "'RGBA[0, 0, 0, 102]'");
-shouldBe("parse('rgba(0, 0, 0, .50)')", "'RGBA[0, 0, 0, 127]'");
+shouldBe("parse('rgba(0, 0, 0, .50)')", "'RGBA[0, 0, 0, 128]'");
 shouldBe("parse('rgba(0, 0, 0, .60)')", "'RGBA[0, 0, 0, 153]'");
 shouldBe("parse('rgba(0, 0, 0, .70)')", "'RGBA[0, 0, 0, 179]'");
 shouldBe("parse('rgba(0, 0, 0, .80)')", "'RGBA[0, 0, 0, 204]'");
 shouldBe("parse('rgba(0, 0, 0, .90)')", "'RGBA[0, 0, 0, 230]'");
-shouldBe("parse('rgba(0, 0, 0, 0.10000000000000000000000)')", "'RGBA[0, 0, 0, 25]'");
+shouldBe("parse('rgba(0, 0, 0, 0.10000000000000000000000)')", "'RGBA[0, 0, 0, 26]'");
 shouldBe("parse('rgba(0, 0, 0, 0.20000000000000000000000)')", "'RGBA[0, 0, 0, 51]'");
-shouldBe("parse('rgba(0, 0, 0, 0.30000000000000000000000)')", "'RGBA[0, 0, 0, 76]'");
+shouldBe("parse('rgba(0, 0, 0, 0.30000000000000000000000)')", "'RGBA[0, 0, 0, 77]'");
 shouldBe("parse('rgba(0, 0, 0, 0.40000000000000000000000)')", "'RGBA[0, 0, 0, 102]'");
-shouldBe("parse('rgba(0, 0, 0, 0.50000000000000000000000)')", "'RGBA[0, 0, 0, 127]'");
+shouldBe("parse('rgba(0, 0, 0, 0.50000000000000000000000)')", "'RGBA[0, 0, 0, 128]'");
 shouldBe("parse('rgba(0, 0, 0, 0.60000000000000000000000)')", "'RGBA[0, 0, 0, 153]'");
 shouldBe("parse('rgba(0, 0, 0, 0.70000000000000000000000)')", "'RGBA[0, 0, 0, 179]'");
 shouldBe("parse('rgba(0, 0, 0, 0.80000000000000000000000)')", "'RGBA[0, 0, 0, 204]'");
 shouldBe("parse('rgba(0, 0, 0, 0.90000000000000000000000)')", "'RGBA[0, 0, 0, 230]'");
 shouldBe("parse('rgba(0, 0, 0, 1.00000000000000000000000)')", "'RGBA[0, 0, 0, 255]'");
-shouldBe("parse('rgba(0, 0, 0, 0.990)')", "'RGBA[0, 0, 0, 253]'");
+shouldBe("parse('rgba(0, 0, 0, 0.990)')", "'RGBA[0, 0, 0, 252]'");
 shouldBe("parse('rgba(0, 0, 0, 0.991)')", "'RGBA[0, 0, 0, 253]'");
 shouldBe("parse('rgba(0, 0, 0, 0.992)')", "'RGBA[0, 0, 0, 253]'");
-shouldBe("parse('rgba(0, 0, 0, 0.993)')", "'RGBA[0, 0, 0, 254]'");
-shouldBe("parse('rgba(0, 0, 0, 0.994)')", "'RGBA[0, 0, 0, 254]'");
+shouldBe("parse('rgba(0, 0, 0, 0.993)')", "'RGBA[0, 0, 0, 253]'");
+shouldBe("parse('rgba(0, 0, 0, 0.994)')", "'RGBA[0, 0, 0, 253]'");
 shouldBe("parse('rgba(0, 0, 0, 0.995)')", "'RGBA[0, 0, 0, 254]'");
 shouldBe("parse('rgba(0, 0, 0, 0.996)')", "'RGBA[0, 0, 0, 254]'");
-shouldBe("parse('rgba(0, 0, 0, 0.997)')", "'RGBA[0, 0, 0, 255]'");
-shouldBe("parse('rgba(0, 0, 0, 0.998)')", "'RGBA[0, 0, 0, 255]'");
+shouldBe("parse('rgba(0, 0, 0, 0.997)')", "'RGBA[0, 0, 0, 254]'");
+shouldBe("parse('rgba(0, 0, 0, 0.998)')", "'RGBA[0, 0, 0, 254]'");
 shouldBe("parse('rgba(0, 0, 0, 0.999)')", "'RGBA[0, 0, 0, 255]'");
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/toDataURL-alpha-stability-expected.png b/third_party/WebKit/LayoutTests/fast/canvas/toDataURL-alpha-stability-expected.png
index d75e03b..78f1c74 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/toDataURL-alpha-stability-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/canvas/toDataURL-alpha-stability-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/css/percentage-non-integer-expected.png b/third_party/WebKit/LayoutTests/fast/css/percentage-non-integer-expected.png
index 8a66359..4546d50 100644
--- a/third_party/WebKit/LayoutTests/fast/css/percentage-non-integer-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/css/percentage-non-integer-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color-expected.txt b/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color-expected.txt
index f3200b7..afed9eb 100644
--- a/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-color-expected.txt
@@ -27,16 +27,16 @@
 PASS computedStyle.textDecorationColor is "rgb(0, 255, 0)"
 
 Valid value 'rgba(100, 100, 100, 0.5)':
-PASS e.style.textDecorationColor is "rgba(100, 100, 100, 0.498039)"
-PASS computedStyle.textDecorationColor is "rgba(100, 100, 100, 0.498039)"
+PASS e.style.textDecorationColor is "rgba(100, 100, 100, 0.5)"
+PASS computedStyle.textDecorationColor is "rgba(100, 100, 100, 0.5)"
 
 Valid value 'hsl(240, 100%, 50%)':
 PASS e.style.textDecorationColor is "rgb(0, 0, 255)"
 PASS computedStyle.textDecorationColor is "rgb(0, 0, 255)"
 
 Valid value 'hsla(240, 100%, 50%, 0.5)':
-PASS e.style.textDecorationColor is "rgba(0, 0, 255, 0.498039)"
-PASS computedStyle.textDecorationColor is "rgba(0, 0, 255, 0.498039)"
+PASS e.style.textDecorationColor is "rgba(0, 0, 255, 0.498)"
+PASS computedStyle.textDecorationColor is "rgba(0, 0, 255, 0.498)"
 
 Initial value:
 PASS e.style.textDecorationColor is "initial"
diff --git a/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-color.js b/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-color.js
index 48660109..94c94885 100644
--- a/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-color.js
+++ b/third_party/WebKit/LayoutTests/fast/css3-text/css3-text-decoration/getComputedStyle/script-tests/getComputedStyle-text-decoration-color.js
@@ -38,13 +38,13 @@
 test("rgb(0, 255, 0)", "rgb(0, 255, 0)", "rgb(0, 255, 0)");
 
 debug("Valid value 'rgba(100, 100, 100, 0.5)':");
-test("rgba(100, 100, 100, 0.5)", "rgba(100, 100, 100, 0.498039)", "rgba(100, 100, 100, 0.498039)");
+test("rgba(100, 100, 100, 0.5)", "rgba(100, 100, 100, 0.5)", "rgba(100, 100, 100, 0.5)");
 
 debug("Valid value 'hsl(240, 100%, 50%)':");
 test("hsl(240, 100%, 50%)", "rgb(0, 0, 255)", "rgb(0, 0, 255)");
 
 debug("Valid value 'hsla(240, 100%, 50%, 0.5)':");
-test("hsla(240, 100%, 50%, 0.5)", "rgba(0, 0, 255, 0.498039)", "rgba(0, 0, 255, 0.498039)");
+test("hsla(240, 100%, 50%, 0.5)", "rgba(0, 0, 255, 0.498)", "rgba(0, 0, 255, 0.498)");
 
 debug("Initial value:");
 test("initial", "initial", "rgb(0, 0, 0)");
diff --git a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.png b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.png
index cdd72c7..b2258d6 100644
--- a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt
index 65fd2d9..270de6a0 100644
--- a/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/frames/content-opacity-1-expected.txt
@@ -11,4 +11,4 @@
       LayoutView at (0,0) size 300x150
     layer at (0,0) size 300x150
       LayoutBlockFlow {HTML} at (0,0) size 300x150
-        LayoutBlockFlow {BODY} at (8,8) size 284x134 [bgcolor=#0000007F]
+        LayoutBlockFlow {BODY} at (8,8) size 284x134 [bgcolor=#00000080]
diff --git a/third_party/WebKit/LayoutTests/fast/layers/self-painting-outline-expected.png b/third_party/WebKit/LayoutTests/fast/layers/self-painting-outline-expected.png
index ad645a3..c210068 100644
--- a/third_party/WebKit/LayoutTests/fast/layers/self-painting-outline-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/layers/self-painting-outline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/replaced/border-radius-clip-content-edge-expected.png b/third_party/WebKit/LayoutTests/fast/replaced/border-radius-clip-content-edge-expected.png
index 81e4a119..4014ef3 100644
--- a/third_party/WebKit/LayoutTests/fast/replaced/border-radius-clip-content-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/replaced/border-radius-clip-content-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt b/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt
index fb7bfae..e3d13a4 100644
--- a/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/ruby/select-ruby-expected.txt
@@ -2,7 +2,7 @@
   LayoutView at (0,0) size 800x600
 layer at (0,0) size 800x40
   LayoutBlockFlow {HTML} at (0,0) size 800x40
-    LayoutBlockFlow {BODY} at (8,8) size 784x24 [color=#00000019]
+    LayoutBlockFlow {BODY} at (8,8) size 784x24 [color=#0000001A]
       LayoutText {#text} at (0,8) size 16x16
         text run at (0,8) width 16: "a"
       LayoutRuby (inline) {RUBY} at (0,0) size 64x16
diff --git a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/collapsed-border-with-col-colgroup-span-expected.png b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/collapsed-border-with-col-colgroup-span-expected.png
index d357c7b..30e448f 100644
--- a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/collapsed-border-with-col-colgroup-span-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/collapsed-border-with-col-colgroup-span-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.png b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.png
index f8ca0a50..4d1158a 100644
--- a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.txt b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.txt
index 821a045..46324c9 100644
--- a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-expected.txt
@@ -5,11 +5,11 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutTable {TABLE} at (0,0) size 118x50
         LayoutTableCol {COLGROUP} at (0,0) size 0x0
-        LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F007F) none]
+        LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F0080) none]
         LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #FF0000)]
         LayoutTableSection {TBODY} at (0,0) size 118x50
           LayoutTableRow {TR} at (0,0) size 118x25
-            LayoutTableCell {TD} at (0,10) size 29x4 [border: none (2px solid #007F007F) none] [r=0 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (0,10) size 29x4 [border: none (2px solid #007F0080) none] [r=0 c=0 rs=1 cs=1]
             LayoutTableCell {TD} at (29,11) size 30x2 [border: none (3px solid #FF0000)] [r=0 c=1 rs=1 cs=1]
             LayoutTableCell {TD} at (59,11) size 29x2 [border: none] [r=0 c=2 rs=1 cs=1]
             LayoutTableCell {TD} at (88,11) size 30x2 [border: none] [r=0 c=3 rs=1 cs=1]
@@ -20,11 +20,11 @@
             LayoutTableCell {TD} at (88,36) size 30x2 [border: none] [r=1 c=3 rs=1 cs=1]
       LayoutTable {TABLE} at (0,50) size 118x50
         LayoutTableCol {COLGROUP} at (0,0) size 0x0
-        LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F007F)]
+        LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F0080)]
         LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #FF0000) none]
         LayoutTableSection {TBODY} at (0,0) size 118x50
           LayoutTableRow {TR} at (0,0) size 118x25
-            LayoutTableCell {TD} at (88,10) size 30x4 [border: none (2px solid #007F007F)] [r=0 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (88,10) size 30x4 [border: none (2px solid #007F0080)] [r=0 c=0 rs=1 cs=1]
             LayoutTableCell {TD} at (59,11) size 29x2 [border: none (2px solid #FF0000) none] [r=0 c=1 rs=1 cs=1]
             LayoutTableCell {TD} at (29,11) size 30x2 [border: none] [r=0 c=2 rs=1 cs=1]
             LayoutTableCell {TD} at (0,11) size 29x2 [border: none] [r=0 c=3 rs=1 cs=1]
@@ -35,12 +35,12 @@
             LayoutTableCell {TD} at (0,36) size 29x2 [border: none] [r=1 c=3 rs=1 cs=1]
       LayoutTable {TABLE} at (0,100) size 27x50
         LayoutTableSection {TBODY} at (0,0) size 27x50
-          LayoutTableRow {TR} at (0,0) size 27x25 [border: none (5px solid #007F007F) none]
+          LayoutTableRow {TR} at (0,0) size 27x25 [border: none (5px solid #007F0080) none]
             LayoutTableCell {TD} at (0,10) size 27x4 [border: none] [r=0 c=0 rs=1 cs=1]
           LayoutTableRow {TR} at (0,25) size 27x25 [border: (5px solid #FF0000) none]
             LayoutTableCell {TD} at (0,35) size 27x5 [border: (3px none #000000)] [r=1 c=0 rs=1 cs=1]
       LayoutTable {TABLE} at (0,150) size 27x50
-        LayoutTableSection {TBODY} at (0,0) size 27x25 [border: none (5px solid #007F007F) none]
+        LayoutTableSection {TBODY} at (0,0) size 27x25 [border: none (5px solid #007F0080) none]
           LayoutTableRow {TR} at (0,0) size 27x25
             LayoutTableCell {TD} at (0,10) size 27x4 [border: none] [r=0 c=0 rs=1 cs=1]
         LayoutTableSection {TBODY} at (0,25) size 27x25 [border: (5px solid #FF0000) none]
diff --git a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.png b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.png
index adafdda..e0f8c74 100644
--- a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt
index cf066ec..b384ba0 100644
--- a/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/table/border-collapsing/equal-precedence-resolution-vertical-expected.txt
@@ -6,11 +6,11 @@
       LayoutBlockFlow {DIV} at (0,0) size 206x206 [border: (3px solid #000000)]
         LayoutTable {TABLE} at (3,3) size 50x118
           LayoutTableCol {COLGROUP} at (0,0) size 0x0
-          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F007F) none]
+          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F0080) none]
           LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: (5px solid #FF0000) none]
           LayoutTableSection {TBODY} at (0,0) size 50x118
             LayoutTableRow {TR} at (0,0) size 25x118
-              LayoutTableCell {TD} at (0,10) size 25x9 [border: none (2px solid #007F007F)] [r=0 c=0 rs=1 cs=1]
+              LayoutTableCell {TD} at (0,10) size 25x9 [border: none (2px solid #007F0080)] [r=0 c=0 rs=1 cs=1]
               LayoutTableCell {TD} at (0,40) size 25x7 [border: (3px solid #FF0000) none] [r=0 c=1 rs=1 cs=1]
               LayoutTableCell {TD} at (0,70) size 25x6 [border: none] [r=0 c=2 rs=1 cs=1]
               LayoutTableCell {TD} at (0,99) size 25x7 [border: (3px none #000000)] [r=0 c=3 rs=1 cs=1]
@@ -21,11 +21,11 @@
               LayoutTableCell {TD} at (25,99) size 25x7 [border: (3px none #000000)] [r=1 c=3 rs=1 cs=1]
         LayoutTable {TABLE} at (53,3) size 50x118
           LayoutTableCol {COLGROUP} at (0,0) size 0x0
-          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: (5px solid #007F007F) none]
+          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: (5px solid #007F0080) none]
           LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #FF0000) none]
           LayoutTableSection {TBODY} at (0,0) size 50x118
             LayoutTableRow {TR} at (0,0) size 25x118
-              LayoutTableCell {TD} at (0,98) size 25x10 [border: (3px solid #007F007F) none (3px solid #007F007F)] [r=0 c=0 rs=1 cs=1]
+              LayoutTableCell {TD} at (0,98) size 25x10 [border: (3px solid #007F0080) none (3px solid #007F0080)] [r=0 c=0 rs=1 cs=1]
               LayoutTableCell {TD} at (0,70) size 25x6 [border: none (2px solid #FF0000) none] [r=0 c=1 rs=1 cs=1]
               LayoutTableCell {TD} at (0,40) size 25x7 [border: (3px none #000000)] [r=0 c=2 rs=1 cs=1]
               LayoutTableCell {TD} at (0,11) size 25x6 [border: none] [r=0 c=3 rs=1 cs=1]
@@ -36,12 +36,12 @@
               LayoutTableCell {TD} at (25,11) size 25x6 [border: none] [r=1 c=3 rs=1 cs=1]
         LayoutTable {TABLE} at (103,3) size 50x27
           LayoutTableSection {TBODY} at (0,0) size 50x27
-            LayoutTableRow {TR} at (0,0) size 25x27 [border: none (5px solid #007F007F)]
+            LayoutTableRow {TR} at (0,0) size 25x27 [border: none (5px solid #007F0080)]
               LayoutTableCell {TD} at (0,10) size 25x7 [border: none] [r=0 c=0 rs=1 cs=1]
             LayoutTableRow {TR} at (25,0) size 25x27 [border: none (5px solid #FF0000) none]
               LayoutTableCell {TD} at (25,10) size 25x6 [border: none] [r=1 c=0 rs=1 cs=1]
         LayoutTable {TABLE} at (153,3) size 50x27
-          LayoutTableSection {TBODY} at (0,0) size 25x27 [border: none (5px solid #007F007F)]
+          LayoutTableSection {TBODY} at (0,0) size 25x27 [border: none (5px solid #007F0080)]
             LayoutTableRow {TR} at (0,0) size 25x27
               LayoutTableCell {TD} at (0,10) size 25x7 [border: none] [r=0 c=0 rs=1 cs=1]
           LayoutTableSection {TBODY} at (25,0) size 25x27 [border: none (5px solid #FF0000) none]
@@ -50,11 +50,11 @@
       LayoutBlockFlow {DIV} at (0,206) size 206x206 [border: (3px solid #000000)]
         LayoutTable {TABLE} at (3,3) size 50x118
           LayoutTableCol {COLGROUP} at (0,0) size 0x0
-          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F007F) none]
+          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #007F0080) none]
           LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: (5px solid #FF0000) none]
           LayoutTableSection {TBODY} at (0,0) size 50x118
             LayoutTableRow {TR} at (0,0) size 25x118
-              LayoutTableCell {TD} at (0,10) size 25x8 [border: none (2px solid #007F007F) none] [r=0 c=0 rs=1 cs=1]
+              LayoutTableCell {TD} at (0,10) size 25x8 [border: none (2px solid #007F0080) none] [r=0 c=0 rs=1 cs=1]
               LayoutTableCell {TD} at (0,40) size 25x7 [border: (3px solid #FF0000) none] [r=0 c=1 rs=1 cs=1]
               LayoutTableCell {TD} at (0,70) size 25x6 [border: none] [r=0 c=2 rs=1 cs=1]
               LayoutTableCell {TD} at (0,99) size 25x7 [border: (3px none #000000)] [r=0 c=3 rs=1 cs=1]
@@ -65,11 +65,11 @@
               LayoutTableCell {TD} at (25,99) size 25x7 [border: (3px none #000000)] [r=1 c=3 rs=1 cs=1]
         LayoutTable {TABLE} at (53,3) size 50x118
           LayoutTableCol {COLGROUP} at (0,0) size 0x0
-          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: (5px solid #007F007F) none]
+          LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: (5px solid #007F0080) none]
           LayoutTableCol {COLGROUP} at (0,0) size 0x0 [border: none (5px solid #FF0000) none]
           LayoutTableSection {TBODY} at (0,0) size 50x118
             LayoutTableRow {TR} at (0,0) size 25x118
-              LayoutTableCell {TD} at (0,98) size 25x9 [border: (3px solid #007F007F) none] [r=0 c=0 rs=1 cs=1]
+              LayoutTableCell {TD} at (0,98) size 25x9 [border: (3px solid #007F0080) none] [r=0 c=0 rs=1 cs=1]
               LayoutTableCell {TD} at (0,70) size 25x6 [border: none (2px solid #FF0000) none] [r=0 c=1 rs=1 cs=1]
               LayoutTableCell {TD} at (0,40) size 25x7 [border: (3px none #000000)] [r=0 c=2 rs=1 cs=1]
               LayoutTableCell {TD} at (0,11) size 25x6 [border: none] [r=0 c=3 rs=1 cs=1]
@@ -80,12 +80,12 @@
               LayoutTableCell {TD} at (25,11) size 25x6 [border: none] [r=1 c=3 rs=1 cs=1]
         LayoutTable {TABLE} at (103,3) size 50x27
           LayoutTableSection {TBODY} at (0,0) size 50x27
-            LayoutTableRow {TR} at (0,0) size 25x27 [border: none (5px solid #007F007F) none]
+            LayoutTableRow {TR} at (0,0) size 25x27 [border: none (5px solid #007F0080) none]
               LayoutTableCell {TD} at (0,10) size 25x6 [border: none] [r=0 c=0 rs=1 cs=1]
             LayoutTableRow {TR} at (25,0) size 25x27 [border: none (5px solid #FF0000)]
               LayoutTableCell {TD} at (25,10) size 25x7 [border: none] [r=1 c=0 rs=1 cs=1]
         LayoutTable {TABLE} at (153,3) size 50x27
-          LayoutTableSection {TBODY} at (0,0) size 25x27 [border: none (5px solid #007F007F) none]
+          LayoutTableSection {TBODY} at (0,0) size 25x27 [border: none (5px solid #007F0080) none]
             LayoutTableRow {TR} at (0,0) size 25x27
               LayoutTableCell {TD} at (0,10) size 25x6 [border: none] [r=0 c=0 rs=1 cs=1]
           LayoutTableSection {TBODY} at (25,0) size 25x27 [border: none (5px solid #FF0000)]
diff --git a/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.png b/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.png
index d728958..595de96 100644
--- a/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.txt
index d3391cada..3cdd7a9 100644
--- a/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/table/row-box-shadow-expected.txt
@@ -6,11 +6,11 @@
       LayoutTable {TABLE} at (0,0) size 234x346
         LayoutTableSection {TBODY} at (0,0) size 234x346
           LayoutTableRow {TR} at (0,10) size 234x102 [bgcolor=#0000FF]
-            LayoutTableCell {TD} at (10,60) size 102x2 [bgcolor=#FF00007F] [r=0 c=0 rs=1 cs=1]
-            LayoutTableCell {TD} at (122,60) size 102x2 [bgcolor=#FF00007F] [r=0 c=1 rs=1 cs=1]
+            LayoutTableCell {TD} at (10,60) size 102x2 [bgcolor=#FF000080] [r=0 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (122,60) size 102x2 [bgcolor=#FF000080] [r=0 c=1 rs=1 cs=1]
           LayoutTableRow {TR} at (0,122) size 234x102 [bgcolor=#0000FF]
-            LayoutTableCell {TD} at (10,172) size 102x2 [bgcolor=#FF00007F] [r=1 c=0 rs=1 cs=1]
-            LayoutTableCell {TD} at (122,172) size 102x2 [bgcolor=#FF00007F] [r=1 c=1 rs=1 cs=1]
+            LayoutTableCell {TD} at (10,172) size 102x2 [bgcolor=#FF000080] [r=1 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (122,172) size 102x2 [bgcolor=#FF000080] [r=1 c=1 rs=1 cs=1]
           LayoutTableRow {TR} at (0,234) size 234x102 [bgcolor=#0000FF]
-            LayoutTableCell {TD} at (10,284) size 102x2 [bgcolor=#FF00007F] [r=2 c=0 rs=1 cs=1]
-            LayoutTableCell {TD} at (122,284) size 102x2 [bgcolor=#FF00007F] [r=2 c=1 rs=1 cs=1]
+            LayoutTableCell {TD} at (10,284) size 102x2 [bgcolor=#FF000080] [r=2 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (122,284) size 102x2 [bgcolor=#FF000080] [r=2 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.png b/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.png
index ae8da0d7..e0ffccc 100644
--- a/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.txt
index 5be9874c..9c9a7d7 100644
--- a/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/table/section-box-shadow-expected.txt
@@ -5,16 +5,16 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x458
       LayoutTable {TABLE} at (0,0) size 234x458
         LayoutTableSection {THEAD} at (0,0) size 234x234 [bgcolor=#0000FF]
-          LayoutTableRow {TR} at (0,10) size 234x102 [bgcolor=#FF00007F]
+          LayoutTableRow {TR} at (0,10) size 234x102 [bgcolor=#FF000080]
             LayoutTableCell {TD} at (10,60) size 102x2 [r=0 c=0 rs=1 cs=1]
             LayoutTableCell {TD} at (122,60) size 102x2 [r=0 c=1 rs=1 cs=1]
-          LayoutTableRow {TR} at (0,122) size 234x102 [bgcolor=#FF00007F]
+          LayoutTableRow {TR} at (0,122) size 234x102 [bgcolor=#FF000080]
             LayoutTableCell {TD} at (10,172) size 102x2 [r=1 c=0 rs=1 cs=1]
             LayoutTableCell {TD} at (122,172) size 102x2 [r=1 c=1 rs=1 cs=1]
         LayoutTableSection {TBODY} at (0,234) size 234x224 [bgcolor=#0000FF]
-          LayoutTableRow {TR} at (0,0) size 234x102 [bgcolor=#FF00007F]
+          LayoutTableRow {TR} at (0,0) size 234x102 [bgcolor=#FF000080]
             LayoutTableCell {TD} at (10,50) size 102x2 [r=0 c=0 rs=1 cs=1]
             LayoutTableCell {TD} at (122,50) size 102x2 [r=0 c=1 rs=1 cs=1]
-          LayoutTableRow {TR} at (0,112) size 234x102 [bgcolor=#FF00007F]
+          LayoutTableRow {TR} at (0,112) size 234x102 [bgcolor=#FF000080]
             LayoutTableCell {TD} at (10,162) size 102x2 [r=1 c=0 rs=1 cs=1]
             LayoutTableCell {TD} at (122,162) size 102x2 [r=1 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.png b/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.png
index d728958..595de96 100644
--- a/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.txt
index ac3043a8..a5826eec 100644
--- a/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/table/self-painting-row-box-shadow-expected.txt
@@ -7,13 +7,13 @@
         LayoutTableSection {TBODY} at (0,0) size 234x346
 layer at (8,18) size 234x102
   LayoutTableRow {TR} at (0,10) size 234x102 [bgcolor=#0000FF]
-    LayoutTableCell {TD} at (10,60) size 102x2 [bgcolor=#FF00007F] [r=0 c=0 rs=1 cs=1]
-    LayoutTableCell {TD} at (122,60) size 102x2 [bgcolor=#FF00007F] [r=0 c=1 rs=1 cs=1]
+    LayoutTableCell {TD} at (10,60) size 102x2 [bgcolor=#FF000080] [r=0 c=0 rs=1 cs=1]
+    LayoutTableCell {TD} at (122,60) size 102x2 [bgcolor=#FF000080] [r=0 c=1 rs=1 cs=1]
 layer at (8,130) size 234x102
   LayoutTableRow {TR} at (0,122) size 234x102 [bgcolor=#0000FF]
-    LayoutTableCell {TD} at (10,172) size 102x2 [bgcolor=#FF00007F] [r=1 c=0 rs=1 cs=1]
-    LayoutTableCell {TD} at (122,172) size 102x2 [bgcolor=#FF00007F] [r=1 c=1 rs=1 cs=1]
+    LayoutTableCell {TD} at (10,172) size 102x2 [bgcolor=#FF000080] [r=1 c=0 rs=1 cs=1]
+    LayoutTableCell {TD} at (122,172) size 102x2 [bgcolor=#FF000080] [r=1 c=1 rs=1 cs=1]
 layer at (8,242) size 234x102
   LayoutTableRow {TR} at (0,234) size 234x102 [bgcolor=#0000FF]
-    LayoutTableCell {TD} at (10,284) size 102x2 [bgcolor=#FF00007F] [r=2 c=0 rs=1 cs=1]
-    LayoutTableCell {TD} at (122,284) size 102x2 [bgcolor=#FF00007F] [r=2 c=1 rs=1 cs=1]
+    LayoutTableCell {TD} at (10,284) size 102x2 [bgcolor=#FF000080] [r=2 c=0 rs=1 cs=1]
+    LayoutTableCell {TD} at (122,284) size 102x2 [bgcolor=#FF000080] [r=2 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images-expected.png b/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images-expected.png
index 766fbf7d..55606014 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images-expected.png
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/network/waterfall-images-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-background-colors-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-background-colors-expected.txt
index 83cd3146..93abefe1 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-background-colors-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/css/css-get-background-colors-expected.txt
@@ -42,11 +42,11 @@
 
 Running test: testOneSemitransparentBgColor
 Semi-transparent background color: should be light red
-{"backgroundColors":["rgb(255, 128, 128)"]}
+{"backgroundColors":["rgb(255, 127, 127)"]}
 
 Running test: testTwoSemitransparentBgColors
 Two layered semi-transparent background colors: should be medium red
-{"backgroundColors":["rgb(255, 64, 64)"]}
+{"backgroundColors":["rgb(255, 63, 63)"]}
 
 Running test: testOpaqueGradientBackground
 Opaque gradient: should be red and black
@@ -54,7 +54,7 @@
 
 Running test: testOpaqueGradientBackgroundBehindScrim
 Opaque gradient behind semi-transparent color: should be light red and 50% grey
-{"backgroundColors":["rgb(255, 127, 127)","rgb(127, 127, 127)"]}
+{"backgroundColors":["rgb(255, 128, 128)","rgb(128, 128, 128)"]}
 
 Running test: testOpaqueGradientBackgroundWithColorBackground
 Opaque gradient and solid color background on same element: should be red and black
@@ -62,11 +62,11 @@
 
 Running test: testPartiallyTransparentGradientBackground
 Semi-transparent gradient: should be light red and 50% grey
-{"backgroundColors":["rgb(255, 128, 128)","rgb(128, 128, 128)"]}
+{"backgroundColors":["rgb(255, 127, 127)","rgb(127, 127, 127)"]}
 
 Running test: testPartiallyTransparentGradientAndColorBackground
 Semi-transparent gradient and solid color on same element: should be dark red and 50% grey
-{"backgroundColors":["rgb(127, 0, 0)","rgb(127, 127, 127)"]}
+{"backgroundColors":["rgb(128, 0, 0)","rgb(128, 128, 128)"]}
 
 Running test: testTwoPartiallyTransparentGradientBackgrounds
 Layered semi-transparent gradients: should be empty array
@@ -94,7 +94,7 @@
 
 Running test: testBackgroundImageBehindScrim
 Background image behind scrim: should be semi-transparent white
-{"backgroundColors":["rgba(255, 255, 255, 0.498039)"]}
+{"backgroundColors":["rgba(255, 255, 255, 0.5)"]}
 
 Running test: testForegroundImage
 Image behind text: should be empty array
@@ -102,7 +102,7 @@
 
 Running test: testForegroundImageBehindScrim
 Image behind scrim: should be semi-transparent white
-{"backgroundColors":["rgba(255, 255, 255, 0.498039)"]}
+{"backgroundColors":["rgba(255, 255, 255, 0.5)"]}
 
 Running test: testForegroundCanvas
 Canvas behind text: should be empty array
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions-expected.txt b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions-expected.txt
index caceac4b..25022c43 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions-expected.txt
@@ -71,18 +71,39 @@
 Checking 'shou'
 Not Found: should not find this
 
+Checking 'myMap.get('
+Found: "first")
+Found: "second")
+Found: "third")
+
+Checking 'myMap.get(''
+Found: 'first')
+Found: 'second')
+Found: 'third')
+
+Checking 'myMap.set('firs'
+Found: 'first', 
+
+Checking 'myMap.set(should'
+Found: shouldFindThisFunction
+Not Found: shouldNotFindThis
+Not Found: "shouldNotFindThis")
+
+Checking 'myMap.delete(''
+Found: 'first')
+Found: 'second')
+Found: 'third')
+
 Checking 'document.   bo'
 Found: body
 
 Checking 'document.	bo'
 Found: body
 
-Checking 'document.
-bo'
+Checking 'document.\nbo'
 Found: body
 
-Checking 'document.
-bo'
+Checking 'document.\r\nbo'
 Found: body
 
 Checking 'document   [    'bo'
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
index 2dd77ca2..20ee94f 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-correct-suggestions.html
@@ -12,9 +12,11 @@
 }
 
 function shouldNotFindThisFunction() { }
-
+function shouldFindThisFunction() { }
 window["should not find this"] = true;
 
+var myMap = new Map([['first', 1], ['second', 2], ['third', 3], ['shouldNotFindThis', 4]]);
+
 function test()
 {
     var consoleEditor;
@@ -31,7 +33,7 @@
         function checkExpected(suggestions)
         {
             var completions = new Set(suggestions.map(suggestion => suggestion.title));
-            var message = "Checking '" + text + "'";
+            var message = "Checking '" + text.replace('\n', '\\n').replace('\r', '\\r') + "'";
             if (force)
                 message += " forcefully";
             InspectorTest.addResult(message);
@@ -72,6 +74,11 @@
         () => testCompletions("// do", ["document"], false),
         () => testCompletions('["should', ["shouldNotFindThisFunction"]),
         () => testCompletions("shou", ["should not find this"]),
+        () => testCompletions('myMap.get(', ['"first")', '"second")', '"third")']),
+        () => testCompletions('myMap.get(\'', ['\'first\')', '\'second\')', '\'third\')']),
+        () => testCompletions('myMap.set(\'firs', ['\'first\', ']),
+        () => testCompletions('myMap.set(should', ['shouldFindThisFunction', 'shouldNotFindThis', '\"shouldNotFindThis\")']),
+        () => testCompletions('myMap.delete(\'', ['\'first\')', '\'second\')', '\'third\')']),
         () => testCompletions("document.   bo", ["body"]),
         () => testCompletions("document.\tbo", ["body"]),
         () => testCompletions("document.\nbo", ["body"]),
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html b/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html
index bfb2840..1b60eda 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-dir-global.html
@@ -23,7 +23,7 @@
         if (result.type === "error")
             testController.notifyDone("Exception:" + result);
         var objectProxy = InspectorTest.runtimeModel.createRemoteObject(result);
-        objectProxy.getOwnProperties(getPropertiesCallback);
+        objectProxy.getOwnProperties(false, getPropertiesCallback);
     }
 
     function getPropertiesCallback(properties)
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-format-es6-expected.txt b/third_party/WebKit/LayoutTests/inspector/console/console-format-es6-expected.txt
index 4ccddf85..e666283 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-format-es6-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-format-es6-expected.txt
@@ -74,10 +74,10 @@
 console-format-es6.html:12 [Set(1)]
 globals[11]
 Set(1) {WeakSet {…}}
-console-format-es6.html:11 Map(5) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, Object {foo: "from"} => Object {foo: "to"}}
-console-format-es6.html:12 [Map(5)]
+console-format-es6.html:11 Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, Object {foo: "from"} => Object {foo: "to"}…}
+console-format-es6.html:12 [Map(6)]
 globals[12]
-Map(5) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, Object {foo: "from"} => Object {foo: "to"}}
+Map(6) {" from str " => " to str ", undefined => undefined, null => null, 42 => 42, Object {foo: "from"} => Object {foo: "to"}…}
 Expanded all messages
 console-format-es6.html:11 Promise
     __proto__: Promise
@@ -255,29 +255,31 @@
     [[Entries]]: Array(1)
         0: WeakSet
         length: 1
-console-format-es6.html:11 Map(5)
+console-format-es6.html:11 Map(6)
     size: (...)
     __proto__: Map
-    [[Entries]]: Array(5)
+    [[Entries]]: Array(6)
         0: {" from str " => " to str "}
         1: {undefined => undefined}
         2: {null => null}
         3: {42 => 42}
         4: {Object => Object}
-        length: 5
+        5: {Array(1) => Array(1)}
+        length: 6
 console-format-es6.html:12 Array(1)
-    0: Map(5)
+    0: Map(6)
     length: 1
     __proto__: Array(0)
 globals[12]
-Map(5)
+Map(6)
     size: (...)
     __proto__: Map
-    [[Entries]]: Array(5)
+    [[Entries]]: Array(6)
         0: {" from str " => " to str "}
         1: {undefined => undefined}
         2: {null => null}
         3: {42 => 42}
         4: {Object => Object}
-        length: 5
+        5: {Array(1) => Array(1)}
+        length: 6
 
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-format-es6.html b/third_party/WebKit/LayoutTests/inspector/console/console-format-es6.html
index 6173369..64437fd 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-format-es6.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-format-es6.html
@@ -48,6 +48,7 @@
     bigmap.set(null, null);
     bigmap.set(42, 42);
     bigmap.set({foo:"from"}, {foo:"to"});
+    bigmap.set(["from"], ["to"]);
 
     var p = Promise.reject(-0);
     p.catch(function() {});
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt b/third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt
index 52ae781..2374586c 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt
@@ -1,13 +1,13 @@
-CONSOLE MESSAGE: line 26: test,test2,,,test4,,,,,
-CONSOLE MESSAGE: line 27: %o
-CONSOLE MESSAGE: line 28: %O
-CONSOLE MESSAGE: line 29: Test for zero "%f" in formatter
-CONSOLE MESSAGE: line 30: %% self-escape1
-CONSOLE MESSAGE: line 31: %%s self-escape2
-CONSOLE MESSAGE: line 32: %%ss self-escape3
-CONSOLE MESSAGE: line 33: %%s%s%%s self-escape4
-CONSOLE MESSAGE: line 34: %%%%% self-escape5
-CONSOLE MESSAGE: line 35: %%%s self-escape6
+CONSOLE MESSAGE: line 27: test,test2,,,test4,,,,,
+CONSOLE MESSAGE: line 28: %o
+CONSOLE MESSAGE: line 29: %O
+CONSOLE MESSAGE: line 30: Test for zero "%f" in formatter
+CONSOLE MESSAGE: line 31: %% self-escape1
+CONSOLE MESSAGE: line 32: %%s self-escape2
+CONSOLE MESSAGE: line 33: %%ss self-escape3
+CONSOLE MESSAGE: line 34: %%s%s%%s self-escape4
+CONSOLE MESSAGE: line 35: %%%%% self-escape5
+CONSOLE MESSAGE: line 36: %%%s self-escape6
 CONSOLE MESSAGE: line 12: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
 CONSOLE MESSAGE: line 13: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
 CONSOLE MESSAGE: line 12: /foo\\bar\sbaz/i
@@ -94,22 +94,26 @@
 CONSOLE MESSAGE: line 13: [object Uint8Array]
 CONSOLE MESSAGE: line 12: [object Uint8Array]
 CONSOLE MESSAGE: line 13: [object Uint8Array]
+CONSOLE MESSAGE: line 12: [object Uint8Array]
+CONSOLE MESSAGE: line 13: [object Uint8Array]
 CONSOLE MESSAGE: line 12: [object Object]
 CONSOLE MESSAGE: line 13: [object Object]
 CONSOLE MESSAGE: line 12: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
 CONSOLE MESSAGE: line 13: 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+CONSOLE MESSAGE: line 12: test
+CONSOLE MESSAGE: line 13: test
 Tests that console logging dumps proper messages.
 
- console-format.html:21 Array(10)
-console-format.html:22 Array(10)
+ console-format.html:22 Array(10)
 console-format.html:23 Array(10)
-console-format.html:24 Test for zero "0" in formatter
-console-format.html:25 % self-escape1 dummy
-console-format.html:26 %s self-escape2 dummy
-console-format.html:27 %ss self-escape3 dummy
-console-format.html:28 %sdummy%s self-escape4
-console-format.html:29 %%% self-escape5 dummy
-console-format.html:30 %dummy self-escape6
+console-format.html:24 Array(10)
+console-format.html:25 Test for zero "0" in formatter
+console-format.html:26 % self-escape1 dummy
+console-format.html:27 %s self-escape2 dummy
+console-format.html:28 %ss self-escape3 dummy
+console-format.html:29 %sdummy%s self-escape4
+console-format.html:30 %%% self-escape5 dummy
+console-format.html:31 %dummy self-escape6
 console-format.html:7 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
 console-format.html:8 [/^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\…?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i]
 globals[0]
@@ -275,30 +279,31 @@
 console-format.html:8 [DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of th…]
 globals[36]
 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
+console-format.html:7 Uint8Array(1) [3]
+console-format.html:8 [Uint8Array(1)]
+globals[37]
+Uint8Array(1) [3]
 console-format.html:7 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…]
 console-format.html:8 [Uint8Array(400)]
-globals[37]
+globals[38]
 Uint8Array(400) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…]
 console-format.html:7 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…]
 console-format.html:8 [Uint8Array(400000000)]
-globals[38]
+globals[39]
 Uint8Array(400000000) [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0…]
 console-format.html:7 namespace.longSubNamespace.x.className {}
 console-format.html:8 [n…e.l…e.x.className]
-globals[39]
+globals[40]
 namespace.longSubNamespace.x.className {}
 console-format.html:7 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…]
 console-format.html:8 [Array(200)]
-globals[40]
+globals[41]
 [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1…]
+console-format.html:7 ["test"]
+console-format.html:8 [Array(1)]
+globals[42]
+["test"]
 Expanded all messages
-console-format.html:21 Array(10)
-    0: "test"
-    1: "test2"
-    4: "test4"
-    foo: Object
-    length: 10
-    __proto__: Array(0)
 console-format.html:22 Array(10)
     0: "test"
     1: "test2"
@@ -313,13 +318,20 @@
     foo: Object
     length: 10
     __proto__: Array(0)
-console-format.html:24 Test for zero "0" in formatter
-console-format.html:25 % self-escape1 dummy
-console-format.html:26 %s self-escape2 dummy
-console-format.html:27 %ss self-escape3 dummy
-console-format.html:28 %sdummy%s self-escape4
-console-format.html:29 %%% self-escape5 dummy
-console-format.html:30 %dummy self-escape6
+console-format.html:24 Array(10)
+    0: "test"
+    1: "test2"
+    4: "test4"
+    foo: Object
+    length: 10
+    __proto__: Array(0)
+console-format.html:25 Test for zero "0" in formatter
+console-format.html:26 % self-escape1 dummy
+console-format.html:27 %s self-escape2 dummy
+console-format.html:28 %ss self-escape3 dummy
+console-format.html:29 %sdummy%s self-escape4
+console-format.html:30 %%% self-escape5 dummy
+console-format.html:31 %dummy self-escape6
 console-format.html:7 /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
 console-format.html:8 Array(1)
     0: /^url\(\s*(?:(?:"(?:[^\\\"]|(?:\\[\da-f]{1,6}\s?|\.))*"|'(?:[^\\\']|(?:\\[\da-f]{1,6}\s?|\.))*')|(?:[!#$%&*-~\w]|(?:\\[\da-f]{1,6}\s?|\.))*)\s*\)/i
@@ -703,6 +715,27 @@
     __proto__: Array(0)
 globals[36]
 DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
+console-format.html:7 Uint8Array(1)
+    0: 3
+    buffer: (...)
+    byteLength: (...)
+    byteOffset: (...)
+    length: (...)
+    Symbol(Symbol.toStringTag): (...)
+    __proto__: TypedArray
+console-format.html:8 Array(1)
+    0: Uint8Array(1)
+    length: 1
+    __proto__: Array(0)
+globals[37]
+Uint8Array(1)
+    0: 3
+    buffer: (...)
+    byteLength: (...)
+    byteOffset: (...)
+    length: (...)
+    Symbol(Symbol.toStringTag): (...)
+    __proto__: TypedArray
 console-format.html:7 Uint8Array(400)
     [0 … 99]
     [100 … 199]
@@ -714,7 +747,7 @@
     0: Uint8Array(400)
     length: 1
     __proto__: Array(0)
-globals[37]
+globals[38]
 Uint8Array(400)
     [0 … 99]
     [100 … 199]
@@ -732,7 +765,7 @@
     0: Uint8Array(400000000)
     length: 1
     __proto__: Array(0)
-globals[38]
+globals[39]
 Uint8Array(400000000)
     [0 … 99999999]
     [100000000 … 199999999]
@@ -745,7 +778,7 @@
     0: namespace.longSubNamespace.x.className
     length: 1
     __proto__: Array(0)
-globals[39]
+globals[40]
 namespace.longSubNamespace.x.className
     __proto__: Object
 console-format.html:7 Array(200)
@@ -757,10 +790,23 @@
     0: Array(200)
     length: 1
     __proto__: Array(0)
-globals[40]
+globals[41]
 Array(200)
     [0 … 99]
     [100 … 199]
     length: 200
     __proto__: Array(0)
+console-format.html:7 Array(1)
+    0: "test"
+    length: 1
+    __proto__: Array(0)
+console-format.html:8 Array(1)
+    0: Array(1)
+    length: 1
+    __proto__: Array(0)
+globals[42]
+Array(1)
+    0: "test"
+    length: 1
+    __proto__: Array(0)
 
diff --git a/third_party/WebKit/LayoutTests/inspector/console/console-format.html b/third_party/WebKit/LayoutTests/inspector/console/console-format.html
index e29edf2e..d02f2c85 100644
--- a/third_party/WebKit/LayoutTests/inspector/console/console-format.html
+++ b/third_party/WebKit/LayoutTests/inspector/console/console-format.html
@@ -18,6 +18,7 @@
     var foo = { foo: "foo"};
     var bar = { bar: "bar" };
     bar.__proto__ = foo;
+    var singleArray = ["test"];
     var array = ["test", "test2"]; array.length = 10;
     array.foo = {};
     array[4] = "test4";
@@ -67,6 +68,7 @@
     var arrayLikeFunction = function( /**/ foo/**/, /*/**/bar,
     /**/baz) {};
     arrayLikeFunction.splice = function() {};
+    var tinyTypedArray = new Uint8Array([3]);
     var smallTypedArray = new Uint8Array(new ArrayBuffer(400));
     smallTypedArray["foo"] = "bar";
     var bigTypedArray = new Uint8Array(new ArrayBuffer(400 * 1000 * 1000));
@@ -85,7 +87,7 @@
         NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [function() {}], bar, svg,
         objectWithNonEnumerables, negZero, Object.create(null), Object, Object.prototype, arrayLikeFunction,
         new Number(42), new String("abc"), new Uint16Array([1, 2, 3]), textNode, domException(),
-        smallTypedArray, bigTypedArray, instanceWithLongClassName, bigArray
+        tinyTypedArray, smallTypedArray, bigTypedArray, instanceWithLongClassName, bigArray, singleArray
     ];
 
     runTest();
diff --git a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html
index 8ed0593..79d56ab0 100644
--- a/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html
+++ b/third_party/WebKit/LayoutTests/inspector/profiler/heap-snapshot-inspect-dom-wrapper.html
@@ -69,7 +69,7 @@
             InspectorTest.addResult("PASS: got at least one HTMLBodyElement wrapper");
 
             for (var i = 0; i < remoteObjects.length; i++)
-                remoteObjects[i].getOwnProperties(didGetOwnProperties);
+                remoteObjects[i].getOwnProperties(false, didGetOwnProperties);
         }
 
         var didGetOwnPropertiesCount = 0;
diff --git a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-getProperties.html b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-getProperties.html
index 390af85..52b6edc 100644
--- a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-getProperties.html
+++ b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-getProperties.html
@@ -42,12 +42,12 @@
 
         function testGetterAndSetter(next)
         {
-            obj1.getOwnProperties(dumpProperties.bind(this, next));
+            obj1.getOwnProperties(false, dumpProperties.bind(this, next));
         },
 
         function testGetterOnly(next)
         {
-            obj2.getOwnProperties(dumpProperties.bind(this, next));
+            obj2.getOwnProperties(false, dumpProperties.bind(this, next));
         }
     ]);
 
diff --git a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-localStorage-getProperties.html b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-localStorage-getProperties.html
index fe69b1be..b652171 100644
--- a/third_party/WebKit/LayoutTests/inspector/runtime/runtime-localStorage-getProperties.html
+++ b/third_party/WebKit/LayoutTests/inspector/runtime/runtime-localStorage-getProperties.html
@@ -12,7 +12,7 @@
     function step1(error, result, exceptionDetails)
     {
         var localStorageHandle = InspectorTest.runtimeModel.createRemoteObject(result);
-        localStorageHandle.getOwnProperties(step2);
+        localStorageHandle.getOwnProperties(false, step2);
     }
 
     function step2(properties)
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile-expected.txt b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile-expected.txt
index 6d5667c2..b35172c 100644
--- a/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/timeline-js/timeline-js-line-level-profile-expected.txt
@@ -1,10 +1,10 @@
 Tests that a line-level CPU profile is shown in the text editor.
 .../inspector/tracing/resources/timeline-data.js
-99 CodeMirror-gutter-performance 10.0 ms rgba(255, 187, 0, 0.262745)
-101 CodeMirror-gutter-performance 1900.0 ms rgba(255, 187, 0, 0.717647)
-0 CodeMirror-gutter-performance 100.0 ms rgba(255, 187, 0, 0.462745)
-1 CodeMirror-gutter-performance 200.0 ms rgba(255, 187, 0, 0.521569)
-2 CodeMirror-gutter-performance 300.0 ms rgba(255, 187, 0, 0.556863)
-3 CodeMirror-gutter-performance 400.0 ms rgba(255, 187, 0, 0.580392)
-54 CodeMirror-gutter-performance 220.0 ms rgba(255, 187, 0, 0.529412)
+99 CodeMirror-gutter-performance 10.0 ms rgba(255, 187, 0, 0.263)
+101 CodeMirror-gutter-performance 1900.0 ms rgba(255, 187, 0, 0.718)
+0 CodeMirror-gutter-performance 100.0 ms rgba(255, 187, 0, 0.463)
+1 CodeMirror-gutter-performance 200.0 ms rgba(255, 187, 0, 0.52)
+2 CodeMirror-gutter-performance 300.0 ms rgba(255, 187, 0, 0.557)
+3 CodeMirror-gutter-performance 400.0 ms rgba(255, 187, 0, 0.58)
+54 CodeMirror-gutter-performance 220.0 ms rgba(255, 187, 0, 0.53)
 
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/composited-overflow-with-borderbox-background-expected.png b/third_party/WebKit/LayoutTests/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
index f015a70..ac8c39eb 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png
index 8944bace..a3b305b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png
index 8b126a3..0486cac 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png
index f6893a32..40a1fd92 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.png
index d10343b..41f5e1a3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.txt
index eff1c6c..0b6a7c2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/images/direct-image-background-color-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x564
-      LayoutImage {IMG} at (20,0) size 280x200 [bgcolor=#0000807F]
+      LayoutImage {IMG} at (20,0) size 280x200 [bgcolor=#00008080]
       LayoutBlockFlow {P} at (0,440) size 784x20
         LayoutText {#text} at (0,0) size 232x19
           text run at (0,0) width 232: "Top and bottom should look the same."
 layer at (28,240) size 280x200
-  LayoutImage {IMG} at (20,220) size 280x200 [bgcolor=#0000807F]
+  LayoutImage {IMG} at (20,220) size 280x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
index 5d65525..12c871cc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
index c0e8bab..d6a82ec 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/shadows/shadow-drawing-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/shadows/shadow-drawing-expected.png
index 1b746c7..3fe242a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/shadows/shadow-drawing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/shadows/shadow-drawing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.png
index 9c9f5c1..7c4a008 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.txt
index e9c96fb..514b71b6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/webgl/webgl-background-color-expected.txt
@@ -3,11 +3,11 @@
 layer at (0,0) size 800x537
   LayoutBlockFlow {HTML} at (0,0) size 800x537
     LayoutBlockFlow {BODY} at (8,20) size 784x501
-      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#0000807F]
+      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#00008080]
       LayoutBlockFlow (anonymous) at (0,220) size 784x245
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,481) size 784x20
         LayoutText {#text} at (0,0) size 232x19
           text run at (0,0) width 232: "Top and bottom should look the same."
 layer at (28,260) size 240x200
-  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#0000807F]
+  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.png
index 66f9c36f..3ebfacf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.txt
index 8ff4ac36..d5bf741 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-expected.txt
@@ -16,16 +16,16 @@
         LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#000000] [border: (20px solid #FFFFFF) (20px double #FFFFFF) (20px solid #FFFFFF)]
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {DIV} at (0,129) size 784x129 [bgcolor=#808080]
-        LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+        LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
         LayoutText {#text} at (132,107) size 4x19
           text run at (132,107) width 4: " "
-        LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+        LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
         LayoutText {#text} at (266,107) size 4x19
           text run at (266,107) width 4: " "
         LayoutBlockFlow {DIV} at (280,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px groove #808080)]
         LayoutText {#text} at (400,107) size 4x19
           text run at (400,107) width 4: " "
-        LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F) (20px double #0000FF7F) (20px solid #0000FF7F)]
+        LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80) (20px double #0000FF80) (20px solid #0000FF80)]
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {DIV} at (0,258) size 784x129
         LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#000000] [border: (20px solid #FFFFFF)]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.png
index fef606d3..d598b404 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.txt
index 8a78c03..630387fe 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/backgrounds/background-leakage-transforms-expected.txt
@@ -13,10 +13,10 @@
         LayoutText {#text} at (288,117) size 4x19
           text run at (288,117) width 4: " "
         LayoutBlockFlow {DIV} at (302,10) size 268x129 [bgcolor=#808080]
-          LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+          LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
           LayoutText {#text} at (132,107) size 4x19
             text run at (132,107) width 4: " "
-          LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+          LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
           LayoutText {#text} at (0,0) size 0x0
         LayoutText {#text} at (0,0) size 0x0
 layer at (8,157) size 769x149
@@ -30,10 +30,10 @@
     LayoutText {#text} at (288,117) size 4x19
       text run at (288,117) width 4: " "
     LayoutBlockFlow {DIV} at (302,10) size 268x129 [bgcolor=#808080]
-      LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
       LayoutText {#text} at (132,107) size 4x19
         text run at (132,107) width 4: " "
-      LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+      LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
       LayoutText {#text} at (0,0) size 0x0
     LayoutText {#text} at (0,0) size 0x0
 layer at (8,306) size 159x540 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
@@ -47,9 +47,9 @@
     LayoutText {#text} at (12,268) size 19x4
       text run at (12,268) width 4: " "
     LayoutBlockFlow {DIV} at (10,282) size 139x248 [bgcolor=#808080]
-      LayoutBlockFlow {DIV} at (16,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (16,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
       LayoutText {#text} at (2,122) size 19x4
         text run at (2,122) width 4: " "
-      LayoutBlockFlow {DIV} at (16,136) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+      LayoutBlockFlow {DIV} at (16,136) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
       LayoutText {#text} at (0,0) size 0x0
     LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.png
index bd41080..97c13211e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.txt
index e2a154b..56e5a716 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/block/float/intruding-painted-twice-expected.txt
@@ -19,10 +19,10 @@
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 342x19
           text run at (0,0) width 342: "These two lines of text should be the same shade of gray:"
-      LayoutBlockFlow {DIV} at (0,92) size 784x28 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,92) size 784x28 [color=#00000080]
         LayoutText {#text} at (0,0) size 264x27
           text run at (0,0) width 264: "Lorem ipsum dolor sit amet"
-      LayoutBlockFlow {DIV} at (0,120) size 784x0 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,120) size 784x0 [color=#00000080]
         LayoutBlockFlow (floating) {DIV} at (0,0) size 264x28
           LayoutText {#text} at (0,0) size 264x27
             text run at (0,0) width 264: "Lorem ipsum dolor sit amet"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha-expected.png
index ca74ab2..4b9701ea 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha2-expected.png
index 23410a4d..3fe1f68f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/border-mixed-alpha2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.png
index 9c4d15d..944470e8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.txt
index d4a1faa..c1fb53a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-expected.txt
@@ -3,40 +3,40 @@
 layer at (0,0) size 800x541
   LayoutBlockFlow {HTML} at (0,0) size 800x541
     LayoutBlockFlow {BODY} at (8,8) size 784x525
-      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,155) size 4x19
         text run at (170,155) width 4: " "
-      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,155) size 4x19
         text run at (344,155) width 4: " "
-      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (518,155) size 4x19
         text run at (518,155) width 4: " "
-      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (692,155) size 4x19
         text run at (692,155) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,185) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,185) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (170,330) size 4x19
         text run at (170,330) width 4: " "
-      LayoutBlockFlow {DIV} at (184,185) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,185) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (344,330) size 4x19
         text run at (344,330) width 4: " "
-      LayoutBlockFlow {DIV} at (358,185) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,185) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (518,330) size 4x19
         text run at (518,330) width 4: " "
-      LayoutBlockFlow {DIV} at (532,185) size 150x150 [border: (50px solid #0000007F) none (50px groove #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,185) size 150x150 [border: (50px solid #00000080) none (50px groove #00000080) (50px solid #00000080)]
       LayoutText {#text} at (692,330) size 4x19
         text run at (692,330) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,360) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,360) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (170,505) size 4x19
         text run at (170,505) width 4: " "
-      LayoutBlockFlow {DIV} at (184,360) size 150x150 [border: (50px solid #0000007F) none (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,360) size 150x150 [border: (50px solid #00000080) none (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,505) size 4x19
         text run at (344,505) width 4: " "
-      LayoutBlockFlow {DIV} at (358,360) size 150x150 [border: (50px solid #0000007F) (50px solid #0080007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,360) size 150x150 [border: (50px solid #00000080) (50px solid #00800080) (50px solid #00000080)]
       LayoutText {#text} at (518,505) size 4x19
         text run at (518,505) width 4: " "
-      LayoutBlockFlow {DIV} at (532,360) size 150x150 [border: (50px solid #0000007F) (50px solid #0080007F) (50px solid #0000007F) (50px solid #0080007F)]
+      LayoutBlockFlow {DIV} at (532,360) size 150x150 [border: (50px solid #00000080) (50px solid #00800080) (50px solid #00000080) (50px solid #00800080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.png
index 58aae45..6290934 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.txt
index 819efa7..1494de8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius-expected.txt
@@ -3,40 +3,40 @@
 layer at (0,0) size 800x493
   LayoutBlockFlow {HTML} at (0,0) size 800x493
     LayoutBlockFlow {BODY} at (8,8) size 784x477
-      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,155) size 4x19
         text run at (170,155) width 4: " "
-      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (344,155) size 4x19
         text run at (344,155) width 4: " "
-      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (518,155) size 4x19
         text run at (518,155) width 4: " "
-      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (692,155) size 4x19
         text run at (692,155) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,185) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,185) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (170,330) size 4x19
         text run at (170,330) width 4: " "
-      LayoutBlockFlow {DIV} at (184,185) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,185) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (344,330) size 4x19
         text run at (344,330) width 4: " "
-      LayoutBlockFlow {DIV} at (358,185) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,185) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (518,330) size 4x19
         text run at (518,330) width 4: " "
-      LayoutBlockFlow {DIV} at (532,185) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,185) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (692,330) size 4x19
         text run at (692,330) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,360) size 150x102 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,360) size 150x102 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,457) size 4x19
         text run at (170,457) width 4: " "
-      LayoutBlockFlow {DIV} at (184,360) size 150x102 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,360) size 150x102 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,457) size 4x19
         text run at (344,457) width 4: " "
-      LayoutBlockFlow {DIV} at (358,360) size 150x102 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,360) size 150x102 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (518,457) size 4x19
         text run at (518,457) width 4: " "
-      LayoutBlockFlow {DIV} at (532,360) size 150x102 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,360) size 150x102 [border: (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.png
index e116fba..9ff4241 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.txt
index f57008c..ceb0709 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/mixed-border-styles-radius2-expected.txt
@@ -3,25 +3,25 @@
 layer at (0,0) size 800x406
   LayoutBlockFlow {HTML} at (0,0) size 800x406
     LayoutBlockFlow {BODY} at (8,8) size 784x390
-      LayoutBlockFlow {DIV} at (20,20) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (20,20) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (190,175) size 4x19
         text run at (190,175) width 4: " "
-      LayoutBlockFlow {DIV} at (214,20) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (214,20) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (384,175) size 4x19
         text run at (384,175) width 4: " "
-      LayoutBlockFlow {DIV} at (408,20) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (408,20) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (578,175) size 4x19
         text run at (578,175) width 4: " "
-      LayoutBlockFlow {DIV} at (602,20) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (602,20) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (20,215) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (20,215) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (190,370) size 4x19
         text run at (190,370) width 4: " "
-      LayoutBlockFlow {DIV} at (214,215) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (214,215) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (384,370) size 4x19
         text run at (384,370) width 4: " "
-      LayoutBlockFlow {DIV} at (408,215) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (408,215) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (578,370) size 4x19
         text run at (578,370) width 4: " "
-      LayoutBlockFlow {DIV} at (602,215) size 150x150 [border: (50px solid #0000007F) none (50px groove #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (602,215) size 150x150 [border: (50px solid #00000080) none (50px groove #00000080) (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-block-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-block-expected.png
index 005b37b..9c8ff8b0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-block-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-block-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-inline-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-inline-expected.png
index 3d335b4a..ab365f98 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/borders/outline-alpha-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/basic-shadows-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/basic-shadows-expected.png
index b1663c8..ac8dd09 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/basic-shadows-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/basic-shadows-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.png
index 4beed5fa..4a2386b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.txt
index b081174..d9d3472 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/box-shadow/inset-box-shadow-radius-expected.txt
@@ -20,18 +20,18 @@
         LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
 layer at (12,12) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (12,12) size 280x280 [border: (10px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (12,12) size 280x280 [border: (10px solid #00FF000D)]
 layer at (12,12) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (304,12) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (304,12) size 280x280 [border: (20px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (304,12) size 280x280 [border: (20px solid #00FF000D)]
 layer at (304,12) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (12,301) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (12,301) size 280x280 [border: (50px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (12,301) size 280x280 [border: (50px solid #00FF000D)]
 layer at (12,301) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (304,301) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (304,301) size 280x280 [border: (90px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (304,301) size 280x280 [border: (90px solid #00FF000D)]
 layer at (304,301) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-expected.png
index de99d9c4..6799b25 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png
index db221ee..178d303 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/toDataURL-alpha-stability-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/toDataURL-alpha-stability-expected.png
index ad82edc..99872cb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/toDataURL-alpha-stability-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/canvas/toDataURL-alpha-stability-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.png
index d41d9ed..3afa918 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.txt
index b82842a0..1ee785f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/percentage-non-integer-expected.txt
@@ -5,55 +5,55 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#00FF00]
         LayoutBlockFlow {DIV} at (0,0) size 100x4
-          LayoutBlockFlow {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,4) size 1005x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.50x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.50x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,8) size 995x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.48x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.48x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,12) size 985x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.47x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.47x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,16) size 975x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.42x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.42x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,20) size 965x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.36x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.36x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,24) size 955x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,28) size 945x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.16x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.16x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,32) size 935x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.03x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.03x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,36) size 930x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.44x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.44x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,40) size 920x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,44) size 910x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.09x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.09x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,48) size 910x4
-          LayoutBlockFlow {DIV} at (0,0) size 101x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 101x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,52) size 900x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,56) size 890x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.56x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.56x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,60) size 885x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.88x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.88x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,64) size 875x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.63x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.63x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,68) size 870x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.91x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.91x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,72) size 860x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.61x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.61x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,76) size 850x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.30x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.30x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,80) size 845x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.55x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.55x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,84) size 840x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,88) size 835x4
-          LayoutBlockFlow {DIV} at (0,0) size 101.03x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 101.03x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,92) size 825x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.64x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.64x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,96) size 815x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.23x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.23x4 [bgcolor=#00000080]
       LayoutBlockFlow (anonymous) at (0,100) size 784x20
         LayoutBR {BR} at (0,0) size 0x19
 layer at (8,128) size 784x0
@@ -86,59 +86,59 @@
   LayoutTable (positioned) {TABLE} at (0,0) size 1000x20
     LayoutTableSection {TBODY} at (0,0) size 1000x20
       LayoutTableRow {TR} at (0,0) size 1000x20
-        LayoutTableCell {TD} at (0,0) size 12x20 [bgcolor=#0000007F] [r=0 c=0 rs=1 cs=1]
+        LayoutTableCell {TD} at (0,0) size 12x20 [bgcolor=#00000080] [r=0 c=0 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (12,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=1 rs=1 cs=1]
+        LayoutTableCell {TD} at (12,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=1 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (22,0) size 14x20 [bgcolor=#0000007F] [r=0 c=2 rs=1 cs=1]
+        LayoutTableCell {TD} at (22,0) size 14x20 [bgcolor=#00000080] [r=0 c=2 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (36,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=3 rs=1 cs=1]
+        LayoutTableCell {TD} at (36,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=3 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (46,0) size 16x20 [bgcolor=#0000007F] [r=0 c=4 rs=1 cs=1]
+        LayoutTableCell {TD} at (46,0) size 16x20 [bgcolor=#00000080] [r=0 c=4 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (62,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=5 rs=1 cs=1]
+        LayoutTableCell {TD} at (62,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=5 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (72,0) size 18x20 [bgcolor=#0000007F] [r=0 c=6 rs=1 cs=1]
+        LayoutTableCell {TD} at (72,0) size 18x20 [bgcolor=#00000080] [r=0 c=6 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (90,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=7 rs=1 cs=1]
+        LayoutTableCell {TD} at (90,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=7 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (100,0) size 20x20 [bgcolor=#0000007F] [r=0 c=8 rs=1 cs=1]
+        LayoutTableCell {TD} at (100,0) size 20x20 [bgcolor=#00000080] [r=0 c=8 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (120,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=9 rs=1 cs=1]
+        LayoutTableCell {TD} at (120,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=9 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (130,0) size 22x20 [bgcolor=#0000007F] [r=0 c=10 rs=1 cs=1]
+        LayoutTableCell {TD} at (130,0) size 22x20 [bgcolor=#00000080] [r=0 c=10 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (152,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=11 rs=1 cs=1]
+        LayoutTableCell {TD} at (152,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=11 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (162,0) size 24x20 [bgcolor=#0000007F] [r=0 c=12 rs=1 cs=1]
+        LayoutTableCell {TD} at (162,0) size 24x20 [bgcolor=#00000080] [r=0 c=12 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (186,10) size 10x0 [bgcolor=#00FF007F] [r=0 c=13 rs=1 cs=1]
-        LayoutTableCell {TD} at (196,0) size 26x20 [bgcolor=#0000007F] [r=0 c=14 rs=1 cs=1]
+        LayoutTableCell {TD} at (186,10) size 10x0 [bgcolor=#00FF0080] [r=0 c=13 rs=1 cs=1]
+        LayoutTableCell {TD} at (196,0) size 26x20 [bgcolor=#00000080] [r=0 c=14 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (222,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=15 rs=1 cs=1]
+        LayoutTableCell {TD} at (222,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=15 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (232,0) size 28x20 [bgcolor=#0000007F] [r=0 c=16 rs=1 cs=1]
+        LayoutTableCell {TD} at (232,0) size 28x20 [bgcolor=#00000080] [r=0 c=16 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (260,0) size 10x20 [bgcolor=#00FF007F] [r=0 c=17 rs=1 cs=1]
+        LayoutTableCell {TD} at (260,0) size 10x20 [bgcolor=#00FF0080] [r=0 c=17 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (270,0) size 30x20 [bgcolor=#0000007F] [r=0 c=18 rs=1 cs=1]
+        LayoutTableCell {TD} at (270,0) size 30x20 [bgcolor=#00000080] [r=0 c=18 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x19
             text run at (0,0) width 4: " "
         LayoutTableCell {TD} at (300,0) size 700x20 [r=0 c=19 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.png
index 97daef0..95ba5556 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.txt
index 825599a..91e01217 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/css/shadow-multiple-expected.txt
@@ -14,7 +14,7 @@
             text run at (102,1) width 77: "text"
         LayoutText {#text} at (179,1) size 12x55
           text run at (179,1) width 12: " "
-        LayoutInline {SPAN} at (0,0) size 99x55 [color=#0000004C]
+        LayoutInline {SPAN} at (0,0) size 99x55 [color=#0000004D]
           LayoutText {#text} at (191,1) size 99x55
             text run at (191,1) width 99: "casts"
         LayoutText {#text} at (290,1) size 12x55
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLMeterElement/meter-styles-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLMeterElement/meter-styles-expected.png
index 54713e80..ce77b5682 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLMeterElement/meter-styles-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLMeterElement/meter-styles-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
index ddef88c5..c6b9d0a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
index fe331b0..41808bf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
index c1c3b008..ec59c31 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
index 710c121b..aa06890 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
index 2a067b4..096c7cf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
index 7042aaa..510903fe 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
index 6d436b647..babf5d0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
index c5afb5c6..799c2d35 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
index 6318076a..b071110b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-expected.png
index a951805c..9507c06 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
index eae7967..8467fb0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-expected.png
index 816d04a..c4356100 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
index e460c462..5adbea2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/checkbox/checkbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/checkbox/checkbox-appearance-basic-expected.png
index 727e2d1..d8156218 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/checkbox/checkbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/checkbox/checkbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-expected.png
index 4d5c54e03..9113d67 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
index 451b241..ecd041bc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
index 9d59d9ac..7815f20b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
index 45f0276f..008a562 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/radio/radio-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/radio/radio-appearance-basic-expected.png
index 90d14bd8..61368e8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/radio/radio-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/radio/radio-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png
index 0436896e3..bdf19bf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/range/range-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.png
index 8b1ec67..7c8b0ff0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/search/search-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png
index 52c6940..6acda92 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png
index a700e7b..07b518f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/submit/submit-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/submit/submit-appearance-basic-expected.png
index bf9fded..c220d51 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/submit/submit-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/submit/submit-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-basic-expected.png
index 386e36b..71c7c53 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/text/text-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-appearance-basic-expected.png
index ec72d3c..98675b3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/gradient-after-transparent-border-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/gradient-after-transparent-border-expected.png
index 9258fe1..dacbaf79 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/gradient-after-transparent-border-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/gradients/gradient-after-transparent-border-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.png
index 385b6de..5220165e5 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.txt
index da607ae..6de5da0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/overflow/float-in-relpositioned-expected.txt
@@ -29,15 +29,15 @@
   LayoutBlockFlow {DIV} at (10,408) size 102x102 [border: (1px solid #000000)]
 layer at (69,81) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (19,243) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (69,305) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
 layer at (69,305) size 75x75 backgroundClip at (19,305) size 100x85 clip at (19,305) size 100x85
-  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (19,467) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
 layer at (19,467) size 75x75 backgroundClip at (19,417) size 85x100 clip at (19,417) size 85x100
-  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/replaced/border-radius-clip-content-edge-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/replaced/border-radius-clip-content-edge-expected.png
index 2c98dfdc..0c9cc76 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/replaced/border-radius-clip-content-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/replaced/border-radius-clip-content-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png
index ec6947cf8..b42c864 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt
index 27912d4..ca1b37c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt
@@ -3,7 +3,7 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-      LayoutBlockFlow {DIV} at (0,0) size 784x285 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,0) size 784x285 [color=#00000080]
         LayoutBlockFlow {DIV} at (0,0) size 784x57
           LayoutText {#text} at (0,1) size 241x55
             text run at (0,1) width 241: "Text shadow"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png
index c557021..35c2db4b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt
index 5b82c83..c7702f8d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt
@@ -15,7 +15,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
@@ -30,7 +30,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
@@ -45,7 +45,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.png
index 5fd6e013..6dbca7ae 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.txt
index 3e68b009..07426239 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/svg/filters/feBlend-all-modes-expected.txt
@@ -233,112 +233,112 @@
         LayoutSVGRoot {svg} at (0,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_normal"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="normal"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_normal"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (50,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_multiply"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="multiply"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_multiply"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (100,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_screen"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="screen"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_screen"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (150,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_darken"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="darken"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_darken"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (200,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_lighten"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="lighten"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_lighten"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (250,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_overlay"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="overlay"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_overlay"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (300,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_color-dodge"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="color-dodge"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_color-dodge"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (350,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_color-burn"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="color-burn"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_color-burn"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (0,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_hard-light"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="hard-light"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_hard-light"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (50,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_soft-light"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="soft-light"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_soft-light"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (100,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_difference"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="difference"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_difference"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (150,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_exclusion"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="exclusion"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_exclusion"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (200,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_hue"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="hue"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_hue"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (250,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_saturation"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="saturation"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_saturation"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (300,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_color"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="color"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_color"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (350,55) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_luminosity"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="luminosity"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_luminosity"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png
index c1a22c3..01fbb5f3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt
index 27af101..e4d7e7a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/combining-character-queries-expected.txt
@@ -205,22 +205,18 @@
           LayoutSVGText {text} at (87,207) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (87,207) size 4x10
               chunk 1 (middle anchor) text run 1 at (87.00,215.00) startOffset 0 endOffset 1 width 4.00: "4"
-          LayoutSVGRect {rect} at (98,161) size 18x49 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=98.00] [y=161.00] [width=18.00] [height=49.00]
-          LayoutSVGText {text} at (105,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (105,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (105.00,215.00) startOffset 0 endOffset 1 width 4.00: "5"
-          LayoutSVGRect {rect} at (116,161) size 3.33x49 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=116.00] [y=161.00] [width=3.33] [height=49.00]
-          LayoutSVGText {text} at (115.66,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (115.66,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (115.67,215.00) startOffset 0 endOffset 1 width 4.00: "6"
-          LayoutSVGRect {rect} at (119.33,161) size 3.33x49 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=119.33] [y=161.00] [width=3.33] [height=49.00]
-          LayoutSVGText {text} at (119,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (119,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (119.00,215.00) startOffset 0 endOffset 1 width 4.00: "7"
-          LayoutSVGRect {rect} at (122.67,161) size 3.33x49 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=122.67] [y=161.00] [width=3.33] [height=49.00]
-          LayoutSVGText {text} at (122.33,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (122.33,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (122.33,215.00) startOffset 0 endOffset 1 width 4.00: "8"
+          LayoutSVGRect {rect} at (98,161) size 3.33x49 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=98.00] [y=161.00] [width=3.33] [height=49.00]
+          LayoutSVGText {text} at (97.66,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (97.66,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (97.67,215.00) startOffset 0 endOffset 1 width 4.00: "5"
+          LayoutSVGRect {rect} at (101.33,161) size 3.33x49 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=101.33] [y=161.00] [width=3.33] [height=49.00]
+          LayoutSVGText {text} at (100.98,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (100.98,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (101.00,215.00) startOffset 0 endOffset 1 width 4.00: "6"
+          LayoutSVGRect {rect} at (104.67,161) size 3.33x49 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=104.67] [y=161.00] [width=3.33] [height=49.00]
+          LayoutSVGText {text} at (104.33,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (104.33,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (104.33,215.00) startOffset 0 endOffset 1 width 4.00: "7"
           LayoutSVGRect {rect} at (200,168) size 11x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=168.00] [width=11.00] [height=40.00]
           LayoutSVGText {text} at (203.50,205) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (203.50,205) size 4x10
@@ -433,34 +429,42 @@
           LayoutSVGText {text} at (200.25,355) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (200.25,355) size 4x10
               chunk 1 (middle anchor) text run 1 at (200.25,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (204.50,318) size 27x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.50] [y=318.00] [width=27.00] [height=40.00]
-          LayoutSVGText {text} at (216,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (216,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (216.00,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (231.50,318) size 4.50x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=231.50] [y=318.00] [width=4.50] [height=40.00]
-          LayoutSVGText {text} at (231.75,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (231.75,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (231.75,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (204.50,318) size 4.50x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.50] [y=318.00] [width=4.50] [height=40.00]
+          LayoutSVGText {text} at (204.75,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (204.75,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (204.75,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (209,318) size 27x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=209.00] [y=318.00] [width=27.00] [height=40.00]
+          LayoutSVGText {text} at (220.50,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (220.50,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (220.50,363.00) startOffset 0 endOffset 1 width 4.00: "2"
           LayoutSVGRect {rect} at (236,318) size 4.50x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=236.00] [y=318.00] [width=4.50] [height=40.00]
           LayoutSVGText {text} at (236.25,355) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (236.25,355) size 4x10
               chunk 1 (middle anchor) text run 1 at (236.25,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (240.50,318) size 4.50x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=240.50] [y=318.00] [width=4.50] [height=40.00]
+          LayoutSVGText {text} at (240.75,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (240.75,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (240.75,363.00) startOffset 0 endOffset 1 width 4.00: "4"
           LayoutSVGRect {rect} at (350,318) size 5x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=5.00] [height=40.00]
           LayoutSVGText {text} at (350.50,355) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (350.50,355) size 4x10
               chunk 1 (middle anchor) text run 1 at (350.50,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (355,318) size 26x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=355.00] [y=318.00] [width=26.00] [height=40.00]
-          LayoutSVGText {text} at (366,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (366,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (366.00,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (381,318) size 3.50x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=381.00] [y=318.00] [width=3.50] [height=40.00]
-          LayoutSVGText {text} at (380.75,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (380.75,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (380.75,363.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (384.50,318) size 3.50x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=384.50] [y=318.00] [width=3.50] [height=40.00]
-          LayoutSVGText {text} at (384.25,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (384.25,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (384.25,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (355,318) size 5x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=355.00] [y=318.00] [width=5.00] [height=40.00]
+          LayoutSVGText {text} at (355.50,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (355.50,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (355.50,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (360,318) size 26x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=360.00] [y=318.00] [width=26.00] [height=40.00]
+          LayoutSVGText {text} at (371,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (371,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (371.00,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (386,318) size 3.50x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=386.00] [y=318.00] [width=3.50] [height=40.00]
+          LayoutSVGText {text} at (385.75,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (385.75,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (385.75,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (389.50,318) size 3.50x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=389.50] [y=318.00] [width=3.50] [height=40.00]
+          LayoutSVGText {text} at (389.25,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (389.25,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (389.25,363.00) startOffset 0 endOffset 1 width 4.00: "4"
         LayoutSVGText {text} at (50,11) size 60x49 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (50,11) size 60x49
             chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 6 width 60.00: "ab\x{30C}c\x{30C}\x{30C}"
@@ -494,9 +498,9 @@
             chunk 1 text run 1 at (382.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
             chunk 1 text run 1 at (382.00,125.00) startOffset 0 endOffset 1 width 18.00: "a"
             chunk 1 text run 1 at (400.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
-        LayoutSVGText {text} at (50,144.81) size 91x65.19 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (50,144.81) size 91x65.19
-            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 9 width 76.00: "fi\x{30C} ffi\x{30C}\x{30C}"
+        LayoutSVGText {text} at (50,144.81) size 73x65.19 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (50,144.81) size 73x65.19
+            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 8 width 58.00: "fi\x{30C} fi\x{30C}\x{30C}"
         LayoutSVGText {text} at (200,168) size 81.05x40 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (200,168) size 81.05x40
             chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 9 width 59.37: "fi\x{30C} ffi\x{30C}\x{30C}"
@@ -523,16 +527,16 @@
             chunk 1 text run 1 at (50.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
             chunk 1 text run 1 at (55.00,350.00) startOffset 0 endOffset 1 width 17.00 RTL: "\x{FDB0}"
             chunk 1 text run 1 at (72.00,350.00) startOffset 0 endOffset 2 width 10.00: "i\x{333}"
-        LayoutSVGText {text} at (186,318) size 76.50x40 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (186,318) size 76.50x40
-            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
-            chunk 1 text run 1 at (204.50,350.00) startOffset 0 endOffset 1 width 27.00 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (231.50,350.00) startOffset 0 endOffset 2 width 9.00: "i\x{333}"
-        LayoutSVGText {text} at (336,318) size 74x40 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (336,318) size 74x40
-            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
-            chunk 1 text run 1 at (355.00,350.00) startOffset 0 endOffset 1 width 26.00 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (381.00,350.00) startOffset 0 endOffset 2 width 7.00: "i\x{333}"
+        LayoutSVGText {text} at (200,318) size 67x40 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (200,318) size 67x40
+            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 2 width 9.00: ".\x{30C}"
+            chunk 1 text run 1 at (209.00,350.00) startOffset 0 endOffset 1 width 27.00 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (236.00,350.00) startOffset 0 endOffset 2 width 9.00: "i\x{333}"
+        LayoutSVGText {text} at (350,318) size 65x40 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (350,318) size 65x40
+            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 2 width 10.00: ".\x{30C}"
+            chunk 1 text run 1 at (360.00,350.00) startOffset 0 endOffset 1 width 26.00 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (386.00,350.00) startOffset 0 endOffset 2 width 7.00: "i\x{333}"
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png
index 8b19d3a3..e5b706aa 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/svg/text/text-fill-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
index a671fea..6485c85e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
index 4d04233..105baf9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
@@ -35,4 +35,4 @@
 layer at (124,114) size 100x100
   LayoutBlockFlow (relative positioned) {DIV} at (51,51) size 100x100 [bgcolor=#0000FF]
 layer at (22,22) size 150x300
-  LayoutBlockFlow (positioned) {DIV} at (1,1) size 150x300 [bgcolor=#0080004C]
+  LayoutBlockFlow (positioned) {DIV} at (1,1) size 150x300 [bgcolor=#0080004D]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
index de99d9c4..6799b25 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
index db221ee..178d303 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png
index ad82edc..99872cb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
index 1fee9fd..65fd7a3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
index 3080a4c..a376115d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png
index ad82edc..99872cb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
index 68550a7..55e8c10 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
index 8558731..4bb6d8d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
index 8558731..4bb6d8d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
index 9c9f5c1..7c4a008 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
index e9c96fb..514b71b6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
@@ -3,11 +3,11 @@
 layer at (0,0) size 800x537
   LayoutBlockFlow {HTML} at (0,0) size 800x537
     LayoutBlockFlow {BODY} at (8,20) size 784x501
-      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#0000807F]
+      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#00008080]
       LayoutBlockFlow (anonymous) at (0,220) size 784x245
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,481) size 784x20
         LayoutText {#text} at (0,0) size 232x19
           text run at (0,0) width 232: "Top and bottom should look the same."
 layer at (28,260) size 240x200
-  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#0000807F]
+  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/shadows/shadow-drawing-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/shadows/shadow-drawing-expected.png
index 78a26f8d..b2884cb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/shadows/shadow-drawing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/compositing/shadows/shadow-drawing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/css/shadow-multiple-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/css/shadow-multiple-expected.png
index 9906055..cfbd7cb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/css/shadow-multiple-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/css/shadow-multiple-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
index 84182ff..78f1373 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
index 8795437..31b2db69 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
index f946419..80f4929 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
index c37ad74..7949aa51 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
index f67bfca..8e494cd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
index c8bcfbd2..d4a183e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
index d9a416bf..c8e6fb6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
index d7c9f37..a2832ed6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
index e1583fb0..e6540e95 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-expected.png
index 7f4e2a4..006ffc1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
index 042fe2e3..ad10b32 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-expected.png
index bcf3399..dc8d39c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
index 7295a7d0..6289e60 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-expected.png
index fcaf6af..f286b92 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
index 769e911..5d2aa35 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
index cb3e377..7aa0c0f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
index b0f505b..0ba6ce7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
index c2402cc2..857a667 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.png
index cea7575..09ad92a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/search/search-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.png
index ab3d765..990f717 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-appearance-basic-expected.png
index afe67c3..c05e4b22 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/submit/submit-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/submit/submit-appearance-basic-expected.png
index 141fa11..dd58ccc39 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/submit/submit-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/submit/submit-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/text-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/text-appearance-basic-expected.png
index ef015b8..442f5a2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/text-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/text/text-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-appearance-basic-expected.png
index b8d467c..b527e6b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-no-blur-expected.png
index 12fdf83..7f06cb7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-no-blur-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-translucent-fill-expected.png
index 91b809c..da404f3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png
index 0ff55b15..7da67ea7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt
index 219566f..758467e4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/text/combining-character-queries-expected.txt
@@ -201,26 +201,22 @@
           LayoutSVGText {text} at (91.36,214) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (91.36,214) size 4x9
               chunk 1 (middle anchor) text run 1 at (91.37,221.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (98.23,161) size 0.42x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=98.23] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (96.42,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.42,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (96.44,221.00) startOffset 0 endOffset 1 width 4.00: "4"
-          LayoutSVGRect {rect} at (98.65,161) size 0.42x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=98.65] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (96.84,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.84,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (96.86,221.00) startOffset 0 endOffset 1 width 4.00: "5"
-          LayoutSVGRect {rect} at (99.06,161) size 12.56x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=99.06] [y=161.00] [width=12.56] [height=55.00]
-          LayoutSVGText {text} at (103.34,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (103.34,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (103.35,221.00) startOffset 0 endOffset 1 width 4.00: "6"
-          LayoutSVGRect {rect} at (111.63,161) size 12.56x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=111.63] [y=161.00] [width=12.56] [height=55.00]
-          LayoutSVGText {text} at (115.91,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (115.91,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (115.91,221.00) startOffset 0 endOffset 1 width 4.00: "7"
-          LayoutSVGRect {rect} at (124.19,161) size 12.56x55 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=124.19] [y=161.00] [width=12.56] [height=55.00]
-          LayoutSVGText {text} at (128.45,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (128.45,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (128.47,221.00) startOffset 0 endOffset 1 width 4.00: "8"
+          LayoutSVGRect {rect} at (98.23,161) size 5.97x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=98.23] [y=161.00] [width=5.97] [height=55.00]
+          LayoutSVGText {text} at (99.20,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (99.20,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (99.21,221.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (104.20,161) size 10.84x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=104.20] [y=161.00] [width=10.84] [height=55.00]
+          LayoutSVGText {text} at (107.61,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (107.61,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (107.62,221.00) startOffset 0 endOffset 1 width 4.00: "5"
+          LayoutSVGRect {rect} at (115.04,161) size 10.84x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=115.04] [y=161.00] [width=10.84] [height=55.00]
+          LayoutSVGText {text} at (118.45,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (118.45,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (118.47,221.00) startOffset 0 endOffset 1 width 4.00: "6"
+          LayoutSVGRect {rect} at (125.89,161) size 10.84x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=125.89] [y=161.00] [width=10.84] [height=55.00]
+          LayoutSVGText {text} at (129.30,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (129.30,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (129.31,221.00) startOffset 0 endOffset 1 width 4.00: "7"
           LayoutSVGRect {rect} at (200,169) size 11.66x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=169.00] [width=11.66] [height=40.00]
           LayoutSVGText {text} at (203.81,207) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (203.81,207) size 4x9
@@ -429,38 +425,46 @@
           LayoutSVGText {text} at (150.59,364) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (150.59,364) size 4x9
               chunk 1 (middle anchor) text run 1 at (150.60,371.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (200,319) size 12.24x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=12.24] [height=40.00]
-          LayoutSVGText {text} at (204.11,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (204.11,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (204.12,364.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (212.24,319) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=212.24] [y=319.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (234.77,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (234.77,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (234.77,364.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (261.30,319) size 10.75x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=261.30] [y=319.00] [width=10.75] [height=40.00]
-          LayoutSVGText {text} at (264.67,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (264.67,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (264.68,364.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (272.05,319) size 10.75x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=272.05] [y=319.00] [width=10.75] [height=40.00]
-          LayoutSVGText {text} at (275.42,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (275.42,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (275.43,364.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (350,318) size 14.83x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=14.83] [height=40.00]
-          LayoutSVGText {text} at (355.41,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (355.41,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (355.42,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (364.83,318) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=364.83] [y=318.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (387.36,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (387.36,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (387.37,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (413.90,318) size 7.88x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=413.90] [y=318.00] [width=7.88] [height=40.00]
-          LayoutSVGText {text} at (415.83,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (415.83,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (415.84,363.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (421.78,318) size 7.88x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=421.78] [y=318.00] [width=7.88] [height=40.00]
-          LayoutSVGText {text} at (423.70,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (423.70,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (423.72,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (200,319) size 4.38x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (200.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (200.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (200.19,364.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (204.38,319) size 4.38x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.38] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (204.56,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (204.56,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (204.56,364.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (208.75,319) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=208.75] [y=319.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (231.28,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (231.28,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (231.28,364.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (257.82,319) size 10.75x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=257.82] [y=319.00] [width=10.75] [height=40.00]
+          LayoutSVGText {text} at (261.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (261.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (261.19,364.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (268.57,319) size 10.75x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=268.57] [y=319.00] [width=10.75] [height=40.00]
+          LayoutSVGText {text} at (271.94,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (271.94,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (271.94,364.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (350,318) size 4.86x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=4.86] [height=40.00]
+          LayoutSVGText {text} at (350.42,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (350.42,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (350.43,363.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (354.86,318) size 4.86x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=354.86] [y=318.00] [width=4.86] [height=40.00]
+          LayoutSVGText {text} at (355.28,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (355.28,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (355.29,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (359.72,318) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=359.72] [y=318.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (382.25,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (382.25,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (382.26,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (408.79,318) size 7.88x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=408.79] [y=318.00] [width=7.88] [height=40.00]
+          LayoutSVGText {text} at (410.72,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (410.72,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (410.73,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (416.67,318) size 7.88x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=416.67] [y=318.00] [width=7.88] [height=40.00]
+          LayoutSVGText {text} at (418.59,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (418.59,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (418.61,363.00) startOffset 0 endOffset 1 width 4.00: "4"
         LayoutSVGText {text} at (50,10.09) size 49.50x55.89 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (50,10.09) size 49.50x55.89
             chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 6 width 48.33: "ab\x{30C}c\x{30C}\x{30C}"
@@ -494,9 +498,9 @@
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 19.47: "a"
             chunk 1 text run 1 at (400.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
-        LayoutSVGText {text} at (42.19,160.08) size 80.94x55.91 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (42.19,160.08) size 80.94x55.91
-            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 9 width 73.13: "fi\x{30C} ffi\x{30C}\x{30C}"
+        LayoutSVGText {text} at (42.19,160.08) size 70.64x55.91 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (42.19,160.08) size 70.64x55.91
+            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 8 width 62.84: "fi\x{30C} fi\x{30C}\x{30C}"
         LayoutSVGText {text} at (200,169) size 63.75x40 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (200,169) size 63.75x40
             chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 9 width 63.20: "fi\x{30C} ffi\x{30C}\x{30C}"
@@ -523,16 +527,16 @@
             chunk 1 text run 1 at (50.00,350.00) startOffset 0 endOffset 1 width 15.62: "\x{30C}"
             chunk 1 text run 1 at (65.62,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
             chunk 1 text run 1 at (114.69,350.00) startOffset 0 endOffset 2 width 50.55: "i\x{333}"
-        LayoutSVGText {text} at (199.41,319) size 83.38x47.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (199.41,319) size 83.38x47.13
-            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 1 width 12.24: "\x{30C}"
-            chunk 1 text run 1 at (212.24,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (261.30,350.00) startOffset 0 endOffset 2 width 21.50: "i\x{333}"
-        LayoutSVGText {text} at (335.16,318) size 94.48x48.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (335.16,318) size 94.48x48.13
-            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 1 width 14.83: "\x{30C}"
-            chunk 1 text run 1 at (364.83,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (413.90,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}"
+        LayoutSVGText {text} at (200,319) size 79.30x47.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (200,319) size 79.30x47.13
+            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 2 width 8.75: ".\x{30C}"
+            chunk 1 text run 1 at (208.75,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (257.82,350.00) startOffset 0 endOffset 2 width 21.50: "i\x{333}"
+        LayoutSVGText {text} at (350,318) size 74.53x48.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (350,318) size 74.53x48.13
+            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 2 width 14.83: ".\x{30C}"
+            chunk 1 text run 1 at (359.72,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (408.79,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}"
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
index b5f59e7e..0218429 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/backgrounds/background-leakage-transforms-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/backgrounds/background-leakage-transforms-expected.png
index 6a7ab514..1a2a786 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/backgrounds/background-leakage-transforms-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/backgrounds/background-leakage-transforms-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/basic/fieldset-stretch-to-legend-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/basic/fieldset-stretch-to-legend-expected.png
index 68f57a65..35c8cad4e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/basic/fieldset-stretch-to-legend-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/basic/fieldset-stretch-to-legend-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/float/relative-painted-twice-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/float/relative-painted-twice-expected.png
index 89f96e8..7a39e33 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/float/relative-painted-twice-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/block/float/relative-painted-twice-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/box-shadow/basic-shadows-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/box-shadow/basic-shadows-expected.png
index adc61341..6ed7e64 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/box-shadow/basic-shadows-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/box-shadow/basic-shadows-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-expected.png
index 2c649c3..9877fa03 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-shadow-expected.png
index 66a6024c..f6b9b659 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/css/shadow-multiple-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/css/shadow-multiple-expected.png
index 2897ba3..1ef54d0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/css/shadow-multiple-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/css/shadow-multiple-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
index 0d77cfd..c53a3c4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
index bd8d0e8..41a615b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
index 4ade32a..6864aa63 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
index 2535bdc..bdf474a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
index 016fa45..afe5b8d4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
index 562ccbd7..4d1881d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
index 783ae3e..99c5a8b7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
index 0745f36..9f7e12f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
index cd7da19..1f55e06ca 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-expected.png
index 37bb45c9..4a13b1c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
index 8cb57b9..9d5a8ac 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-expected.png
index 0b9e1a3f..3fff0ccf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
index bc0736d..31279c63 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/checkbox/checkbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/checkbox/checkbox-appearance-basic-expected.png
index 0ed4cd7..1aec597 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/checkbox/checkbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/checkbox/checkbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-expected.png
index 972b0d4..4f330ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
index a36192ba..e336c75 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
index 525ff94..e109a85 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
index 5d0bc49..d9786332 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
index 66a9088..4cef70df 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/radio/radio-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/radio/radio-appearance-basic-expected.png
index b9b1cd5..eafce57 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/radio/radio-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/radio/radio-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.png
index 31087c7f..d19096e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/search/search-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.png
index 87bb1105..bf55327 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-appearance-basic-expected.png
index fc92cb0..602331f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/submit/submit-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/submit/submit-appearance-basic-expected.png
index ae9f7e4..a519da6c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/submit/submit-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/submit/submit-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-basic-expected.png
index 3f1cd06..4e8cbcb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/text/text-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-appearance-basic-expected.png
index b1d85e5..a6e6c1a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/overflow/float-in-relpositioned-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/overflow/float-in-relpositioned-expected.png
index 6a9c595..d5eebcd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/overflow/float-in-relpositioned-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/overflow/float-in-relpositioned-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/shadow-translucent-fill-expected.png
index cb930369..72d1b248b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/composited-overflow-with-borderbox-background-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
index f3129811..39258bdc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.png
index e531ac9..58f240a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt
index 0d1592d..7105aacb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/text/combining-character-queries-expected.txt
@@ -201,26 +201,22 @@
           LayoutSVGText {text} at (83.55,214) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (83.55,214) size 4x9
               chunk 1 (middle anchor) text run 1 at (83.56,221.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (90.42,161) size 0.42x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=90.42] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (88.63,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (88.63,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (88.63,221.00) startOffset 0 endOffset 1 width 4.00: "4"
-          LayoutSVGRect {rect} at (90.84,161) size 0.42x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=90.84] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (89.03,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (89.03,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (89.05,221.00) startOffset 0 endOffset 1 width 4.00: "5"
-          LayoutSVGRect {rect} at (91.25,161) size 9.96x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=91.25] [y=161.00] [width=9.96] [height=55.00]
-          LayoutSVGText {text} at (94.22,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (94.22,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (94.23,221.00) startOffset 0 endOffset 1 width 4.00: "6"
-          LayoutSVGRect {rect} at (101.21,161) size 9.96x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=101.21] [y=161.00] [width=9.96] [height=55.00]
-          LayoutSVGText {text} at (104.19,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (104.19,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (104.19,221.00) startOffset 0 endOffset 1 width 4.00: "7"
-          LayoutSVGRect {rect} at (111.17,161) size 9.96x55 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=111.17] [y=161.00] [width=9.96] [height=55.00]
-          LayoutSVGText {text} at (114.14,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (114.14,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (114.15,221.00) startOffset 0 endOffset 1 width 4.00: "8"
+          LayoutSVGRect {rect} at (90.42,161) size 5.97x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=90.42] [y=161.00] [width=5.97] [height=55.00]
+          LayoutSVGText {text} at (91.39,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (91.39,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (91.40,221.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (96.39,161) size 8.24x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=96.39] [y=161.00] [width=8.24] [height=55.00]
+          LayoutSVGText {text} at (98.50,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (98.50,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (98.51,221.00) startOffset 0 endOffset 1 width 4.00: "5"
+          LayoutSVGRect {rect} at (104.63,161) size 8.24x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=104.63] [y=161.00] [width=8.24] [height=55.00]
+          LayoutSVGText {text} at (106.75,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (106.75,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (106.75,221.00) startOffset 0 endOffset 1 width 4.00: "6"
+          LayoutSVGRect {rect} at (112.87,161) size 8.24x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=112.87] [y=161.00] [width=8.24] [height=55.00]
+          LayoutSVGText {text} at (114.98,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (114.98,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (114.99,221.00) startOffset 0 endOffset 1 width 4.00: "7"
           LayoutSVGRect {rect} at (200,169) size 11.66x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=169.00] [width=11.66] [height=40.00]
           LayoutSVGText {text} at (203.81,207) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (203.81,207) size 4x9
@@ -429,38 +425,46 @@
           LayoutSVGText {text} at (150.59,364) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (150.59,364) size 4x9
               chunk 1 (middle anchor) text run 1 at (150.60,371.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (200,319) size 11.66x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=11.66] [height=40.00]
-          LayoutSVGText {text} at (203.81,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (203.81,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (203.83,364.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (211.66,319) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=211.66] [y=319.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (234.19,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (234.19,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (234.19,364.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (260.72,319) size 5.06x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=260.72] [y=319.00] [width=5.06] [height=40.00]
-          LayoutSVGText {text} at (261.25,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (261.25,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (261.25,364.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (265.78,319) size 5.06x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=265.78] [y=319.00] [width=5.06] [height=40.00]
-          LayoutSVGText {text} at (266.30,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (266.30,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (266.31,364.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (200,319) size 4.38x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (200.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (200.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (200.19,364.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (204.38,319) size 4.38x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.38] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (204.56,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (204.56,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (204.56,364.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (208.75,319) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=208.75] [y=319.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (231.28,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (231.28,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (231.28,364.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (257.82,319) size 5.06x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=257.82] [y=319.00] [width=5.06] [height=40.00]
+          LayoutSVGText {text} at (258.34,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (258.34,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (258.35,364.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (262.88,319) size 5.06x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=262.88] [y=319.00] [width=5.06] [height=40.00]
+          LayoutSVGText {text} at (263.39,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (263.39,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (263.40,364.00) startOffset 0 endOffset 1 width 4.00: "4"
           LayoutSVGRect {rect} at (350,318) size 4.86x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=4.86] [height=40.00]
           LayoutSVGText {text} at (350.42,356) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (350.42,356) size 4x9
               chunk 1 (middle anchor) text run 1 at (350.43,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (354.86,318) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=354.86] [y=318.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (377.39,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (377.39,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (377.40,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (403.93,318) size 3.89x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=403.93] [y=318.00] [width=3.89] [height=40.00]
-          LayoutSVGText {text} at (403.86,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (403.86,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (403.87,363.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (407.82,318) size 3.89x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=407.82] [y=318.00] [width=3.89] [height=40.00]
-          LayoutSVGText {text} at (407.75,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (407.75,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (407.76,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (354.86,318) size 4.86x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=354.86] [y=318.00] [width=4.86] [height=40.00]
+          LayoutSVGText {text} at (355.28,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (355.28,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (355.29,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (359.72,318) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=359.72] [y=318.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (382.25,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (382.25,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (382.26,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (408.79,318) size 3.89x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=408.79] [y=318.00] [width=3.89] [height=40.00]
+          LayoutSVGText {text} at (408.73,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (408.73,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (408.73,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (412.68,318) size 3.89x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=412.68] [y=318.00] [width=3.89] [height=40.00]
+          LayoutSVGText {text} at (412.61,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (412.61,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (412.62,363.00) startOffset 0 endOffset 1 width 4.00: "4"
         LayoutSVGText {text} at (50,10.09) size 49.50x55.89 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (50,10.09) size 49.50x55.89
             chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 6 width 48.33: "ab\x{30C}c\x{30C}\x{30C}"
@@ -494,9 +498,9 @@
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 19.47: "a"
             chunk 1 text run 1 at (400.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
-        LayoutSVGText {text} at (42.19,160.08) size 66.86x55.91 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (42.19,160.08) size 66.86x55.91
-            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 9 width 57.51: "fi\x{30C} ffi\x{30C}\x{30C}"
+        LayoutSVGText {text} at (42.19,160.08) size 61.73x55.91 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (42.19,160.08) size 61.73x55.91
+            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 8 width 47.22: "fi\x{30C} fi\x{30C}\x{30C}"
         LayoutSVGText {text} at (200,169) size 63.75x40 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (200,169) size 63.75x40
             chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 9 width 63.20: "fi\x{30C} ffi\x{30C}\x{30C}"
@@ -523,16 +527,16 @@
             chunk 1 text run 1 at (50.00,350.00) startOffset 0 endOffset 1 width 15.62: "\x{30C}"
             chunk 1 text run 1 at (65.62,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
             chunk 1 text run 1 at (114.69,350.00) startOffset 0 endOffset 2 width 50.55: "i\x{333}"
-        LayoutSVGText {text} at (199.41,319) size 82.80x47.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (199.41,319) size 82.80x47.13
-            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 1 width 11.66: "\x{30C}"
-            chunk 1 text run 1 at (211.66,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (260.72,350.00) startOffset 0 endOffset 2 width 10.12: "i\x{333}"
-        LayoutSVGText {text} at (335.16,318) size 80.80x48.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (335.16,318) size 80.80x48.13
-            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
-            chunk 1 text run 1 at (354.86,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (403.93,350.00) startOffset 0 endOffset 2 width 7.78: "i\x{333}"
+        LayoutSVGText {text} at (200,319) size 79.30x47.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (200,319) size 79.30x47.13
+            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 2 width 8.75: ".\x{30C}"
+            chunk 1 text run 1 at (208.75,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (257.82,350.00) startOffset 0 endOffset 2 width 10.12: "i\x{333}"
+        LayoutSVGText {text} at (350,318) size 70.81x48.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (350,318) size 70.81x48.13
+            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 2 width 9.72: ".\x{30C}"
+            chunk 1 text run 1 at (359.72,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (408.79,350.00) startOffset 0 endOffset 2 width 7.78: "i\x{333}"
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
index 2c649c3..9877fa03 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
index 66a6024c..f6b9b659 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
index 5ada77e..5585a23 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
index 77f1977..a7721ea 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
index 567068fb68..8aa12313a2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-content-under-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/spinvalidation/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
similarity index 63%
rename from third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-content-under-overflow-controls-expected.png
rename to third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/spinvalidation/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
index 8695e80..39258bdc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-content-under-overflow-controls-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/spinvalidation/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-content-under-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/stable/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
similarity index 63%
copy from third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-content-under-overflow-controls-expected.png
copy to third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/stable/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
index 8695e80..39258bdc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/clip-content-under-overflow-controls-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/virtual/stable/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/checkbox/checkbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/checkbox/checkbox-appearance-basic-expected.png
index 427d132c..3c126cd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/checkbox/checkbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/checkbox/checkbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/radio/radio-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/radio/radio-appearance-basic-expected.png
index bcc38bb..740c4614 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/radio/radio-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/radio/radio-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.png
index d60a1fa..1da037c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.txt
index 4e8c6e8..1171824 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/svg/text/combining-character-queries-expected.txt
@@ -201,26 +201,22 @@
           LayoutSVGText {text} at (91.36,214) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (91.36,214) size 4x9
               chunk 1 (middle anchor) text run 1 at (91.37,221.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (98.23,161) size 0.42x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=98.23] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (96.42,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.42,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (96.44,221.00) startOffset 0 endOffset 1 width 4.00: "4"
-          LayoutSVGRect {rect} at (98.65,161) size 0.42x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=98.65] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (96.84,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.84,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (96.86,221.00) startOffset 0 endOffset 1 width 4.00: "5"
-          LayoutSVGRect {rect} at (99.06,161) size 17.77x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=99.06] [y=161.00] [width=17.77] [height=55.00]
-          LayoutSVGText {text} at (105.94,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (105.94,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (105.95,221.00) startOffset 0 endOffset 1 width 4.00: "6"
-          LayoutSVGRect {rect} at (116.83,161) size 17.77x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=116.83] [y=161.00] [width=17.77] [height=55.00]
-          LayoutSVGText {text} at (123.70,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (123.70,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (123.72,221.00) startOffset 0 endOffset 1 width 4.00: "7"
-          LayoutSVGRect {rect} at (134.60,161) size 17.77x55 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=134.60] [y=161.00] [width=17.77] [height=55.00]
-          LayoutSVGText {text} at (141.47,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (141.47,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (141.48,221.00) startOffset 0 endOffset 1 width 4.00: "8"
+          LayoutSVGRect {rect} at (98.23,161) size 5.97x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=98.23] [y=161.00] [width=5.97] [height=55.00]
+          LayoutSVGText {text} at (99.20,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (99.20,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (99.21,221.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (104.20,161) size 16.05x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=104.20] [y=161.00] [width=16.05] [height=55.00]
+          LayoutSVGText {text} at (110.22,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (110.22,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (110.23,221.00) startOffset 0 endOffset 1 width 4.00: "5"
+          LayoutSVGRect {rect} at (120.25,161) size 16.05x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=120.25] [y=161.00] [width=16.05] [height=55.00]
+          LayoutSVGText {text} at (126.27,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (126.27,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (126.28,221.00) startOffset 0 endOffset 1 width 4.00: "6"
+          LayoutSVGRect {rect} at (136.30,161) size 16.05x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=136.30] [y=161.00] [width=16.05] [height=55.00]
+          LayoutSVGText {text} at (142.31,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (142.31,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (142.33,221.00) startOffset 0 endOffset 1 width 4.00: "7"
           LayoutSVGRect {rect} at (200,169) size 11.66x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=169.00] [width=11.66] [height=40.00]
           LayoutSVGText {text} at (203.81,207) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (203.81,207) size 4x9
@@ -429,38 +425,46 @@
           LayoutSVGText {text} at (150.59,364) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (150.59,364) size 4x9
               chunk 1 (middle anchor) text run 1 at (150.60,371.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (200,319) size 12.24x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=12.24] [height=40.00]
-          LayoutSVGText {text} at (204.11,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (204.11,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (204.12,364.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (212.24,319) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=212.24] [y=319.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (234.77,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (234.77,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (234.77,364.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (261.30,319) size 10.75x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=261.30] [y=319.00] [width=10.75] [height=40.00]
-          LayoutSVGText {text} at (264.67,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (264.67,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (264.68,364.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (272.05,319) size 10.75x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=272.05] [y=319.00] [width=10.75] [height=40.00]
-          LayoutSVGText {text} at (275.42,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (275.42,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (275.43,364.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (350,318) size 14.83x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=14.83] [height=40.00]
-          LayoutSVGText {text} at (355.41,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (355.41,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (355.42,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (364.83,318) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=364.83] [y=318.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (387.36,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (387.36,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (387.37,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (413.90,318) size 7.88x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=413.90] [y=318.00] [width=7.88] [height=40.00]
-          LayoutSVGText {text} at (415.83,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (415.83,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (415.84,363.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (421.78,318) size 7.88x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=421.78] [y=318.00] [width=7.88] [height=40.00]
-          LayoutSVGText {text} at (423.70,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (423.70,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (423.72,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (200,319) size 4.38x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (200.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (200.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (200.19,364.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (204.38,319) size 4.38x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.38] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (204.56,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (204.56,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (204.56,364.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (208.75,319) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=208.75] [y=319.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (231.28,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (231.28,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (231.28,364.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (257.82,319) size 10.75x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=257.82] [y=319.00] [width=10.75] [height=40.00]
+          LayoutSVGText {text} at (261.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (261.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (261.19,364.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (268.57,319) size 10.75x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=268.57] [y=319.00] [width=10.75] [height=40.00]
+          LayoutSVGText {text} at (271.94,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (271.94,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (271.94,364.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (350,318) size 5.02x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=5.02] [height=40.00]
+          LayoutSVGText {text} at (350.50,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (350.50,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (350.51,363.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (355.02,318) size 5.02x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=355.02] [y=318.00] [width=5.02] [height=40.00]
+          LayoutSVGText {text} at (355.53,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (355.53,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (355.54,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (360.05,318) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=360.05] [y=318.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (382.58,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (382.58,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (382.58,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (409.12,318) size 7.88x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=409.12] [y=318.00] [width=7.88] [height=40.00]
+          LayoutSVGText {text} at (411.05,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (411.05,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (411.05,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (417,318) size 7.88x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=416.99] [y=318.00] [width=7.88] [height=40.00]
+          LayoutSVGText {text} at (418.92,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (418.92,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (418.93,363.00) startOffset 0 endOffset 1 width 4.00: "4"
         LayoutSVGText {text} at (50,10.09) size 49.50x55.89 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (50,10.09) size 49.50x55.89
             chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 6 width 48.33: "ab\x{30C}c\x{30C}\x{30C}"
@@ -494,9 +498,9 @@
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 19.47: "a"
             chunk 1 text run 1 at (400.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
-        LayoutSVGText {text} at (42.19,160.08) size 104.55x55.91 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (42.19,160.08) size 104.55x55.91
-            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 9 width 88.75: "fi\x{30C} ffi\x{30C}\x{30C}"
+        LayoutSVGText {text} at (42.19,160.08) size 94.27x55.91 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (42.19,160.08) size 94.27x55.91
+            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 8 width 78.46: "fi\x{30C} fi\x{30C}\x{30C}"
         LayoutSVGText {text} at (200,169) size 63.75x40 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (200,169) size 63.75x40
             chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 9 width 63.20: "fi\x{30C} ffi\x{30C}\x{30C}"
@@ -523,16 +527,16 @@
             chunk 1 text run 1 at (50.00,350.00) startOffset 0 endOffset 1 width 15.62: "\x{30C}"
             chunk 1 text run 1 at (65.62,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
             chunk 1 text run 1 at (114.69,350.00) startOffset 0 endOffset 2 width 50.55: "i\x{333}"
-        LayoutSVGText {text} at (199.41,319) size 83.38x47.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (199.41,319) size 83.38x47.13
-            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 1 width 12.24: "\x{30C}"
-            chunk 1 text run 1 at (212.24,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (261.30,350.00) startOffset 0 endOffset 2 width 21.50: "i\x{333}"
-        LayoutSVGText {text} at (335.16,318) size 94.48x48.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (335.16,318) size 94.48x48.13
-            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 1 width 14.83: "\x{30C}"
-            chunk 1 text run 1 at (364.83,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (413.90,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}"
+        LayoutSVGText {text} at (200,319) size 79.30x47.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (200,319) size 79.30x47.13
+            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 2 width 8.75: ".\x{30C}"
+            chunk 1 text run 1 at (208.75,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (257.82,350.00) startOffset 0 endOffset 2 width 21.50: "i\x{333}"
+        LayoutSVGText {text} at (350,318) size 74.86x48.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (350,318) size 74.86x48.13
+            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 2 width 14.83: ".\x{30C}"
+            chunk 1 text run 1 at (360.05,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (409.12,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}"
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.png
index c2c3cbbe..0a7b3b8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.txt
index ab8dff6..458be41 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/images/direct-image-background-color-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x564
-      LayoutImage {IMG} at (20,0) size 280x200 [bgcolor=#0000807F]
+      LayoutImage {IMG} at (20,0) size 280x200 [bgcolor=#00008080]
       LayoutBlockFlow {P} at (0,440) size 784x18
         LayoutText {#text} at (0,0) size 245x18
           text run at (0,0) width 245: "Top and bottom should look the same."
 layer at (28,240) size 280x200
-  LayoutImage {IMG} at (20,220) size 280x200 [bgcolor=#0000807F]
+  LayoutImage {IMG} at (20,220) size 280x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-content-under-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-content-under-overflow-controls-expected.png
deleted file mode 100644
index 133dc07..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/clip-content-under-overflow-controls-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
index 327618e2..1e7d8dcf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
index 3b0ff6b..be405160 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/scrollbar-painting-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/scrollbar-painting-expected.png
deleted file mode 100644
index 133dc07..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/scrollbar-painting-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/shadows/shadow-drawing-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/shadows/shadow-drawing-expected.png
index 68ef1c9..864923d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/shadows/shadow-drawing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/shadows/shadow-drawing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.png
index 41d7bbc..8d83b949 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.txt
index 4e01cf6..6a341961 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/webgl/webgl-background-color-expected.txt
@@ -3,11 +3,11 @@
 layer at (0,0) size 800x534
   LayoutBlockFlow {HTML} at (0,0) size 800x534
     LayoutBlockFlow {BODY} at (8,20) size 784x498
-      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#0000807F]
+      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#00008080]
       LayoutBlockFlow (anonymous) at (0,220) size 784x244
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,480) size 784x18
         LayoutText {#text} at (0,0) size 245x18
           text run at (0,0) width 245: "Top and bottom should look the same."
 layer at (28,260) size 240x200
-  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#0000807F]
+  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-expected.txt
index f945b7f..6c9b171 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-expected.txt
@@ -16,16 +16,16 @@
         LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#000000] [border: (20px solid #FFFFFF) (20px double #FFFFFF) (20px solid #FFFFFF)]
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {DIV} at (0,128) size 784x128 [bgcolor=#808080]
-        LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+        LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
         LayoutText {#text} at (132,108) size 4x18
           text run at (132,108) width 4: " "
-        LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+        LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
         LayoutText {#text} at (266,108) size 4x18
           text run at (266,108) width 4: " "
         LayoutBlockFlow {DIV} at (280,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px groove #808080)]
         LayoutText {#text} at (400,108) size 4x18
           text run at (400,108) width 4: " "
-        LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F) (20px double #0000FF7F) (20px solid #0000FF7F)]
+        LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80) (20px double #0000FF80) (20px solid #0000FF80)]
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {DIV} at (0,256) size 784x128
         LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#000000] [border: (20px solid #FFFFFF)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png
index 953a6ae..f194a1e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.txt
index 28f4756..f6bdafd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/backgrounds/background-leakage-transforms-expected.txt
@@ -13,10 +13,10 @@
         LayoutText {#text} at (288,118) size 4x18
           text run at (288,118) width 4: " "
         LayoutBlockFlow {DIV} at (302,10) size 268x128 [bgcolor=#808080]
-          LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+          LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
           LayoutText {#text} at (132,108) size 4x18
             text run at (132,108) width 4: " "
-          LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+          LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
           LayoutText {#text} at (0,0) size 0x0
         LayoutText {#text} at (0,0) size 0x0
 layer at (8,156) size 769x148
@@ -30,10 +30,10 @@
     LayoutText {#text} at (288,118) size 4x18
       text run at (288,118) width 4: " "
     LayoutBlockFlow {DIV} at (302,10) size 268x128 [bgcolor=#808080]
-      LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
       LayoutText {#text} at (132,108) size 4x18
         text run at (132,108) width 4: " "
-      LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+      LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
       LayoutText {#text} at (0,0) size 0x0
     LayoutText {#text} at (0,0) size 0x0
 layer at (8,304) size 158x540 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
@@ -47,9 +47,9 @@
     LayoutText {#text} at (12,268) size 18x4
       text run at (12,268) width 4: " "
     LayoutBlockFlow {DIV} at (10,282) size 138x248 [bgcolor=#808080]
-      LayoutBlockFlow {DIV} at (16,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (16,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
       LayoutText {#text} at (2,122) size 18x4
         text run at (2,122) width 4: " "
-      LayoutBlockFlow {DIV} at (16,136) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+      LayoutBlockFlow {DIV} at (16,136) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
       LayoutText {#text} at (0,0) size 0x0
     LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/block/basic/fieldset-stretch-to-legend-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/block/basic/fieldset-stretch-to-legend-expected.png
index 5b11206..b1d154a9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/block/basic/fieldset-stretch-to-legend-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/block/basic/fieldset-stretch-to-legend-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.png
index f83226b..98cb112 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.txt
index 6fdc752..27e1dbf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/intruding-painted-twice-expected.txt
@@ -19,10 +19,10 @@
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 367x18
           text run at (0,0) width 367: "These two lines of text should be the same shade of gray:"
-      LayoutBlockFlow {DIV} at (0,86) size 784x28 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,86) size 784x28 [color=#00000080]
         LayoutText {#text} at (0,0) size 267x28
           text run at (0,0) width 267: "Lorem ipsum dolor sit amet"
-      LayoutBlockFlow {DIV} at (0,114) size 784x0 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,114) size 784x0 [color=#00000080]
         LayoutBlockFlow (floating) {DIV} at (0,0) size 266.63x28
           LayoutText {#text} at (0,0) size 267x28
             text run at (0,0) width 267: "Lorem ipsum dolor sit amet"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/relative-painted-twice-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/relative-painted-twice-expected.png
index b93b363a..5f99bf4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/relative-painted-twice-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/block/float/relative-painted-twice-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-expected.txt
index 092f59a..f1fb14f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-expected.txt
@@ -3,40 +3,40 @@
 layer at (0,0) size 800x538
   LayoutBlockFlow {HTML} at (0,0) size 800x538
     LayoutBlockFlow {BODY} at (8,8) size 784x522
-      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,156) size 4x18
         text run at (170,156) width 4: " "
-      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,156) size 4x18
         text run at (344,156) width 4: " "
-      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (518,156) size 4x18
         text run at (518,156) width 4: " "
-      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (692,156) size 4x18
         text run at (692,156) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (170,330) size 4x18
         text run at (170,330) width 4: " "
-      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (344,330) size 4x18
         text run at (344,330) width 4: " "
-      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (518,330) size 4x18
         text run at (518,330) width 4: " "
-      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #0000007F) none (50px groove #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #00000080) none (50px groove #00000080) (50px solid #00000080)]
       LayoutText {#text} at (692,330) size 4x18
         text run at (692,330) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,358) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,358) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (170,504) size 4x18
         text run at (170,504) width 4: " "
-      LayoutBlockFlow {DIV} at (184,358) size 150x150 [border: (50px solid #0000007F) none (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,358) size 150x150 [border: (50px solid #00000080) none (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,504) size 4x18
         text run at (344,504) width 4: " "
-      LayoutBlockFlow {DIV} at (358,358) size 150x150 [border: (50px solid #0000007F) (50px solid #0080007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,358) size 150x150 [border: (50px solid #00000080) (50px solid #00800080) (50px solid #00000080)]
       LayoutText {#text} at (518,504) size 4x18
         text run at (518,504) width 4: " "
-      LayoutBlockFlow {DIV} at (532,358) size 150x150 [border: (50px solid #0000007F) (50px solid #0080007F) (50px solid #0000007F) (50px solid #0080007F)]
+      LayoutBlockFlow {DIV} at (532,358) size 150x150 [border: (50px solid #00000080) (50px solid #00800080) (50px solid #00000080) (50px solid #00800080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius-expected.txt
index e6de970..c46294a5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius-expected.txt
@@ -3,40 +3,40 @@
 layer at (0,0) size 800x490
   LayoutBlockFlow {HTML} at (0,0) size 800x490
     LayoutBlockFlow {BODY} at (8,8) size 784x474
-      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,156) size 4x18
         text run at (170,156) width 4: " "
-      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (344,156) size 4x18
         text run at (344,156) width 4: " "
-      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (518,156) size 4x18
         text run at (518,156) width 4: " "
-      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (692,156) size 4x18
         text run at (692,156) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (170,330) size 4x18
         text run at (170,330) width 4: " "
-      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (344,330) size 4x18
         text run at (344,330) width 4: " "
-      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (518,330) size 4x18
         text run at (518,330) width 4: " "
-      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (692,330) size 4x18
         text run at (692,330) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,358) size 150x102 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,358) size 150x102 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,456) size 4x18
         text run at (170,456) width 4: " "
-      LayoutBlockFlow {DIV} at (184,358) size 150x102 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,358) size 150x102 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,456) size 4x18
         text run at (344,456) width 4: " "
-      LayoutBlockFlow {DIV} at (358,358) size 150x102 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,358) size 150x102 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (518,456) size 4x18
         text run at (518,456) width 4: " "
-      LayoutBlockFlow {DIV} at (532,358) size 150x102 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,358) size 150x102 [border: (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius2-expected.txt
index fe88075..d54a8cbe 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/mixed-border-styles-radius2-expected.txt
@@ -3,25 +3,25 @@
 layer at (0,0) size 800x404
   LayoutBlockFlow {HTML} at (0,0) size 800x404
     LayoutBlockFlow {BODY} at (8,8) size 784x388
-      LayoutBlockFlow {DIV} at (20,20) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (20,20) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (190,176) size 4x18
         text run at (190,176) width 4: " "
-      LayoutBlockFlow {DIV} at (214,20) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (214,20) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (384,176) size 4x18
         text run at (384,176) width 4: " "
-      LayoutBlockFlow {DIV} at (408,20) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (408,20) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (578,176) size 4x18
         text run at (578,176) width 4: " "
-      LayoutBlockFlow {DIV} at (602,20) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (602,20) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (20,214) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (20,214) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (190,370) size 4x18
         text run at (190,370) width 4: " "
-      LayoutBlockFlow {DIV} at (214,214) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (214,214) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (384,370) size 4x18
         text run at (384,370) width 4: " "
-      LayoutBlockFlow {DIV} at (408,214) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (408,214) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (578,370) size 4x18
         text run at (578,370) width 4: " "
-      LayoutBlockFlow {DIV} at (602,214) size 150x150 [border: (50px solid #0000007F) none (50px groove #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (602,214) size 150x150 [border: (50px solid #00000080) none (50px groove #00000080) (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-block-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-block-expected.png
index 2177f3463..6675850 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-block-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-block-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-inline-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-inline-expected.png
index d88d15f..62db17a2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/borders/outline-alpha-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/basic-shadows-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/basic-shadows-expected.png
index de03ed6..d09434a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/basic-shadows-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/basic-shadows-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/inset-box-shadow-radius-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/inset-box-shadow-radius-expected.txt
index 3baa197..83c13bc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/inset-box-shadow-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/box-shadow/inset-box-shadow-radius-expected.txt
@@ -20,18 +20,18 @@
         LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
 layer at (12,12) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (12,12) size 280x280 [border: (10px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (12,12) size 280x280 [border: (10px solid #00FF000D)]
 layer at (12,12) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (304,12) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (304,12) size 280x280 [border: (20px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (304,12) size 280x280 [border: (20px solid #00FF000D)]
 layer at (304,12) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (12,300) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (12,300) size 280x280 [border: (50px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (12,300) size 280x280 [border: (50px solid #00FF000D)]
 layer at (12,300) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (304,300) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (304,300) size 280x280 [border: (90px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (304,300) size 280x280 [border: (90px solid #00FF000D)]
 layer at (304,300) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-expected.png
index cf6b419..89b633e1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-shadow-expected.png
index 66d320a..bfd4965 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.txt
index 94a62da..2b611ef 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/percentage-non-integer-expected.txt
@@ -5,55 +5,55 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#00FF00]
         LayoutBlockFlow {DIV} at (0,0) size 100x4
-          LayoutBlockFlow {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,4) size 1005x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.50x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.50x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,8) size 995x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.48x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.48x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,12) size 985x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.47x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.47x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,16) size 975x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.42x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.42x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,20) size 965x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.36x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.36x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,24) size 955x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,28) size 945x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.16x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.16x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,32) size 935x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.03x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.03x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,36) size 930x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.44x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.44x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,40) size 920x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,44) size 910x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.09x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.09x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,48) size 910x4
-          LayoutBlockFlow {DIV} at (0,0) size 101x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 101x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,52) size 900x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,56) size 890x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.56x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.56x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,60) size 885x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.88x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.88x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,64) size 875x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.63x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.63x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,68) size 870x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.91x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.91x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,72) size 860x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.61x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.61x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,76) size 850x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.30x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.30x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,80) size 845x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.55x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.55x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,84) size 840x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,88) size 835x4
-          LayoutBlockFlow {DIV} at (0,0) size 101.03x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 101.03x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,92) size 825x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.64x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.64x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,96) size 815x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.23x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.23x4 [bgcolor=#00000080]
       LayoutBlockFlow (anonymous) at (0,100) size 784x18
         LayoutBR {BR} at (0,0) size 0x18
 layer at (8,126) size 784x0
@@ -86,59 +86,59 @@
   LayoutTable (positioned) {TABLE} at (0,0) size 1000x20
     LayoutTableSection {TBODY} at (0,0) size 1000x20
       LayoutTableRow {TR} at (0,0) size 1000x20
-        LayoutTableCell {TD} at (0,1) size 12x18 [bgcolor=#0000007F] [r=0 c=0 rs=1 cs=1]
+        LayoutTableCell {TD} at (0,1) size 12x18 [bgcolor=#00000080] [r=0 c=0 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (12,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=1 rs=1 cs=1]
+        LayoutTableCell {TD} at (12,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=1 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (22,1) size 14x18 [bgcolor=#0000007F] [r=0 c=2 rs=1 cs=1]
+        LayoutTableCell {TD} at (22,1) size 14x18 [bgcolor=#00000080] [r=0 c=2 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (36,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=3 rs=1 cs=1]
+        LayoutTableCell {TD} at (36,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=3 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (46,1) size 16x18 [bgcolor=#0000007F] [r=0 c=4 rs=1 cs=1]
+        LayoutTableCell {TD} at (46,1) size 16x18 [bgcolor=#00000080] [r=0 c=4 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (62,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=5 rs=1 cs=1]
+        LayoutTableCell {TD} at (62,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=5 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (72,1) size 18x18 [bgcolor=#0000007F] [r=0 c=6 rs=1 cs=1]
+        LayoutTableCell {TD} at (72,1) size 18x18 [bgcolor=#00000080] [r=0 c=6 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (90,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=7 rs=1 cs=1]
+        LayoutTableCell {TD} at (90,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=7 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (100,1) size 20x18 [bgcolor=#0000007F] [r=0 c=8 rs=1 cs=1]
+        LayoutTableCell {TD} at (100,1) size 20x18 [bgcolor=#00000080] [r=0 c=8 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (120,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=9 rs=1 cs=1]
+        LayoutTableCell {TD} at (120,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=9 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (130,1) size 22x18 [bgcolor=#0000007F] [r=0 c=10 rs=1 cs=1]
+        LayoutTableCell {TD} at (130,1) size 22x18 [bgcolor=#00000080] [r=0 c=10 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (152,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=11 rs=1 cs=1]
+        LayoutTableCell {TD} at (152,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=11 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (162,1) size 24x18 [bgcolor=#0000007F] [r=0 c=12 rs=1 cs=1]
+        LayoutTableCell {TD} at (162,1) size 24x18 [bgcolor=#00000080] [r=0 c=12 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (186,10) size 10x0 [bgcolor=#00FF007F] [r=0 c=13 rs=1 cs=1]
-        LayoutTableCell {TD} at (196,1) size 26x18 [bgcolor=#0000007F] [r=0 c=14 rs=1 cs=1]
+        LayoutTableCell {TD} at (186,10) size 10x0 [bgcolor=#00FF0080] [r=0 c=13 rs=1 cs=1]
+        LayoutTableCell {TD} at (196,1) size 26x18 [bgcolor=#00000080] [r=0 c=14 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (222,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=15 rs=1 cs=1]
+        LayoutTableCell {TD} at (222,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=15 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (232,1) size 28x18 [bgcolor=#0000007F] [r=0 c=16 rs=1 cs=1]
+        LayoutTableCell {TD} at (232,1) size 28x18 [bgcolor=#00000080] [r=0 c=16 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (260,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=17 rs=1 cs=1]
+        LayoutTableCell {TD} at (260,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=17 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (270,1) size 30x18 [bgcolor=#0000007F] [r=0 c=18 rs=1 cs=1]
+        LayoutTableCell {TD} at (270,1) size 30x18 [bgcolor=#00000080] [r=0 c=18 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x18
             text run at (0,0) width 4: " "
         LayoutTableCell {TD} at (300,1) size 700x18 [r=0 c=19 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.png
index 769d73d..2347688 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.txt
index d5c462a..37db157 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/shadow-multiple-expected.txt
@@ -14,7 +14,7 @@
             text run at (123,0) width 96: "text"
         LayoutText {#text} at (218,0) size 17x56
           text run at (218,0) width 17: " "
-        LayoutInline {SPAN} at (0,0) size 128x56 [color=#0000004C]
+        LayoutInline {SPAN} at (0,0) size 128x56 [color=#0000004D]
           LayoutText {#text} at (234,0) size 128x56
             text run at (234,0) width 128: "casts"
         LayoutText {#text} at (361,0) size 17x56
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.png
index 36ad966..5ae51cf9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
index 0d29e9c2..f87a77f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
index b03a9a2a..0402c17 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
index c3cb37a..774c192 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
index 689923ed..a716aac 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
index a05280b..a99e49d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
index 8e6a3fe..07cca46 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
index b2989ba..06dc79d7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
index e1260cc5..53d82856 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
index 852f21a..1b031005 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-expected.png
index 8c6e397..8287cde2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
index 86d39519..47bb722c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-expected.png
index 1b576c4..27b65a3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
index 839ca9c..c7f6cc88 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/checkbox/checkbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/checkbox/checkbox-appearance-basic-expected.png
index e47dc3f..c35ccd6c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/checkbox/checkbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/checkbox/checkbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-expected.png
index 5cdc49e..bd700c3c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
index 14f9bc4..50a7446b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
index 61dcb76..a8162a1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
index 1ee6c16..2495919b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
index 833b382ee..f34d853 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/radio/radio-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/radio/radio-appearance-basic-expected.png
index 2eda1723..b4ec6017 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/radio/radio-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/radio/radio-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/range/range-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/range/range-appearance-basic-expected.png
index 69828b4..fbd18524 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/range/range-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/range/range-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.png
index f81e9d0..d87dc5d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/search/search-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.png
index 4908c22f..45d0bb16 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-basic-expected.png
index 1046833..6ae2984 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/submit/submit-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/submit/submit-appearance-basic-expected.png
index 3a5e3200..1719f74 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/submit/submit-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/submit/submit-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-basic-expected.png
index c214617..63c413a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/text/text-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-appearance-basic-expected.png
index 0569882..1ba60844 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/gradient-after-transparent-border-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/gradient-after-transparent-border-expected.png
index 6ef6477..3a38941 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/gradient-after-transparent-border-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/gradients/gradient-after-transparent-border-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.png
index 44a3c464..66f653a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.txt
index 9b2a0d1..2c506b30 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/overflow/float-in-relpositioned-expected.txt
@@ -29,15 +29,15 @@
   LayoutBlockFlow {DIV} at (10,404) size 102x102 [border: (1px solid #000000)]
 layer at (69,77) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (19,239) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (69,301) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
 layer at (69,301) size 75x75 backgroundClip at (19,301) size 100x85 clip at (19,301) size 100x85
-  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (19,463) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
 layer at (19,463) size 75x75 backgroundClip at (19,413) size 85x100 clip at (19,413) size 85x100
-  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/select-ruby-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/select-ruby-expected.png
index 50335d5c..1b66e5f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/select-ruby-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/ruby/select-ruby-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.png
index 2570f57..a620ffae9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/text/shadow-no-blur-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.txt
similarity index 99%
rename from third_party/WebKit/LayoutTests/fast/text/shadow-no-blur-expected.txt
rename to third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.txt
index 0d5f169..3b73ac7 100644
--- a/third_party/WebKit/LayoutTests/fast/text/shadow-no-blur-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-no-blur-expected.txt
@@ -3,7 +3,7 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-      LayoutBlockFlow {DIV} at (0,0) size 784x280 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,0) size 784x280 [color=#00000080]
         LayoutBlockFlow {DIV} at (0,0) size 784x56
           LayoutText {#text} at (0,0) size 298x56
             text run at (0,0) width 298: "Text shadow"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png
index 1b38129..4a2af41 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt
index 70d0c99..15b9bdea 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt
@@ -15,7 +15,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
@@ -30,7 +30,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
@@ -45,7 +45,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/composited-overflow-with-borderbox-background-expected.png b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
index 05d0ea92..21b0b3d9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png
index 5d14a18..ac8bc98 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt
index a532517a..b95f3fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/combining-character-queries-expected.txt
@@ -201,26 +201,22 @@
           LayoutSVGText {text} at (91.36,214) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (91.36,214) size 4x9
               chunk 1 (middle anchor) text run 1 at (91.37,221.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (98.23,161) size 0.42x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=98.23] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (96.42,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.42,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (96.44,221.00) startOffset 0 endOffset 1 width 4.00: "4"
-          LayoutSVGRect {rect} at (98.65,161) size 0.42x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=98.65] [y=161.00] [width=0.42] [height=55.00]
-          LayoutSVGText {text} at (96.84,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.84,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (96.86,221.00) startOffset 0 endOffset 1 width 4.00: "5"
-          LayoutSVGRect {rect} at (99.06,161) size 12.56x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=99.06] [y=161.00] [width=12.56] [height=55.00]
-          LayoutSVGText {text} at (103.34,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (103.34,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (103.35,221.00) startOffset 0 endOffset 1 width 4.00: "6"
-          LayoutSVGRect {rect} at (111.63,161) size 12.56x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=111.63] [y=161.00] [width=12.56] [height=55.00]
-          LayoutSVGText {text} at (115.91,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (115.91,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (115.91,221.00) startOffset 0 endOffset 1 width 4.00: "7"
-          LayoutSVGRect {rect} at (124.19,161) size 12.56x55 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=124.19] [y=161.00] [width=12.56] [height=55.00]
-          LayoutSVGText {text} at (128.45,214) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (128.45,214) size 4x9
-              chunk 1 (middle anchor) text run 1 at (128.47,221.00) startOffset 0 endOffset 1 width 4.00: "8"
+          LayoutSVGRect {rect} at (98.23,161) size 5.97x55 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=98.23] [y=161.00] [width=5.97] [height=55.00]
+          LayoutSVGText {text} at (99.20,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (99.20,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (99.21,221.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (104.20,161) size 10.84x55 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=104.20] [y=161.00] [width=10.84] [height=55.00]
+          LayoutSVGText {text} at (107.61,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (107.61,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (107.62,221.00) startOffset 0 endOffset 1 width 4.00: "5"
+          LayoutSVGRect {rect} at (115.04,161) size 10.84x55 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=115.04] [y=161.00] [width=10.84] [height=55.00]
+          LayoutSVGText {text} at (118.45,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (118.45,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (118.47,221.00) startOffset 0 endOffset 1 width 4.00: "6"
+          LayoutSVGRect {rect} at (125.89,161) size 10.84x55 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=125.89] [y=161.00] [width=10.84] [height=55.00]
+          LayoutSVGText {text} at (129.30,214) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (129.30,214) size 4x9
+              chunk 1 (middle anchor) text run 1 at (129.31,221.00) startOffset 0 endOffset 1 width 4.00: "7"
           LayoutSVGRect {rect} at (200,169) size 11.66x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=169.00] [width=11.66] [height=40.00]
           LayoutSVGText {text} at (203.81,207) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (203.81,207) size 4x9
@@ -429,38 +425,46 @@
           LayoutSVGText {text} at (150.59,364) size 4x9 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (150.59,364) size 4x9
               chunk 1 (middle anchor) text run 1 at (150.60,371.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (200,319) size 12.24x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=12.24] [height=40.00]
-          LayoutSVGText {text} at (204.11,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (204.11,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (204.12,364.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (212.24,319) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=212.24] [y=319.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (234.77,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (234.77,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (234.77,364.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (261.30,319) size 10.75x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=261.30] [y=319.00] [width=10.75] [height=40.00]
-          LayoutSVGText {text} at (264.67,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (264.67,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (264.68,364.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (272.05,319) size 10.75x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=272.05] [y=319.00] [width=10.75] [height=40.00]
-          LayoutSVGText {text} at (275.42,357) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (275.42,357) size 4x9
-              chunk 1 (middle anchor) text run 1 at (275.43,364.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (350,318) size 14.83x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=14.83] [height=40.00]
-          LayoutSVGText {text} at (355.41,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (355.41,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (355.42,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (364.83,318) size 49.07x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=364.83] [y=318.00] [width=49.07] [height=40.00]
-          LayoutSVGText {text} at (387.36,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (387.36,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (387.37,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (413.90,318) size 7.88x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=413.90] [y=318.00] [width=7.88] [height=40.00]
-          LayoutSVGText {text} at (415.83,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (415.83,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (415.84,363.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (421.78,318) size 7.88x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=421.78] [y=318.00] [width=7.88] [height=40.00]
-          LayoutSVGText {text} at (423.70,356) size 4x9 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (423.70,356) size 4x9
-              chunk 1 (middle anchor) text run 1 at (423.72,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (200,319) size 4.38x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (200.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (200.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (200.19,364.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (204.38,319) size 4.38x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.38] [y=319.00] [width=4.38] [height=40.00]
+          LayoutSVGText {text} at (204.56,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (204.56,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (204.56,364.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (208.75,319) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=208.75] [y=319.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (231.28,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (231.28,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (231.28,364.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (257.82,319) size 10.75x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=257.82] [y=319.00] [width=10.75] [height=40.00]
+          LayoutSVGText {text} at (261.19,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (261.19,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (261.19,364.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (268.57,319) size 10.75x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=268.57] [y=319.00] [width=10.75] [height=40.00]
+          LayoutSVGText {text} at (271.94,357) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (271.94,357) size 4x9
+              chunk 1 (middle anchor) text run 1 at (271.94,364.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (350,318) size 5.02x40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=5.02] [height=40.00]
+          LayoutSVGText {text} at (350.50,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (350.50,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (350.51,363.00) startOffset 0 endOffset 1 width 4.00: "0"
+          LayoutSVGRect {rect} at (355.02,318) size 5.02x40 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=355.02] [y=318.00] [width=5.02] [height=40.00]
+          LayoutSVGText {text} at (355.53,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (355.53,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (355.54,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (360.05,318) size 49.07x40 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=360.05] [y=318.00] [width=49.07] [height=40.00]
+          LayoutSVGText {text} at (382.58,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (382.58,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (382.58,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (409.12,318) size 7.88x40 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=409.12] [y=318.00] [width=7.88] [height=40.00]
+          LayoutSVGText {text} at (411.05,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (411.05,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (411.05,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (417,318) size 7.88x40 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=416.99] [y=318.00] [width=7.88] [height=40.00]
+          LayoutSVGText {text} at (418.92,356) size 4x9 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (418.92,356) size 4x9
+              chunk 1 (middle anchor) text run 1 at (418.93,363.00) startOffset 0 endOffset 1 width 4.00: "4"
         LayoutSVGText {text} at (50,10.09) size 49.50x55.89 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (50,10.09) size 49.50x55.89
             chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 6 width 48.33: "ab\x{30C}c\x{30C}\x{30C}"
@@ -494,9 +498,9 @@
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 19.47: "a"
             chunk 1 text run 1 at (400.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
-        LayoutSVGText {text} at (42.19,160.08) size 80.94x55.91 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (42.19,160.08) size 80.94x55.91
-            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 9 width 73.13: "fi\x{30C} ffi\x{30C}\x{30C}"
+        LayoutSVGText {text} at (42.19,160.08) size 70.64x55.91 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (42.19,160.08) size 70.64x55.91
+            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 8 width 62.84: "fi\x{30C} fi\x{30C}\x{30C}"
         LayoutSVGText {text} at (200,169) size 63.75x40 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (200,169) size 63.75x40
             chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 9 width 63.20: "fi\x{30C} ffi\x{30C}\x{30C}"
@@ -523,16 +527,16 @@
             chunk 1 text run 1 at (50.00,350.00) startOffset 0 endOffset 1 width 15.62: "\x{30C}"
             chunk 1 text run 1 at (65.62,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
             chunk 1 text run 1 at (114.69,350.00) startOffset 0 endOffset 2 width 50.55: "i\x{333}"
-        LayoutSVGText {text} at (199.41,319) size 83.38x47.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (199.41,319) size 83.38x47.13
-            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 1 width 12.24: "\x{30C}"
-            chunk 1 text run 1 at (212.24,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (261.30,350.00) startOffset 0 endOffset 2 width 21.50: "i\x{333}"
-        LayoutSVGText {text} at (335.16,318) size 94.48x48.13 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (335.16,318) size 94.48x48.13
-            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 1 width 14.83: "\x{30C}"
-            chunk 1 text run 1 at (364.83,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (413.90,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}"
+        LayoutSVGText {text} at (200,319) size 79.30x47.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (200,319) size 79.30x47.13
+            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 2 width 8.75: ".\x{30C}"
+            chunk 1 text run 1 at (208.75,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (257.82,350.00) startOffset 0 endOffset 2 width 21.50: "i\x{333}"
+        LayoutSVGText {text} at (350,318) size 74.86x48.13 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (350,318) size 74.86x48.13
+            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 2 width 14.83: ".\x{30C}"
+            chunk 1 text run 1 at (360.05,350.00) startOffset 0 endOffset 1 width 49.07 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (409.12,350.00) startOffset 0 endOffset 2 width 15.76: "i\x{333}"
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png
index cdf75d49..25b8f772 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/svg/text/text-fill-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
index 056d0f0..a2f7602 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
index db5173dc..4a0be3f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
@@ -35,4 +35,4 @@
 layer at (124,114) size 100x100
   LayoutBlockFlow (relative positioned) {DIV} at (51,51) size 100x100 [bgcolor=#0000FF]
 layer at (22,22) size 150x300
-  LayoutBlockFlow (positioned) {DIV} at (1,1) size 150x300 [bgcolor=#0080004C]
+  LayoutBlockFlow (positioned) {DIV} at (1,1) size 150x300 [bgcolor=#0080004D]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
index cf6b419..89b633e1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
index 66d320a..bfd4965 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
index 9dc0dbf..74c3cda1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
index 59274cf..623dc9a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png
deleted file mode 100644
index 133dc07..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
index 9a7b355..0cc11fd5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/spinvalidation/paint/invalidation/composited-overflow-with-borderbox-background-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/spinvalidation/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
new file mode 100644
index 0000000..21b0b3d9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/spinvalidation/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/paint/invalidation/composited-overflow-with-borderbox-background-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
new file mode 100644
index 0000000..21b0b3d9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/paint/invalidation/composited-overflow-with-borderbox-background-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
index 41d7bbc..8d83b949 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
new file mode 100644
index 0000000..6a341961
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x534
+  LayoutBlockFlow {HTML} at (0,0) size 800x534
+    LayoutBlockFlow {BODY} at (8,20) size 784x498
+      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#00008080]
+      LayoutBlockFlow (anonymous) at (0,220) size 784x244
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,480) size 784x18
+        LayoutText {#text} at (0,0) size 245x18
+          text run at (0,0) width 245: "Top and bottom should look the same."
+layer at (28,260) size 240x200
+  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png
index 22bd897..8809638 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-div-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png
index cba2e2a..d4917a0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png
index e769c1fe..0838645 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/gestures/gesture-tapHighlight-pixel-transparent-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.png
index 16442de..7415e58b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.txt
index d73194e..fe67fbdb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/images/direct-image-background-color-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,20) size 784x564
-      LayoutImage {IMG} at (20,0) size 280x200 [bgcolor=#0000807F]
+      LayoutImage {IMG} at (20,0) size 280x200 [bgcolor=#00008080]
       LayoutBlockFlow {P} at (0,440) size 784x18
         LayoutText {#text} at (0,0) size 245x17
           text run at (0,0) width 245: "Top and bottom should look the same."
 layer at (28,240) size 280x200
-  LayoutImage {IMG} at (20,220) size 280x200 [bgcolor=#0000807F]
+  LayoutImage {IMG} at (20,220) size 280x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
index 9fe5fa84..ced3f3f5 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-opaque-to-transparent-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
index 017596a..0d2ca44 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/overflow/overflow-scroll-background-transparent-to-opaque-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/scrollbar-painting-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/scrollbar-painting-expected.png
deleted file mode 100644
index 8695e80..0000000
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/scrollbar-painting-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/shadows/shadow-drawing-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/shadows/shadow-drawing-expected.png
index 1a42947..7546b31e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/shadows/shadow-drawing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/shadows/shadow-drawing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.png
index 7391cc8..6c8ec4a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.txt
index 91628ed..61d6fc5c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/webgl/webgl-background-color-expected.txt
@@ -3,11 +3,11 @@
 layer at (0,0) size 800x534
   LayoutBlockFlow {HTML} at (0,0) size 800x534
     LayoutBlockFlow {BODY} at (8,20) size 784x498
-      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#0000807F]
+      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#00008080]
       LayoutBlockFlow (anonymous) at (0,220) size 784x244
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,480) size 784x18
         LayoutText {#text} at (0,0) size 245x17
           text run at (0,0) width 245: "Top and bottom should look the same."
 layer at (28,260) size 240x200
-  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#0000807F]
+  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-expected.txt
index 401f874..282316a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-expected.txt
@@ -16,16 +16,16 @@
         LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#000000] [border: (20px solid #FFFFFF) (20px double #FFFFFF) (20px solid #FFFFFF)]
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {DIV} at (0,128) size 784x128 [bgcolor=#808080]
-        LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+        LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
         LayoutText {#text} at (132,108) size 4x17
           text run at (132,108) width 4: " "
-        LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+        LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
         LayoutText {#text} at (266,108) size 4x17
           text run at (266,108) width 4: " "
         LayoutBlockFlow {DIV} at (280,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px groove #808080)]
         LayoutText {#text} at (400,108) size 4x17
           text run at (400,108) width 4: " "
-        LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F) (20px double #0000FF7F) (20px solid #0000FF7F)]
+        LayoutBlockFlow {DIV} at (414,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80) (20px double #0000FF80) (20px solid #0000FF80)]
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {DIV} at (0,256) size 784x128
         LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#000000] [border: (20px solid #FFFFFF)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png
index 2ba3c5d..7a4c3ac 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.txt
index 1db8f0b..0f25cb9d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/backgrounds/background-leakage-transforms-expected.txt
@@ -13,10 +13,10 @@
         LayoutText {#text} at (288,118) size 4x17
           text run at (288,118) width 4: " "
         LayoutBlockFlow {DIV} at (302,10) size 268x128 [bgcolor=#808080]
-          LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+          LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
           LayoutText {#text} at (132,108) size 4x17
             text run at (132,108) width 4: " "
-          LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+          LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
           LayoutText {#text} at (0,0) size 0x0
         LayoutText {#text} at (0,0) size 0x0
 layer at (8,156) size 769x148
@@ -30,10 +30,10 @@
     LayoutText {#text} at (288,118) size 4x17
       text run at (288,118) width 4: " "
     LayoutBlockFlow {DIV} at (302,10) size 268x128 [bgcolor=#808080]
-      LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (12,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
       LayoutText {#text} at (132,108) size 4x17
         text run at (132,108) width 4: " "
-      LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+      LayoutBlockFlow {DIV} at (146,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
       LayoutText {#text} at (0,0) size 0x0
     LayoutText {#text} at (0,0) size 0x0
 layer at (8,304) size 158x540 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
@@ -47,9 +47,9 @@
     LayoutText {#text} at (12,268) size 17x4
       text run at (12,268) width 4: " "
     LayoutBlockFlow {DIV} at (10,282) size 138x248 [bgcolor=#808080]
-      LayoutBlockFlow {DIV} at (15,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF7F)]
+      LayoutBlockFlow {DIV} at (15,12) size 110x100 [bgcolor=#FFFFFF] [border: (20px solid #0000FF80)]
       LayoutText {#text} at (2,122) size 17x4
         text run at (2,122) width 4: " "
-      LayoutBlockFlow {DIV} at (15,136) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF7F)]
+      LayoutBlockFlow {DIV} at (15,136) size 110x100 [bgcolor=#FFFFFF] [border: (20px double #0000FF80)]
       LayoutText {#text} at (0,0) size 0x0
     LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png
index 312d40b..25b7184b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/block/basic/fieldset-stretch-to-legend-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.png
index 34a9faa..d747e85 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.txt
index dafa0525..d36b6ba 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/block/float/intruding-painted-twice-expected.txt
@@ -19,10 +19,10 @@
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 367x17
           text run at (0,0) width 367: "These two lines of text should be the same shade of gray:"
-      LayoutBlockFlow {DIV} at (0,86) size 784x27 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,86) size 784x27 [color=#00000080]
         LayoutText {#text} at (0,0) size 267x26
           text run at (0,0) width 267: "Lorem ipsum dolor sit amet"
-      LayoutBlockFlow {DIV} at (0,113) size 784x0 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,113) size 784x0 [color=#00000080]
         LayoutBlockFlow (floating) {DIV} at (0,0) size 266.63x27
           LayoutText {#text} at (0,0) size 267x26
             text run at (0,0) width 267: "Lorem ipsum dolor sit amet"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/block/float/relative-painted-twice-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/block/float/relative-painted-twice-expected.png
index eafd224..92cd3a3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/block/float/relative-painted-twice-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/block/float/relative-painted-twice-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-expected.txt
index 35b83fce..116a926 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-expected.txt
@@ -3,40 +3,40 @@
 layer at (0,0) size 800x538
   LayoutBlockFlow {HTML} at (0,0) size 800x538
     LayoutBlockFlow {BODY} at (8,8) size 784x522
-      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,156) size 4x17
         text run at (170,156) width 4: " "
-      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,156) size 4x17
         text run at (344,156) width 4: " "
-      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (518,156) size 4x17
         text run at (518,156) width 4: " "
-      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (692,156) size 4x17
         text run at (692,156) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (170,330) size 4x17
         text run at (170,330) width 4: " "
-      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (344,330) size 4x17
         text run at (344,330) width 4: " "
-      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (518,330) size 4x17
         text run at (518,330) width 4: " "
-      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #0000007F) none (50px groove #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #00000080) none (50px groove #00000080) (50px solid #00000080)]
       LayoutText {#text} at (692,330) size 4x17
         text run at (692,330) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,358) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,358) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (170,504) size 4x17
         text run at (170,504) width 4: " "
-      LayoutBlockFlow {DIV} at (184,358) size 150x150 [border: (50px solid #0000007F) none (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,358) size 150x150 [border: (50px solid #00000080) none (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,504) size 4x17
         text run at (344,504) width 4: " "
-      LayoutBlockFlow {DIV} at (358,358) size 150x150 [border: (50px solid #0000007F) (50px solid #0080007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,358) size 150x150 [border: (50px solid #00000080) (50px solid #00800080) (50px solid #00000080)]
       LayoutText {#text} at (518,504) size 4x17
         text run at (518,504) width 4: " "
-      LayoutBlockFlow {DIV} at (532,358) size 150x150 [border: (50px solid #0000007F) (50px solid #0080007F) (50px solid #0000007F) (50px solid #0080007F)]
+      LayoutBlockFlow {DIV} at (532,358) size 150x150 [border: (50px solid #00000080) (50px solid #00800080) (50px solid #00000080) (50px solid #00800080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius-expected.txt
index dbec691..36fc2e4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius-expected.txt
@@ -3,40 +3,40 @@
 layer at (0,0) size 800x490
   LayoutBlockFlow {HTML} at (0,0) size 800x490
     LayoutBlockFlow {BODY} at (8,8) size 784x474
-      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,156) size 4x17
         text run at (170,156) width 4: " "
-      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,10) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (344,156) size 4x17
         text run at (344,156) width 4: " "
-      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,10) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (518,156) size 4x17
         text run at (518,156) width 4: " "
-      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,10) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (692,156) size 4x17
         text run at (692,156) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,184) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (170,330) size 4x17
         text run at (170,330) width 4: " "
-      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,184) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (344,330) size 4x17
         text run at (344,330) width 4: " "
-      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (518,330) size 4x17
         text run at (518,330) width 4: " "
-      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,184) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (692,330) size 4x17
         text run at (692,330) width 4: " "
       LayoutBR {BR} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (10,358) size 150x102 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (10,358) size 150x102 [border: (50px solid #00000080)]
       LayoutText {#text} at (170,456) size 4x17
         text run at (170,456) width 4: " "
-      LayoutBlockFlow {DIV} at (184,358) size 150x102 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (184,358) size 150x102 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (344,456) size 4x17
         text run at (344,456) width 4: " "
-      LayoutBlockFlow {DIV} at (358,358) size 150x102 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (358,358) size 150x102 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (518,456) size 4x17
         text run at (518,456) width 4: " "
-      LayoutBlockFlow {DIV} at (532,358) size 150x102 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (532,358) size 150x102 [border: (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius2-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius2-expected.txt
index bb9030739..acdf388e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/borders/mixed-border-styles-radius2-expected.txt
@@ -3,25 +3,25 @@
 layer at (0,0) size 800x404
   LayoutBlockFlow {HTML} at (0,0) size 800x404
     LayoutBlockFlow {BODY} at (8,8) size 784x388
-      LayoutBlockFlow {DIV} at (20,20) size 150x150 [border: (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (20,20) size 150x150 [border: (50px solid #00000080)]
       LayoutText {#text} at (190,176) size 4x17
         text run at (190,176) width 4: " "
-      LayoutBlockFlow {DIV} at (214,20) size 150x150 [border: (50px solid #0000007F) (50px double #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (214,20) size 150x150 [border: (50px solid #00000080) (50px double #00000080) (50px solid #00000080)]
       LayoutText {#text} at (384,176) size 4x17
         text run at (384,176) width 4: " "
-      LayoutBlockFlow {DIV} at (408,20) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (408,20) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (578,176) size 4x17
         text run at (578,176) width 4: " "
-      LayoutBlockFlow {DIV} at (602,20) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (602,20) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {DIV} at (20,214) size 150x150 [border: (50px solid #0000007F) (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (20,214) size 150x150 [border: (50px solid #00000080) (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (190,370) size 4x17
         text run at (190,370) width 4: " "
-      LayoutBlockFlow {DIV} at (214,214) size 150x150 [border: (50px solid #0000007F) none (50px solid #00000000) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (214,214) size 150x150 [border: (50px solid #00000080) none (50px solid #00000000) (50px solid #00000080)]
       LayoutText {#text} at (384,370) size 4x17
         text run at (384,370) width 4: " "
-      LayoutBlockFlow {DIV} at (408,214) size 150x150 [border: (50px solid #0000007F) none (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (408,214) size 150x150 [border: (50px solid #00000080) none (50px solid #00000080)]
       LayoutText {#text} at (578,370) size 4x17
         text run at (578,370) width 4: " "
-      LayoutBlockFlow {DIV} at (602,214) size 150x150 [border: (50px solid #0000007F) none (50px groove #0000007F) (50px solid #0000007F)]
+      LayoutBlockFlow {DIV} at (602,214) size 150x150 [border: (50px solid #00000080) none (50px groove #00000080) (50px solid #00000080)]
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-block-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-block-expected.png
index a7bc509..c93f7ef 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-block-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-block-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-inline-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-inline-expected.png
index 156039d..52d1931 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/borders/outline-alpha-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/basic-shadows-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/basic-shadows-expected.png
index 388c45b..bddf115 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/basic-shadows-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/basic-shadows-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/inset-box-shadow-radius-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/inset-box-shadow-radius-expected.txt
index 0df3631..b20c5f56 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/inset-box-shadow-radius-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/box-shadow/inset-box-shadow-radius-expected.txt
@@ -20,18 +20,18 @@
         LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
 layer at (12,12) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (12,12) size 280x280 [border: (10px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (12,12) size 280x280 [border: (10px solid #00FF000D)]
 layer at (12,12) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (304,12) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (304,12) size 280x280 [border: (20px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (304,12) size 280x280 [border: (20px solid #00FF000D)]
 layer at (304,12) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (12,300) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (12,300) size 280x280 [border: (50px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (12,300) size 280x280 [border: (50px solid #00FF000D)]
 layer at (12,300) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
 layer at (304,300) size 280x280
-  LayoutBlockFlow (positioned) {DIV} at (304,300) size 280x280 [border: (90px solid #00FF000C)]
+  LayoutBlockFlow (positioned) {DIV} at (304,300) size 280x280 [border: (90px solid #00FF000D)]
 layer at (304,300) size 280x280
   LayoutBlockFlow (relative positioned) {DIV} at (0,0) size 280x280
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-expected.png
index b24c587..435d4ad 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png
index 2ee3fbd..fe3c4887 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/percentage-non-integer-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/percentage-non-integer-expected.txt
index cf475d9..dc4c4a8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/percentage-non-integer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/percentage-non-integer-expected.txt
@@ -5,55 +5,55 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {DIV} at (0,0) size 100x100 [bgcolor=#00FF00]
         LayoutBlockFlow {DIV} at (0,0) size 100x4
-          LayoutBlockFlow {DIV} at (0,0) size 100x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,4) size 1005x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.50x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.50x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,8) size 995x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.48x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.48x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,12) size 985x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.47x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.47x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,16) size 975x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.42x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.42x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,20) size 965x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.36x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.36x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,24) size 955x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,28) size 945x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.16x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.16x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,32) size 935x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.03x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.03x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,36) size 930x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.44x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.44x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,40) size 920x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.27x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,44) size 910x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.09x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.09x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,48) size 910x4
-          LayoutBlockFlow {DIV} at (0,0) size 101x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 101x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,52) size 900x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,56) size 890x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.56x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.56x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,60) size 885x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.88x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.88x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,64) size 875x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.63x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.63x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,68) size 870x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.91x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.91x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,72) size 860x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.61x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.61x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,76) size 850x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.30x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.30x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,80) size 845x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.55x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.55x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,84) size 840x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.80x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,88) size 835x4
-          LayoutBlockFlow {DIV} at (0,0) size 101.03x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 101.03x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,92) size 825x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.64x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.64x4 [bgcolor=#00000080]
         LayoutBlockFlow {DIV} at (0,96) size 815x4
-          LayoutBlockFlow {DIV} at (0,0) size 100.23x4 [bgcolor=#0000007F]
+          LayoutBlockFlow {DIV} at (0,0) size 100.23x4 [bgcolor=#00000080]
       LayoutBlockFlow (anonymous) at (0,100) size 784x18
         LayoutBR {BR} at (0,0) size 0x17
 layer at (8,126) size 784x0
@@ -86,59 +86,59 @@
   LayoutTable (positioned) {TABLE} at (0,0) size 1000x20
     LayoutTableSection {TBODY} at (0,0) size 1000x20
       LayoutTableRow {TR} at (0,0) size 1000x20
-        LayoutTableCell {TD} at (0,1) size 12x18 [bgcolor=#0000007F] [r=0 c=0 rs=1 cs=1]
+        LayoutTableCell {TD} at (0,1) size 12x18 [bgcolor=#00000080] [r=0 c=0 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (12,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=1 rs=1 cs=1]
+        LayoutTableCell {TD} at (12,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=1 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (22,1) size 14x18 [bgcolor=#0000007F] [r=0 c=2 rs=1 cs=1]
+        LayoutTableCell {TD} at (22,1) size 14x18 [bgcolor=#00000080] [r=0 c=2 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (36,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=3 rs=1 cs=1]
+        LayoutTableCell {TD} at (36,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=3 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (46,1) size 16x18 [bgcolor=#0000007F] [r=0 c=4 rs=1 cs=1]
+        LayoutTableCell {TD} at (46,1) size 16x18 [bgcolor=#00000080] [r=0 c=4 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (62,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=5 rs=1 cs=1]
+        LayoutTableCell {TD} at (62,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=5 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (72,1) size 18x18 [bgcolor=#0000007F] [r=0 c=6 rs=1 cs=1]
+        LayoutTableCell {TD} at (72,1) size 18x18 [bgcolor=#00000080] [r=0 c=6 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (90,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=7 rs=1 cs=1]
+        LayoutTableCell {TD} at (90,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=7 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (100,1) size 20x18 [bgcolor=#0000007F] [r=0 c=8 rs=1 cs=1]
+        LayoutTableCell {TD} at (100,1) size 20x18 [bgcolor=#00000080] [r=0 c=8 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (120,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=9 rs=1 cs=1]
+        LayoutTableCell {TD} at (120,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=9 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (130,1) size 22x18 [bgcolor=#0000007F] [r=0 c=10 rs=1 cs=1]
+        LayoutTableCell {TD} at (130,1) size 22x18 [bgcolor=#00000080] [r=0 c=10 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (152,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=11 rs=1 cs=1]
+        LayoutTableCell {TD} at (152,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=11 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (162,1) size 24x18 [bgcolor=#0000007F] [r=0 c=12 rs=1 cs=1]
+        LayoutTableCell {TD} at (162,1) size 24x18 [bgcolor=#00000080] [r=0 c=12 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (186,10) size 10x0 [bgcolor=#00FF007F] [r=0 c=13 rs=1 cs=1]
-        LayoutTableCell {TD} at (196,1) size 26x18 [bgcolor=#0000007F] [r=0 c=14 rs=1 cs=1]
+        LayoutTableCell {TD} at (186,10) size 10x0 [bgcolor=#00FF0080] [r=0 c=13 rs=1 cs=1]
+        LayoutTableCell {TD} at (196,1) size 26x18 [bgcolor=#00000080] [r=0 c=14 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (222,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=15 rs=1 cs=1]
+        LayoutTableCell {TD} at (222,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=15 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (232,1) size 28x18 [bgcolor=#0000007F] [r=0 c=16 rs=1 cs=1]
+        LayoutTableCell {TD} at (232,1) size 28x18 [bgcolor=#00000080] [r=0 c=16 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (260,1) size 10x18 [bgcolor=#00FF007F] [r=0 c=17 rs=1 cs=1]
+        LayoutTableCell {TD} at (260,1) size 10x18 [bgcolor=#00FF0080] [r=0 c=17 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
-        LayoutTableCell {TD} at (270,1) size 30x18 [bgcolor=#0000007F] [r=0 c=18 rs=1 cs=1]
+        LayoutTableCell {TD} at (270,1) size 30x18 [bgcolor=#00000080] [r=0 c=18 rs=1 cs=1]
           LayoutText {#text} at (0,0) size 4x17
             text run at (0,0) width 4: " "
         LayoutTableCell {TD} at (300,1) size 700x18 [r=0 c=19 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.png
index f608350..6b0e230 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.txt
index 6671e7d..c57ac15 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/css/shadow-multiple-expected.txt
@@ -14,7 +14,7 @@
             text run at (102,1) width 78: "text"
         LayoutText {#text} at (179,1) size 13x53
           text run at (179,1) width 13: " "
-        LayoutInline {SPAN} at (0,0) size 100x53 [color=#0000004C]
+        LayoutInline {SPAN} at (0,0) size 100x53 [color=#0000004D]
           LayoutText {#text} at (191,1) size 100x53
             text run at (191,1) width 100: "casts"
         LayoutText {#text} at (290,1) size 13x53
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLMeterElement/meter-styles-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLMeterElement/meter-styles-expected.png
index 29359bf..74a6019 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLMeterElement/meter-styles-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLMeterElement/meter-styles-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
index 3834425..3a54ed89 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
index a87ab03..25004b8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
index 5bd0ecc..cfe18a93 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
index c72f6c6..e592f920 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
index 6f565fa6..3cb2a65 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
index b420990..7ef03a1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-ru-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
index 493a7a6..4a01ef1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
index b4a3a725..a27a78dc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
index c75bdc8..5609f191 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-expected.png
index f49565a2..d5aff82 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
index a5289441..8867267 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-expected.png
index 9a3b7b2..e8825b9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
index 8c971c6..5a6fded0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/checkbox/checkbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/checkbox/checkbox-appearance-basic-expected.png
index 6df8e97f..d57c299 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/checkbox/checkbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/checkbox/checkbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-expected.png
index 9da94d7..21858ee 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
index 035243ff..b15cf4d5 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
index 593bbb3..ab49a424 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-one-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
index 197523fa..e0d192e3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/color/color-suggestion-picker-two-row-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/radio/radio-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/radio/radio-appearance-basic-expected.png
index e8660e9..388a2001 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/radio/radio-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/radio/radio-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png
index a094426..926003e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/range/range-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.png
index b8d8926..5e79026 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/search/search-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png
index c11da768..2fcfba3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/listbox-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
index 28bac72..6ff5e79 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/submit/submit-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/submit/submit-appearance-basic-expected.png
index 206812f..89e3875 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/submit/submit-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/submit/submit-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-basic-expected.png
index f0cb9b2..dcdb860 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/text/text-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-appearance-basic-expected.png
index 5d74470..db8fefc3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/gradient-after-transparent-border-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/gradient-after-transparent-border-expected.png
index 62b379a..e35cfe53 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/gradients/gradient-after-transparent-border-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/gradients/gradient-after-transparent-border-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.png
index 5f96462..85551fe 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.txt
index ab04f1e..d454fe0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/overflow/float-in-relpositioned-expected.txt
@@ -29,15 +29,15 @@
   LayoutBlockFlow {DIV} at (10,404) size 102x102 [border: (1px solid #000000)]
 layer at (69,77) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (19,239) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
-    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+    LayoutBlockFlow (floating) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (69,301) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
 layer at (69,301) size 75x75 backgroundClip at (19,301) size 100x85 clip at (19,301) size 100x85
-  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
 layer at (19,463) size 25x25
   LayoutBlockFlow (relative positioned) {DIV} at (1,1) size 25x25 [bgcolor=#000000]
 layer at (19,463) size 75x75 backgroundClip at (19,413) size 85x100 clip at (19,413) size 85x100
-  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF7F]
+  LayoutBlockFlow (positioned) {DIV} at (0,0) size 75x75 [bgcolor=#0000FF80]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.png
index 470956a..2c6516be 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.txt
index 3d0e4b8..2aa7b50 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-no-blur-expected.txt
@@ -3,7 +3,7 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-      LayoutBlockFlow {DIV} at (0,0) size 784x275 [color=#0000007F]
+      LayoutBlockFlow {DIV} at (0,0) size 784x275 [color=#00000080]
         LayoutBlockFlow {DIV} at (0,0) size 784x55
           LayoutText {#text} at (0,1) size 244x53
             text run at (0,1) width 244: "Text shadow"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png
index 8962e82..68fae62 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt
index 033a353..75f9191 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt
@@ -15,7 +15,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
@@ -30,7 +30,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
@@ -45,7 +45,7 @@
             text run at (48,0) width 24: "A"
         LayoutText {#text} at (72,0) size 24x24
           text run at (72,0) width 24: " "
-        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000001A]
           LayoutText {#text} at (96,0) size 24x24
             text run at (96,0) width 24: "A"
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png
index 414138c..4b6c55fb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt
index dfff998..65b9ed0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/combining-character-queries-expected.txt
@@ -201,26 +201,22 @@
           LayoutSVGText {text} at (74.59,207) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (74.59,207) size 4x10
               chunk 1 (middle anchor) text run 1 at (74.61,215.00) startOffset 0 endOffset 1 width 4.00: "3"
-          LayoutSVGRect {rect} at (81.84,161) size 11.02x49 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=81.84] [y=161.00] [width=11.02] [height=49.00]
-          LayoutSVGText {text} at (85.34,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (85.34,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (85.35,215.00) startOffset 0 endOffset 1 width 4.00: "4"
-          LayoutSVGRect {rect} at (92.86,161) size 11.66x49 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=92.86] [y=161.00] [width=11.66] [height=49.00]
-          LayoutSVGText {text} at (96.69,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (96.69,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (96.69,215.00) startOffset 0 endOffset 1 width 4.00: "5"
-          LayoutSVGRect {rect} at (104.52,161) size 3.24x49 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=104.52] [y=161.00] [width=3.24] [height=49.00]
-          LayoutSVGText {text} at (104.13,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (104.13,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (104.14,215.00) startOffset 0 endOffset 1 width 4.00: "6"
-          LayoutSVGRect {rect} at (107.76,161) size 3.24x49 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=107.76] [y=161.00] [width=3.24] [height=49.00]
-          LayoutSVGText {text} at (107.38,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (107.38,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (107.38,215.00) startOffset 0 endOffset 1 width 4.00: "7"
-          LayoutSVGRect {rect} at (111,161) size 3.24x49 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=111.00] [y=161.00] [width=3.24] [height=49.00]
-          LayoutSVGText {text} at (110.61,207) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (110.61,207) size 4x10
-              chunk 1 (middle anchor) text run 1 at (110.62,215.00) startOffset 0 endOffset 1 width 4.00: "8"
+          LayoutSVGRect {rect} at (81.84,161) size 11.66x49 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=81.84] [y=161.00] [width=11.66] [height=49.00]
+          LayoutSVGText {text} at (85.66,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (85.66,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (85.67,215.00) startOffset 0 endOffset 1 width 4.00: "4"
+          LayoutSVGRect {rect} at (93.49,161) size 3.24x49 [fill={[type=SOLID] [color=#4B0082] [opacity=0.30]}] [x=93.49] [y=161.00] [width=3.24] [height=49.00]
+          LayoutSVGText {text} at (93.11,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (93.11,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (93.11,215.00) startOffset 0 endOffset 1 width 4.00: "5"
+          LayoutSVGRect {rect} at (96.74,161) size 3.24x49 [fill={[type=SOLID] [color=#EE82EE] [opacity=0.30]}] [x=96.74] [y=161.00] [width=3.24] [height=49.00]
+          LayoutSVGText {text} at (96.34,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (96.34,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (96.36,215.00) startOffset 0 endOffset 1 width 4.00: "6"
+          LayoutSVGRect {rect} at (99.98,161) size 3.24x49 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=99.98] [y=161.00] [width=3.24] [height=49.00]
+          LayoutSVGText {text} at (99.59,207) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (99.59,207) size 4x10
+              chunk 1 (middle anchor) text run 1 at (99.60,215.00) startOffset 0 endOffset 1 width 4.00: "7"
           LayoutSVGRect {rect} at (200,169) size 11.66x39 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=200.00] [y=169.00] [width=11.66] [height=39.00]
           LayoutSVGText {text} at (203.81,205) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (203.81,205) size 4x10
@@ -433,34 +429,42 @@
           LayoutSVGText {text} at (200.19,355) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (200.19,355) size 4x10
               chunk 1 (middle anchor) text run 1 at (200.19,363.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (204.38,319) size 26.25x39 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.38] [y=319.00] [width=26.25] [height=39.00]
-          LayoutSVGText {text} at (215.50,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (215.50,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (215.50,363.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (230.63,319) size 4.86x39 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=230.63] [y=319.00] [width=4.86] [height=39.00]
-          LayoutSVGText {text} at (231.05,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (231.05,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (231.06,363.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (235.49,319) size 4.86x39 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=235.49] [y=319.00] [width=4.86] [height=39.00]
-          LayoutSVGText {text} at (235.91,355) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (235.91,355) size 4x10
-              chunk 1 (middle anchor) text run 1 at (235.92,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (204.38,319) size 4.38x39 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=204.38] [y=319.00] [width=4.38] [height=39.00]
+          LayoutSVGText {text} at (204.56,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (204.56,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (204.56,363.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (208.75,319) size 26.25x39 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=208.75] [y=319.00] [width=26.25] [height=39.00]
+          LayoutSVGText {text} at (219.88,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (219.88,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (219.88,363.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (235,319) size 4.86x39 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=235.00] [y=319.00] [width=4.86] [height=39.00]
+          LayoutSVGText {text} at (235.42,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (235.42,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (235.43,363.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (239.86,319) size 4.86x39 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=239.86] [y=319.00] [width=4.86] [height=39.00]
+          LayoutSVGText {text} at (240.28,355) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (240.28,355) size 4x10
+              chunk 1 (middle anchor) text run 1 at (240.29,363.00) startOffset 0 endOffset 1 width 4.00: "4"
           LayoutSVGRect {rect} at (350,318) size 4.86x39 [fill={[type=SOLID] [color=#FF0000] [opacity=0.30]}] [x=350.00] [y=318.00] [width=4.86] [height=39.00]
           LayoutSVGText {text} at (350.42,354) size 4x10 contains 1 chunk(s)
             LayoutSVGInlineText {#text} at (350.42,354) size 4x10
               chunk 1 (middle anchor) text run 1 at (350.43,362.00) startOffset 0 endOffset 1 width 4.00: "0"
-          LayoutSVGRect {rect} at (354.86,318) size 26.25x39 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=354.86] [y=318.00] [width=26.25] [height=39.00]
-          LayoutSVGText {text} at (365.98,354) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (365.98,354) size 4x10
-              chunk 1 (middle anchor) text run 1 at (365.99,362.00) startOffset 0 endOffset 1 width 4.00: "1"
-          LayoutSVGRect {rect} at (381.11,318) size 3.89x39 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=381.11] [y=318.00] [width=3.89] [height=39.00]
-          LayoutSVGText {text} at (381.05,354) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (381.05,354) size 4x10
-              chunk 1 (middle anchor) text run 1 at (381.06,362.00) startOffset 0 endOffset 1 width 4.00: "2"
-          LayoutSVGRect {rect} at (385,318) size 3.89x39 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=385.00] [y=318.00] [width=3.89] [height=39.00]
-          LayoutSVGText {text} at (384.94,354) size 4x10 contains 1 chunk(s)
-            LayoutSVGInlineText {#text} at (384.94,354) size 4x10
-              chunk 1 (middle anchor) text run 1 at (384.94,362.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (354.86,318) size 4.86x39 [fill={[type=SOLID] [color=#FFA500] [opacity=0.30]}] [x=354.86] [y=318.00] [width=4.86] [height=39.00]
+          LayoutSVGText {text} at (355.28,354) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (355.28,354) size 4x10
+              chunk 1 (middle anchor) text run 1 at (355.29,362.00) startOffset 0 endOffset 1 width 4.00: "1"
+          LayoutSVGRect {rect} at (359.72,318) size 26.25x39 [fill={[type=SOLID] [color=#FFFF00] [opacity=0.30]}] [x=359.72] [y=318.00] [width=26.25] [height=39.00]
+          LayoutSVGText {text} at (370.84,354) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (370.84,354) size 4x10
+              chunk 1 (middle anchor) text run 1 at (370.85,362.00) startOffset 0 endOffset 1 width 4.00: "2"
+          LayoutSVGRect {rect} at (385.97,318) size 3.89x39 [fill={[type=SOLID] [color=#008000] [opacity=0.30]}] [x=385.97] [y=318.00] [width=3.89] [height=39.00]
+          LayoutSVGText {text} at (385.91,354) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (385.91,354) size 4x10
+              chunk 1 (middle anchor) text run 1 at (385.92,362.00) startOffset 0 endOffset 1 width 4.00: "3"
+          LayoutSVGRect {rect} at (389.86,318) size 3.89x39 [fill={[type=SOLID] [color=#0000FF] [opacity=0.30]}] [x=389.86] [y=318.00] [width=3.89] [height=39.00]
+          LayoutSVGText {text} at (389.80,354) size 4x10 contains 1 chunk(s)
+            LayoutSVGInlineText {#text} at (389.80,354) size 4x10
+              chunk 1 (middle anchor) text run 1 at (389.81,362.00) startOffset 0 endOffset 1 width 4.00: "4"
         LayoutSVGText {text} at (50,11) size 48.56x49 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (50,11) size 48.56x49
             chunk 1 text run 1 at (50.00,50.00) startOffset 0 endOffset 6 width 48.57: "ab\x{30C}c\x{30C}\x{30C}"
@@ -494,9 +498,9 @@
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
             chunk 1 text run 1 at (380.53,125.00) startOffset 0 endOffset 1 width 19.47: "a"
             chunk 1 text run 1 at (400.00,125.00) startOffset 0 endOffset 1 width 0.00 RTL: "\x{200F}"
-        LayoutSVGText {text} at (50,161) size 69.23x49 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (50,161) size 69.23x49
-            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 9 width 64.24: "fi\x{30C} ffi\x{30C}\x{30C}"
+        LayoutSVGText {text} at (50,161) size 58.20x49 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (50,161) size 58.20x49
+            chunk 1 text run 1 at (50.00,200.00) startOffset 0 endOffset 8 width 53.22: "fi\x{30C} fi\x{30C}\x{30C}"
         LayoutSVGText {text} at (200,169) size 67.53x39 contains 1 chunk(s)
           LayoutSVGInlineText {#text} at (200,169) size 67.53x39
             chunk 1 text run 1 at (200.00,200.00) startOffset 0 endOffset 9 width 62.53: "fi\x{30C} ffi\x{30C}\x{30C}"
@@ -523,16 +527,16 @@
             chunk 1 text run 1 at (50.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
             chunk 1 text run 1 at (55.23,350.00) startOffset 0 endOffset 1 width 26.25 RTL: "\x{FDB0}"
             chunk 1 text run 1 at (81.48,350.00) startOffset 0 endOffset 2 width 9.72: "i\x{333}"
-        LayoutSVGText {text} at (195,319) size 50.34x39 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (195,319) size 50.34x39
-            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
-            chunk 1 text run 1 at (204.38,350.00) startOffset 0 endOffset 1 width 26.25 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (230.63,350.00) startOffset 0 endOffset 2 width 9.72: "i\x{333}"
-        LayoutSVGText {text} at (344,318) size 50.88x40 contains 1 chunk(s)
-          LayoutSVGInlineText {#text} at (344,318) size 50.88x40
-            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 1 width 0.00: "\x{30C}"
-            chunk 1 text run 1 at (354.86,350.00) startOffset 0 endOffset 1 width 26.25 RTL: "\x{FDB0}"
-            chunk 1 text run 1 at (381.11,350.00) startOffset 0 endOffset 2 width 7.78: "i\x{333}"
+        LayoutSVGText {text} at (200,319) size 49.72x39 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (200,319) size 49.72x39
+            chunk 1 text run 1 at (200.00,350.00) startOffset 0 endOffset 2 width 8.75: ".\x{30C}"
+            chunk 1 text run 1 at (208.75,350.00) startOffset 0 endOffset 1 width 26.25 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (235.00,350.00) startOffset 0 endOffset 2 width 9.72: "i\x{333}"
+        LayoutSVGText {text} at (350,318) size 49.73x40 contains 1 chunk(s)
+          LayoutSVGInlineText {#text} at (350,318) size 49.73x40
+            chunk 1 text run 1 at (350.00,350.00) startOffset 0 endOffset 2 width 9.72: ".\x{30C}"
+            chunk 1 text run 1 at (359.72,350.00) startOffset 0 endOffset 1 width 26.25 RTL: "\x{FDB0}"
+            chunk 1 text run 1 at (385.97,350.00) startOffset 0 endOffset 2 width 7.78: "i\x{333}"
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png
index ee727c7..d5b7860 100644
--- a/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/svg/text/text-fill-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
index 91b2882..199dfd8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
index 5fdfde2a..9336a319 100644
--- a/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/transforms/3d/point-mapping/3d-point-mapping-overlapping-expected.txt
@@ -35,4 +35,4 @@
 layer at (124,114) size 100x100
   LayoutBlockFlow (relative positioned) {DIV} at (51,51) size 100x100 [bgcolor=#0000FF]
 layer at (22,22) size 150x300
-  LayoutBlockFlow (positioned) {DIV} at (1,1) size 150x300 [bgcolor=#0080004C]
+  LayoutBlockFlow (positioned) {DIV} at (1,1) size 150x300 [bgcolor=#0080004D]
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
index b24c587..435d4ad 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
index 2ee3fbd..fe3c4887 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
index ee5b675..a32db9af 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
index 1ccb0a30..c154c192 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/gpu/fast/canvas/canvas-composite-video-shadow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png
index 8695e80..797fa6c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clip-content-under-overflow-controls-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
index 11a0ec7e..983898d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
index 1547bd8a..ee2eec1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
index 1547bd8a..ee2eec1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-background-color-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
new file mode 100644
index 0000000..6c8ec4a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-background-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
new file mode 100644
index 0000000..61d6fc5c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/threaded/compositing/webgl/webgl-background-color-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x534
+  LayoutBlockFlow {HTML} at (0,0) size 800x534
+    LayoutBlockFlow {BODY} at (8,20) size 784x498
+      LayoutBlockFlow {DIV} at (20,0) size 240x200 [bgcolor=#00008080]
+      LayoutBlockFlow (anonymous) at (0,220) size 784x244
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,480) size 784x18
+        LayoutText {#text} at (0,0) size 245x17
+          text run at (0,0) width 245: "Top and bottom should look the same."
+layer at (28,260) size 240x200
+  LayoutHTMLCanvas {CANVAS} at (20,20) size 240x200 [bgcolor=#00008080]
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
index e8ed24a..c28df2e 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
index d2f13633..c3ded87 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
index b8e4ed2c..b28a209 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-minimum-date-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
index d7e4073..a251322 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-ar-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
index 1dccbe8c..945e866b 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-required-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
index 24910ad9..84fce83 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
index 2517ddf..d068c97 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
index 14915c0..766ecd0f 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom200-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-expected.png
index e2ab42fd..64ed178 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
index ea256e2..b1693f2d 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/month-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-expected.png
index 54421dd..5c6c24c 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-step-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
index 473e365..33aae082 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/week-picker-appearance-step-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.png
index 5c4b1dd..839f0c66 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/forms/search/search-appearance-basic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png
index f5f2faece..461f900 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
index 5a797a7..f22338b 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor150/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
index c7edfca..be5a1ac 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
index c7edfca..be5a1ac 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/scalefactor200withzoom/fast/hidpi/static/calendar-picker-appearance-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/resources/magnitude-perf.js b/third_party/WebKit/LayoutTests/resources/magnitude-perf.js
deleted file mode 100644
index 4dfd21d0..0000000
--- a/third_party/WebKit/LayoutTests/resources/magnitude-perf.js
+++ /dev/null
@@ -1,444 +0,0 @@
-// Magnitude verifies time complexity of a function.
-// Magnitude.run can be called multiple times in a single script if desired,
-// optionally with different parameters each time.
-//
-// Usage:
-// <script src="../resources/magnitude-perf.js"></script>
-// <script>
-// function setup(magnitude)
-// {
-//     ...
-// }
-//
-// function test(magnitude)
-// {
-//     ...
-// }
-// ...
-// Magnitude.description('Test that foo is linear in number of nodes.');
-// Magnitude.run(setup, test, expected);
-// </script>
-//
-// setup: function to run once before the test-loop. Takes a magnitude
-//        argument that is the value of 'n'.
-// test: function whose runtime is being tested. Also takes a magnitude
-//       argument.
-// expected: one of the run-time constants listed below, e.g.:
-//           Magnitude.CONSTANT, Magnitude.LINEAR, etc.
-
-if (window.testRunner)
-    testRunner.dumpAsText();
-
-// Namespace
-var Magnitude = {};
-
-// Description of test; prepended to the dumped markup
-Magnitude.description = function(description)
-{
-    Magnitude._log(description);
-};
-
-// Parameters (customize per test)
-// See "Time Complexity Tests" document for details:
-// http://dev.chromium.org/developers/testing/time-complexity-tests
-// Specify over which range the growth rate should hold:
-//   2^n ... 2^(n+k-1)  where n = initialExponent, k = numPoints
-Magnitude.initialExponent = 0;
-Magnitude.numPoints = 8;
-// Number of trials to run
-// (Trial = compute times for all magnitudes, compute statistical test,
-//  decide if for this dataset, the data fits the model)
-Magnitude.numTrials = 3;
-// Fraction of trials that must succeed for test overall to PASS
-// (Default 50% means 2 out of 3 must succeed)
-Magnitude.successThreshold = 0.50;
-// Run = for each magnitude, run test function until pass this time limit,
-// then stop and compute average time
-Magnitude.millisecondsPerRun = 25;
-// Strict tolerance, so noisy tests explicitly state noisiness
-// Ok to relax for noisy tests;
-// try tolerance = 0.10 or 0.20, and/or trim = 1 or 2 to relax slightly
-// tolerance is "max (trimmed) deviation from expected",
-// where "expected" is:
-// * expected slope (linear, polynomial),
-// * median value (constant),
-// * predicted value in linear regression (logarithmic).
-// For log this often needs to be very large (due to scaling), and 1.00 is ok.
-Magnitude.trim = 0; // trim = 1 useful if unusual value on initial run
-Magnitude.tolerance = 0.05;
-
-Magnitude.CONSTANT = 'O(1)';
-Magnitude.LINEAR = 'O(n)';
-Magnitude.POLYNOMIAL = '>=O(n^2)';
-
-// Utility functions
-Magnitude._max = function(array) {
-    return Math.max.apply(null, array);
-};
-
-Magnitude._min = function(array) {
-    return Math.min.apply(null, array);
-};
-
-Magnitude._sortTrimArray = function(array, trim) {
-    // sort array, then trim both ends
-    // used for computing trimmed maximum absolute deviation
-    var sorted_array = array.map(Math.abs).sort(function(a, b) { return a - b; });
-    if (!trim)
-        return sorted_array;
-    else
-        return sorted_array.slice(trim, -trim);
-};
-
-Magnitude._relativeDeviations = function(array, ref)
-{
-    return array.map(function(x) { return (x - ref) / ref; });
-};
-
-Magnitude._absSortDownTrimTop = function(array, trim) {
-    // only trim the top of array
-    // used for computing trimmed maximum absolute deviation
-    if (trim === undefined)
-        trim = 0;
-    return array.map(Math.abs).sort(
-        function(a, b) { return b - a; }).slice(trim);
-};
-
-Magnitude._median = function(array) {
-    array.sort(function(a, b) { return a - b; });
-    var len = array.length;
-    if (!len)
-        return;
-    var half = Math.floor(len / 2);
-    if (len % 2)
-        return array[half];
-    return (array[half - 1] + array[half]) / 2;
-};
-
-// Logging functions
-Magnitude._log = function(msg)
-{
-    if (!Magnitude._container)
-        Magnitude._container = document.createElement('pre');
-    Magnitude._container.appendChild(document.createTextNode(msg + '\n'));
-};
-
-Magnitude._debug = function(msg)
-{
-    Magnitude._debugLog += msg + '\n';
-};
-
-Magnitude._logRunTimes = function()
-{
-    // Print out the magnitudes and times in CSV
-    // to afford easy copy-paste to a charting application.
-    Magnitude._debug('magnitudes: ' + Magnitude._magnitudes.join(','));
-    Magnitude._debug('times: ' + Magnitude._times.join(','));
-};
-
-Magnitude._for = function(n, body, callback)
-{
-    var i = 0;
-    var results = [];
-
-    function iteration(result) {
-        results.push(result);
-        if (++i === n)
-            callback(results);
-        else
-            body(i, iteration);
-    }
-
-    if (Magnitude._async) {
-        body(i, iteration);
-    } else {
-        for (; i < n; ++i) {
-            body(i, function(result) {
-                results.push(result);
-            });
-        }
-        callback(results);
-    }
-};
-
-Magnitude._while = function(condition, body, callback)
-{
-    function iteration() {
-        if (condition())
-            body(iteration);
-        else
-            callback();
-    }
-
-    if (Magnitude._async) {
-        iteration();
-    } else {
-        while (condition()) {
-            body(function() {});
-        }
-        callback();
-    }
-};
-
-// Main
-Magnitude.run = function(setup, test, expected)
-{
-    function runTest(magnitude, callback) {
-        test(magnitude);
-        callback();
-    }
-    Magnitude._run(setup, runTest, expected, false);
-};
-
-Magnitude.runAsync = function(setup, test, expected)
-{
-    if (window.testRunner)
-        testRunner.waitUntilDone();
-    window.addEventListener('load', function() {
-        Magnitude._run(setup, test, expected, true);
-    }, false);
-};
-
-Magnitude._run = function(setup, test, expected, async)
-{
-    Magnitude._async = async;
-    Magnitude._debugLog = '\nDEBUG LOG:\n';
-    Magnitude._debug('Expected complexity: ' + expected);
-
-    Magnitude._exponents = [];
-    Magnitude._magnitudes = [];
-    var maxExponent = Magnitude.initialExponent + Magnitude.numPoints;
-    for (var i = Magnitude.initialExponent; i < maxExponent; i++) {
-        Magnitude._exponents.push(i);
-        Magnitude._magnitudes.push(Math.pow(2, i));
-    }
-
-    Magnitude._numSuccesses = 0;
-    function runTrial(trialNumber, nextTrial)
-    {
-        Magnitude._trialNumber = trialNumber;
-        Magnitude._debug('\nTrial #' + trialNumber);
-        Magnitude._for(Magnitude.numPoints, Magnitude._runTime.bind(null, setup, test), completeTrial.bind(null, nextTrial));
-    }
-    function completeTrial(nextTrial, times)
-    {
-        Magnitude._times = times;
-        Magnitude._logRunTimes();
-        switch (expected) {
-            case Magnitude.CONSTANT:
-                passed = Magnitude._isConstant();
-                break;
-            case Magnitude.LINEAR:
-                passed = Magnitude._isLinear();
-                break;
-            case Magnitude.POLYNOMIAL:
-                passed = Magnitude._isPolynomial();
-                break;
-            default:
-                Magnitude._log('FAIL: unrecognized order of growth: ' + expected);
-                passed = false;
-                break;
-        }
-        Magnitude._debug('Trial #' + Magnitude._trialNumber + ': ' +
-            (passed ? 'SUCCESS' : 'FAILURE'));
-        if (passed)
-          Magnitude._numSuccesses++;
-        nextTrial();
-    }
-    Magnitude._for(Magnitude.numTrials, runTrial, Magnitude._finish);
-};
-
-Magnitude._finish = function()
-{
-    var neededToPass = Magnitude.numTrials * Magnitude.successThreshold;
-    Magnitude._debug('Successes: ' + Magnitude._numSuccesses + ', need ' +
-        neededToPass + ' (' + (100 * Magnitude.successThreshold) + '%) ' +
-        'to pass');
-    var passedOverall = (Magnitude._numSuccesses >= neededToPass);
-    Magnitude._log(passedOverall ? 'PASS' : 'FAIL');
-
-    // By default don't log detailed information to layout test results,
-    // in order to keep expected results consistent from run to run.
-    if (!window.testRunner || !passedOverall)
-        Magnitude._log(Magnitude._debugLog);
-
-    if (Magnitude._async && window.testRunner)
-        testRunner.notifyDone();
-};
-
-Magnitude._runTime = function(setup, test, pointIndex, callback)
-{
-    var magnitude = Magnitude._magnitudes[pointIndex];
-    setup(magnitude);
-
-    var debugStr = 'run for magnitude ' + magnitude;
-    if (window.GCController) {
-        if (GCController.getJSObjectCount)
-            debugStr += ' jsObjectCountBefore ' + GCController.getJSObjectCount();
-
-        GCController.collectAll();
-
-        if (GCController.getJSObjectCount)
-            debugStr += ' jsObjectCountAfter ' + GCController.getJSObjectCount();
-    }
-
-    Magnitude._debug(debugStr);
-
-    var nowFunction = window.performance && window.performance.now ?
-        window.performance.now.bind(window.performance) : Date.now;
-
-    // Possibly run multiple times, to deal with delays at end
-    var runOk = false;
-    var attempt = 0;
-    var maxAttempts = 5;
-    var millisecondsPerIteration;
-    var totalTimeMilliseconds;
-    var iterations;
-
-    function iteration(nextIteration)
-    {
-        var start = nowFunction();
-        iterations = 0;
-        totalTimeMilliseconds = 0;
-        function completeRun(nextRun)
-        {
-             iterations++;
-             totalTimeMilliseconds = nowFunction() - start;
-             nextRun();
-        }
-        Magnitude._while(function() { return totalTimeMilliseconds < Magnitude.millisecondsPerRun; }, function(nextRun) { test(magnitude, completeRun.bind(null, nextRun)); }, completeIteration.bind(null, nextIteration));
-    }
-
-    function completeIteration(nextIteration)
-    {
-        millisecondsPerIteration = totalTimeMilliseconds / iterations;
-        Magnitude._debug(iterations + ' iterations in ' +
-            totalTimeMilliseconds + ' milliseconds, ' +
-            'average ' + millisecondsPerIteration +
-            ' milliseconds per iteration');
-
-        var overTime = totalTimeMilliseconds - Magnitude.millisecondsPerRun;
-        var relativeOverTimeTolerance = 0.001;
-        var overTimeTolerance = Magnitude.millisecondsPerRun *
-            relativeOverTimeTolerance;
-        // If overTime is more than the duration of a run,
-        // there was some delay, which introduces noise.
-        // Allow a small amount of tolerance.
-        if (overTime < (millisecondsPerIteration + overTimeTolerance))
-            runOk = true;
-        else {
-            Magnitude._debug('over-time: ' + overTime +
-                ' exceeds average run-time ' + millisecondsPerIteration +
-                ' by more than tolerance of ' + overTimeTolerance +
-                ' assuming delay');
-            attempt++;
-            if (attempt < maxAttempts)
-                Magnitude._debug('Retrying to reduce delay noise');
-            else {
-                Magnitude._debug('Failed to reduce delay noise after ' +
-                    maxAttempts + ' attempts, proceeding with noisy data');
-                runOk = true;
-            }
-        }
-        nextIteration();
-    }
-    Magnitude._while(function() { return !runOk; }, iteration, function() { callback(millisecondsPerIteration); });
-};
-
-// Auxiliary computations
-Magnitude._log2Ratios = function()
-{
-    // Compute base-2 logarithm of ratios of times,
-    // equivalently the difference of the base-2 logarithms:
-    // log_2(t[i+1]/t[i]) = log_2(t[i+1]) - log_2(t[i])
-    // Since times are exponentially spaced (base 2),
-    // this is the slope of the step on the log-log scale,
-    // and hence for O(n^k) growth should be k (the exponent).
-    var ratioArray = [];
-    var log2RatioArray = [];
-    for (var i = 0; i < Magnitude.numPoints - 1; i++) {
-        var ratio = Magnitude._times[i + 1] / Magnitude._times[i];
-        var log2Ratio = Math.log(ratio) / Math.log(2);
-        ratioArray.push(ratio);
-        log2RatioArray.push(log2Ratio);
-    }
-    Magnitude._debug('ratios: ' + ratioArray.join(','));
-    Magnitude._debug('log-ratios (base 2): ' + log2RatioArray.join(','));
-    return log2RatioArray;
-};
-
-// Statistical tests
-Magnitude._isConstant = function()
-{
-    // Time should be approximately constant.
-    // To deal with noise, instead of constant, check that
-    // (trimmed) abs relative deviation from median is within tolerance of 0.
-    var times = Magnitude._times;
-    var median = Magnitude._median(times);
-    var relativeDeviations = Magnitude._relativeDeviations(times, median);
-    Magnitude._debug('Median time: ' + median);
-    Magnitude._debug('Relative deviations: ' + relativeDeviations.join(','));
-    var trimmedAbsRelativeDeviations = Magnitude._absSortDownTrimTop(relativeDeviations, Magnitude.trim);
-    Magnitude._debug('Trimmed sorted absolute relative deviations: ' +
-        trimmedAbsRelativeDeviations.join(','));
-    var maxAbsDeviation = trimmedAbsRelativeDeviations[0];
-    Magnitude._debug('Maximum Absolute Relative Deviation: ' + maxAbsDeviation);
-    return maxAbsDeviation <= Magnitude.tolerance;
-};
-
-Magnitude._isLinear = function()
-{
-    // Exponent of a monomial is the slope on the log-log scale.
-    // Magnitudes are exponentially stepped, so log ratio is slope
-    // of secant on log-log scale.
-    // In linear growth, (trimmed) log2Ratio should equal 1, to within tolerance
-    // (Special case of polynomial; see below for why this is separate.)
-    //
-    // Can do better by removing outlying points (and then computing the
-    // slope between the neighboring points) instead of trimming ratios,
-    // so we retain the data of the slope of that double step, but since we are
-    // only looking at the Maximum (Absolute) Deviation, in practice these
-    // generally amount to the same: given an outlier, the slope coming into
-    // the point and the slope going out will generally be high/low or low/high,
-    // and thus both be trimmed, while the slope of the double step will
-    // generally not be extreme, so not informative.
-    var logRatios = Magnitude._log2Ratios();
-    var trimmedLogRatios = Magnitude._sortTrimArray(logRatios, Magnitude.trim);
-    var minLogRatio = Magnitude._min(trimmedLogRatios);
-    var maxLogRatio = Magnitude._max(trimmedLogRatios);
-    var maxAbsDeviation = Math.max(Math.abs(1 - minLogRatio),
-                                   Math.abs(maxLogRatio - 1));
-    Magnitude._debug('Maximum Absolute Deviation: ' + maxAbsDeviation);
-    Magnitude._debug('Tolerance: ' + Magnitude.tolerance);
-    return maxAbsDeviation <= Magnitude.tolerance;
-};
-
-Magnitude._isPolynomial = function()
-{
-    // Exponent of a monomial is the slope on the log-log scale.
-    // Magnitudes are exponentially stepped, so log ratio is slope
-    // of secant on log-log scale.
-    // Polynomial growth is expected to be O(n^2) or greater,
-    // so logRatio should be at least 2: check (trimmed) min with tolerance
-    //
-    // Linear is fundamentally a special case of polynomial,
-    // but here not specifying a specific exponent, and instead testing
-    // that it grows *at least* quadratically (>= 2, rather than = 2 or = 3).
-    // Thus we have separate functions.
-    var logRatios = Magnitude._log2Ratios();
-    var trimmedLogRatios = Magnitude._sortTrimArray(logRatios, Magnitude.trim);
-    var minLogRatio = Magnitude._min(trimmedLogRatios);
-    var absDeviationMin = Math.abs(2 - minLogRatio);
-    Magnitude._debug('Absolute Deviation of Minimum: ' + absDeviationMin);
-    Magnitude._debug('Tolerance: ' + Magnitude.tolerance);
-    return absDeviationMin <= Magnitude.tolerance;
-};
-
-// Register listener
-window.addEventListener('load', function() {
-    // FIXME: Add Magnitude.waitUntilDone/notifyDone for tests that need to
-    // operate after the load event has fired.
-    if (window.testRunner)
-        document.body.innerHTML = '';
-    document.body.appendChild(Magnitude._container);
-}, false);
diff --git a/third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-display-expected.png b/third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-display-expected.png
index b08fbd2..b90661b3 100644
--- a/third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-display-expected.png
+++ b/third_party/WebKit/LayoutTests/scrollbars/custom-scrollbar-display-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.png b/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.png
index ebe463be..01d5d2225 100644
--- a/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.png
+++ b/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.txt b/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.txt
index 5fa08b8..d720c5e 100644
--- a/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.txt
+++ b/third_party/WebKit/LayoutTests/svg/custom/fill-opacity-rgba-expected.txt
@@ -2,4 +2,4 @@
   LayoutView at (0,0) size 800x600
 layer at (0,0) size 100x100
   LayoutSVGRoot {svg} at (0,0) size 100x100
-    LayoutSVGRect {rect} at (20,20) size 60x60 [fill={[type=SOLID] [color=#00FF007F]}] [x=20.00] [y=20.00] [width=60.00] [height=60.00]
+    LayoutSVGRect {rect} at (20,20) size 60x60 [fill={[type=SOLID] [color=#00FF0080]}] [x=20.00] [y=20.00] [width=60.00] [height=60.00]
diff --git a/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.png b/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.png
index 0c553f2..c46c5bb 100644
--- a/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.png
+++ b/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.txt b/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.txt
index 42213205..ce62c02d 100644
--- a/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.txt
+++ b/third_party/WebKit/LayoutTests/svg/filters/feBlend-all-modes-expected.txt
@@ -233,112 +233,112 @@
         LayoutSVGRoot {svg} at (0,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_normal"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="normal"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_normal"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (50,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_multiply"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="multiply"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_multiply"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (100,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_screen"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="screen"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_screen"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (150,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_darken"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="darken"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_darken"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (200,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_lighten"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="lighten"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_lighten"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (250,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_overlay"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="overlay"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_overlay"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (300,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_color-dodge"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="color-dodge"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_color-dodge"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (350,0) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_color-burn"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="color-burn"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_color-burn"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (0,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_hard-light"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="hard-light"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_hard-light"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (50,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_soft-light"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="soft-light"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_soft-light"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (100,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_difference"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="difference"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_difference"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (150,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_exclusion"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="exclusion"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_exclusion"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (200,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_hue"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="hue"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_hue"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (250,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_saturation"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="saturation"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_saturation"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (300,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_color"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="color"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_color"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
         LayoutSVGRoot {svg} at (350,54) size 50x50
           LayoutSVGResourceFilter {filter} [id="f_luminosity"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
             [feBlend mode="luminosity"]
-              [feFlood flood-color="#3340CC7F" flood-opacity="1.00"]
-              [feFlood flood-color="#99C0667F" flood-opacity="1.00"]
+              [feFlood flood-color="#3340CC80" flood-opacity="1.00"]
+              [feFlood flood-color="#99C06680" flood-opacity="1.00"]
           LayoutSVGRect {rect} at (0,0) size 50x50 [fill={[type=SOLID] [color=#000000]}] [x=0.00] [y=0.00] [width=50.00] [height=50.00]
             [filter="f_luminosity"] LayoutSVGResourceFilter {filter} at (0,0) size 50x50
diff --git a/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html b/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
index 21cef57fc..98afd680 100644
--- a/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
+++ b/third_party/WebKit/LayoutTests/svg/text/combining-character-queries.html
@@ -22,7 +22,8 @@
     <text x="400" y="125" class="testTextRun" font-family="sans-serif" direction="rtl">&#8207;a&#8207;b&#x030c;&#8207;c&#x030c;&#x030c;</text>
 
     <!-- multiple combining diacritics on ligatures in LTR -->
-    <text x="50" y="200" class="testTextRun" font-family="cursive">fi&#x030c; ffi&#x030c;&#x030c;</text>
+    <!-- MacOS has differences with the "ffi" glyph and diacritics in cursive font family so the first run uses 'fi' as a workaround. -->
+    <text x="50" y="200" class="testTextRun" font-family="cursive">fi&#x030c; fi&#x030c;&#x030c;</text>
     <text x="200" y="200" class="testTextRun" font-family="serif">fi&#x030c; ffi&#x030c;&#x030c;</text>
     <text x="350" y="200" class="testTextRun" font-family="sans-serif">fi&#x030c; ffi&#x030c;&#x030c;</text>
 
@@ -33,8 +34,9 @@
 
     <!-- combining diacritics which are wider than characters in mixed bidi runs -->
     <text x="50" y="350" class="testTextRun" font-family="cursive"> &#x030c;&#64944;i&#819;</text>
-    <text x="200" y="350" class="testTextRun" font-family="serif"> &#x030c;&#64944;i&#819;</text>
-    <text x="350" y="350" class="testTextRun" font-family="sans-serif"> &#x030c;&#64944;i&#819;</text>
+    <!-- Linux has differences with space width in the following two runs so a period is used as a workaround. -->
+    <text x="200" y="350" class="testTextRun" font-family="serif">.&#x030c;&#64944;i&#819;</text>
+    <text x="350" y="350" class="testTextRun" font-family="sans-serif">.&#x030c;&#64944;i&#819;</text>
 </svg>
 <script src="resources/highlightGlyphs.js"></script>
 <script>
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-expected.png b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-expected.png
index add9872..7ecb23a 100644
--- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-fill-expected.png b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-fill-expected.png
index ab2c454b..bcc8bcb 100644
--- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-arc-circumference-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-transformclip-expected.png b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-transformclip-expected.png
index 84f0a116..2dcbcbf 100644
--- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-transformclip-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-composite-transformclip-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-expected.png b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-expected.png
index 603b5c8..079d827 100644
--- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-fill-expected.png b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-fill-expected.png
index 439fccc..f0a34f66 100644
--- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/canvas-ellipse-circumference-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png
index d75e03b..78f1c74 100644
--- a/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/display_list_2d_canvas/fast/canvas/toDataURL-alpha-stability-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-expected.png b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-expected.png
index 4ed1c61..f92a57dd 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-fill-expected.png b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-fill-expected.png
index 7802c19..8aabedc6 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-arc-circumference-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-composite-transformclip-expected.png b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-composite-transformclip-expected.png
index 123074d..dae93154 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-composite-transformclip-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-composite-transformclip-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-expected.png b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-expected.png
index 1ad6b09..6bf295d4 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-fill-expected.png b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-fill-expected.png
index 68cc02d..5171812e 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-ellipse-circumference-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-fillPath-shadow-expected.txt b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-fillPath-shadow-expected.txt
index a96920c2..d494c5a 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-fillPath-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/canvas-fillPath-shadow-expected.txt
@@ -4,16 +4,16 @@
 
 
 PASS data[0] is 255
-FAIL data[1] should be 20. Was 21.
+PASS data[1] is 20
 PASS data[2] is 0
 PASS data[0] is 255
-FAIL data[1] should be 20. Was 21.
+PASS data[1] is 20
 PASS data[2] is 0
 PASS data[0] is 255
 PASS data[1] is within 3 of 20
 PASS data[2] is 0
 PASS data[0] is 255
-FAIL data[1] should be 20. Was 21.
+PASS data[1] is 20
 PASS data[2] is 0
 PASS data[0] is 255
 PASS data[1] is 0
diff --git a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png
index d75e03b..78f1c74 100644
--- a/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png
+++ b/third_party/WebKit/LayoutTests/virtual/gpu/fast/canvas/toDataURL-alpha-stability-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt b/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt
index 3dcfc7b..86a7938 100644
--- a/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/prefer_compositing_to_lcd_text/compositing/overflow/clear-scroll-parent-expected.txt
@@ -12,7 +12,7 @@
       "bounds": [308, 208],
       "shouldFlattenTransform": false,
       "drawsContent": true,
-      "backgroundColor": "#00FF007F"
+      "backgroundColor": "#00FF0080"
     },
     {
       "name": "Scrolling Layer",
@@ -60,7 +60,7 @@
       "position": [10, 10],
       "bounds": [100, 100],
       "drawsContent": true,
-      "backgroundColor": "#FF00007F"
+      "backgroundColor": "#FF000080"
     },
     {
       "name": "Squashing Containment Layer",
@@ -72,7 +72,7 @@
       "position": [22, 102],
       "bounds": [100, 100],
       "drawsContent": true,
-      "backgroundColor": "#0000FF7F"
+      "backgroundColor": "#0000FF80"
     },
     {
       "name": "Squashing Layer (first squashed layer: LayoutBlockFlow (relative positioned) DIV class='box')",
diff --git a/third_party/WebKit/PRESUBMIT.py b/third_party/WebKit/PRESUBMIT.py
index 8cb201b..fed22524 100644
--- a/third_party/WebKit/PRESUBMIT.py
+++ b/third_party/WebKit/PRESUBMIT.py
@@ -17,6 +17,8 @@
     # LayoutTests/imported is excluded because these files are automatically
     # imported, so we do not have direct control over their content.
     r'^third_party[\\\/]WebKit[\\\/]LayoutTests[\\\/]imported[\\\/].*',
+    # Also created and imported via a script:
+    r'^third_party[\\\/]WebKit[\\\/]Tools[\\\/]Scripts[\\\/]webkitpy[\\\/]thirdparty[\\\/]wpt[\\\/]wpt[\\\/].*',
 )
 
 
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
index 8a73ed8..52ec735 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
@@ -35,7 +35,7 @@
         m_resourceRequest("http://www.streaming-test.com/"),
         m_resource(ScriptResource::create(m_resourceRequest, "UTF-8")),
         m_pendingScript(PendingScript::create(0, m_resource.get())) {
-    m_resource->setStatus(Resource::Pending);
+    m_resource->setStatus(ResourceStatus::Pending);
     m_pendingScript = PendingScript::create(0, m_resource.get());
     ScriptStreamer::setSmallScriptThresholdForTesting(0);
   }
@@ -69,7 +69,7 @@
 
   void finish() {
     m_resource->finish();
-    m_resource->setStatus(Resource::Cached);
+    m_resource->setStatus(ResourceStatus::Cached);
   }
 
   void processTasksUntilStreamingComplete() {
diff --git a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
index cd27b86..cf7ce8b8 100644
--- a/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
+++ b/third_party/WebKit/Source/core/css/RemoteFontFaceSource.cpp
@@ -114,13 +114,13 @@
                                     : FontLoadHistograms::FromNetwork);
   m_histograms.recordRemoteFont(m_font.get(), m_isInterventionTriggered);
   m_histograms.fontLoaded(m_font->isCORSFailed(),
-                          m_font->getStatus() == Resource::LoadError,
+                          m_font->getStatus() == ResourceStatus::LoadError,
                           m_isInterventionTriggered);
 
   m_font->ensureCustomFontData();
   // FIXME: Provide more useful message such as OTS rejection reason.
   // See crbug.com/97467
-  if (m_font->getStatus() == Resource::DecodeError &&
+  if (m_font->getStatus() == ResourceStatus::DecodeError &&
       m_fontSelector->document()) {
     m_fontSelector->document()->addConsoleMessage(ConsoleMessage::create(
         OtherMessageSource, WarningMessageLevel,
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h b/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
index 00d29bb3..b7846a0 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSResourceValue.h
@@ -20,14 +20,14 @@
 
   const String state() const {
     switch (status()) {
-      case Resource::Status::NotStarted:
+      case ResourceStatus::NotStarted:
         return "unloaded";
-      case Resource::Status::Pending:
+      case ResourceStatus::Pending:
         return "loading";
-      case Resource::Status::Cached:
+      case ResourceStatus::Cached:
         return "loaded";
-      case Resource::Status::LoadError:
-      case Resource::Status::DecodeError:
+      case ResourceStatus::LoadError:
+      case ResourceStatus::DecodeError:
         return "error";
       default:
         NOTREACHED();
@@ -40,7 +40,7 @@
  protected:
   CSSResourceValue() {}
 
-  virtual Resource::Status status() const = 0;
+  virtual ResourceStatus status() const = 0;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSResourceValueTest.cpp b/third_party/WebKit/Source/core/css/cssom/CSSResourceValueTest.cpp
index ddc1cb16..282fb217 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSResourceValueTest.cpp
+++ b/third_party/WebKit/Source/core/css/cssom/CSSResourceValueTest.cpp
@@ -12,25 +12,28 @@
 
 class FakeCSSResourceValue : public CSSResourceValue {
  public:
-  FakeCSSResourceValue(Resource::Status status) : m_status(status) {}
-  Resource::Status status() const override { return m_status; }
+  FakeCSSResourceValue(ResourceStatus status) : m_status(status) {}
+  ResourceStatus status() const override { return m_status; }
 
   CSSValue* toCSSValue() const override { return nullptr; }
   StyleValueType type() const override { return Unknown; }
 
  private:
-  Resource::Status m_status;
+  ResourceStatus m_status;
 };
 
 }  // namespace
 
 TEST(CSSResourceValueTest, TestStatus) {
-  EXPECT_EQ((new FakeCSSResourceValue(Resource::NotStarted))->state(),
+  EXPECT_EQ((new FakeCSSResourceValue(ResourceStatus::NotStarted))->state(),
             "unloaded");
-  EXPECT_EQ((new FakeCSSResourceValue(Resource::Pending))->state(), "loading");
-  EXPECT_EQ((new FakeCSSResourceValue(Resource::Cached))->state(), "loaded");
-  EXPECT_EQ((new FakeCSSResourceValue(Resource::LoadError))->state(), "error");
-  EXPECT_EQ((new FakeCSSResourceValue(Resource::DecodeError))->state(),
+  EXPECT_EQ((new FakeCSSResourceValue(ResourceStatus::Pending))->state(),
+            "loading");
+  EXPECT_EQ((new FakeCSSResourceValue(ResourceStatus::Cached))->state(),
+            "loaded");
+  EXPECT_EQ((new FakeCSSResourceValue(ResourceStatus::LoadError))->state(),
+            "error");
+  EXPECT_EQ((new FakeCSSResourceValue(ResourceStatus::DecodeError))->state(),
             "error");
 }
 
diff --git a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
index a561eb2..667d4df 100644
--- a/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
+++ b/third_party/WebKit/Source/core/css/cssom/CSSStyleImageValue.h
@@ -62,9 +62,9 @@
 
   virtual bool isCachePending() const { return m_imageValue->isCachePending(); }
 
-  Resource::Status status() const override {
+  ResourceStatus status() const override {
     if (isCachePending())
-      return Resource::Status::NotStarted;
+      return ResourceStatus::NotStarted;
     return m_imageValue->cachedImage()->cachedImage()->getStatus();
   }
 
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
index d7c12f4..2f16c13c 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -369,8 +369,10 @@
   }
 
   if (isTenthAlpha(string, length - 1)) {
-    static const int tenthAlphaValues[] = {0,   25,  51,  76,  102,
-                                           127, 153, 179, 204, 230};
+    // Fast conversions for 0.1 steps of alpha values between 0.0 and 0.9,
+    // where 0.1 alpha is value 26 (25.5 rounded) and so on.
+    static const int tenthAlphaValues[] = {0,   26,  51,  77,  102,
+                                           128, 153, 179, 204, 230};
     value = negative ? 0 : tenthAlphaValues[string[length - 2] - '0'];
     string = end;
     return true;
@@ -379,9 +381,8 @@
   double alpha = 0;
   if (!parseDouble(string, end, terminator, alpha))
     return false;
-  value = negative
-              ? 0
-              : static_cast<int>(std::min(alpha, 1.0) * nextafter(256.0, 0.0));
+  value =
+      negative ? 0 : static_cast<int>(roundf(std::min(alpha, 1.0) * 255.0f));
   string = end;
   return true;
 }
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
index c4c2011..b356ef9 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -433,10 +433,9 @@
     double alpha;
     if (!consumeNumberRaw(args, alpha))
       return false;
-    // Convert the floating pointer number of alpha to an integer in the range
-    // [0, 256), with an equal distribution across all 256 values.
-    int alphaComponent = static_cast<int>(clampTo<double>(alpha, 0.0, 1.0) *
-                                          nextafter(256.0, 0.0));
+    // W3 standard stipulates a 2.55 alpha value multiplication factor.
+    int alphaComponent =
+        static_cast<int>(lroundf(clampTo<double>(alpha, 0.0, 1.0) * 255.0f));
     result =
         makeRGBA(colorArray[0], colorArray[1], colorArray[2], alphaComponent);
   } else {
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index 5f52c92..ee87d5e 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -2668,7 +2668,7 @@
     // gesture. Since tracking that across arbitrary boundaries (eg.
     // animations) is difficult, for now we match IE's heuristic and bring
     // up the keyboard if there's been any gesture since load.
-    document().page()->chromeClient().showVirtualKeyboard();
+    document().page()->chromeClient().showVirtualKeyboardOnElementFocus();
   }
 }
 
diff --git a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
index 628607c8..ee1eeb0f 100644
--- a/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLObjectElement.cpp
@@ -387,7 +387,7 @@
   // Before we give up and use fallback content, check to see if this is a MIME
   // type issue.
   if (m_imageLoader && m_imageLoader->image() &&
-      m_imageLoader->image()->getStatus() != Resource::LoadError) {
+      m_imageLoader->image()->getStatus() != ResourceStatus::LoadError) {
     m_serviceType = m_imageLoader->image()->response().mimeType();
     if (!isImageType()) {
       // If we don't think we have an image type anymore, then clear the image
diff --git a/third_party/WebKit/Source/core/html/ImageDocument.cpp b/third_party/WebKit/Source/core/html/ImageDocument.cpp
index 06ee1ef..7d03d36 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.cpp
+++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp
@@ -154,7 +154,7 @@
     // If decoding has already failed, there's no point in sending additional
     // data to the ImageResource.
     if (document()->cachedImageResourceDeprecated()->getStatus() !=
-        Resource::DecodeError)
+        ResourceStatus::DecodeError)
       document()->cachedImageResourceDeprecated()->appendData(data, length);
   }
 
diff --git a/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp b/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp
index 130c77e..2d6dd9b 100644
--- a/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp
+++ b/third_party/WebKit/Source/core/html/parser/CSSPreloadScannerTest.cpp
@@ -63,7 +63,7 @@
   KURL url(ParsedURLString, "http://127.0.0.1/foo.css");
   CSSStyleSheetResource* resource =
       CSSStyleSheetResource::createForTest(ResourceRequest(url), "utf-8");
-  resource->setStatus(Resource::Pending);
+  resource->setStatus(ResourceStatus::Pending);
 
   PreloadRecordingCSSPreloaderResourceClient* resourceClient =
       new PreloadRecordingCSSPreloaderResourceClient(resource, preloader);
@@ -90,7 +90,7 @@
   KURL url(ParsedURLString, "http://127.0.0.1/foo.css");
   Persistent<CSSStyleSheetResource> resource =
       CSSStyleSheetResource::createForTest(ResourceRequest(url), "utf-8");
-  resource->setStatus(Resource::Pending);
+  resource->setStatus(ResourceStatus::Pending);
 
   new PreloadRecordingCSSPreloaderResourceClient(resource, preloader);
 
@@ -141,7 +141,7 @@
   KURL url(ParsedURLString, "http://127.0.0.1/foo.css");
   CSSStyleSheetResource* resource =
       CSSStyleSheetResource::createForTest(ResourceRequest(url), "utf-8");
-  resource->setStatus(Resource::Pending);
+  resource->setStatus(ResourceStatus::Pending);
 
   PreloadRecordingCSSPreloaderResourceClient* resourceClient =
       new PreloadRecordingCSSPreloaderResourceClient(resource, preloader);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index 812d33c..10fc07b 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -780,7 +780,7 @@
             .build();
     if (cachedResource->wasCanceled())
       resourceObject->setCanceled(true);
-    else if (cachedResource->getStatus() == Resource::LoadError)
+    else if (cachedResource->getStatus() == ResourceStatus::LoadError)
       resourceObject->setFailed(true);
     subresources->addItem(std::move(resourceObject));
   }
diff --git a/third_party/WebKit/Source/core/loader/ImageLoader.cpp b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
index a48a04c6..68bec714 100644
--- a/third_party/WebKit/Source/core/loader/ImageLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/ImageLoader.cpp
@@ -400,7 +400,7 @@
   if (m_loadingImageDocument && updateBehavior != UpdateForcedReload) {
     ImageResource* imageResource =
         ImageResource::create(imageSourceToKURL(m_element->imageSourceURL()));
-    imageResource->setStatus(Resource::Pending);
+    imageResource->setStatus(ResourceStatus::Pending);
     m_imageResourceForImageDocument = imageResource;
     setImage(imageResource->getContent());
     return;
diff --git a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
index d40e5f1..63df50a 100644
--- a/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/CSSStyleSheetResource.cpp
@@ -114,7 +114,7 @@
   if (!m_decodedSheetText.isNull()) {
     // We should have the decoded sheet text cached when the resource is fully
     // loaded.
-    DCHECK_EQ(getStatus(), Resource::Cached);
+    DCHECK_EQ(getStatus(), ResourceStatus::Cached);
 
     return m_decodedSheetText;
   }
diff --git a/third_party/WebKit/Source/core/loader/resource/FontResource.cpp b/third_party/WebKit/Source/core/loader/resource/FontResource.cpp
index c8d8995..6401832 100644
--- a/third_party/WebKit/Source/core/loader/resource/FontResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/FontResource.cpp
@@ -139,7 +139,7 @@
     if (m_fontData) {
       recordPackageFormatHistogram(packageFormatOf(data()));
     } else {
-      setStatus(DecodeError);
+      setStatus(ResourceStatus::DecodeError);
       recordPackageFormatHistogram(PackageFormatUnknown);
     }
   }
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
index dda3a38..f3c3221 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -76,9 +76,7 @@
   const ResourceResponse& response() const override {
     return m_resource->response();
   }
-  Resource::Status getStatus() const override {
-    return m_resource->getStatus();
-  }
+  ResourceStatus getStatus() const override { return m_resource->getStatus(); }
   bool isPlaceholder() const override { return m_resource->isPlaceholder(); }
   bool isCacheValidator() const override {
     return m_resource->isCacheValidator();
@@ -326,7 +324,7 @@
   clearData();
   setEncodedSize(0);
   if (!errorOccurred())
-    setStatus(DecodeError);
+    setStatus(ResourceStatus::DecodeError);
 
   if (!allDataReceived && loader()) {
     // TODO(hiroshige): Do not call didFinishLoading() directly.
@@ -442,7 +440,7 @@
                 false);
   }
 
-  setStatus(NotStarted);
+  setStatus(ResourceStatus::NotStarted);
 
   DCHECK(m_isSchedulingReload);
   m_isSchedulingReload = false;
@@ -466,7 +464,7 @@
     m_multipartParsingState = MultipartParsingState::FinishedParsingFirstPart;
     // Notify finished when the first part ends.
     if (!errorOccurred())
-      setStatus(Cached);
+      setStatus(ResourceStatus::Cached);
     // We notify clients and observers of finish in checkNotify() and
     // updateImageAndClearBuffer(), respectively, and they will not be
     // notified again in Resource::finish()/error().
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
index 0eb3a24..c5c2ac2 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceTest.cpp
@@ -239,7 +239,7 @@
 
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::create(imageResource->getContent());
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
 
   // Send the multipart response. No image or data buffer is created. Note that
   // the response must be routed through ResourceLoader to ensure the load is
@@ -322,24 +322,24 @@
 
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::create(imageResource->getContent());
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
 
   // The load should still be alive, but a timer should be started to cancel the
   // load inside removeClient().
   observer->removeAsObserver();
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
   EXPECT_TRUE(memoryCache()->resourceForURL(testURL));
 
   // Trigger the cancel timer, ensure the load was cancelled and the resource
   // was evicted from the cache.
   blink::testing::runPendingTasks();
-  EXPECT_EQ(Resource::LoadError, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::LoadError, imageResource->getStatus());
   EXPECT_FALSE(memoryCache()->resourceForURL(testURL));
 }
 
 TEST(ImageResourceTest, DecodedDataRemainsWhileHasClients) {
   ImageResource* imageResource = ImageResource::create(ResourceRequest());
-  imageResource->setStatus(Resource::Pending);
+  imageResource->setStatus(ResourceStatus::Pending);
 
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::create(imageResource->getContent());
@@ -383,7 +383,7 @@
 
 TEST(ImageResourceTest, UpdateBitmapImages) {
   ImageResource* imageResource = ImageResource::create(ResourceRequest());
-  imageResource->setStatus(Resource::Pending);
+  imageResource->setStatus(ResourceStatus::Pending);
 
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::create(imageResource->getContent());
@@ -410,7 +410,7 @@
   ResourceRequest request = ResourceRequest(testURL);
   request.setPreviewsState(WebURLRequest::ServerLoFiOn);
   ImageResource* imageResource = ImageResource::create(request);
-  imageResource->setStatus(Resource::Pending);
+  imageResource->setStatus(ResourceStatus::Pending);
 
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::create(imageResource->getContent());
@@ -569,13 +569,13 @@
       0.0, kJpegImageSubrangeWithDimensionsLength,
       kJpegImageSubrangeWithDimensionsLength);
 
-  EXPECT_EQ(Resource::Cached, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Cached, imageResource->getStatus());
   EXPECT_TRUE(imageResource->isPlaceholder());
 
   imageResource->reloadIfLoFiOrPlaceholderImage(fetcher,
                                                 Resource::kReloadAlways);
 
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
   EXPECT_FALSE(imageResource->isPlaceholder());
   EXPECT_EQ(nullAtom,
             imageResource->resourceRequest().httpHeaderField("range"));
@@ -859,7 +859,7 @@
           ResourceResponse(testURL, "image/jpeg", 18, nullAtom, String())),
       nullptr);
   imageResource->loader()->didReceiveData("notactuallyanimage", 18);
-  EXPECT_EQ(Resource::DecodeError, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::DecodeError, imageResource->getStatus());
   EXPECT_FALSE(imageResource->isLoading());
 }
 
@@ -887,7 +887,7 @@
   imageResource->loader()->didFinishLoading(0.0, sizeof(kJpegImage),
                                             sizeof(kJpegImage));
 
-  EXPECT_EQ(Resource::Cached, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Cached, imageResource->getStatus());
   EXPECT_EQ(sizeof(kJpegImage), imageResource->encodedSize());
   EXPECT_FALSE(imageResource->isPlaceholder());
   EXPECT_LT(0, observer->imageChangedCount());
@@ -989,7 +989,7 @@
       0.0, kJpegImageSubrangeWithDimensionsLength,
       kJpegImageSubrangeWithDimensionsLength);
 
-  EXPECT_EQ(Resource::Cached, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Cached, imageResource->getStatus());
   EXPECT_EQ(kJpegImageSubrangeWithDimensionsLength,
             imageResource->encodedSize());
   EXPECT_TRUE(imageResource->isPlaceholder());
@@ -1031,7 +1031,7 @@
 
   // The dimensions could not be extracted, so the full original image should be
   // loading.
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
   EXPECT_FALSE(imageResource->isPlaceholder());
   EXPECT_EQ(nullAtom,
             imageResource->resourceRequest().httpHeaderField("range"));
@@ -1048,7 +1048,7 @@
   imageResource->loader()->didFinishLoading(0.0, sizeof(kJpegImage),
                                             sizeof(kJpegImage));
 
-  EXPECT_EQ(Resource::Cached, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Cached, imageResource->getStatus());
   EXPECT_EQ(sizeof(kJpegImage), imageResource->encodedSize());
   EXPECT_FALSE(imageResource->isPlaceholder());
   EXPECT_LT(0, observer->imageChangedCount());
@@ -1079,7 +1079,7 @@
   ImageResource* secondImageResource =
       ImageResource::fetch(nonPlaceholderRequest, fetcher);
   EXPECT_EQ(imageResource, secondImageResource);
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
   EXPECT_FALSE(imageResource->isPlaceholder());
   EXPECT_EQ(nullAtom,
             imageResource->resourceRequest().httpHeaderField("range"));
@@ -1121,7 +1121,7 @@
       0.0, kJpegImageSubrangeWithDimensionsLength,
       kJpegImageSubrangeWithDimensionsLength);
 
-  EXPECT_EQ(Resource::Cached, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Cached, imageResource->getStatus());
   EXPECT_EQ(kJpegImageSubrangeWithDimensionsLength,
             imageResource->encodedSize());
   EXPECT_TRUE(imageResource->isPlaceholder());
@@ -1132,7 +1132,7 @@
   ImageResource* secondImageResource =
       ImageResource::fetch(nonPlaceholderRequest, fetcher);
   EXPECT_EQ(imageResource, secondImageResource);
-  EXPECT_EQ(Resource::Pending, imageResource->getStatus());
+  EXPECT_EQ(ResourceStatus::Pending, imageResource->getStatus());
   EXPECT_FALSE(imageResource->isPlaceholder());
   EXPECT_EQ(nullAtom,
             imageResource->resourceRequest().httpHeaderField("range"));
@@ -1151,7 +1151,7 @@
                                         "text/html");
   ResourceRequest request = ResourceRequest(testURL);
   ImageResource* imageResource = ImageResource::create(request);
-  imageResource->setStatus(Resource::Pending);
+  imageResource->setStatus(ResourceStatus::Pending);
 
   std::unique_ptr<MockImageResourceObserver> observer =
       MockImageResourceObserver::create(imageResource->getContent());
diff --git a/third_party/WebKit/Source/core/page/ChromeClient.h b/third_party/WebKit/Source/core/page/ChromeClient.h
index 8006fc31..7d91e79 100644
--- a/third_party/WebKit/Source/core/page/ChromeClient.h
+++ b/third_party/WebKit/Source/core/page/ChromeClient.h
@@ -313,7 +313,7 @@
   virtual void didCancelCompositionOnSelectionChange() {}
   virtual void resetInputMethod() {}
   virtual void didUpdateTextOfFocusedElementByNonUserInput(LocalFrame&) {}
-  virtual void showVirtualKeyboard() {}
+  virtual void showVirtualKeyboardOnElementFocus() {}
 
   virtual void registerViewportLayers() const {}
 
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 05975ca..cfbfd93 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -418,7 +418,7 @@
   const String cacheIdentifier = m_document->fetcher()->getCacheIdentifier();
   Resource* resource = memoryCache()->resourceForURL(
       m_document->completeURL(url), cacheIdentifier);
-  return resource && resource->getStatus() == Resource::Cached;
+  return resource && resource->getStatus() == ResourceStatus::Cached;
 }
 
 int Internals::getResourcePriority(const String& url, Document* document) {
diff --git a/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js b/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js
index 5d13d66..20d5b22a 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/EventListenersUtils.js
@@ -31,7 +31,7 @@
    * @return {!Promise<!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}>}
    */
   function getOwnProperties(object) {
-    return object.getOwnPropertiesPromise();
+    return object.getOwnPropertiesPromise(false /* generatePreview */);
   }
 
   /**
diff --git a/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js b/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js
index 34bec39..76e8ca1 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/EventListenersView.js
@@ -285,7 +285,8 @@
     var subtitle = this.listItemElement.createChild('span', 'event-listener-tree-subtitle');
     subtitle.appendChild(linkifier.linkifyRawLocation(this._eventListener.location(), this._eventListener.sourceURL()));
 
-    title.appendChild(Components.ObjectPropertiesSection.createValueElement(object, false));
+    title.appendChild(
+        Components.ObjectPropertiesSection.createValueElement(object, false /* wasThrown */, false /* showPreview */));
 
     if (this._eventListener.removeFunction()) {
       var deleteButton = title.createChild('span', 'event-listener-button');
diff --git a/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js b/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js
index b9aad4f..c5206f2e 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/JavaScriptAutocomplete.js
@@ -14,13 +14,24 @@
  * @return {!Promise<!UI.SuggestBox.Suggestions>}
  */
 Components.JavaScriptAutocomplete.completionsForTextInCurrentContext = function(text, query, force) {
+  var clippedExpression = Components.JavaScriptAutocomplete._clipExpression(text, true);
+  var mapCompletionsPromise = Components.JavaScriptAutocomplete._mapCompletions(text, query);
+  return Components.JavaScriptAutocomplete.completionsForExpression(clippedExpression, query, force)
+      .then(completions => mapCompletionsPromise.then(mapCompletions => mapCompletions.concat(completions)));
+};
+
+/**
+ * @param {string} text
+ * @param {boolean=} allowEndingBracket
+ * @return {string}
+ */
+Components.JavaScriptAutocomplete._clipExpression = function(text, allowEndingBracket) {
   var index;
   var stopChars = new Set('=:({;,!+-*/&|^<>`'.split(''));
   var whiteSpaceChars = new Set(' \r\n\t'.split(''));
   var continueChars = new Set('[. \r\n\t'.split(''));
 
   for (index = text.length - 1; index >= 0; index--) {
-    // Pass less stop characters to rangeOfWord so the range will be a more complete expression.
     if (stopChars.has(text.charAt(index)))
       break;
     if (whiteSpaceChars.has(text.charAt(index)) && !continueChars.has(text.charAt(index - 1)))
@@ -35,16 +46,112 @@
     if (character === ']')
       bracketCount++;
     // Allow an open bracket at the end for property completion.
-    if (character === '[' && index < clippedExpression.length - 1) {
+    if (character === '[' && (index < clippedExpression.length - 1 || !allowEndingBracket)) {
       bracketCount--;
       if (bracketCount < 0)
         break;
     }
     index--;
   }
-  clippedExpression = clippedExpression.substring(index + 1).trim();
+  return clippedExpression.substring(index + 1).trim();
+};
 
-  return Components.JavaScriptAutocomplete.completionsForExpression(clippedExpression, query, force);
+/**
+ * @param {string} text
+ * @param {string} query
+ * @return {!Promise<!UI.SuggestBox.Suggestions>}
+ */
+Components.JavaScriptAutocomplete._mapCompletions = function(text, query) {
+  var mapMatch = text.match(/\.\s*(get|set|delete)\s*\(\s*$/);
+  var executionContext = UI.context.flavor(SDK.ExecutionContext);
+  if (!executionContext || !mapMatch)
+    return Promise.resolve([]);
+
+  var clippedExpression = Components.JavaScriptAutocomplete._clipExpression(text.substring(0, mapMatch.index));
+  var fulfill;
+  var promise = new Promise(x => fulfill = x);
+  executionContext.evaluate(clippedExpression, 'completion', true, true, false, false, false, evaluated);
+  return promise;
+
+  /**
+   * @param {?SDK.RemoteObject} result
+   * @param {!Protocol.Runtime.ExceptionDetails=} exceptionDetails
+   */
+  function evaluated(result, exceptionDetails) {
+    if (!result || !!exceptionDetails || result.subtype !== 'map') {
+      fulfill([]);
+      return;
+    }
+    result.getOwnPropertiesPromise().then(extractEntriesProperty);
+  }
+
+  /**
+   * @param {!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}} properties
+   */
+  function extractEntriesProperty(properties) {
+    var internalProperties = properties.internalProperties || [];
+    var entriesProperty = internalProperties.find(property => property.name === '[[Entries]]');
+    if (!entriesProperty) {
+      fulfill([]);
+      return;
+    }
+    entriesProperty.value.callFunctionJSONPromise(getEntries).then(keysObj => gotKeys(Object.keys(keysObj)));
+  }
+
+  /**
+   * @suppressReceiverCheck
+   * @this {!Array<{key:?, value:?}>}
+   * @return {!Object}
+   */
+  function getEntries() {
+    var result = {__proto__: null};
+    for (var i = 0; i < this.length; i++) {
+      if (typeof this[i].key === 'string')
+        result[this[i].key] = true;
+    }
+    return result;
+  }
+
+  /**
+   * @param {!Array<string>} rawKeys
+   */
+  function gotKeys(rawKeys) {
+    var caseSensitivePrefix = [];
+    var caseInsensitivePrefix = [];
+    var caseSensitiveAnywhere = [];
+    var caseInsensitiveAnywhere = [];
+    var quoteChar = '"';
+    if (query.startsWith('\''))
+      quoteChar = '\'';
+    var endChar = ')';
+    if (mapMatch[0].indexOf('set') !== -1)
+      endChar = ', ';
+
+    var sorter = rawKeys.length < 1000 ? String.naturalOrderComparator : undefined;
+    var keys = rawKeys.sort(sorter).map(key => quoteChar + key + quoteChar + endChar);
+
+    for (var key of keys) {
+      if (key.length < query.length)
+        continue;
+      if (query.length && key.toLowerCase().indexOf(query.toLowerCase()) === -1)
+        continue;
+      // Substitute actual newlines with newline characters. @see crbug.com/498421
+      var title = key.split('\n').join('\\n');
+
+      if (key.startsWith(query))
+        caseSensitivePrefix.push({title: title, priority: 4});
+      else if (key.toLowerCase().startsWith(query.toLowerCase()))
+        caseInsensitivePrefix.push({title: title, priority: 3});
+      else if (key.indexOf(query) !== -1)
+        caseSensitiveAnywhere.push({title: title, priority: 2});
+      else
+        caseInsensitiveAnywhere.push({title: title, priority: 1});
+    }
+    var suggestions = caseSensitivePrefix.concat(caseInsensitivePrefix, caseSensitiveAnywhere, caseInsensitiveAnywhere);
+    if (suggestions.length)
+      suggestions[0].subtitle = Common.UIString('Keys');
+    fulfill(suggestions);
+  }
 };
 
 /**
@@ -76,8 +183,8 @@
   if (!query && !expressionString && !force)
     return Promise.resolve([]);
 
-  var fufill;
-  var promise = new Promise(x => fufill = x);
+  var fulfill;
+  var promise = new Promise(x => fulfill = x);
   var selectedFrame = executionContext.debuggerModel.selectedCallFrame();
   if (!expressionString && selectedFrame)
     variableNamesInScopes(selectedFrame, receivedPropertyNames);
@@ -91,7 +198,7 @@
    */
   function evaluated(result, exceptionDetails) {
     if (!result || !!exceptionDetails) {
-      fufill([]);
+      fulfill([]);
       return;
     }
 
@@ -104,7 +211,9 @@
         return Promise.resolve(/** @type {?SDK.RemoteObject} */ (null));
       if (object.type !== 'object' || object.subtype !== 'proxy')
         return Promise.resolve(/** @type {?SDK.RemoteObject} */ (object));
-      return object.getOwnPropertiesPromise().then(extractTargetFromProperties).then(extractTarget);
+      return object.getOwnPropertiesPromise(false /* generatePreview */)
+          .then(extractTargetFromProperties)
+          .then(extractTarget);
     }
 
     /**
@@ -206,7 +315,9 @@
     for (var i = 0; i < scopeChain.length; ++i) {
       var scope = scopeChain[i];
       var object = scope.object();
-      object.getAllProperties(false, propertiesCollected.bind(null, scope.typeName()));
+      object.getAllProperties(
+          false /* accessorPropertiesOnly */, false /* generatePreview */,
+          propertiesCollected.bind(null, scope.typeName()));
     }
   }
 
@@ -219,7 +330,7 @@
     if (result && !exceptionDetails)
       receivedPropertyNames(/** @type {!Object} */ (result.value));
     else
-      fufill([]);
+      fulfill([]);
   }
 
   /**
@@ -228,7 +339,7 @@
   function receivedPropertyNames(object) {
     executionContext.target().runtimeAgent().releaseObjectGroup('completion');
     if (!object) {
-      fufill([]);
+      fulfill([]);
       return;
     }
     var propertyGroups = /** @type {!Array<!Components.JavaScriptAutocomplete.CompletionGroup>} */ (object);
@@ -258,7 +369,7 @@
       ];
       propertyGroups.push({items: commandLineAPI});
     }
-    fufill(Components.JavaScriptAutocomplete._completionsForQuery(
+    fulfill(Components.JavaScriptAutocomplete._completionsForQuery(
         dotNotation, bracketNotation, expressionString, query, propertyGroups));
   }
 };
@@ -292,7 +403,7 @@
   var result = [];
   var lastGroupTitle;
   for (var group of propertyGroups) {
-    group.items.sort(itemComparator);
+    group.items.sort(itemComparator.bind(null, group.items.length > 1000));
     var caseSensitivePrefix = [];
     var caseInsensitivePrefix = [];
     var caseSensitiveAnywhere = [];
@@ -336,17 +447,18 @@
   return result;
 
   /**
+   * @param {boolean} naturalOrder
    * @param {string} a
    * @param {string} b
    * @return {number}
    */
-  function itemComparator(a, b) {
+  function itemComparator(naturalOrder, a, b) {
     var aStartsWithUnderscore = a.startsWith('_');
     var bStartsWithUnderscore = b.startsWith('_');
     if (aStartsWithUnderscore && !bStartsWithUnderscore)
       return 1;
     if (bStartsWithUnderscore && !aStartsWithUnderscore)
       return -1;
-    return String.naturalOrderComparator(a, b);
+    return naturalOrder ? String.naturalOrderComparator(a, b) : a.localeCompare(b);
   }
 };
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js b/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js
index f892558..be78fcf 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/ObjectPopoverHelper.js
@@ -138,6 +138,7 @@
 
         if (result.type === 'function') {
           result.getOwnProperties(
+              false /* generatePreview */,
               didGetFunctionProperties.bind(this, result, popoverContentElement, valueElement, anchorElement));
           return;
         }
diff --git a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
index 21f0f97..3b705eab 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/ObjectPropertiesSection.js
@@ -77,7 +77,8 @@
   static defaultObjectPresentation(object, linkifier, skipProto) {
     var componentRoot = createElementWithClass('span', 'source-code');
     var shadowRoot = UI.createShadowRootWithCoreStyles(componentRoot, 'components/objectValue.css');
-    shadowRoot.appendChild(Components.ObjectPropertiesSection.createValueElement(object, false));
+    shadowRoot.appendChild(
+        Components.ObjectPropertiesSection.createValueElement(object, false /* wasThrown */, true /* showPreview */));
     if (!object.hasChildren)
       return componentRoot;
 
@@ -218,27 +219,30 @@
   /**
    * @param {!SDK.RemoteObject} value
    * @param {boolean} wasThrown
+   * @param {boolean} showPreview
    * @param {!Element=} parentElement
    * @param {!Components.Linkifier=} linkifier
    * @return {!Element}
    */
-  static createValueElementWithCustomSupport(value, wasThrown, parentElement, linkifier) {
+  static createValueElementWithCustomSupport(value, wasThrown, showPreview, parentElement, linkifier) {
     if (value.customPreview()) {
       var result = (new Components.CustomPreviewComponent(value)).element;
       result.classList.add('object-properties-section-custom-section');
       return result;
     }
-    return Components.ObjectPropertiesSection.createValueElement(value, wasThrown, parentElement, linkifier);
+    return Components.ObjectPropertiesSection.createValueElement(
+        value, wasThrown, showPreview, parentElement, linkifier);
   }
 
   /**
    * @param {!SDK.RemoteObject} value
    * @param {boolean} wasThrown
+   * @param {boolean} showPreview
    * @param {!Element=} parentElement
    * @param {!Components.Linkifier=} linkifier
    * @return {!Element}
    */
-  static createValueElement(value, wasThrown, parentElement, linkifier) {
+  static createValueElement(value, wasThrown, showPreview, parentElement, linkifier) {
     var valueElement;
     var type = value.type;
     var subtype = value.subtype;
@@ -261,8 +265,13 @@
         parentElement.classList.add('hbox');
     } else {
       valueElement = createElementWithClass('span', 'object-value-' + (subtype || type));
-      valueElement.setTextContentTruncatedIfNeeded(description);
       valueElement.title = description || '';
+      if (Runtime.experiments.isEnabled('objectPreviews') && value.preview && showPreview) {
+        var previewFormatter = new Components.RemoteObjectPreviewFormatter();
+        previewFormatter.appendObjectPreview(valueElement, value.preview, false /* isEntry */);
+      } else {
+        valueElement.setTextContentTruncatedIfNeeded(description);
+      }
     }
 
     if (wasThrown) {
@@ -546,10 +555,11 @@
           treeElement, properties, internalProperties, skipProto, targetValue || value, linkifier, emptyPlaceholder);
     }
 
+    var generatePreview = Runtime.experiments.isEnabled('objectPreviews');
     if (flattenProtoChain)
-      value.getAllProperties(false, callback);
+      value.getAllProperties(false, generatePreview, callback);
     else
-      SDK.RemoteObject.loadFromObjectPerProto(value, callback);
+      SDK.RemoteObject.loadFromObjectPerProto(value, generatePreview, callback);
   }
 
   /**
@@ -781,8 +791,9 @@
     separatorElement.textContent = ': ';
 
     if (this.property.value) {
+      var showPreview = this.property.name !== '__proto__';
       this.valueElement = Components.ObjectPropertiesSection.createValueElementWithCustomSupport(
-          this.property.value, this.property.wasThrown, this.listItemElement, this._linkifier);
+          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 = Components.ObjectPropertyTreeElement.createRemoteObjectAccessorPropertySpan(
@@ -1166,7 +1177,8 @@
     function processArrayFragment(arrayFragment, wasThrown) {
       if (!arrayFragment || wasThrown)
         return;
-      arrayFragment.getAllProperties(false, processProperties.bind(this));
+      arrayFragment.getAllProperties(
+          false, Runtime.experiments.isEnabled('objectPreviews'), processProperties.bind(this));
     }
 
     /** @this {Components.ArrayGroupingTreeElement} */
@@ -1224,7 +1236,7 @@
     function processObjectFragment(arrayFragment, wasThrown) {
       if (!arrayFragment || wasThrown)
         return;
-      arrayFragment.getOwnProperties(processProperties.bind(this));
+      arrayFragment.getOwnProperties(Runtime.experiments.isEnabled('objectPreviews'), processProperties.bind(this));
     }
 
     /**
diff --git a/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js b/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
index 30cb1a7..8266ac3 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/RemoteObjectPreviewFormatter.js
@@ -21,27 +21,43 @@
   /**
    * @param {!Element} parentElement
    * @param {!Protocol.Runtime.ObjectPreview} preview
+   * @param {boolean} isEntry
    */
-  appendObjectPreview(parentElement, preview) {
+  appendObjectPreview(parentElement, preview, isEntry) {
+    const previewExperimentEnabled = Runtime.experiments.isEnabled('objectPreviews');
     var description = preview.description;
-    if (preview.type !== 'object' || preview.subtype === 'null') {
+    if (preview.type !== 'object' || preview.subtype === 'null' || (previewExperimentEnabled && isEntry)) {
       parentElement.appendChild(this.renderPropertyPreview(preview.type, preview.subtype, description));
       return;
     }
-    if (description && preview.subtype !== 'array')
-      parentElement.createTextChildren(description, ' ');
+    const isArrayOrTypedArray = preview.subtype === 'array' || preview.subtype === 'typedarray';
+    if (description) {
+      if (previewExperimentEnabled) {
+        // Hide the description for plain objects and plain arrays.
+        const plainObjectDescription = 'Object';
+        const size = SDK.RemoteObject.arrayLength(preview) || SDK.RemoteObject.mapOrSetEntriesCount(preview);
+        var text = preview.subtype === 'typedarray' ? SDK.RemoteObject.arrayNameFromDescription(description) : '';
+        if (isArrayOrTypedArray)
+          text += size > 1 ? ('(' + size + ')') : '';
+        else
+          text = description === plainObjectDescription ? '' : description;
+        if (text.length > 0)
+          parentElement.createChild('span', 'object-description').textContent = text + ' ';
+      } else if (preview.subtype !== 'array') {
+        parentElement.createTextChildren(description, ' ');
+      }
+    }
 
-    var isArray = preview.subtype === 'array' || preview.subtype === 'typedarray';
-    parentElement.createTextChild(isArray ? '[' : '{');
+    parentElement.createTextChild(isArrayOrTypedArray ? '[' : '{');
     if (preview.entries)
       this._appendEntriesPreview(parentElement, preview);
-    else if (isArray)
+    else if (isArrayOrTypedArray)
       this._appendArrayPropertiesPreview(parentElement, preview);
     else
       this._appendObjectPropertiesPreview(parentElement, preview);
     if (preview.overflow)
       parentElement.createChild('span').textContent = '\u2026';
-    parentElement.createTextChild(isArray ? ']' : '}');
+    parentElement.createTextChild(isArrayOrTypedArray ? ']' : '}');
   }
 
   /**
@@ -164,10 +180,10 @@
 
       var entry = preview.entries[i];
       if (entry.key) {
-        this.appendObjectPreview(parentElement, entry.key);
+        this.appendObjectPreview(parentElement, entry.key, true /* isEntry */);
         parentElement.createTextChild(' => ');
       }
-      this.appendObjectPreview(parentElement, entry.value);
+      this.appendObjectPreview(parentElement, entry.value, true /* isEntry */);
     }
   }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/components/objectValue.css b/third_party/WebKit/Source/devtools/front_end/components/objectValue.css
index 828ec16..cfd403e 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/objectValue.css
+++ b/third_party/WebKit/Source/devtools/front_end/components/objectValue.css
@@ -98,3 +98,7 @@
 :host-context(.-theme-with-dark-background) .object-value-boolean {
     color: hsl(252, 100%, 75%);
 }
+
+.object-description {
+    color: gray;
+}
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
index 5351fa7..11d9e33 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js
@@ -264,7 +264,7 @@
 
     var excludedTokens = new Set(['js-comment', 'js-string-2', 'js-def']);
     var trimmedBefore = before.trim();
-    if (!trimmedBefore.endsWith('['))
+    if (!trimmedBefore.endsWith('[') && !trimmedBefore.match(/\.\s*(get|set|delete)\s*\(\s*$/))
       excludedTokens.add('js-string');
     if (!trimmedBefore.endsWith('.'))
       excludedTokens.add('js-property');
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
index 8c62058d..edc25c3 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js
@@ -526,7 +526,7 @@
     var titleElement = createElement('span');
     if (includePreview && obj.preview) {
       titleElement.classList.add('console-object-preview');
-      this._previewFormatter.appendObjectPreview(titleElement, obj.preview);
+      this._previewFormatter.appendObjectPreview(titleElement, obj.preview, false /* isEntry */);
     } else if (obj.type === 'function') {
       Components.ObjectPropertiesSection.formatObjectAsFunction(obj, titleElement, false);
       titleElement.classList.add('object-value-function');
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js b/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js
index 1bf84cd6..a262639 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/PropertiesWidget.js
@@ -108,7 +108,7 @@
       if (!result.object || result.wasThrown)
         return;
 
-      var promise = result.object.getOwnPropertiesPromise().then(fillSection.bind(this));
+      var promise = result.object.getOwnPropertiesPromise(false /* generatePreview */).then(fillSection.bind(this));
       result.object.release();
       return promise;
     }
diff --git a/third_party/WebKit/Source/devtools/front_end/main/Main.js b/third_party/WebKit/Source/devtools/front_end/main/Main.js
index bf62f56..f8f4953 100644
--- a/third_party/WebKit/Source/devtools/front_end/main/Main.js
+++ b/third_party/WebKit/Source/devtools/front_end/main/Main.js
@@ -104,6 +104,7 @@
     Runtime.experiments.register('inputEventsOnTimelineOverview', 'Input events on Timeline overview', true);
     Runtime.experiments.register('liveSASS', 'Live SASS');
     Runtime.experiments.register('networkGroupingRequests', 'Network request groups support', true);
+    Runtime.experiments.register('objectPreviews', 'Object previews', true);
     Runtime.experiments.register('persistence2', 'Persistence 2.0');
     Runtime.experiments.register('persistenceValidation', 'Validate persistence bindings');
     Runtime.experiments.register('requestBlocking', 'Request blocking', true);
diff --git a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js b/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
index 58a3e64..f2efc63 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/ResourcesPanel.js
@@ -639,9 +639,10 @@
     this.visibleView = view;
 
     this._storageViewToolbar.removeToolbarItems();
-    var toolbarItems = view instanceof UI.SimpleView ? view.syncToolbarItems() : null;
-    for (var i = 0; toolbarItems && i < toolbarItems.length; ++i)
+    var toolbarItems = (view instanceof UI.SimpleView && view.syncToolbarItems()) || [];
+    for (var i = 0; i < toolbarItems.length; ++i)
       this._storageViewToolbar.appendToolbarItem(toolbarItems[i]);
+    this._storageViewToolbar.element.classList.toggle('hidden', !toolbarItems.length);
   }
 
   closeVisibleView() {
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
index 4de10f21..d7892a7 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -684,7 +684,8 @@
    * @return {!Promise<?SDK.DebuggerModel.FunctionDetails>}
    */
   functionDetailsPromise(remoteObject) {
-    return remoteObject.getAllPropertiesPromise(/* accessorPropertiesOnly */ false).then(buildDetails.bind(this));
+    return remoteObject.getAllPropertiesPromise(false /* accessorPropertiesOnly */, false /* generatePreview */)
+        .then(buildDetails.bind(this));
 
     /**
      * @param {!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}} response
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
index efc30fd9..591eb5f5 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/RemoteObject.js
@@ -64,6 +64,15 @@
   }
 
   /**
+   * @param {string} description
+   * @return {string}
+   */
+  static arrayNameFromDescription(description) {
+    return description.replace(SDK.RemoteObject._descriptionLengthParenRegex, '')
+        .replace(SDK.RemoteObject._descriptionLengthSquareRegex, '');
+  }
+
+  /**
    * @param {!SDK.RemoteObject|!Protocol.Runtime.RemoteObject|!Protocol.Runtime.ObjectPreview} object
    * @return {number}
    */
@@ -72,7 +81,19 @@
       return 0;
     // Array lengths in V8-generated descriptions switched from square brackets to parentheses.
     // Both formats are checked in case the front end is dealing with an old version of V8.
-    var matches = object.description.match(/\[([0-9]+)\]/) || object.description.match(/\(([0-9]+)\)/);
+    var parenMatches = object.description.match(SDK.RemoteObject._descriptionLengthParenRegex);
+    var squareMatches = object.description.match(SDK.RemoteObject._descriptionLengthSquareRegex);
+    return parenMatches ? parseInt(parenMatches[1], 10) : (squareMatches ? parseInt(squareMatches[1], 10) : 0);
+  }
+
+  /**
+   * @param {!Protocol.Runtime.ObjectPreview} preview
+   * @return {number}
+   */
+  static mapOrSetEntriesCount(preview) {
+    if (preview.subtype !== 'map' && preview.subtype !== 'set')
+      return 0;
+    var matches = preview.description.match(SDK.RemoteObject._descriptionLengthParenRegex);
     if (!matches)
       return 0;
     return parseInt(matches[1], 10);
@@ -119,9 +140,10 @@
 
   /**
    * @param {!SDK.RemoteObject} object
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  static loadFromObjectPerProto(object, callback) {
+  static loadFromObjectPerProto(object, generatePreview, callback) {
     // Combines 2 asynch calls. Doesn't rely on call-back orders (some calls may be loop-back).
     var savedOwnProperties;
     var savedAccessorProperties;
@@ -177,8 +199,8 @@
       processCallback();
     }
 
-    object.getAllProperties(true, allAccessorPropertiesCallback);
-    object.getOwnProperties(ownPropertiesCallback);
+    object.getAllProperties(true /* accessorPropertiesOnly */, generatePreview, allAccessorPropertiesCallback);
+    object.getOwnProperties(generatePreview, ownPropertiesCallback);
   }
 
   /**
@@ -216,16 +238,18 @@
   }
 
   /**
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  getOwnProperties(callback) {
+  getOwnProperties(generatePreview, callback) {
     throw 'Not implemented';
   }
 
   /**
+   * @param {boolean} generatePreview
    * @return {!Promise<!{properties: ?Array.<!SDK.RemoteObjectProperty>, internalProperties: ?Array.<!SDK.RemoteObjectProperty>}>}
    */
-  getOwnPropertiesPromise() {
+  getOwnPropertiesPromise(generatePreview) {
     return new Promise(promiseConstructor.bind(this));
 
     /**
@@ -233,7 +257,7 @@
      * @this {SDK.RemoteObject}
      */
     function promiseConstructor(success) {
-      this.getOwnProperties(getOwnPropertiesCallback.bind(null, success));
+      this.getOwnProperties(!!generatePreview, getOwnPropertiesCallback.bind(null, success));
     }
 
     /**
@@ -248,17 +272,19 @@
 
   /**
    * @param {boolean} accessorPropertiesOnly
+   * @param {boolean} generatePreview
    * @param {function(?Array<!SDK.RemoteObjectProperty>, ?Array<!SDK.RemoteObjectProperty>)} callback
    */
-  getAllProperties(accessorPropertiesOnly, callback) {
+  getAllProperties(accessorPropertiesOnly, generatePreview, callback) {
     throw 'Not implemented';
   }
 
   /**
    * @param {boolean} accessorPropertiesOnly
+   * @param {boolean} generatePreview
    * @return {!Promise<!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}>}
    */
-  getAllPropertiesPromise(accessorPropertiesOnly) {
+  getAllPropertiesPromise(accessorPropertiesOnly, generatePreview) {
     return new Promise(promiseConstructor.bind(this));
 
     /**
@@ -266,7 +292,7 @@
      * @this {SDK.RemoteObject}
      */
     function promiseConstructor(success) {
-      this.getAllProperties(accessorPropertiesOnly, getAllPropertiesCallback.bind(null, success));
+      this.getAllProperties(accessorPropertiesOnly, generatePreview, getAllPropertiesCallback.bind(null, success));
     }
 
     /**
@@ -494,19 +520,21 @@
 
   /**
    * @override
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  getOwnProperties(callback) {
-    this.doGetProperties(true, false, false, callback);
+  getOwnProperties(generatePreview, callback) {
+    this.doGetProperties(true, false, generatePreview, callback);
   }
 
   /**
    * @override
    * @param {boolean} accessorPropertiesOnly
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  getAllProperties(accessorPropertiesOnly, callback) {
-    this.doGetProperties(false, accessorPropertiesOnly, false, callback);
+  getAllProperties(accessorPropertiesOnly, generatePreview, callback) {
+    this.doGetProperties(false, accessorPropertiesOnly, generatePreview, callback);
   }
 
   /**
@@ -1125,18 +1153,20 @@
 
   /**
    * @override
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  getOwnProperties(callback) {
+  getOwnProperties(generatePreview, callback) {
     callback(this._children(), null);
   }
 
   /**
    * @override
    * @param {boolean} accessorPropertiesOnly
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  getAllProperties(accessorPropertiesOnly, callback) {
+  getAllProperties(accessorPropertiesOnly, generatePreview, callback) {
     if (accessorPropertiesOnly)
       callback([], null);
     else
@@ -1368,7 +1398,7 @@
    * @return {!Promise<!SDK.RemoteObject>}
    */
   targetFunction() {
-    return this._object.getOwnPropertiesPromise().then(targetFunction.bind(this));
+    return this._object.getOwnPropertiesPromise(false /* generatePreview */).then(targetFunction.bind(this));
 
     /**
      * @param {!{properties: ?Array<!SDK.RemoteObjectProperty>, internalProperties: ?Array<!SDK.RemoteObjectProperty>}} ownProperties
@@ -1423,3 +1453,15 @@
     return this._object;
   }
 };
+
+/**
+ * @const
+ * @type {!RegExp}
+ */
+SDK.RemoteObject._descriptionLengthParenRegex = /\(([0-9]+)\)/;
+
+/**
+ * @const
+ * @type {!RegExp}
+ */
+SDK.RemoteObject._descriptionLengthSquareRegex = /\[([0-9]+)\]/;
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
index 22513ac..ba9737d 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/JavaScriptSourceFrame.js
@@ -571,7 +571,7 @@
     var functionLocation = callFrame.functionLocation();
     if (localScope && functionLocation) {
       Sources.SourceMapNamesResolver.resolveScopeInObject(localScope)
-          .getAllProperties(false, this._prepareScopeVariables.bind(this, callFrame));
+          .getAllProperties(false, false, this._prepareScopeVariables.bind(this, callFrame));
     }
 
     if (this._clearValueWidgetsTimer) {
@@ -689,10 +689,12 @@
         var value = valuesMap.get(name);
         var propertyCount = value.preview ? value.preview.properties.length : 0;
         var entryCount = value.preview && value.preview.entries ? value.preview.entries.length : 0;
-        if (value.preview && propertyCount + entryCount < 10)
-          formatter.appendObjectPreview(nameValuePair, value.preview);
-        else
-          nameValuePair.appendChild(Components.ObjectPropertiesSection.createValueElement(value, false));
+        if (value.preview && propertyCount + entryCount < 10) {
+          formatter.appendObjectPreview(nameValuePair, value.preview, false /* isEntry */);
+        } else {
+          nameValuePair.appendChild(Components.ObjectPropertiesSection.createValueElement(
+              value, false /* wasThrown */, false /* showPreview */));
+        }
         ++renderedNameCount;
       }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
index 2649b9b..11fc49fa 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/SourceMapNamesResolver.js
@@ -403,18 +403,20 @@
 
   /**
    * @override
+   * @param {boolean} generatePreview
    * @param {function(?Array.<!SDK.RemoteObjectProperty>, ?Array.<!SDK.RemoteObjectProperty>)} callback
    */
-  getOwnProperties(callback) {
-    this._object.getOwnProperties(callback);
+  getOwnProperties(generatePreview, callback) {
+    this._object.getOwnProperties(generatePreview, callback);
   }
 
   /**
    * @override
    * @param {boolean} accessorPropertiesOnly
+   * @param {boolean} generatePreview
    * @param {function(?Array<!SDK.RemoteObjectProperty>, ?Array<!SDK.RemoteObjectProperty>)} callback
    */
-  getAllProperties(accessorPropertiesOnly, callback) {
+  getAllProperties(accessorPropertiesOnly, generatePreview, callback) {
     /**
      * @param {?Array.<!SDK.RemoteObjectProperty>} properties
      * @param {?Array.<!SDK.RemoteObjectProperty>} internalProperties
@@ -445,7 +447,7 @@
       callback(newProperties, internalProperties);
     }
 
-    this._object.getAllProperties(accessorPropertiesOnly, wrappedCallback.bind(this));
+    this._object.getAllProperties(accessorPropertiesOnly, generatePreview, wrappedCallback.bind(this));
   }
 
   /**
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
index fe488fbc..4982a85 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/WatchExpressionsSidebarPane.js
@@ -335,7 +335,7 @@
       this._valueElement.textContent = Common.UIString('<not available>');
     } else {
       this._valueElement = Components.ObjectPropertiesSection.createValueElementWithCustomSupport(
-          result, !!exceptionDetails, titleElement, this._linkifier);
+          result, !!exceptionDetails, false /* showPreview */, titleElement, this._linkifier);
     }
     var separatorElement = createElementWithClass('span', 'watch-expressions-separator');
     separatorElement.textContent = ': ';
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/tabbedPane.css b/third_party/WebKit/Source/devtools/front_end/ui/tabbedPane.css
index 0b98b26..1b14d72 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/tabbedPane.css
+++ b/third_party/WebKit/Source/devtools/front_end/ui/tabbedPane.css
@@ -126,12 +126,7 @@
 }
 
 .tabbed-pane-header-tab .tabbed-pane-close-button {
-    display: inline-block;
-    position: relative;
-    top: 2px;
-    left: 1px;
-    margin-left: 2px;
-    margin-top: -3px;
+    margin: 0 -3px 0 4px;
     visibility: hidden;
 }
 
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
index 89a1ea22..f40038d 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
@@ -348,7 +348,7 @@
 ScriptPromise BluetoothRemoteGATTCharacteristic::getDescriptorsImpl(
     ScriptState* scriptState,
     mojom::blink::WebBluetoothGATTQueryQuantity quantity,
-    const String& descriptor) {
+    const String& descriptorsUUID) {
   if (!getGatt()->connected()) {
     return ScriptPromise::rejectWithDOMException(
         scriptState,
@@ -369,11 +369,8 @@
   getGatt()->AddToActiveAlgorithms(resolver);
 
   mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
-  WTF::Optional<String> uuid = WTF::nullopt;
-  if (!descriptor.isEmpty())
-    uuid = descriptor;
   service->RemoteCharacteristicGetDescriptors(
-      m_characteristic->instance_id, quantity, uuid,
+      m_characteristic->instance_id, quantity, descriptorsUUID,
       convertToBaseCallback(
           WTF::bind(&BluetoothRemoteGATTCharacteristic::GetDescriptorsCallback,
                     wrapPersistent(this), m_characteristic->instance_id,
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
index 85341816..25c2e338 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTServer.cpp
@@ -187,12 +187,8 @@
   AddToActiveAlgorithms(resolver);
 
   mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
-  WTF::Optional<String> uuid = WTF::nullopt;
-  if (!servicesUUID.isEmpty())
-    uuid = servicesUUID;
-
   service->RemoteServerGetPrimaryServices(
-      device()->id(), quantity, uuid,
+      device()->id(), quantity, servicesUUID,
       convertToBaseCallback(
           WTF::bind(&BluetoothRemoteGATTServer::GetPrimaryServicesCallback,
                     wrapPersistent(this), quantity, wrapPersistent(resolver))));
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
index 82c8b22..e9da959b 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTService.cpp
@@ -146,12 +146,8 @@
   device()->gatt()->AddToActiveAlgorithms(resolver);
 
   mojom::blink::WebBluetoothService* service = m_device->bluetooth()->service();
-
-  WTF::Optional<String> uuid = WTF::nullopt;
-  if (!characteristicsUUID.isEmpty())
-    uuid = characteristicsUUID;
   service->RemoteServiceGetCharacteristics(
-      m_service->instance_id, quantity, uuid,
+      m_service->instance_id, quantity, characteristicsUUID,
       convertToBaseCallback(
           WTF::bind(&BluetoothRemoteGATTService::GetCharacteristicsCallback,
                     wrapPersistent(this), m_service->instance_id, quantity,
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
index ab091e5..e8a544f 100644
--- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
+++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
@@ -225,7 +225,7 @@
 ShapeDetection status=experimental
 SharedArrayBuffer
 SharedWorker status=stable
-SlimmingPaintInvalidation implied_by=SlimmingPaintV2, status=experimental
+SlimmingPaintInvalidation implied_by=SlimmingPaintV2, status=stable
 SlimmingPaintV2
 SlimmingPaintStrictCullRectClipping
 // Used as argument in attribute of stable-release functions/interfaces where
diff --git a/third_party/WebKit/Source/platform/graphics/Color.cpp b/third_party/WebKit/Source/platform/graphics/Color.cpp
index 3ad2e4d..3b406bf 100644
--- a/third_party/WebKit/Source/platform/graphics/Color.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
@@ -210,7 +210,16 @@
   result.appendNumber(static_cast<unsigned char>(blue()));
   if (colorHasAlpha) {
     result.append(", ");
-    result.appendNumber(alpha() / 255.0f, 6);
+    // See <alphavalue> section in
+    // http://dev.w3.org/csswg/cssom/#serializing-css-values
+    int alphavalue = alpha();
+    float rounded = round(alphavalue * 100 / 255.0f) / 100;
+    if (round(rounded * 255) == alphavalue) {
+      result.appendNumber(rounded, 2);
+    } else {
+      rounded = round(alphavalue * 1000 / 255.0f) / 1000;
+      result.appendNumber(rounded, 3);
+    }
   }
 
   result.append(')');
diff --git a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
index 4e994b24..66acc34 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/MemoryCacheCorrectnessTest.cpp
@@ -427,7 +427,7 @@
   request1.setHTTPMethod(HTTPNames::POST);
   RawResource* resource1 =
       RawResource::create(ResourceRequest(request1.url()), Resource::Raw);
-  resource1->setStatus(Resource::Pending);
+  resource1->setStatus(ResourceStatus::Pending);
   memoryCache()->add(resource1);
 
   ResourceRequest request2(KURL(ParsedURLString, kResourceURL));
diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
index b4fd2da8..c2a3782 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
@@ -302,12 +302,6 @@
     resource->finishPendingClients();
 }
 
-constexpr Resource::Status Resource::NotStarted;
-constexpr Resource::Status Resource::Pending;
-constexpr Resource::Status Resource::Cached;
-constexpr Resource::Status Resource::LoadError;
-constexpr Resource::Status Resource::DecodeError;
-
 Resource::Resource(const ResourceRequest& request,
                    Type type,
                    const ResourceLoaderOptions& options)
@@ -322,7 +316,7 @@
       m_cacheIdentifier(MemoryCache::defaultCacheIdentifier()),
       m_preloadResult(PreloadNotReferenced),
       m_type(type),
-      m_status(NotStarted),
+      m_status(ResourceStatus::NotStarted),
       m_needsSynchronousCacheHit(false),
       m_linkPreload(false),
       m_isRevalidating(false),
@@ -360,7 +354,7 @@
   CHECK(!m_loader);
   DCHECK(stillNeedsLoad());
   m_loader = loader;
-  m_status = Pending;
+  m_status = ResourceStatus::Pending;
 }
 
 void Resource::checkNotify() {
@@ -422,7 +416,7 @@
     memoryCache()->remove(this);
 
   if (!errorOccurred())
-    setStatus(LoadError);
+    setStatus(ResourceStatus::LoadError);
   DCHECK(errorOccurred());
   clearData();
   m_loader = nullptr;
@@ -433,7 +427,7 @@
   DCHECK(!m_isRevalidating);
   m_loadFinishTime = loadFinishTime;
   if (!errorOccurred())
-    m_status = Cached;
+    m_status = ResourceStatus::Cached;
   m_loader = nullptr;
   checkNotify();
 }
@@ -576,7 +570,7 @@
   CHECK(!m_isRevalidationStartForbidden);
   m_isRevalidating = true;
   m_resourceRequest = request;
-  m_status = NotStarted;
+  m_status = ResourceStatus::NotStarted;
 }
 
 bool Resource::willFollowRedirect(const ResourceRequest& newRequest,
diff --git a/third_party/WebKit/Source/platform/loader/fetch/Resource.h b/third_party/WebKit/Source/platform/loader/fetch/Resource.h
index ce181b0..ac68d27 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/Resource.h
+++ b/third_party/WebKit/Source/platform/loader/fetch/Resource.h
@@ -86,15 +86,6 @@
   };
   static const int kLastResourceType = Mock + 1;
 
-  using Status = ResourceStatus;
-
-  // TODO(hiroshige): Remove the following declarations.
-  static constexpr Status NotStarted = ResourceStatus::NotStarted;
-  static constexpr Status Pending = ResourceStatus::Pending;
-  static constexpr Status Cached = ResourceStatus::Cached;
-  static constexpr Status LoadError = ResourceStatus::LoadError;
-  static constexpr Status DecodeError = ResourceStatus::DecodeError;
-
   // Whether a resource client for a preload should mark the preload as
   // referenced.
   enum PreloadReferencePolicy {
@@ -172,8 +163,8 @@
   };
   PreloadResult getPreloadResult() const { return m_preloadResult; }
 
-  Status getStatus() const { return m_status; }
-  void setStatus(Status status) { m_status = status; }
+  ResourceStatus getStatus() const { return m_status; }
+  void setStatus(ResourceStatus status) { m_status = status; }
 
   size_t size() const { return encodedSize() + decodedSize() + overheadSize(); }
 
@@ -197,10 +188,10 @@
   size_t decodedSize() const { return m_decodedSize; }
   size_t overheadSize() const { return m_overheadSize; }
 
-  bool isLoaded() const { return m_status > Pending; }
+  bool isLoaded() const { return m_status > ResourceStatus::Pending; }
 
-  bool isLoading() const { return m_status == Pending; }
-  bool stillNeedsLoad() const { return m_status < Pending; }
+  bool isLoading() const { return m_status == ResourceStatus::Pending; }
+  bool stillNeedsLoad() const { return m_status < ResourceStatus::Pending; }
 
   void setLoader(ResourceLoader*);
   ResourceLoader* loader() const { return m_loader.get(); }
@@ -245,7 +236,8 @@
 
   bool wasCanceled() const { return m_error.isCancellation(); }
   bool errorOccurred() const {
-    return m_status == LoadError || m_status == DecodeError;
+    return m_status == ResourceStatus::LoadError ||
+           m_status == ResourceStatus::DecodeError;
   }
   bool loadFailedOrCanceled() const { return !m_error.isNull(); }
 
@@ -462,7 +454,7 @@
 
   PreloadResult m_preloadResult;
   Type m_type;
-  Status m_status;
+  ResourceStatus m_status;
 
   bool m_needsSynchronousCacheHit;
   bool m_linkPreload;
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index 2ad9540..690a6ed 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -292,7 +292,7 @@
                                          ResourceLoadStartType type,
                                          bool isStaticData) {
   if (type == ResourceLoadingFromCache &&
-      resource->getStatus() == Resource::Cached &&
+      resource->getStatus() == ResourceStatus::Cached &&
       !m_validatedURLs.contains(resource->url())) {
     context().dispatchDidLoadResourceFromMemoryCache(
         identifier, resource, request.resourceRequest().frameType(),
diff --git a/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.cpp b/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.cpp
index 4f660e0..6d40dd50 100644
--- a/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.cpp
+++ b/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.cpp
@@ -22,4 +22,13 @@
   return data.ReadUuid(output);
 }
 
+// static
+void StructTraits<bluetooth::mojom::UUIDDataView, WTF::String>::SetToNull(
+    WTF::String* output) {
+  if (output->isNull())
+    return;
+  WTF::String result;
+  output->swap(result);
+}
+
 }  // namespace mojo
diff --git a/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.h b/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.h
index 0234b3d4..acbc60b 100644
--- a/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.h
+++ b/third_party/WebKit/Source/platform/mojo/BluetoothStructTraits.h
@@ -26,6 +26,10 @@
   static const WTF::String& uuid(const WTF::String& input) { return input; }
 
   static bool Read(bluetooth::mojom::UUIDDataView, WTF::String* output);
+
+  static bool IsNull(const WTF::String& input) { return input.isNull(); }
+
+  static void SetToNull(WTF::String* output);
 };
 
 }  // namespace mojo
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
index 0ead39e..e99519df 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.cc
@@ -327,19 +327,17 @@
     base::TimeTicks desired_run_time,
     EnqueueOrder sequence_number,
     bool nestable) {
-  if (any_thread().immediate_incoming_queue.empty())
-    any_thread().time_domain->OnQueueHasIncomingImmediateWork(this);
   // If the |immediate_incoming_queue| is empty we need a DoWork posted to make
   // it run.
   if (any_thread().immediate_incoming_queue.empty()) {
-    // There's no point posting a DoWork for a disabled queue, however we can
+    // However there's no point posting a DoWork for a blocked queue. NB we can
     // only tell if it's disabled from the main thread.
-    if (base::PlatformThread::CurrentId() == thread_id_) {
-      if (IsQueueEnabled() && !BlockedByFenceLocked())
-        any_thread().task_queue_manager->MaybeScheduleImmediateWork(FROM_HERE);
-    } else {
-      any_thread().task_queue_manager->MaybeScheduleImmediateWork(FROM_HERE);
-    }
+    bool queue_is_blocked =
+        RunsTasksOnCurrentThread() &&
+        (!IsQueueEnabled() || main_thread_only().current_fence);
+    any_thread().task_queue_manager->OnQueueHasIncomingImmediateWork(
+        this, queue_is_blocked);
+    any_thread().time_domain->OnQueueHasImmediateWork(this);
   }
   any_thread().immediate_incoming_queue.emplace_back(
       posted_from, task, desired_run_time, sequence_number, nestable,
@@ -674,22 +672,6 @@
          main_thread_only().current_fence;
 }
 
-bool TaskQueueImpl::BlockedByFenceLocked() const {
-  if (!main_thread_only().current_fence)
-    return false;
-
-  if (!main_thread_only().immediate_work_queue->BlockedByFence() ||
-      !main_thread_only().delayed_work_queue->BlockedByFence()) {
-    return false;
-  }
-
-  if (any_thread().immediate_incoming_queue.empty())
-    return true;
-
-  return any_thread().immediate_incoming_queue.front().enqueue_order() >
-         main_thread_only().current_fence;
-}
-
 EnqueueOrder TaskQueueImpl::GetFenceForTest() const {
   return main_thread_only().current_fence;
 }
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
index eae226c..209a86b2 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_impl.h
@@ -298,9 +298,6 @@
   // Can be called from any thread.
   WTF::Deque<TaskQueueImpl::Task> TakeImmediateIncomingQueue();
 
-  // As BlockedByFence but safe to be called while locked.
-  bool BlockedByFenceLocked() const;
-
   void TraceQueueSize(bool is_locked) const;
   static void QueueAsValueInto(const WTF::Deque<Task>& queue,
                                base::trace_event::TracedValue* state);
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc
index fdb9ec5..16dc908 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.cc
@@ -147,18 +147,35 @@
   queues_.erase(task_queue);
 
   selector_.RemoveQueue(task_queue.get());
+
+  {
+    base::AutoLock lock(any_thread_lock_);
+    any_thread().has_incoming_immediate_work.erase(task_queue.get());
+  }
 }
 
-void TaskQueueManager::UpdateWorkQueues(LazyNow* lazy_now) {
+void TaskQueueManager::ReloadEmptyWorkQueues(
+    const std::unordered_set<internal::TaskQueueImpl*>& queues_to_reload)
+    const {
+  // There are two cases where a queue needs reloading.  First, it might be
+  // completely empty and we've just posted a task (this method handles that
+  // case). Secondly if the work queue becomes empty in when calling
+  // WorkQueue::TakeTaskFromWorkQueue (handled there).
+  for (internal::TaskQueueImpl* queue : queues_to_reload) {
+    queue->ReloadImmediateWorkQueueIfEmpty();
+  }
+}
+
+void TaskQueueManager::WakeupReadyDelayedQueues(LazyNow* lazy_now) {
   TRACE_EVENT0(disabled_by_default_tracing_category_,
-               "TaskQueueManager::UpdateWorkQueues");
+               "TaskQueueManager::WakeupReadyDelayedQueues");
 
   for (TimeDomain* time_domain : time_domains_) {
     if (time_domain == real_time_domain_.get()) {
-      time_domain->UpdateWorkQueues(lazy_now);
+      time_domain->WakeupReadyDelayedQueues(lazy_now);
     } else {
       LazyNow time_domain_lazy_now = time_domain->CreateLazyNow();
-      time_domain->UpdateWorkQueues(&time_domain_lazy_now);
+      time_domain->WakeupReadyDelayedQueues(&time_domain_lazy_now);
     }
   }
 }
@@ -169,6 +186,37 @@
   delegate_->PostTask(FROM_HERE, from_main_thread_immediate_do_work_closure_);
 }
 
+void TaskQueueManager::OnQueueHasIncomingImmediateWork(
+    internal::TaskQueueImpl* queue,
+    bool queue_is_blocked) {
+  bool on_main_thread = delegate_->BelongsToCurrentThread();
+
+  {
+    base::AutoLock lock(any_thread_lock_);
+    any_thread().has_incoming_immediate_work.insert(queue);
+
+    if (queue_is_blocked)
+      return;
+
+    // De-duplicate DoWork posts.
+    if (on_main_thread) {
+      if (!main_thread_pending_wakeups_.insert(base::TimeTicks()).second)
+        return;
+    } else {
+      if (any_thread().other_thread_pending_wakeup)
+        return;
+      any_thread().other_thread_pending_wakeup = true;
+    }
+  }
+
+  if (on_main_thread) {
+    delegate_->PostTask(FROM_HERE, from_main_thread_immediate_do_work_closure_);
+  } else {
+    delegate_->PostTask(FROM_HERE,
+                        from_other_thread_immediate_do_work_closure_);
+  }
+}
+
 void TaskQueueManager::MaybeScheduleImmediateWork(
     const tracked_objects::Location& from_here) {
   bool on_main_thread = delegate_->BelongsToCurrentThread();
@@ -237,9 +285,20 @@
     queues_to_delete_.clear();
 
   LazyNow lazy_now(real_time_domain()->CreateLazyNow());
-  UpdateWorkQueues(&lazy_now);
+  WakeupReadyDelayedQueues(&lazy_now);
 
   for (int i = 0; i < work_batch_size_; i++) {
+    std::unordered_set<internal::TaskQueueImpl*> queues_to_reload;
+
+    {
+      base::AutoLock lock(any_thread_lock_);
+      std::swap(queues_to_reload, any_thread().has_incoming_immediate_work);
+    }
+
+    // It's important we call ReloadEmptyWorkQueues out side of the lock to
+    // avoid a lock order inversion.
+    ReloadEmptyWorkQueues(queues_to_reload);
+
     internal::WorkQueue* work_queue;
     if (!SelectWorkQueueToService(&work_queue))
       break;
@@ -260,7 +319,7 @@
 
     lazy_now = time_after_task.is_null() ? real_time_domain()->CreateLazyNow()
                                          : LazyNow(time_after_task);
-    UpdateWorkQueues(&lazy_now);
+    WakeupReadyDelayedQueues(&lazy_now);
 
     // Only run a single task per batch in nested run loops so that we can
     // properly exit the nested loop when someone calls RunLoop::Quit().
@@ -289,6 +348,18 @@
 
 base::Optional<base::TimeDelta> TaskQueueManager::ComputeDelayTillNextTask(
     LazyNow* lazy_now) {
+  DCHECK(main_thread_checker_.CalledOnValidThread());
+
+  std::unordered_set<internal::TaskQueueImpl*> queues_to_reload;
+  {
+    base::AutoLock lock(any_thread_lock_);
+    std::swap(queues_to_reload, any_thread().has_incoming_immediate_work);
+  }
+
+  // It's important we call ReloadEmptyWorkQueues out side of the lock to
+  // avoid a lock order inversion.
+  ReloadEmptyWorkQueues(queues_to_reload);
+
   // If the selector has non-empty queues we trivially know there is immediate
   // work to be done.
   if (!selector_.EnabledWorkQueuesEmpty())
@@ -505,6 +576,15 @@
   for (auto* time_domain : time_domains_)
     time_domain->AsValueInto(state.get());
   state->EndArray();
+  {
+    base::AutoLock lock(any_thread_lock_);
+    state->BeginArray("has_incoming_immediate_work");
+    for (internal::TaskQueueImpl* task_queue :
+         any_thread().has_incoming_immediate_work) {
+      state->AppendString(task_queue->GetName());
+    }
+    state->EndArray();
+  }
   return std::move(state);
 }
 
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
index 76103b4b..8016827 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager.h
@@ -180,7 +180,7 @@
 
   // Delayed Tasks with run_times <= Now() are enqueued onto the work queue and
   // reloads any empty work queues.
-  void UpdateWorkQueues(LazyNow* lazy_now);
+  void WakeupReadyDelayedQueues(LazyNow* lazy_now);
 
   // Chooses the next work queue to service. Returns true if |out_queue|
   // indicates the queue from which the next task should be run, false to
@@ -222,6 +222,17 @@
   AsValueWithSelectorResult(bool should_run,
                             internal::WorkQueue* selected_work_queue) const;
 
+  // Adds |queue| to |any_thread().has_incoming_immediate_work_| and if
+  // |queue_is_blocked| is false it makes sure a DoWork is posted.
+  // Can be called from any thread.
+  void OnQueueHasIncomingImmediateWork(internal::TaskQueueImpl* queue,
+                                       bool queue_is_blocked);
+
+  // Calls |ReloadImmediateWorkQueueIfEmpty| on all queues in
+  // |queues_to_reload|.
+  void ReloadEmptyWorkQueues(const std::unordered_set<internal::TaskQueueImpl*>&
+                                 queues_to_reload) const;
+
   std::set<TimeDomain*> time_domains_;
   std::unique_ptr<RealTimeDomain> real_time_domain_;
 
@@ -250,6 +261,9 @@
   struct AnyThread {
     AnyThread();
 
+    // Set of task queues with newly available work on the incoming queue.
+    std::unordered_set<internal::TaskQueueImpl*> has_incoming_immediate_work;
+
     bool other_thread_pending_wakeup;
   };
 
diff --git a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
index 06678cdd..d36cacb 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/task_queue_manager_unittest.cc
@@ -116,13 +116,13 @@
           manager_->NewTaskQueue(TaskQueue::Spec(TaskQueue::QueueType::TEST)));
   }
 
-  void UpdateWorkQueues(LazyNow lazy_now) {
-    manager_->UpdateWorkQueues(&lazy_now);
+  void WakeupReadyDelayedQueues(LazyNow lazy_now) {
+    manager_->WakeupReadyDelayedQueues(&lazy_now);
   }
 
   base::Optional<base::TimeDelta> ComputeDelayTillNextTask(LazyNow* lazy_now) {
     // TODO(alexclarke): Remove this once the DoWork refactor lands.
-    manager_->UpdateWorkQueues(lazy_now);
+    manager_->WakeupReadyDelayedQueues(lazy_now);
     return manager_->ComputeDelayTillNextTask(lazy_now);
   }
 
@@ -322,7 +322,7 @@
   EXPECT_THAT(run_order, ElementsAre(1, 2, 4, 5, 3));
 }
 
-TEST_F(TaskQueueManagerTest, QueuePolling) {
+TEST_F(TaskQueueManagerTest, HasPendingImmediateWork_ImmediateTask) {
   Initialize(1u);
 
   std::vector<EnqueueOrder> run_order;
@@ -330,6 +330,43 @@
   runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order));
   EXPECT_TRUE(runners_[0]->HasPendingImmediateWork());
 
+  // Move the task into the |immediate_work_queue|.
+  EXPECT_TRUE(runners_[0]->immediate_work_queue()->Empty());
+  std::unique_ptr<TaskQueue::QueueEnabledVoter> voter =
+      runners_[0]->CreateQueueEnabledVoter();
+  voter->SetQueueEnabled(false);
+  test_task_runner_->RunUntilIdle();
+  EXPECT_FALSE(runners_[0]->immediate_work_queue()->Empty());
+  EXPECT_TRUE(runners_[0]->HasPendingImmediateWork());
+
+  // Run the task, making the queue empty.
+  voter->SetQueueEnabled(true);
+  test_task_runner_->RunUntilIdle();
+  EXPECT_FALSE(runners_[0]->HasPendingImmediateWork());
+}
+
+TEST_F(TaskQueueManagerTest, HasPendingImmediateWork_DelayedTask) {
+  Initialize(1u);
+
+  std::vector<EnqueueOrder> run_order;
+  base::TimeDelta delay(base::TimeDelta::FromMilliseconds(10));
+  runners_[0]->PostDelayedTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order),
+                               delay);
+  EXPECT_FALSE(runners_[0]->HasPendingImmediateWork());
+  now_src_->Advance(delay);
+  EXPECT_TRUE(runners_[0]->HasPendingImmediateWork());
+
+  // Move the task into the |delayed_work_queue|.
+  EXPECT_TRUE(runners_[0]->delayed_work_queue()->Empty());
+  std::unique_ptr<TaskQueue::QueueEnabledVoter> voter =
+      runners_[0]->CreateQueueEnabledVoter();
+  voter->SetQueueEnabled(false);
+  test_task_runner_->RunUntilIdle();
+  EXPECT_FALSE(runners_[0]->delayed_work_queue()->Empty());
+  EXPECT_TRUE(runners_[0]->HasPendingImmediateWork());
+
+  // Run the task, making the queue empty.
+  voter->SetQueueEnabled(true);
   test_task_runner_->RunUntilIdle();
   EXPECT_FALSE(runners_[0]->HasPendingImmediateWork());
 }
@@ -531,6 +568,7 @@
       runners_[0]->CreateQueueEnabledVoter();
   voter->SetQueueEnabled(false);
   runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order));
+  EXPECT_FALSE(test_task_runner_->HasPendingTasks());
 
   test_task_runner_->RunUntilIdle();
   EXPECT_TRUE(run_order.empty());
@@ -547,6 +585,7 @@
   runners_[0]->PostTask(FROM_HERE, base::Bind(&TestTask, 1, &run_order));
   std::unique_ptr<TaskQueue::QueueEnabledVoter> voter =
       runners_[0]->CreateQueueEnabledVoter();
+  EXPECT_TRUE(test_task_runner_->HasPendingTasks());
   voter->SetQueueEnabled(false);
 
   test_task_runner_->RunUntilIdle();
@@ -1085,12 +1124,12 @@
 
   // Move time forwards until just before the delayed task should run.
   now_src_->Advance(base::TimeDelta::FromMilliseconds(10));
-  UpdateWorkQueues(LazyNow(now_src_.get()));
+  WakeupReadyDelayedQueues(LazyNow(now_src_.get()));
   EXPECT_FALSE(runners_[0]->HasPendingImmediateWork());
 
   // Force the delayed task onto the work queue.
   now_src_->Advance(base::TimeDelta::FromMilliseconds(2));
-  UpdateWorkQueues(LazyNow(now_src_.get()));
+  WakeupReadyDelayedQueues(LazyNow(now_src_.get()));
   EXPECT_TRUE(runners_[0]->HasPendingImmediateWork());
 
   test_task_runner_->RunUntilIdle();
@@ -2301,5 +2340,60 @@
   EXPECT_FALSE(ComputeDelayTillNextTask(&lazy_now));
 }
 
+namespace {
+void MessageLoopTaskWithDelayedQuit(
+    base::MessageLoop* message_loop,
+    base::SimpleTestTickClock* now_src,
+    scoped_refptr<internal::TaskQueueImpl> task_queue) {
+  base::MessageLoop::ScopedNestableTaskAllower allow(message_loop);
+  base::RunLoop run_loop;
+  task_queue->PostDelayedTask(FROM_HERE, run_loop.QuitClosure(),
+                              base::TimeDelta::FromMilliseconds(100));
+  now_src->Advance(base::TimeDelta::FromMilliseconds(200));
+  run_loop.Run();
+}
+}  // namespace
+
+TEST_F(TaskQueueManagerTest, DelayedTaskRunsInNestedMessageLoop) {
+  InitializeWithRealMessageLoop(1u);
+  base::RunLoop run_loop;
+  runners_[0]->PostTask(
+      FROM_HERE,
+      base::Bind(&MessageLoopTaskWithDelayedQuit, message_loop_.get(),
+                 now_src_.get(), base::RetainedRef(runners_[0])));
+  run_loop.RunUntilIdle();
+}
+
+namespace {
+void MessageLoopTaskWithImmediateQuit(
+    base::MessageLoop* message_loop,
+    base::Closure non_nested_quit_closure,
+    scoped_refptr<internal::TaskQueueImpl> task_queue) {
+  base::MessageLoop::ScopedNestableTaskAllower allow(message_loop);
+
+  base::RunLoop run_loop;
+  // Needed because entering the nested message loop causes a DoWork to get
+  // posted.
+  task_queue->PostTask(FROM_HERE, base::Bind(&NopTask));
+  task_queue->PostTask(FROM_HERE, run_loop.QuitClosure());
+  run_loop.Run();
+  non_nested_quit_closure.Run();
+}
+}  // namespace
+
+TEST_F(TaskQueueManagerTest,
+       DelayedNestedMessageLoopDoesntPreventTasksRunning) {
+  InitializeWithRealMessageLoop(1u);
+  base::RunLoop run_loop;
+  runners_[0]->PostDelayedTask(
+      FROM_HERE,
+      base::Bind(&MessageLoopTaskWithImmediateQuit, message_loop_.get(),
+                 run_loop.QuitClosure(), base::RetainedRef(runners_[0])),
+      base::TimeDelta::FromMilliseconds(100));
+
+  now_src_->Advance(base::TimeDelta::FromMilliseconds(200));
+  run_loop.Run();
+}
+
 }  // namespace scheduler
 }  // namespace blink
diff --git a/third_party/WebKit/Source/platform/scheduler/base/time_domain.cc b/third_party/WebKit/Source/platform/scheduler/base/time_domain.cc
index c94546e3..0e4a333 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain.cc
@@ -28,11 +28,6 @@
   DCHECK(main_thread_checker_.CalledOnValidThread());
   DCHECK_EQ(queue->GetTimeDomain(), this);
 
-  {
-    base::AutoLock lock(has_incoming_immediate_work_lock_);
-    has_incoming_immediate_work_.erase(queue);
-  }
-
   CancelDelayedWork(queue);
 }
 
@@ -42,19 +37,6 @@
   DCHECK_EQ(queue->GetTimeDomain(), this);
   DCHECK(destination_time_domain);
 
-  // Make sure we remember to update |queue| if it's got incoming immediate
-  // work.
-  bool has_incoming_immediate_work;
-  {
-    base::AutoLock lock(has_incoming_immediate_work_lock_);
-    has_incoming_immediate_work = has_incoming_immediate_work_.erase(queue);
-  }
-  if (has_incoming_immediate_work) {
-    base::AutoLock lock(
-        destination_time_domain->has_incoming_immediate_work_lock_);
-    destination_time_domain->has_incoming_immediate_work_.insert(queue);
-  }
-
   // If no wakeup has been requested then bail out.
   if (!queue->heap_handle().IsValid())
     return;
@@ -99,13 +81,7 @@
     observer_->OnTimeDomainHasDelayedWork(queue);
 }
 
-void TimeDomain::OnQueueHasIncomingImmediateWork(
-    internal::TaskQueueImpl* queue) {
-  {
-    base::AutoLock lock(has_incoming_immediate_work_lock_);
-    has_incoming_immediate_work_.insert(queue);
-  }
-
+void TimeDomain::OnQueueHasImmediateWork(internal::TaskQueueImpl* queue) {
   if (observer_)
     observer_->OnTimeDomainHasImmediateWork(queue);
 }
@@ -124,23 +100,6 @@
   delayed_wakeup_queue_.erase(queue->heap_handle());
 }
 
-void TimeDomain::UpdateWorkQueues(LazyNow* lazy_now) {
-  DCHECK(main_thread_checker_.CalledOnValidThread());
-
-  // Move any ready delayed tasks into the Incoming queues.
-  WakeupReadyDelayedQueues(lazy_now);
-
-  std::set<internal::TaskQueueImpl*> queues_to_reload_if_empty;
-
-  {
-    base::AutoLock lock(has_incoming_immediate_work_lock_);
-    std::swap(queues_to_reload_if_empty, has_incoming_immediate_work_);
-  }
-
-  for (internal::TaskQueueImpl* queue : queues_to_reload_if_empty)
-    queue->ReloadImmediateWorkQueueIfEmpty();
-}
-
 void TimeDomain::WakeupReadyDelayedQueues(LazyNow* lazy_now) {
   DCHECK(main_thread_checker_.CalledOnValidThread());
   // Wake up any queues with pending delayed work.  Note std::multipmap stores
@@ -185,13 +144,6 @@
 void TimeDomain::AsValueInto(base::trace_event::TracedValue* state) const {
   state->BeginDictionary();
   state->SetString("name", GetName());
-  {
-    base::AutoLock lock(has_incoming_immediate_work_lock_);
-    state->BeginArray("has_incoming_immediate_work");
-    for (internal::TaskQueueImpl* queue : has_incoming_immediate_work_)
-      state->AppendString(queue->GetName());
-    state->EndArray();
-  }
   state->SetInteger("registered_delay_count", delayed_wakeup_queue_.size());
   if (!delayed_wakeup_queue_.empty()) {
     base::TimeDelta delay = delayed_wakeup_queue_.min().time - Now();
diff --git a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
index 9da367d..10202f5 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain.h
@@ -91,11 +91,9 @@
   // the next task was posted to and it returns true.  Returns false otherwise.
   bool NextScheduledTaskQueue(TaskQueue** out_task_queue) const;
 
-  // Adds |queue| to |has_incoming_immediate_work_| which causes
-  // UpdateWorkQueues to reload the immediate work queue if empty. Can be
-  // called from any thread.
-  // TODO(alexclarke): Move this to the TaskQueueManager.
-  void OnQueueHasIncomingImmediateWork(internal::TaskQueueImpl* queue);
+  // Notifies the time domain observer (if any) that |queue| has incoming
+  // immediate work.
+  void OnQueueHasImmediateWork(internal::TaskQueueImpl* queue);
 
   // Schedules a call to TaskQueueImpl::WakeUpForDelayedWork when this
   // TimeDomain reaches |delayed_run_time|.  This supersedes any previously
@@ -114,9 +112,6 @@
   // Removes |queue| from all internal data structures.
   void UnregisterQueue(internal::TaskQueueImpl* queue);
 
-  // Updates active queues associated with this TimeDomain.
-  void UpdateWorkQueues(LazyNow* lazy_now);
-
   // Called by the TaskQueueManager when the TimeDomain is registered.
   virtual void OnRegisterWithTaskQueueManager(
       TaskQueueManager* task_queue_manager) = 0;
@@ -167,15 +162,7 @@
 
   IntrusiveHeap<DelayedWakeup> delayed_wakeup_queue_;
 
-  // This lock guards only |has_incoming_immediate_work_|.  It's not expected to
-  // be heavily contended.
-  mutable base::Lock has_incoming_immediate_work_lock_;
-
-  // Set of task queues with newly available work on the incoming queue.
-  // TODO(alexclarke): Move this to the TaskQueueManager.
-  std::set<internal::TaskQueueImpl*> has_incoming_immediate_work_;
-
-  Observer* observer_;  // NOT OWNED.
+  Observer* const observer_;  // NOT OWNED.
 
   base::ThreadChecker main_thread_checker_;
 
diff --git a/third_party/WebKit/Source/platform/scheduler/base/time_domain_unittest.cc b/third_party/WebKit/Source/platform/scheduler/base/time_domain_unittest.cc
index 65fc020..f8eaf85 100644
--- a/third_party/WebKit/Source/platform/scheduler/base/time_domain_unittest.cc
+++ b/third_party/WebKit/Source/platform/scheduler/base/time_domain_unittest.cc
@@ -33,10 +33,10 @@
   using TimeDomain::CancelDelayedWork;
   using TimeDomain::NextScheduledRunTime;
   using TimeDomain::NextScheduledTaskQueue;
-  using TimeDomain::OnQueueHasIncomingImmediateWork;
+  using TimeDomain::OnQueueHasImmediateWork;
   using TimeDomain::ScheduleDelayedWork;
   using TimeDomain::UnregisterQueue;
-  using TimeDomain::UpdateWorkQueues;
+  using TimeDomain::WakeupReadyDelayedQueues;
 
   // TimeSource implementation:
   LazyNow CreateLazyNow() const override { return LazyNow(now_); }
@@ -195,7 +195,7 @@
   EXPECT_FALSE(time_domain_->NextScheduledTaskQueue(&next_task_queue));
 }
 
-TEST_F(TimeDomainTest, UpdateWorkQueues) {
+TEST_F(TimeDomainTest, WakeupReadyDelayedQueues) {
   base::TimeDelta delay = base::TimeDelta::FromMilliseconds(50);
   EXPECT_CALL(*time_domain_.get(), RequestWakeup(_, delay));
   base::TimeTicks now = time_domain_->Now();
@@ -207,13 +207,13 @@
   EXPECT_EQ(delayed_runtime, next_run_time);
 
   LazyNow lazy_now = time_domain_->CreateLazyNow();
-  time_domain_->UpdateWorkQueues(&lazy_now);
+  time_domain_->WakeupReadyDelayedQueues(&lazy_now);
   ASSERT_TRUE(time_domain_->NextScheduledRunTime(&next_run_time));
   EXPECT_EQ(delayed_runtime, next_run_time);
 
   time_domain_->SetNow(delayed_runtime);
   lazy_now = time_domain_->CreateLazyNow();
-  time_domain_->UpdateWorkQueues(&lazy_now);
+  time_domain_->WakeupReadyDelayedQueues(&lazy_now);
   ASSERT_FALSE(time_domain_->NextScheduledRunTime(&next_run_time));
 }
 
@@ -252,7 +252,7 @@
 
 TEST_F(TimeDomainWithObserverTest, OnTimeDomainHasImmediateWork) {
   EXPECT_CALL(*observer_, OnTimeDomainHasImmediateWork(task_queue_.get()));
-  time_domain_->OnQueueHasIncomingImmediateWork(task_queue_.get());
+  time_domain_->OnQueueHasImmediateWork(task_queue_.get());
 }
 
 TEST_F(TimeDomainWithObserverTest, OnTimeDomainHasDelayedWork) {
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index 572ef67..c41e111 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -1071,9 +1071,9 @@
     m_webView->client()->resetInputMethod();
 }
 
-void ChromeClientImpl::showVirtualKeyboard() {
+void ChromeClientImpl::showVirtualKeyboardOnElementFocus() {
   if (m_webView->client())
-    m_webView->client()->showVirtualKeyboard();
+    m_webView->client()->showVirtualKeyboardOnElementFocus();
 }
 
 void ChromeClientImpl::showUnhandledTapUIIfNeeded(
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.h b/third_party/WebKit/Source/web/ChromeClientImpl.h
index 227a1057..c74b0ab 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.h
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.h
@@ -207,7 +207,7 @@
 
   void didCancelCompositionOnSelectionChange() override;
   void resetInputMethod() override;
-  void showVirtualKeyboard() override;
+  void showVirtualKeyboardOnElementFocus() override;
 
   void registerViewportLayers() const override;
 
diff --git a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
index 819b436..f4246ad 100644
--- a/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebEmbeddedWorkerImpl.cpp
@@ -299,8 +299,8 @@
   settings->setStrictMixedContentChecking(true);
   settings->setAllowRunningOfInsecureContent(false);
   settings->setDataSaverEnabled(m_workerStartData.dataSaverEnabled);
-  m_mainFrame = toWebLocalFrameImpl(
-      WebLocalFrame::create(WebTreeScopeType::Document, this));
+  m_mainFrame = toWebLocalFrameImpl(WebLocalFrame::create(
+      WebTreeScopeType::Document, this, nullptr, nullptr));
   m_webView->setMainFrame(m_mainFrame.get());
   m_mainFrame->setDevToolsAgentClient(this);
 
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
index b3cac00..b762eb63 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.cpp
@@ -1431,32 +1431,47 @@
 
 // WebLocalFrameImpl public --------------------------------------------------
 
-WebLocalFrame* WebLocalFrame::create(WebTreeScopeType scope,
-                                     WebFrameClient* client,
-                                     WebFrame* opener) {
-  return WebLocalFrameImpl::create(scope, client, opener);
+WebLocalFrame* WebLocalFrame::create(
+    WebTreeScopeType scope,
+    WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry,
+    WebFrame* opener) {
+  return WebLocalFrameImpl::create(scope, client, interfaceProvider,
+                                   interfaceRegistry, opener);
 }
 
-WebLocalFrame* WebLocalFrame::createProvisional(WebFrameClient* client,
-                                                WebRemoteFrame* oldWebFrame,
-                                                WebSandboxFlags flags) {
-  return WebLocalFrameImpl::createProvisional(client, oldWebFrame, flags);
+WebLocalFrame* WebLocalFrame::createProvisional(
+    WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry,
+    WebRemoteFrame* oldWebFrame,
+    WebSandboxFlags flags) {
+  return WebLocalFrameImpl::createProvisional(
+      client, interfaceProvider, interfaceRegistry, oldWebFrame, flags);
 }
 
-WebLocalFrameImpl* WebLocalFrameImpl::create(WebTreeScopeType scope,
-                                             WebFrameClient* client,
-                                             WebFrame* opener) {
-  WebLocalFrameImpl* frame = new WebLocalFrameImpl(scope, client);
+WebLocalFrameImpl* WebLocalFrameImpl::create(
+    WebTreeScopeType scope,
+    WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry,
+    WebFrame* opener) {
+  WebLocalFrameImpl* frame = new WebLocalFrameImpl(
+      scope, client, interfaceProvider, interfaceRegistry);
   frame->setOpener(opener);
   return frame;
 }
 
 WebLocalFrameImpl* WebLocalFrameImpl::createProvisional(
     WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry,
     WebRemoteFrame* oldWebFrame,
     WebSandboxFlags flags) {
   DCHECK(client);
-  WebLocalFrameImpl* webFrame = new WebLocalFrameImpl(oldWebFrame, client);
+  WebLocalFrameImpl* webFrame = new WebLocalFrameImpl(
+      oldWebFrame, client, interfaceProvider, interfaceRegistry);
   Frame* oldFrame = oldWebFrame->toImplBase()->frame();
   webFrame->setParent(oldWebFrame->parent());
   webFrame->setOpener(oldWebFrame->opener());
@@ -1469,7 +1484,7 @@
   // reuse it here.
   LocalFrame* frame = LocalFrame::create(
       webFrame->m_frameLoaderClientImpl.get(), oldFrame->host(), tempOwner,
-      client->interfaceProvider(), client->interfaceRegistry());
+      interfaceProvider, interfaceRegistry);
   // Set the name and unique name directly, bypassing any of the normal logic
   // to calculate unique name.
   frame->tree().setPrecalculatedName(
@@ -1490,8 +1505,11 @@
   return webFrame;
 }
 
-WebLocalFrameImpl::WebLocalFrameImpl(WebTreeScopeType scope,
-                                     WebFrameClient* client)
+WebLocalFrameImpl::WebLocalFrameImpl(
+    WebTreeScopeType scope,
+    WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry)
     : WebLocalFrame(scope),
       m_frameLoaderClientImpl(FrameLoaderClientImpl::create(this)),
       m_frameWidget(0),
@@ -1499,6 +1517,8 @@
       m_autofillClient(0),
       m_contentSettingsClient(0),
       m_inputEventsScaleFactorForEmulation(1),
+      m_interfaceProvider(interfaceProvider),
+      m_interfaceRegistry(interfaceRegistry),
       m_webDevToolsFrontend(0),
       m_inputMethodController(new WebInputMethodControllerImpl(this)),
       m_selfKeepAlive(this) {
@@ -1506,12 +1526,17 @@
   frameCount++;
 }
 
-WebLocalFrameImpl::WebLocalFrameImpl(WebRemoteFrame* oldWebFrame,
-                                     WebFrameClient* client)
+WebLocalFrameImpl::WebLocalFrameImpl(
+    WebRemoteFrame* oldWebFrame,
+    WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry)
     : WebLocalFrameImpl(oldWebFrame->inShadowTree()
                             ? WebTreeScopeType::Shadow
                             : WebTreeScopeType::Document,
-                        client) {}
+                        client,
+                        interfaceProvider,
+                        interfaceRegistry) {}
 
 WebLocalFrameImpl::~WebLocalFrameImpl() {
   // The widget for the frame, if any, must have already been closed.
@@ -1540,10 +1565,8 @@
                                             FrameOwner* owner,
                                             const AtomicString& name,
                                             const AtomicString& uniqueName) {
-  setCoreFrame(
-      LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner,
-                         client() ? client()->interfaceProvider() : nullptr,
-                         client() ? client()->interfaceRegistry() : nullptr));
+  setCoreFrame(LocalFrame::create(m_frameLoaderClientImpl.get(), host, owner,
+                                  m_interfaceProvider, m_interfaceRegistry));
   frame()->tree().setPrecalculatedName(name, uniqueName);
   // We must call init() after m_frame is assigned because it is referenced
   // during init(). Note that this may dispatch JS events; the frame may be
diff --git a/third_party/WebKit/Source/web/WebLocalFrameImpl.h b/third_party/WebKit/Source/web/WebLocalFrameImpl.h
index 1e48d48f..288cee89 100644
--- a/third_party/WebKit/Source/web/WebLocalFrameImpl.h
+++ b/third_party/WebKit/Source/web/WebLocalFrameImpl.h
@@ -310,8 +310,12 @@
 
   static WebLocalFrameImpl* create(WebTreeScopeType,
                                    WebFrameClient*,
+                                   blink::InterfaceProvider*,
+                                   blink::InterfaceRegistry*,
                                    WebFrame* opener);
   static WebLocalFrameImpl* createProvisional(WebFrameClient*,
+                                              blink::InterfaceProvider*,
+                                              blink::InterfaceRegistry*,
                                               WebRemoteFrame*,
                                               WebSandboxFlags);
   ~WebLocalFrameImpl() override;
@@ -408,8 +412,14 @@
  private:
   friend class FrameLoaderClientImpl;
 
-  WebLocalFrameImpl(WebTreeScopeType, WebFrameClient*);
-  WebLocalFrameImpl(WebRemoteFrame*, WebFrameClient*);
+  WebLocalFrameImpl(WebTreeScopeType,
+                    WebFrameClient*,
+                    blink::InterfaceProvider*,
+                    blink::InterfaceRegistry*);
+  WebLocalFrameImpl(WebRemoteFrame*,
+                    WebFrameClient*,
+                    blink::InterfaceProvider*,
+                    blink::InterfaceRegistry*);
 
   // Inherited from WebFrame, but intentionally hidden: it never makes sense
   // to call these on a WebLocalFrameImpl.
@@ -463,6 +473,10 @@
   IntSize m_inputEventsOffsetForEmulation;
   float m_inputEventsScaleFactorForEmulation;
 
+  // Borrowed pointers to Mojo objects.
+  blink::InterfaceProvider* m_interfaceProvider;
+  blink::InterfaceRegistry* m_interfaceRegistry;
+
   WebDevToolsFrontendImpl* m_webDevToolsFrontend;
 
   Member<Node> m_contextMenuNode;
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
index 4d5220c..ec573b5 100644
--- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
+++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.cpp
@@ -332,10 +332,13 @@
     const WebString& uniqueName,
     WebSandboxFlags sandboxFlags,
     WebFrameClient* client,
+    blink::InterfaceProvider* interfaceProvider,
+    blink::InterfaceRegistry* interfaceRegistry,
     WebFrame* previousSibling,
     const WebFrameOwnerProperties& frameOwnerProperties,
     WebFrame* opener) {
-  WebLocalFrameImpl* child = WebLocalFrameImpl::create(scope, client, opener);
+  WebLocalFrameImpl* child = WebLocalFrameImpl::create(
+      scope, client, interfaceProvider, interfaceRegistry, opener);
   insertAfter(child, previousSibling);
   RemoteFrameOwner* owner = RemoteFrameOwner::create(
       static_cast<SandboxFlags>(sandboxFlags), frameOwnerProperties);
diff --git a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h b/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
index 64a5077..8bc3cc27 100644
--- a/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
+++ b/third_party/WebKit/Source/web/WebRemoteFrameImpl.h
@@ -130,6 +130,8 @@
                                   const WebString& uniqueName,
                                   WebSandboxFlags,
                                   WebFrameClient*,
+                                  blink::InterfaceProvider*,
+                                  blink::InterfaceRegistry*,
                                   WebFrame* previousSibling,
                                   const WebFrameOwnerProperties&,
                                   WebFrame* opener) override;
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
index 2ba42a23..f0aeeeb 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.cpp
@@ -132,7 +132,8 @@
   // Browser process when the worker is created (similar to
   // RenderThread::OnCreateNewView).
   m_mainFrame = toWebLocalFrameImpl(
-      WebLocalFrame::create(WebTreeScopeType::Document, this));
+      WebLocalFrame::create(WebTreeScopeType::Document, this,
+                            Platform::current()->interfaceProvider(), nullptr));
   m_webView->setMainFrame(m_mainFrame.get());
   m_mainFrame->setDevToolsAgentClient(this);
 
@@ -200,10 +201,6 @@
   return m_networkProvider->serviceWorkerID(dataSource);
 }
 
-InterfaceProvider* WebSharedWorkerImpl::interfaceProvider() {
-  return Platform::current()->interfaceProvider();
-}
-
 void WebSharedWorkerImpl::sendProtocolMessage(int sessionId,
                                               int callId,
                                               const WebString& message,
diff --git a/third_party/WebKit/Source/web/WebSharedWorkerImpl.h b/third_party/WebKit/Source/web/WebSharedWorkerImpl.h
index 683d92ac..3393d9d 100644
--- a/third_party/WebKit/Source/web/WebSharedWorkerImpl.h
+++ b/third_party/WebKit/Source/web/WebSharedWorkerImpl.h
@@ -96,7 +96,6 @@
   void didFinishDocumentLoad(WebLocalFrame*) override;
   bool isControlledByServiceWorker(WebDataSource&) override;
   int64_t serviceWorkerID(WebDataSource&) override;
-  InterfaceProvider* interfaceProvider() override;
 
   // WebDevToolsAgentClient overrides.
   void sendProtocolMessage(int sessionId,
diff --git a/third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp b/third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp
index 50f0f3e..183cf87 100644
--- a/third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp
+++ b/third_party/WebKit/Source/web/tests/ChromeClientImplTest.cpp
@@ -71,8 +71,8 @@
   void SetUp() override {
     m_webView = toWebViewImpl(
         WebView::create(&m_webViewClient, WebPageVisibilityStateVisible));
-    m_webView->setMainFrame(
-        WebLocalFrame::create(WebTreeScopeType::Document, &m_webFrameClient));
+    m_webView->setMainFrame(WebLocalFrame::create(
+        WebTreeScopeType::Document, &m_webFrameClient, nullptr, nullptr));
     m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient());
     m_result = WebNavigationPolicyIgnore;
   }
@@ -252,8 +252,8 @@
   void SetUp() override {
     m_webView = toWebViewImpl(
         WebView::create(&m_webViewClient, WebPageVisibilityStateVisible));
-    m_mainFrame =
-        WebLocalFrame::create(WebTreeScopeType::Document, &m_webFrameClient);
+    m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document,
+                                        &m_webFrameClient, nullptr, nullptr);
     m_webView->setMainFrame(m_mainFrame);
     m_chromeClientImpl = toChromeClientImpl(&m_webView->page()->chromeClient());
   }
diff --git a/third_party/WebKit/Source/web/tests/FrameLoaderClientImplTest.cpp b/third_party/WebKit/Source/web/tests/FrameLoaderClientImplTest.cpp
index 7e6bf458..06305a6 100644
--- a/third_party/WebKit/Source/web/tests/FrameLoaderClientImplTest.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameLoaderClientImplTest.cpp
@@ -67,8 +67,8 @@
     // FIXME: http://crbug.com/363843. This needs to find a better way to
     // not create graphics layers.
     m_webView->settings()->setAcceleratedCompositingEnabled(false);
-    m_mainFrame =
-        WebLocalFrame::create(WebTreeScopeType::Document, &m_webFrameClient);
+    m_mainFrame = WebLocalFrame::create(WebTreeScopeType::Document,
+                                        &m_webFrameClient, nullptr, nullptr);
     m_webView->setMainFrame(m_mainFrame);
   }
 
diff --git a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
index b5210c7..ab788c2 100644
--- a/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameTestHelpers.cpp
@@ -177,7 +177,9 @@
 
   WebLocalFrameImpl* frame = toWebLocalFrameImpl(parent->createLocalChild(
       WebTreeScopeType::Document, name, nameToUniqueName(name),
-      WebSandboxFlags::None, client, previousSibling, properties, nullptr));
+      WebSandboxFlags::None, client,
+      static_cast<TestWebFrameClient*>(client)->interfaceProvider(), nullptr,
+      previousSibling, properties, nullptr));
 
   if (!widgetClient)
     widgetClient = defaultWebWidgetClient();
@@ -232,8 +234,9 @@
   m_webView->setDeviceScaleFactor(
       webViewClient->screenInfo().deviceScaleFactor);
   m_webView->setDefaultPageScaleLimits(1, 4);
-  WebLocalFrame* frame = WebLocalFrameImpl::create(WebTreeScopeType::Document,
-                                                   webFrameClient, opener);
+  WebLocalFrame* frame = WebLocalFrameImpl::create(
+      WebTreeScopeType::Document, webFrameClient,
+      webFrameClient->interfaceProvider(), nullptr, opener);
   m_webView->setMainFrame(frame);
   // TODO(dcheng): The main frame widget currently has a special case.
   // Eliminate this once WebView is no longer a WebWidget.
@@ -316,7 +319,8 @@
     const WebString& uniqueName,
     WebSandboxFlags sandboxFlags,
     const WebFrameOwnerProperties& frameOwnerProperties) {
-  WebLocalFrame* frame = WebLocalFrame::create(scope, this);
+  WebLocalFrame* frame =
+      WebLocalFrame::create(scope, this, interfaceProvider(), nullptr);
   parent->appendChild(frame);
   return frame;
 }
diff --git a/third_party/WebKit/Source/web/tests/FrameTestHelpers.h b/third_party/WebKit/Source/web/tests/FrameTestHelpers.h
index dced6da7..d3fb7f7a 100644
--- a/third_party/WebKit/Source/web/tests/FrameTestHelpers.h
+++ b/third_party/WebKit/Source/web/tests/FrameTestHelpers.h
@@ -253,6 +253,9 @@
 
   bool isLoading() { return m_loadsInProgress > 0; }
 
+  // Tests can override the virtual method below to mock the interface provider.
+  virtual blink::InterfaceProvider* interfaceProvider() { return nullptr; }
+
  private:
   int m_loadsInProgress = 0;
 };
diff --git a/third_party/WebKit/Source/web/tests/ImeOnFocusTest.cpp b/third_party/WebKit/Source/web/tests/ImeOnFocusTest.cpp
index 29d3367..569af1e 100644
--- a/third_party/WebKit/Source/web/tests/ImeOnFocusTest.cpp
+++ b/third_party/WebKit/Source/web/tests/ImeOnFocusTest.cpp
@@ -28,7 +28,9 @@
   ImeRequestTrackingWebViewClient() : m_virtualKeyboardRequestCount(0) {}
 
   // WebWidgetClient methods
-  void showVirtualKeyboard() override { ++m_virtualKeyboardRequestCount; }
+  void showVirtualKeyboardOnElementFocus() override {
+    ++m_virtualKeyboardRequestCount;
+  }
 
   // Local methds
   void reset() { m_virtualKeyboardRequestCount = 0; }
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 4f486737..25e59a6bd 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -7075,7 +7075,8 @@
       const WebFrameOwnerProperties& frameOwnerProperties) {
     DCHECK(m_childClient);
     m_childFrameCreationCount++;
-    WebLocalFrame* frame = WebLocalFrame::create(scope, m_childClient);
+    WebLocalFrame* frame =
+        WebLocalFrame::create(scope, m_childClient, nullptr, nullptr);
     parent->appendChild(frame);
     return frame;
   }
@@ -8488,7 +8489,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   FrameTestHelpers::TestWebWidgetClient webWidgetClient;
   WebFrameWidget::create(&webWidgetClient, localFrame);
   remoteFrame->swap(localFrame);
@@ -8518,7 +8519,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   remoteFrame->swap(localFrame);
 
   // Verify that the size that was set with a remote main frame is correct
@@ -8597,7 +8598,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   swapAndVerifyFirstChildConsistency("remote->local", mainFrame(), localFrame);
 
   // FIXME: This almost certainly fires more load events on the iframe element
@@ -8640,7 +8641,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   swapAndVerifyMiddleChildConsistency("remote->local", mainFrame(), localFrame);
 
   // FIXME: This almost certainly fires more load events on the iframe element
@@ -8678,7 +8679,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   swapAndVerifyLastChildConsistency("remote->local", mainFrame(), localFrame);
 
   // FIXME: This almost certainly fires more load events on the iframe element
@@ -8705,7 +8706,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrameImpl* provisionalFrame = WebLocalFrameImpl::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
 
   // The provisional frame should have a local frame owner.
   FrameOwner* owner = provisionalFrame->frame()->owner();
@@ -8758,7 +8759,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   swapAndVerifySubframeConsistency("remote->local", targetFrame, localFrame);
 
   // FIXME: This almost certainly fires more load events on the iframe element
@@ -8806,7 +8807,7 @@
   // code path.
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   remoteFrame->swap(localFrame);
   v8::Local<v8::Value> localWindow = mainFrame()->executeScriptAndReturnValue(
       WebScriptSource("document.querySelector('#frame2').contentWindow;"));
@@ -8843,7 +8844,7 @@
 
   FrameTestHelpers::TestWebFrameClient client;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   remoteFrame->swap(localFrame);
   v8::Local<v8::Value> localWindowTop =
       mainFrame()->executeScriptAndReturnValue(WebScriptSource("saved.top"));
@@ -9000,7 +9001,7 @@
 
   RemoteToLocalSwapWebFrameClient client(remoteFrame);
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html");
   EXPECT_EQ(WebInitialCommitInChildFrame, client.historyCommitType());
 
@@ -9025,7 +9026,7 @@
 
   RemoteToLocalSwapWebFrameClient client(remoteFrame);
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   localFrame->setCommittedFirstRealLoad();
   FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html");
   EXPECT_EQ(WebStandardCommit, client.historyCommitType());
@@ -9058,7 +9059,7 @@
   // Swap back to a LocalFrame.
   RemoteToLocalSwapWebFrameClient client(remoteFrame);
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &client, remoteFrame, WebSandboxFlags::None);
+      &client, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   FrameTestHelpers::loadFrame(localFrame, m_baseURL + "subframe-hello.html");
   EXPECT_EQ(uniqueName.utf8(), localFrame->uniqueName().utf8());
   EXPECT_EQ(uniqueName.utf8(), WebString(toWebLocalFrameImpl(localFrame)
@@ -9085,7 +9086,7 @@
 
   RemoteToLocalSwapWebFrameClient client2(remoteFrame2);
   WebLocalFrame* localFrame2 = WebLocalFrame::createProvisional(
-      &client2, remoteFrame2, WebSandboxFlags::None);
+      &client2, nullptr, nullptr, remoteFrame2, WebSandboxFlags::None);
   FrameTestHelpers::loadFrame(localFrame2, m_baseURL + "subframe-hello.html");
   EXPECT_EQ(uniqueName2.utf8(), localFrame2->uniqueName().utf8());
   EXPECT_EQ(uniqueName2.utf8(), WebString(toWebLocalFrameImpl(localFrame2)
@@ -9230,8 +9231,9 @@
 
   // Do a remote-to-local swap in the popup.
   FrameTestHelpers::TestWebFrameClient popupLocalClient;
-  WebLocalFrame* popupLocalFrame = WebLocalFrame::createProvisional(
-      &popupLocalClient, popupRemoteFrame, WebSandboxFlags::None);
+  WebLocalFrame* popupLocalFrame =
+      WebLocalFrame::createProvisional(&popupLocalClient, nullptr, nullptr,
+                                       popupRemoteFrame, WebSandboxFlags::None);
   popupRemoteFrame->swap(popupLocalFrame);
 
   // The initial document created during the remote-to-local swap should have
@@ -9254,7 +9256,7 @@
   // Now swap in a local frame. It shouldn't crash.
   FrameTestHelpers::TestWebFrameClient localClient;
   WebLocalFrame* localFrame = WebLocalFrame::createProvisional(
-      &localClient, remoteFrame, WebSandboxFlags::None);
+      &localClient, nullptr, nullptr, remoteFrame, WebSandboxFlags::None);
   remoteFrame->swap(localFrame);
 
   // And the opener cycle should still be preserved.
@@ -9660,7 +9662,7 @@
   // Do a remote-to-local swap of the top frame.
   FrameTestHelpers::TestWebFrameClient localClient;
   WebLocalFrame* localRoot = WebLocalFrame::createProvisional(
-      &localClient, remoteRoot, WebSandboxFlags::None);
+      &localClient, nullptr, nullptr, remoteRoot, WebSandboxFlags::None);
   FrameTestHelpers::TestWebWidgetClient webWidgetClient;
   WebFrameWidget::create(&webWidgetClient, localRoot);
   remoteRoot->swap(localRoot);
@@ -10583,7 +10585,7 @@
   Document* document =
       toLocalFrame(helper.webView()->page()->mainFrame())->document();
   EXPECT_TRUE(document->isImageDocument());
-  EXPECT_EQ(Resource::DecodeError,
+  EXPECT_EQ(ResourceStatus::DecodeError,
             toImageDocument(document)->cachedImage()->getStatus());
 }
 
@@ -11210,7 +11212,8 @@
                                     const WebString& uniqueName,
                                     WebSandboxFlags sandboxFlags,
                                     const WebFrameOwnerProperties&) override {
-      WebLocalFrame* frame = WebLocalFrame::create(scope, &m_childClient);
+      WebLocalFrame* frame =
+          WebLocalFrame::create(scope, &m_childClient, nullptr, nullptr);
       parent->appendChild(frame);
       return frame;
     }
diff --git a/third_party/WebKit/Source/web/tests/WebViewTest.cpp b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
index 1bf6e39..4a6c50a 100644
--- a/third_party/WebKit/Source/web/tests/WebViewTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebViewTest.cpp
@@ -396,11 +396,11 @@
                                    "style></head></html>",
                                    baseURL);
   // Expected: red (50% alpha) blended atop base of kBlue.
-  EXPECT_EQ(0xFF7F0080, webView->backgroundColor());
+  EXPECT_EQ(0xFF80007F, webView->backgroundColor());
 
   webView->setBaseBackgroundColor(kTranslucentPutty);
   // Expected: red (50% alpha) blended atop kTranslucentPutty. Note the alpha.
-  EXPECT_EQ(0xBFE93B32, webView->backgroundColor());
+  EXPECT_EQ(0xBFE93A31, webView->backgroundColor());
 
   webView->setBaseBackgroundColor(kTransparent);
   FrameTestHelpers::loadHTMLString(webView->mainFrame(),
@@ -438,8 +438,8 @@
   webView->setBaseBackgroundColor(kBlue);
   EXPECT_EQ(kBlue, webView->backgroundColor());
   FrameTestHelpers::TestWebFrameClient webFrameClient;
-  WebLocalFrame* frame =
-      WebLocalFrame::create(WebTreeScopeType::Document, &webFrameClient);
+  WebLocalFrame* frame = WebLocalFrame::create(
+      WebTreeScopeType::Document, &webFrameClient, nullptr, nullptr);
   webView->setMainFrame(frame);
   webView->close();
 }
@@ -2151,8 +2151,8 @@
       WebViewImpl::create(nullptr, WebPageVisibilityStateVisible);
   FrameTestHelpers::TestWebFrameClient webFrameClient;
   FrameTestHelpers::TestWebWidgetClient webWidgetClient;
-  WebLocalFrame* localFrame =
-      WebLocalFrame::create(WebTreeScopeType::Document, &webFrameClient);
+  WebLocalFrame* localFrame = WebLocalFrame::create(
+      WebTreeScopeType::Document, &webFrameClient, nullptr, nullptr);
   webView->setMainFrame(localFrame);
 
   // TODO(dcheng): The main frame widget currently has a special case.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium
index 611cd27..53e7ba3 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/README.chromium
@@ -71,37 +71,38 @@
 Name: web-platform-tests - Test Suites for Web Platform specifications
 Short Name: wpt
 URL: https://github.com/w3c/web-platform-tests/
-Version: a014b88ca26296bc09e362795ad9c52463f69b91 (Also check wpt/WPTHeads)
+Version: 82173128ef6f536e5faaafc29eecc521380f81ae (Also check wpt/WPTHeads)
 License: LICENSES FOR W3C TEST SUITES (http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html)
 License File: wpt/wpt/LICENSE
 Security Critical: no
-Description: Used to run all supported web-platform-tests as part of blink layout tests. The wpt/wpt
+Description: Used to run all supported web-platform-tests as part of Blink layout tests. The wpt/wpt
              directory only contains the tools as opposed to LayoutTests/external/wpt
-             which contains the tests. Also see wpt/README.chormium for more details on maintenance.
+             which contains the tests. Also see wpt/README.chromium for more details on maintenance.
 Local Modifications: Removed all files except for those listed in wpt/WPTWhiteList.
 
 Name: wpt-tools - Tools for Web Platform Tests
 Short Name: wpt-tools
 URL: https://github.com/w3c/wpt-tools
-Version: 35d2dd69e32e2e08d5fcff72e6feeb42b206710e (Also check wpt/WPTHeads)
+Version: 8e71a1002c843eb363b8583645b433a5ee833ace (Also check wpt/WPTHeads)
 License: W3C 3-clause BSD License (http://www.w3.org/Consortium/Legal/2008/03-bsd-license.html)
 License File: wpt/wpt/tools/LICENSE
 Security Critical: no
-Description: Used to run all supported web-platform-tests as part of blink layout tests.
-             Also see wpt/README.chormium for more details on maintenance.
+Description: Used to run all supported web-platform-tests as part of Blink layout tests.
+             Also see wpt/README.chromium for more details on maintenance.
+             This includes the WPT manifest update script.
 Local Modifications: Removed all files except for those listed in wpt/WPTWhiteList.
 
 Name: six - Python 2 and 3 compatibility library
 Short Name: six
 URL: https://bitbucket.org/gutworth/six
-   However, this is cloned from https://github.com/jgraham/six as a sub module of
+   However, this is cloned from https://github.com/jgraham/six as a submodule of
    web-platform-tests.
 Version: 3b6173c833d217ab0186c355804f5925cbcfca47 (Also check wpt/WPTHeads)
 License: MIT
 License File: wpt/wpt/tools/six/LICENSE
 Security Critical: no
 Description: Dependency from wptserve below.
-             Also see wpt/README.chormium for more details on maintenance.
+             Also see wpt/README.chromium for more details on maintenance.
 Local Modifications: Removed all files except for those listed in wpt/WPTWhiteList.
 
 Name: wptserve - Web server designed for use with web-platform-tests
@@ -111,6 +112,17 @@
 License: W3C 3-clause BSD License (http://www.w3.org/Consortium/Legal/2008/03-bsd-license.html)
 License File: wpt/wpt/tools/wptserve/LICENSE
 Security Critical: no
-Description: Used to run all supported web-platform-tests as part of blink layout tests.
-             Also see wpt/README.chormium for more details on maintenance.
+Description: Used to run all supported web-platform-tests as part of Blink layout tests.
+             Also see wpt/README.chromium for more details on maintenance.
+Local Modifications: Removed all files except for those listed in wpt/WPTWhiteList.
+
+Name: html5lib - HTML-parsing library
+Short Name: html5lib
+URL: https://github.com/html5lib/html5lib-python
+Version: 7cce65bbaa78411f98b8b37eeefc9db03c580097 (Also check wpt/WPTHeads)
+License: MIT
+License File: wpt/wpt/tools/html5lib/LICENSE
+Security Critical: no
+Description: This is a dependency of the manifest WPT manifest update script.
+             Also see wpt/README.chromium for more details on maintenance.
 Local Modifications: Removed all files except for those listed in wpt/WPTWhiteList.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads
index ce28f2fd..46b1091 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTHeads
@@ -1,4 +1,5 @@
 82173128ef6f536e5faaafc29eecc521380f81ae
 ./ tools 8e71a1002c843eb363b8583645b433a5ee833ace
-./tools wptserve 6059a5e2703b914192cc3cd76e707363187d85fa
+./tools html5lib 7cce65bbaa78411f98b8b37eeefc9db03c580097
 ./tools six 3b6173c833d217ab0186c355804f5925cbcfca47
+./tools wptserve 6059a5e2703b914192cc3cd76e707363187d85fa
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList
index 1fdcc1d..702be73a 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/WPTWhiteList
@@ -1,18 +1,63 @@
-./config.default.json
-./CONTRIBUTING.md
 ./.gitignore
 ./__init__.py
+./config.default.json
+./CONTRIBUTING.md
 ./LICENSE.md
 ./manifest
 ./serve
 ./serve.py
-./tools/gitignore/gitignore.py
-./tools/gitignore/__init__.py
 ./tools/__init__.py
+./tools/gitignore/__init__.py
+./tools/gitignore/gitignore.py
+./tools/html5lib/html5lib
+./tools/html5lib/html5lib/__init__.py
+./tools/html5lib/html5lib/constants.py
+./tools/html5lib/html5lib/filters
+./tools/html5lib/html5lib/filters/__init__.py
+./tools/html5lib/html5lib/filters/_base.py
+./tools/html5lib/html5lib/filters/alphabeticalattributes.py
+./tools/html5lib/html5lib/filters/inject_meta_charset.py
+./tools/html5lib/html5lib/filters/lint.py
+./tools/html5lib/html5lib/filters/optionaltags.py
+./tools/html5lib/html5lib/filters/sanitizer.py
+./tools/html5lib/html5lib/filters/whitespace.py
+./tools/html5lib/html5lib/html5parser.py
+./tools/html5lib/html5lib/ihatexml.py
+./tools/html5lib/html5lib/inputstream.py
+./tools/html5lib/html5lib/sanitizer.py
+./tools/html5lib/html5lib/serializer
+./tools/html5lib/html5lib/serializer/__init__.py
+./tools/html5lib/html5lib/serializer/htmlserializer.py
+./tools/html5lib/html5lib/tokenizer.py
+./tools/html5lib/html5lib/treeadapters
+./tools/html5lib/html5lib/treeadapters/__init__.py
+./tools/html5lib/html5lib/treeadapters/sax.py
+./tools/html5lib/html5lib/treebuilders
+./tools/html5lib/html5lib/treebuilders/__init__.py
+./tools/html5lib/html5lib/treebuilders/_base.py
+./tools/html5lib/html5lib/treebuilders/dom.py
+./tools/html5lib/html5lib/treebuilders/etree.py
+./tools/html5lib/html5lib/treebuilders/etree_lxml.py
+./tools/html5lib/html5lib/treewalkers
+./tools/html5lib/html5lib/treewalkers/__init__.py
+./tools/html5lib/html5lib/treewalkers/_base.py
+./tools/html5lib/html5lib/treewalkers/dom.py
+./tools/html5lib/html5lib/treewalkers/etree.py
+./tools/html5lib/html5lib/treewalkers/genshistream.py
+./tools/html5lib/html5lib/treewalkers/lxmletree.py
+./tools/html5lib/html5lib/treewalkers/pulldom.py
+./tools/html5lib/html5lib/trie
+./tools/html5lib/html5lib/trie/__init__.py
+./tools/html5lib/html5lib/trie/_base.py
+./tools/html5lib/html5lib/trie/datrie.py
+./tools/html5lib/html5lib/trie/py.py
+./tools/html5lib/html5lib/utils.py
+./tools/html5lib/LICENSE
+./tools/html5lib/README.rst
 ./tools/LICENSE
 ./tools/localpaths.py
-./tools/manifest/catalog/xhtml.dtd
 ./tools/manifest/__init__.py
+./tools/manifest/catalog/xhtml.dtd
 ./tools/manifest/item.py
 ./tools/manifest/log.py
 ./tools/manifest/manifest.py
@@ -29,16 +74,16 @@
 ./tools/six/LICENSE
 ./tools/six/README
 ./tools/six/six.py
-./tools/sslutils/base.py
 ./tools/sslutils/__init__.py
+./tools/sslutils/base.py
 ./tools/sslutils/openssl.py
 ./tools/sslutils/pregenerated.py
 ./tools/wptserve/.gitignore
 ./tools/wptserve/LICENSE
 ./tools/wptserve/README.md
+./tools/wptserve/wptserve/__init__.py
 ./tools/wptserve/wptserve/constants.py
 ./tools/wptserve/wptserve/handlers.py
-./tools/wptserve/wptserve/__init__.py
 ./tools/wptserve/wptserve/logger.py
 ./tools/wptserve/wptserve/pipes.py
 ./tools/wptserve/wptserve/ranges.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/checkout.sh b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/checkout.sh
index 5b61235..ad14bf7 100755
--- a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/checkout.sh
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/checkout.sh
@@ -50,4 +50,6 @@
   $action
 done
 
+chmod 755 $TARGET_DIR/tools/manifest/update.py
+
 # TODO(burnik): Handle the SSL certs and other configuration.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/LICENSE b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/LICENSE
new file mode 100644
index 0000000..c87fa7a
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/LICENSE
@@ -0,0 +1,20 @@
+Copyright (c) 2006-2013 James Graham and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/README.rst b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/README.rst
new file mode 100644
index 0000000..9e0a0f7
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/README.rst
@@ -0,0 +1,157 @@
+html5lib
+========
+
+.. image:: https://travis-ci.org/html5lib/html5lib-python.png?branch=master
+  :target: https://travis-ci.org/html5lib/html5lib-python
+
+html5lib is a pure-python library for parsing HTML. It is designed to
+conform to the WHATWG HTML specification, as is implemented by all major
+web browsers.
+
+
+Usage
+-----
+
+Simple usage follows this pattern:
+
+.. code-block:: python
+
+  import html5lib
+  with open("mydocument.html", "rb") as f:
+      document = html5lib.parse(f)
+
+or:
+
+.. code-block:: python
+
+  import html5lib
+  document = html5lib.parse("<p>Hello World!")
+
+By default, the ``document`` will be an ``xml.etree`` element instance.
+Whenever possible, html5lib chooses the accelerated ``ElementTree``
+implementation (i.e. ``xml.etree.cElementTree`` on Python 2.x).
+
+Two other tree types are supported: ``xml.dom.minidom`` and
+``lxml.etree``. To use an alternative format, specify the name of
+a treebuilder:
+
+.. code-block:: python
+
+  import html5lib
+  with open("mydocument.html", "rb") as f:
+      lxml_etree_document = html5lib.parse(f, treebuilder="lxml")
+
+When using with ``urllib2`` (Python 2), the charset from HTTP should be
+pass into html5lib as follows:
+
+.. code-block:: python
+
+  from contextlib import closing
+  from urllib2 import urlopen
+  import html5lib
+
+  with closing(urlopen("http://example.com/")) as f:
+      document = html5lib.parse(f, encoding=f.info().getparam("charset"))
+
+When using with ``urllib.request`` (Python 3), the charset from HTTP
+should be pass into html5lib as follows:
+
+.. code-block:: python
+
+  from urllib.request import urlopen
+  import html5lib
+
+  with urlopen("http://example.com/") as f:
+      document = html5lib.parse(f, encoding=f.info().get_content_charset())
+
+To have more control over the parser, create a parser object explicitly.
+For instance, to make the parser raise exceptions on parse errors, use:
+
+.. code-block:: python
+
+  import html5lib
+  with open("mydocument.html", "rb") as f:
+      parser = html5lib.HTMLParser(strict=True)
+      document = parser.parse(f)
+
+When you're instantiating parser objects explicitly, pass a treebuilder
+class as the ``tree`` keyword argument to use an alternative document
+format:
+
+.. code-block:: python
+
+  import html5lib
+  parser = html5lib.HTMLParser(tree=html5lib.getTreeBuilder("dom"))
+  minidom_document = parser.parse("<p>Hello World!")
+
+More documentation is available at http://html5lib.readthedocs.org/.
+
+
+Installation
+------------
+
+html5lib works on CPython 2.6+, CPython 3.2+ and PyPy.  To install it,
+use:
+
+.. code-block:: bash
+
+    $ pip install html5lib
+
+
+Optional Dependencies
+---------------------
+
+The following third-party libraries may be used for additional
+functionality:
+
+- ``datrie`` can be used to improve parsing performance (though in
+  almost all cases the improvement is marginal);
+
+- ``lxml`` is supported as a tree format (for both building and
+  walking) under CPython (but *not* PyPy where it is known to cause
+  segfaults);
+
+- ``genshi`` has a treewalker (but not builder); and
+
+- ``charade`` can be used as a fallback when character encoding cannot
+  be determined; ``chardet``, from which it was forked, can also be used
+  on Python 2.
+
+- ``ordereddict`` can be used under Python 2.6
+  (``collections.OrderedDict`` is used instead on later versions) to
+  serialize attributes in alphabetical order.
+
+
+Bugs
+----
+
+Please report any bugs on the `issue tracker
+<https://github.com/html5lib/html5lib-python/issues>`_.
+
+
+Tests
+-----
+
+Unit tests require the ``nose`` library and can be run using the
+``nosetests`` command in the root directory; ``ordereddict`` is
+required under Python 2.6. All should pass.
+
+Test data are contained in a separate `html5lib-tests
+<https://github.com/html5lib/html5lib-tests>`_ repository and included
+as a submodule, thus for git checkouts they must be initialized::
+
+  $ git submodule init
+  $ git submodule update
+
+If you have all compatible Python implementations available on your
+system, you can run tests on all of them using the ``tox`` utility,
+which can be found on PyPI.
+
+
+Questions?
+----------
+
+There's a mailing list available for support on Google Groups,
+`html5lib-discuss <http://groups.google.com/group/html5lib-discuss>`_,
+though you may get a quicker response asking on IRC in `#whatwg on
+irc.freenode.net <http://wiki.whatwg.org/wiki/IRC>`_.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/__init__.py
new file mode 100644
index 0000000..a67a652
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/__init__.py
@@ -0,0 +1,23 @@
+"""
+HTML parsing library based on the WHATWG "HTML5"
+specification. The parser is designed to be compatible with existing
+HTML found in the wild and implements well-defined error recovery that
+is largely compatible with modern desktop web browsers.
+
+Example usage:
+
+import html5lib
+f = open("my_document.html")
+tree = html5lib.parse(f)
+"""
+
+from __future__ import absolute_import, division, unicode_literals
+
+from .html5parser import HTMLParser, parse, parseFragment
+from .treebuilders import getTreeBuilder
+from .treewalkers import getTreeWalker
+from .serializer import serialize
+
+__all__ = ["HTMLParser", "parse", "parseFragment", "getTreeBuilder",
+           "getTreeWalker", "serialize"]
+__version__ = "0.9999-dev"
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/constants.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/constants.py
new file mode 100644
index 0000000..e708984
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/constants.py
@@ -0,0 +1,3104 @@
+from __future__ import absolute_import, division, unicode_literals
+
+import string
+import gettext
+_ = gettext.gettext
+
+EOF = None
+
+E = {
+    "null-character":
+        _("Null character in input stream, replaced with U+FFFD."),
+    "invalid-codepoint":
+        _("Invalid codepoint in stream."),
+    "incorrectly-placed-solidus":
+        _("Solidus (/) incorrectly placed in tag."),
+    "incorrect-cr-newline-entity":
+        _("Incorrect CR newline entity, replaced with LF."),
+    "illegal-windows-1252-entity":
+        _("Entity used with illegal number (windows-1252 reference)."),
+    "cant-convert-numeric-entity":
+        _("Numeric entity couldn't be converted to character "
+          "(codepoint U+%(charAsInt)08x)."),
+    "illegal-codepoint-for-numeric-entity":
+        _("Numeric entity represents an illegal codepoint: "
+          "U+%(charAsInt)08x."),
+    "numeric-entity-without-semicolon":
+        _("Numeric entity didn't end with ';'."),
+    "expected-numeric-entity-but-got-eof":
+        _("Numeric entity expected. Got end of file instead."),
+    "expected-numeric-entity":
+        _("Numeric entity expected but none found."),
+    "named-entity-without-semicolon":
+        _("Named entity didn't end with ';'."),
+    "expected-named-entity":
+        _("Named entity expected. Got none."),
+    "attributes-in-end-tag":
+        _("End tag contains unexpected attributes."),
+    'self-closing-flag-on-end-tag':
+        _("End tag contains unexpected self-closing flag."),
+    "expected-tag-name-but-got-right-bracket":
+        _("Expected tag name. Got '>' instead."),
+    "expected-tag-name-but-got-question-mark":
+        _("Expected tag name. Got '?' instead. (HTML doesn't "
+          "support processing instructions.)"),
+    "expected-tag-name":
+        _("Expected tag name. Got something else instead"),
+    "expected-closing-tag-but-got-right-bracket":
+        _("Expected closing tag. Got '>' instead. Ignoring '</>'."),
+    "expected-closing-tag-but-got-eof":
+        _("Expected closing tag. Unexpected end of file."),
+    "expected-closing-tag-but-got-char":
+        _("Expected closing tag. Unexpected character '%(data)s' found."),
+    "eof-in-tag-name":
+        _("Unexpected end of file in the tag name."),
+    "expected-attribute-name-but-got-eof":
+        _("Unexpected end of file. Expected attribute name instead."),
+    "eof-in-attribute-name":
+        _("Unexpected end of file in attribute name."),
+    "invalid-character-in-attribute-name":
+        _("Invalid character in attribute name"),
+    "duplicate-attribute":
+        _("Dropped duplicate attribute on tag."),
+    "expected-end-of-tag-name-but-got-eof":
+        _("Unexpected end of file. Expected = or end of tag."),
+    "expected-attribute-value-but-got-eof":
+        _("Unexpected end of file. Expected attribute value."),
+    "expected-attribute-value-but-got-right-bracket":
+        _("Expected attribute value. Got '>' instead."),
+    'equals-in-unquoted-attribute-value':
+        _("Unexpected = in unquoted attribute"),
+    'unexpected-character-in-unquoted-attribute-value':
+        _("Unexpected character in unquoted attribute"),
+    "invalid-character-after-attribute-name":
+        _("Unexpected character after attribute name."),
+    "unexpected-character-after-attribute-value":
+        _("Unexpected character after attribute value."),
+    "eof-in-attribute-value-double-quote":
+        _("Unexpected end of file in attribute value (\")."),
+    "eof-in-attribute-value-single-quote":
+        _("Unexpected end of file in attribute value (')."),
+    "eof-in-attribute-value-no-quotes":
+        _("Unexpected end of file in attribute value."),
+    "unexpected-EOF-after-solidus-in-tag":
+        _("Unexpected end of file in tag. Expected >"),
+    "unexpected-character-after-solidus-in-tag":
+        _("Unexpected character after / in tag. Expected >"),
+    "expected-dashes-or-doctype":
+        _("Expected '--' or 'DOCTYPE'. Not found."),
+    "unexpected-bang-after-double-dash-in-comment":
+        _("Unexpected ! after -- in comment"),
+    "unexpected-space-after-double-dash-in-comment":
+        _("Unexpected space after -- in comment"),
+    "incorrect-comment":
+        _("Incorrect comment."),
+    "eof-in-comment":
+        _("Unexpected end of file in comment."),
+    "eof-in-comment-end-dash":
+        _("Unexpected end of file in comment (-)"),
+    "unexpected-dash-after-double-dash-in-comment":
+        _("Unexpected '-' after '--' found in comment."),
+    "eof-in-comment-double-dash":
+        _("Unexpected end of file in comment (--)."),
+    "eof-in-comment-end-space-state":
+        _("Unexpected end of file in comment."),
+    "eof-in-comment-end-bang-state":
+        _("Unexpected end of file in comment."),
+    "unexpected-char-in-comment":
+        _("Unexpected character in comment found."),
+    "need-space-after-doctype":
+        _("No space after literal string 'DOCTYPE'."),
+    "expected-doctype-name-but-got-right-bracket":
+        _("Unexpected > character. Expected DOCTYPE name."),
+    "expected-doctype-name-but-got-eof":
+        _("Unexpected end of file. Expected DOCTYPE name."),
+    "eof-in-doctype-name":
+        _("Unexpected end of file in DOCTYPE name."),
+    "eof-in-doctype":
+        _("Unexpected end of file in DOCTYPE."),
+    "expected-space-or-right-bracket-in-doctype":
+        _("Expected space or '>'. Got '%(data)s'"),
+    "unexpected-end-of-doctype":
+        _("Unexpected end of DOCTYPE."),
+    "unexpected-char-in-doctype":
+        _("Unexpected character in DOCTYPE."),
+    "eof-in-innerhtml":
+        _("XXX innerHTML EOF"),
+    "unexpected-doctype":
+        _("Unexpected DOCTYPE. Ignored."),
+    "non-html-root":
+        _("html needs to be the first start tag."),
+    "expected-doctype-but-got-eof":
+        _("Unexpected End of file. Expected DOCTYPE."),
+    "unknown-doctype":
+        _("Erroneous DOCTYPE."),
+    "expected-doctype-but-got-chars":
+        _("Unexpected non-space characters. Expected DOCTYPE."),
+    "expected-doctype-but-got-start-tag":
+        _("Unexpected start tag (%(name)s). Expected DOCTYPE."),
+    "expected-doctype-but-got-end-tag":
+        _("Unexpected end tag (%(name)s). Expected DOCTYPE."),
+    "end-tag-after-implied-root":
+        _("Unexpected end tag (%(name)s) after the (implied) root element."),
+    "expected-named-closing-tag-but-got-eof":
+        _("Unexpected end of file. Expected end tag (%(name)s)."),
+    "two-heads-are-not-better-than-one":
+        _("Unexpected start tag head in existing head. Ignored."),
+    "unexpected-end-tag":
+        _("Unexpected end tag (%(name)s). Ignored."),
+    "unexpected-start-tag-out-of-my-head":
+        _("Unexpected start tag (%(name)s) that can be in head. Moved."),
+    "unexpected-start-tag":
+        _("Unexpected start tag (%(name)s)."),
+    "missing-end-tag":
+        _("Missing end tag (%(name)s)."),
+    "missing-end-tags":
+        _("Missing end tags (%(name)s)."),
+    "unexpected-start-tag-implies-end-tag":
+        _("Unexpected start tag (%(startName)s) "
+          "implies end tag (%(endName)s)."),
+    "unexpected-start-tag-treated-as":
+        _("Unexpected start tag (%(originalName)s). Treated as %(newName)s."),
+    "deprecated-tag":
+        _("Unexpected start tag %(name)s. Don't use it!"),
+    "unexpected-start-tag-ignored":
+        _("Unexpected start tag %(name)s. Ignored."),
+    "expected-one-end-tag-but-got-another":
+        _("Unexpected end tag (%(gotName)s). "
+          "Missing end tag (%(expectedName)s)."),
+    "end-tag-too-early":
+        _("End tag (%(name)s) seen too early. Expected other end tag."),
+    "end-tag-too-early-named":
+        _("Unexpected end tag (%(gotName)s). Expected end tag (%(expectedName)s)."),
+    "end-tag-too-early-ignored":
+        _("End tag (%(name)s) seen too early. Ignored."),
+    "adoption-agency-1.1":
+        _("End tag (%(name)s) violates step 1, "
+          "paragraph 1 of the adoption agency algorithm."),
+    "adoption-agency-1.2":
+        _("End tag (%(name)s) violates step 1, "
+          "paragraph 2 of the adoption agency algorithm."),
+    "adoption-agency-1.3":
+        _("End tag (%(name)s) violates step 1, "
+          "paragraph 3 of the adoption agency algorithm."),
+    "adoption-agency-4.4":
+        _("End tag (%(name)s) violates step 4, "
+          "paragraph 4 of the adoption agency algorithm."),
+    "unexpected-end-tag-treated-as":
+        _("Unexpected end tag (%(originalName)s). Treated as %(newName)s."),
+    "no-end-tag":
+        _("This element (%(name)s) has no end tag."),
+    "unexpected-implied-end-tag-in-table":
+        _("Unexpected implied end tag (%(name)s) in the table phase."),
+    "unexpected-implied-end-tag-in-table-body":
+        _("Unexpected implied end tag (%(name)s) in the table body phase."),
+    "unexpected-char-implies-table-voodoo":
+        _("Unexpected non-space characters in "
+          "table context caused voodoo mode."),
+    "unexpected-hidden-input-in-table":
+        _("Unexpected input with type hidden in table context."),
+    "unexpected-form-in-table":
+        _("Unexpected form in table context."),
+    "unexpected-start-tag-implies-table-voodoo":
+        _("Unexpected start tag (%(name)s) in "
+          "table context caused voodoo mode."),
+    "unexpected-end-tag-implies-table-voodoo":
+        _("Unexpected end tag (%(name)s) in "
+          "table context caused voodoo mode."),
+    "unexpected-cell-in-table-body":
+        _("Unexpected table cell start tag (%(name)s) "
+          "in the table body phase."),
+    "unexpected-cell-end-tag":
+        _("Got table cell end tag (%(name)s) "
+          "while required end tags are missing."),
+    "unexpected-end-tag-in-table-body":
+        _("Unexpected end tag (%(name)s) in the table body phase. Ignored."),
+    "unexpected-implied-end-tag-in-table-row":
+        _("Unexpected implied end tag (%(name)s) in the table row phase."),
+    "unexpected-end-tag-in-table-row":
+        _("Unexpected end tag (%(name)s) in the table row phase. Ignored."),
+    "unexpected-select-in-select":
+        _("Unexpected select start tag in the select phase "
+          "treated as select end tag."),
+    "unexpected-input-in-select":
+        _("Unexpected input start tag in the select phase."),
+    "unexpected-start-tag-in-select":
+        _("Unexpected start tag token (%(name)s in the select phase. "
+          "Ignored."),
+    "unexpected-end-tag-in-select":
+        _("Unexpected end tag (%(name)s) in the select phase. Ignored."),
+    "unexpected-table-element-start-tag-in-select-in-table":
+        _("Unexpected table element start tag (%(name)s) in the select in table phase."),
+    "unexpected-table-element-end-tag-in-select-in-table":
+        _("Unexpected table element end tag (%(name)s) in the select in table phase."),
+    "unexpected-char-after-body":
+        _("Unexpected non-space characters in the after body phase."),
+    "unexpected-start-tag-after-body":
+        _("Unexpected start tag token (%(name)s)"
+          " in the after body phase."),
+    "unexpected-end-tag-after-body":
+        _("Unexpected end tag token (%(name)s)"
+          " in the after body phase."),
+    "unexpected-char-in-frameset":
+        _("Unexpected characters in the frameset phase. Characters ignored."),
+    "unexpected-start-tag-in-frameset":
+        _("Unexpected start tag token (%(name)s)"
+          " in the frameset phase. Ignored."),
+    "unexpected-frameset-in-frameset-innerhtml":
+        _("Unexpected end tag token (frameset) "
+          "in the frameset phase (innerHTML)."),
+    "unexpected-end-tag-in-frameset":
+        _("Unexpected end tag token (%(name)s)"
+          " in the frameset phase. Ignored."),
+    "unexpected-char-after-frameset":
+        _("Unexpected non-space characters in the "
+          "after frameset phase. Ignored."),
+    "unexpected-start-tag-after-frameset":
+        _("Unexpected start tag (%(name)s)"
+          " in the after frameset phase. Ignored."),
+    "unexpected-end-tag-after-frameset":
+        _("Unexpected end tag (%(name)s)"
+          " in the after frameset phase. Ignored."),
+    "unexpected-end-tag-after-body-innerhtml":
+        _("Unexpected end tag after body(innerHtml)"),
+    "expected-eof-but-got-char":
+        _("Unexpected non-space characters. Expected end of file."),
+    "expected-eof-but-got-start-tag":
+        _("Unexpected start tag (%(name)s)"
+          ". Expected end of file."),
+    "expected-eof-but-got-end-tag":
+        _("Unexpected end tag (%(name)s)"
+          ". Expected end of file."),
+    "eof-in-table":
+        _("Unexpected end of file. Expected table content."),
+    "eof-in-select":
+        _("Unexpected end of file. Expected select content."),
+    "eof-in-frameset":
+        _("Unexpected end of file. Expected frameset content."),
+    "eof-in-script-in-script":
+        _("Unexpected end of file. Expected script content."),
+    "eof-in-foreign-lands":
+        _("Unexpected end of file. Expected foreign content"),
+    "non-void-element-with-trailing-solidus":
+        _("Trailing solidus not allowed on element %(name)s"),
+    "unexpected-html-element-in-foreign-content":
+        _("Element %(name)s not allowed in a non-html context"),
+    "unexpected-end-tag-before-html":
+        _("Unexpected end tag (%(name)s) before html."),
+    "XXX-undefined-error":
+        _("Undefined error (this sucks and should be fixed)"),
+}
+
+namespaces = {
+    "html": "http://www.w3.org/1999/xhtml",
+    "mathml": "http://www.w3.org/1998/Math/MathML",
+    "svg": "http://www.w3.org/2000/svg",
+    "xlink": "http://www.w3.org/1999/xlink",
+    "xml": "http://www.w3.org/XML/1998/namespace",
+    "xmlns": "http://www.w3.org/2000/xmlns/"
+}
+
+scopingElements = frozenset((
+    (namespaces["html"], "applet"),
+    (namespaces["html"], "caption"),
+    (namespaces["html"], "html"),
+    (namespaces["html"], "marquee"),
+    (namespaces["html"], "object"),
+    (namespaces["html"], "table"),
+    (namespaces["html"], "td"),
+    (namespaces["html"], "th"),
+    (namespaces["mathml"], "mi"),
+    (namespaces["mathml"], "mo"),
+    (namespaces["mathml"], "mn"),
+    (namespaces["mathml"], "ms"),
+    (namespaces["mathml"], "mtext"),
+    (namespaces["mathml"], "annotation-xml"),
+    (namespaces["svg"], "foreignObject"),
+    (namespaces["svg"], "desc"),
+    (namespaces["svg"], "title"),
+))
+
+formattingElements = frozenset((
+    (namespaces["html"], "a"),
+    (namespaces["html"], "b"),
+    (namespaces["html"], "big"),
+    (namespaces["html"], "code"),
+    (namespaces["html"], "em"),
+    (namespaces["html"], "font"),
+    (namespaces["html"], "i"),
+    (namespaces["html"], "nobr"),
+    (namespaces["html"], "s"),
+    (namespaces["html"], "small"),
+    (namespaces["html"], "strike"),
+    (namespaces["html"], "strong"),
+    (namespaces["html"], "tt"),
+    (namespaces["html"], "u")
+))
+
+specialElements = frozenset((
+    (namespaces["html"], "address"),
+    (namespaces["html"], "applet"),
+    (namespaces["html"], "area"),
+    (namespaces["html"], "article"),
+    (namespaces["html"], "aside"),
+    (namespaces["html"], "base"),
+    (namespaces["html"], "basefont"),
+    (namespaces["html"], "bgsound"),
+    (namespaces["html"], "blockquote"),
+    (namespaces["html"], "body"),
+    (namespaces["html"], "br"),
+    (namespaces["html"], "button"),
+    (namespaces["html"], "caption"),
+    (namespaces["html"], "center"),
+    (namespaces["html"], "col"),
+    (namespaces["html"], "colgroup"),
+    (namespaces["html"], "command"),
+    (namespaces["html"], "dd"),
+    (namespaces["html"], "details"),
+    (namespaces["html"], "dir"),
+    (namespaces["html"], "div"),
+    (namespaces["html"], "dl"),
+    (namespaces["html"], "dt"),
+    (namespaces["html"], "embed"),
+    (namespaces["html"], "fieldset"),
+    (namespaces["html"], "figure"),
+    (namespaces["html"], "footer"),
+    (namespaces["html"], "form"),
+    (namespaces["html"], "frame"),
+    (namespaces["html"], "frameset"),
+    (namespaces["html"], "h1"),
+    (namespaces["html"], "h2"),
+    (namespaces["html"], "h3"),
+    (namespaces["html"], "h4"),
+    (namespaces["html"], "h5"),
+    (namespaces["html"], "h6"),
+    (namespaces["html"], "head"),
+    (namespaces["html"], "header"),
+    (namespaces["html"], "hr"),
+    (namespaces["html"], "html"),
+    (namespaces["html"], "iframe"),
+    # Note that image is commented out in the spec as "this isn't an
+    # element that can end up on the stack, so it doesn't matter,"
+    (namespaces["html"], "image"),
+    (namespaces["html"], "img"),
+    (namespaces["html"], "input"),
+    (namespaces["html"], "isindex"),
+    (namespaces["html"], "li"),
+    (namespaces["html"], "link"),
+    (namespaces["html"], "listing"),
+    (namespaces["html"], "marquee"),
+    (namespaces["html"], "menu"),
+    (namespaces["html"], "meta"),
+    (namespaces["html"], "nav"),
+    (namespaces["html"], "noembed"),
+    (namespaces["html"], "noframes"),
+    (namespaces["html"], "noscript"),
+    (namespaces["html"], "object"),
+    (namespaces["html"], "ol"),
+    (namespaces["html"], "p"),
+    (namespaces["html"], "param"),
+    (namespaces["html"], "plaintext"),
+    (namespaces["html"], "pre"),
+    (namespaces["html"], "script"),
+    (namespaces["html"], "section"),
+    (namespaces["html"], "select"),
+    (namespaces["html"], "style"),
+    (namespaces["html"], "table"),
+    (namespaces["html"], "tbody"),
+    (namespaces["html"], "td"),
+    (namespaces["html"], "textarea"),
+    (namespaces["html"], "tfoot"),
+    (namespaces["html"], "th"),
+    (namespaces["html"], "thead"),
+    (namespaces["html"], "title"),
+    (namespaces["html"], "tr"),
+    (namespaces["html"], "ul"),
+    (namespaces["html"], "wbr"),
+    (namespaces["html"], "xmp"),
+    (namespaces["svg"], "foreignObject")
+))
+
+htmlIntegrationPointElements = frozenset((
+    (namespaces["mathml"], "annotaion-xml"),
+    (namespaces["svg"], "foreignObject"),
+    (namespaces["svg"], "desc"),
+    (namespaces["svg"], "title")
+))
+
+mathmlTextIntegrationPointElements = frozenset((
+    (namespaces["mathml"], "mi"),
+    (namespaces["mathml"], "mo"),
+    (namespaces["mathml"], "mn"),
+    (namespaces["mathml"], "ms"),
+    (namespaces["mathml"], "mtext")
+))
+
+adjustForeignAttributes = {
+    "xlink:actuate": ("xlink", "actuate", namespaces["xlink"]),
+    "xlink:arcrole": ("xlink", "arcrole", namespaces["xlink"]),
+    "xlink:href": ("xlink", "href", namespaces["xlink"]),
+    "xlink:role": ("xlink", "role", namespaces["xlink"]),
+    "xlink:show": ("xlink", "show", namespaces["xlink"]),
+    "xlink:title": ("xlink", "title", namespaces["xlink"]),
+    "xlink:type": ("xlink", "type", namespaces["xlink"]),
+    "xml:base": ("xml", "base", namespaces["xml"]),
+    "xml:lang": ("xml", "lang", namespaces["xml"]),
+    "xml:space": ("xml", "space", namespaces["xml"]),
+    "xmlns": (None, "xmlns", namespaces["xmlns"]),
+    "xmlns:xlink": ("xmlns", "xlink", namespaces["xmlns"])
+}
+
+unadjustForeignAttributes = dict([((ns, local), qname) for qname, (prefix, local, ns) in
+                                  adjustForeignAttributes.items()])
+
+spaceCharacters = frozenset((
+    "\t",
+    "\n",
+    "\u000C",
+    " ",
+    "\r"
+))
+
+tableInsertModeElements = frozenset((
+    "table",
+    "tbody",
+    "tfoot",
+    "thead",
+    "tr"
+))
+
+asciiLowercase = frozenset(string.ascii_lowercase)
+asciiUppercase = frozenset(string.ascii_uppercase)
+asciiLetters = frozenset(string.ascii_letters)
+digits = frozenset(string.digits)
+hexDigits = frozenset(string.hexdigits)
+
+asciiUpper2Lower = dict([(ord(c), ord(c.lower()))
+                         for c in string.ascii_uppercase])
+
+# Heading elements need to be ordered
+headingElements = (
+    "h1",
+    "h2",
+    "h3",
+    "h4",
+    "h5",
+    "h6"
+)
+
+voidElements = frozenset((
+    "base",
+    "command",
+    "event-source",
+    "link",
+    "meta",
+    "hr",
+    "br",
+    "img",
+    "embed",
+    "param",
+    "area",
+    "col",
+    "input",
+    "source",
+    "track"
+))
+
+cdataElements = frozenset(('title', 'textarea'))
+
+rcdataElements = frozenset((
+    'style',
+    'script',
+    'xmp',
+    'iframe',
+    'noembed',
+    'noframes',
+    'noscript'
+))
+
+booleanAttributes = {
+    "": frozenset(("irrelevant",)),
+    "style": frozenset(("scoped",)),
+    "img": frozenset(("ismap",)),
+    "audio": frozenset(("autoplay", "controls")),
+    "video": frozenset(("autoplay", "controls")),
+    "script": frozenset(("defer", "async")),
+    "details": frozenset(("open",)),
+    "datagrid": frozenset(("multiple", "disabled")),
+    "command": frozenset(("hidden", "disabled", "checked", "default")),
+    "hr": frozenset(("noshade")),
+    "menu": frozenset(("autosubmit",)),
+    "fieldset": frozenset(("disabled", "readonly")),
+    "option": frozenset(("disabled", "readonly", "selected")),
+    "optgroup": frozenset(("disabled", "readonly")),
+    "button": frozenset(("disabled", "autofocus")),
+    "input": frozenset(("disabled", "readonly", "required", "autofocus", "checked", "ismap")),
+    "select": frozenset(("disabled", "readonly", "autofocus", "multiple")),
+    "output": frozenset(("disabled", "readonly")),
+}
+
+# entitiesWindows1252 has to be _ordered_ and needs to have an index. It
+# therefore can't be a frozenset.
+entitiesWindows1252 = (
+    8364,   # 0x80  0x20AC  EURO SIGN
+    65533,  # 0x81          UNDEFINED
+    8218,   # 0x82  0x201A  SINGLE LOW-9 QUOTATION MARK
+    402,    # 0x83  0x0192  LATIN SMALL LETTER F WITH HOOK
+    8222,   # 0x84  0x201E  DOUBLE LOW-9 QUOTATION MARK
+    8230,   # 0x85  0x2026  HORIZONTAL ELLIPSIS
+    8224,   # 0x86  0x2020  DAGGER
+    8225,   # 0x87  0x2021  DOUBLE DAGGER
+    710,    # 0x88  0x02C6  MODIFIER LETTER CIRCUMFLEX ACCENT
+    8240,   # 0x89  0x2030  PER MILLE SIGN
+    352,    # 0x8A  0x0160  LATIN CAPITAL LETTER S WITH CARON
+    8249,   # 0x8B  0x2039  SINGLE LEFT-POINTING ANGLE QUOTATION MARK
+    338,    # 0x8C  0x0152  LATIN CAPITAL LIGATURE OE
+    65533,  # 0x8D          UNDEFINED
+    381,    # 0x8E  0x017D  LATIN CAPITAL LETTER Z WITH CARON
+    65533,  # 0x8F          UNDEFINED
+    65533,  # 0x90          UNDEFINED
+    8216,   # 0x91  0x2018  LEFT SINGLE QUOTATION MARK
+    8217,   # 0x92  0x2019  RIGHT SINGLE QUOTATION MARK
+    8220,   # 0x93  0x201C  LEFT DOUBLE QUOTATION MARK
+    8221,   # 0x94  0x201D  RIGHT DOUBLE QUOTATION MARK
+    8226,   # 0x95  0x2022  BULLET
+    8211,   # 0x96  0x2013  EN DASH
+    8212,   # 0x97  0x2014  EM DASH
+    732,    # 0x98  0x02DC  SMALL TILDE
+    8482,   # 0x99  0x2122  TRADE MARK SIGN
+    353,    # 0x9A  0x0161  LATIN SMALL LETTER S WITH CARON
+    8250,   # 0x9B  0x203A  SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
+    339,    # 0x9C  0x0153  LATIN SMALL LIGATURE OE
+    65533,  # 0x9D          UNDEFINED
+    382,    # 0x9E  0x017E  LATIN SMALL LETTER Z WITH CARON
+    376     # 0x9F  0x0178  LATIN CAPITAL LETTER Y WITH DIAERESIS
+)
+
+xmlEntities = frozenset(('lt;', 'gt;', 'amp;', 'apos;', 'quot;'))
+
+entities = {
+    "AElig": "\xc6",
+    "AElig;": "\xc6",
+    "AMP": "&",
+    "AMP;": "&",
+    "Aacute": "\xc1",
+    "Aacute;": "\xc1",
+    "Abreve;": "\u0102",
+    "Acirc": "\xc2",
+    "Acirc;": "\xc2",
+    "Acy;": "\u0410",
+    "Afr;": "\U0001d504",
+    "Agrave": "\xc0",
+    "Agrave;": "\xc0",
+    "Alpha;": "\u0391",
+    "Amacr;": "\u0100",
+    "And;": "\u2a53",
+    "Aogon;": "\u0104",
+    "Aopf;": "\U0001d538",
+    "ApplyFunction;": "\u2061",
+    "Aring": "\xc5",
+    "Aring;": "\xc5",
+    "Ascr;": "\U0001d49c",
+    "Assign;": "\u2254",
+    "Atilde": "\xc3",
+    "Atilde;": "\xc3",
+    "Auml": "\xc4",
+    "Auml;": "\xc4",
+    "Backslash;": "\u2216",
+    "Barv;": "\u2ae7",
+    "Barwed;": "\u2306",
+    "Bcy;": "\u0411",
+    "Because;": "\u2235",
+    "Bernoullis;": "\u212c",
+    "Beta;": "\u0392",
+    "Bfr;": "\U0001d505",
+    "Bopf;": "\U0001d539",
+    "Breve;": "\u02d8",
+    "Bscr;": "\u212c",
+    "Bumpeq;": "\u224e",
+    "CHcy;": "\u0427",
+    "COPY": "\xa9",
+    "COPY;": "\xa9",
+    "Cacute;": "\u0106",
+    "Cap;": "\u22d2",
+    "CapitalDifferentialD;": "\u2145",
+    "Cayleys;": "\u212d",
+    "Ccaron;": "\u010c",
+    "Ccedil": "\xc7",
+    "Ccedil;": "\xc7",
+    "Ccirc;": "\u0108",
+    "Cconint;": "\u2230",
+    "Cdot;": "\u010a",
+    "Cedilla;": "\xb8",
+    "CenterDot;": "\xb7",
+    "Cfr;": "\u212d",
+    "Chi;": "\u03a7",
+    "CircleDot;": "\u2299",
+    "CircleMinus;": "\u2296",
+    "CirclePlus;": "\u2295",
+    "CircleTimes;": "\u2297",
+    "ClockwiseContourIntegral;": "\u2232",
+    "CloseCurlyDoubleQuote;": "\u201d",
+    "CloseCurlyQuote;": "\u2019",
+    "Colon;": "\u2237",
+    "Colone;": "\u2a74",
+    "Congruent;": "\u2261",
+    "Conint;": "\u222f",
+    "ContourIntegral;": "\u222e",
+    "Copf;": "\u2102",
+    "Coproduct;": "\u2210",
+    "CounterClockwiseContourIntegral;": "\u2233",
+    "Cross;": "\u2a2f",
+    "Cscr;": "\U0001d49e",
+    "Cup;": "\u22d3",
+    "CupCap;": "\u224d",
+    "DD;": "\u2145",
+    "DDotrahd;": "\u2911",
+    "DJcy;": "\u0402",
+    "DScy;": "\u0405",
+    "DZcy;": "\u040f",
+    "Dagger;": "\u2021",
+    "Darr;": "\u21a1",
+    "Dashv;": "\u2ae4",
+    "Dcaron;": "\u010e",
+    "Dcy;": "\u0414",
+    "Del;": "\u2207",
+    "Delta;": "\u0394",
+    "Dfr;": "\U0001d507",
+    "DiacriticalAcute;": "\xb4",
+    "DiacriticalDot;": "\u02d9",
+    "DiacriticalDoubleAcute;": "\u02dd",
+    "DiacriticalGrave;": "`",
+    "DiacriticalTilde;": "\u02dc",
+    "Diamond;": "\u22c4",
+    "DifferentialD;": "\u2146",
+    "Dopf;": "\U0001d53b",
+    "Dot;": "\xa8",
+    "DotDot;": "\u20dc",
+    "DotEqual;": "\u2250",
+    "DoubleContourIntegral;": "\u222f",
+    "DoubleDot;": "\xa8",
+    "DoubleDownArrow;": "\u21d3",
+    "DoubleLeftArrow;": "\u21d0",
+    "DoubleLeftRightArrow;": "\u21d4",
+    "DoubleLeftTee;": "\u2ae4",
+    "DoubleLongLeftArrow;": "\u27f8",
+    "DoubleLongLeftRightArrow;": "\u27fa",
+    "DoubleLongRightArrow;": "\u27f9",
+    "DoubleRightArrow;": "\u21d2",
+    "DoubleRightTee;": "\u22a8",
+    "DoubleUpArrow;": "\u21d1",
+    "DoubleUpDownArrow;": "\u21d5",
+    "DoubleVerticalBar;": "\u2225",
+    "DownArrow;": "\u2193",
+    "DownArrowBar;": "\u2913",
+    "DownArrowUpArrow;": "\u21f5",
+    "DownBreve;": "\u0311",
+    "DownLeftRightVector;": "\u2950",
+    "DownLeftTeeVector;": "\u295e",
+    "DownLeftVector;": "\u21bd",
+    "DownLeftVectorBar;": "\u2956",
+    "DownRightTeeVector;": "\u295f",
+    "DownRightVector;": "\u21c1",
+    "DownRightVectorBar;": "\u2957",
+    "DownTee;": "\u22a4",
+    "DownTeeArrow;": "\u21a7",
+    "Downarrow;": "\u21d3",
+    "Dscr;": "\U0001d49f",
+    "Dstrok;": "\u0110",
+    "ENG;": "\u014a",
+    "ETH": "\xd0",
+    "ETH;": "\xd0",
+    "Eacute": "\xc9",
+    "Eacute;": "\xc9",
+    "Ecaron;": "\u011a",
+    "Ecirc": "\xca",
+    "Ecirc;": "\xca",
+    "Ecy;": "\u042d",
+    "Edot;": "\u0116",
+    "Efr;": "\U0001d508",
+    "Egrave": "\xc8",
+    "Egrave;": "\xc8",
+    "Element;": "\u2208",
+    "Emacr;": "\u0112",
+    "EmptySmallSquare;": "\u25fb",
+    "EmptyVerySmallSquare;": "\u25ab",
+    "Eogon;": "\u0118",
+    "Eopf;": "\U0001d53c",
+    "Epsilon;": "\u0395",
+    "Equal;": "\u2a75",
+    "EqualTilde;": "\u2242",
+    "Equilibrium;": "\u21cc",
+    "Escr;": "\u2130",
+    "Esim;": "\u2a73",
+    "Eta;": "\u0397",
+    "Euml": "\xcb",
+    "Euml;": "\xcb",
+    "Exists;": "\u2203",
+    "ExponentialE;": "\u2147",
+    "Fcy;": "\u0424",
+    "Ffr;": "\U0001d509",
+    "FilledSmallSquare;": "\u25fc",
+    "FilledVerySmallSquare;": "\u25aa",
+    "Fopf;": "\U0001d53d",
+    "ForAll;": "\u2200",
+    "Fouriertrf;": "\u2131",
+    "Fscr;": "\u2131",
+    "GJcy;": "\u0403",
+    "GT": ">",
+    "GT;": ">",
+    "Gamma;": "\u0393",
+    "Gammad;": "\u03dc",
+    "Gbreve;": "\u011e",
+    "Gcedil;": "\u0122",
+    "Gcirc;": "\u011c",
+    "Gcy;": "\u0413",
+    "Gdot;": "\u0120",
+    "Gfr;": "\U0001d50a",
+    "Gg;": "\u22d9",
+    "Gopf;": "\U0001d53e",
+    "GreaterEqual;": "\u2265",
+    "GreaterEqualLess;": "\u22db",
+    "GreaterFullEqual;": "\u2267",
+    "GreaterGreater;": "\u2aa2",
+    "GreaterLess;": "\u2277",
+    "GreaterSlantEqual;": "\u2a7e",
+    "GreaterTilde;": "\u2273",
+    "Gscr;": "\U0001d4a2",
+    "Gt;": "\u226b",
+    "HARDcy;": "\u042a",
+    "Hacek;": "\u02c7",
+    "Hat;": "^",
+    "Hcirc;": "\u0124",
+    "Hfr;": "\u210c",
+    "HilbertSpace;": "\u210b",
+    "Hopf;": "\u210d",
+    "HorizontalLine;": "\u2500",
+    "Hscr;": "\u210b",
+    "Hstrok;": "\u0126",
+    "HumpDownHump;": "\u224e",
+    "HumpEqual;": "\u224f",
+    "IEcy;": "\u0415",
+    "IJlig;": "\u0132",
+    "IOcy;": "\u0401",
+    "Iacute": "\xcd",
+    "Iacute;": "\xcd",
+    "Icirc": "\xce",
+    "Icirc;": "\xce",
+    "Icy;": "\u0418",
+    "Idot;": "\u0130",
+    "Ifr;": "\u2111",
+    "Igrave": "\xcc",
+    "Igrave;": "\xcc",
+    "Im;": "\u2111",
+    "Imacr;": "\u012a",
+    "ImaginaryI;": "\u2148",
+    "Implies;": "\u21d2",
+    "Int;": "\u222c",
+    "Integral;": "\u222b",
+    "Intersection;": "\u22c2",
+    "InvisibleComma;": "\u2063",
+    "InvisibleTimes;": "\u2062",
+    "Iogon;": "\u012e",
+    "Iopf;": "\U0001d540",
+    "Iota;": "\u0399",
+    "Iscr;": "\u2110",
+    "Itilde;": "\u0128",
+    "Iukcy;": "\u0406",
+    "Iuml": "\xcf",
+    "Iuml;": "\xcf",
+    "Jcirc;": "\u0134",
+    "Jcy;": "\u0419",
+    "Jfr;": "\U0001d50d",
+    "Jopf;": "\U0001d541",
+    "Jscr;": "\U0001d4a5",
+    "Jsercy;": "\u0408",
+    "Jukcy;": "\u0404",
+    "KHcy;": "\u0425",
+    "KJcy;": "\u040c",
+    "Kappa;": "\u039a",
+    "Kcedil;": "\u0136",
+    "Kcy;": "\u041a",
+    "Kfr;": "\U0001d50e",
+    "Kopf;": "\U0001d542",
+    "Kscr;": "\U0001d4a6",
+    "LJcy;": "\u0409",
+    "LT": "<",
+    "LT;": "<",
+    "Lacute;": "\u0139",
+    "Lambda;": "\u039b",
+    "Lang;": "\u27ea",
+    "Laplacetrf;": "\u2112",
+    "Larr;": "\u219e",
+    "Lcaron;": "\u013d",
+    "Lcedil;": "\u013b",
+    "Lcy;": "\u041b",
+    "LeftAngleBracket;": "\u27e8",
+    "LeftArrow;": "\u2190",
+    "LeftArrowBar;": "\u21e4",
+    "LeftArrowRightArrow;": "\u21c6",
+    "LeftCeiling;": "\u2308",
+    "LeftDoubleBracket;": "\u27e6",
+    "LeftDownTeeVector;": "\u2961",
+    "LeftDownVector;": "\u21c3",
+    "LeftDownVectorBar;": "\u2959",
+    "LeftFloor;": "\u230a",
+    "LeftRightArrow;": "\u2194",
+    "LeftRightVector;": "\u294e",
+    "LeftTee;": "\u22a3",
+    "LeftTeeArrow;": "\u21a4",
+    "LeftTeeVector;": "\u295a",
+    "LeftTriangle;": "\u22b2",
+    "LeftTriangleBar;": "\u29cf",
+    "LeftTriangleEqual;": "\u22b4",
+    "LeftUpDownVector;": "\u2951",
+    "LeftUpTeeVector;": "\u2960",
+    "LeftUpVector;": "\u21bf",
+    "LeftUpVectorBar;": "\u2958",
+    "LeftVector;": "\u21bc",
+    "LeftVectorBar;": "\u2952",
+    "Leftarrow;": "\u21d0",
+    "Leftrightarrow;": "\u21d4",
+    "LessEqualGreater;": "\u22da",
+    "LessFullEqual;": "\u2266",
+    "LessGreater;": "\u2276",
+    "LessLess;": "\u2aa1",
+    "LessSlantEqual;": "\u2a7d",
+    "LessTilde;": "\u2272",
+    "Lfr;": "\U0001d50f",
+    "Ll;": "\u22d8",
+    "Lleftarrow;": "\u21da",
+    "Lmidot;": "\u013f",
+    "LongLeftArrow;": "\u27f5",
+    "LongLeftRightArrow;": "\u27f7",
+    "LongRightArrow;": "\u27f6",
+    "Longleftarrow;": "\u27f8",
+    "Longleftrightarrow;": "\u27fa",
+    "Longrightarrow;": "\u27f9",
+    "Lopf;": "\U0001d543",
+    "LowerLeftArrow;": "\u2199",
+    "LowerRightArrow;": "\u2198",
+    "Lscr;": "\u2112",
+    "Lsh;": "\u21b0",
+    "Lstrok;": "\u0141",
+    "Lt;": "\u226a",
+    "Map;": "\u2905",
+    "Mcy;": "\u041c",
+    "MediumSpace;": "\u205f",
+    "Mellintrf;": "\u2133",
+    "Mfr;": "\U0001d510",
+    "MinusPlus;": "\u2213",
+    "Mopf;": "\U0001d544",
+    "Mscr;": "\u2133",
+    "Mu;": "\u039c",
+    "NJcy;": "\u040a",
+    "Nacute;": "\u0143",
+    "Ncaron;": "\u0147",
+    "Ncedil;": "\u0145",
+    "Ncy;": "\u041d",
+    "NegativeMediumSpace;": "\u200b",
+    "NegativeThickSpace;": "\u200b",
+    "NegativeThinSpace;": "\u200b",
+    "NegativeVeryThinSpace;": "\u200b",
+    "NestedGreaterGreater;": "\u226b",
+    "NestedLessLess;": "\u226a",
+    "NewLine;": "\n",
+    "Nfr;": "\U0001d511",
+    "NoBreak;": "\u2060",
+    "NonBreakingSpace;": "\xa0",
+    "Nopf;": "\u2115",
+    "Not;": "\u2aec",
+    "NotCongruent;": "\u2262",
+    "NotCupCap;": "\u226d",
+    "NotDoubleVerticalBar;": "\u2226",
+    "NotElement;": "\u2209",
+    "NotEqual;": "\u2260",
+    "NotEqualTilde;": "\u2242\u0338",
+    "NotExists;": "\u2204",
+    "NotGreater;": "\u226f",
+    "NotGreaterEqual;": "\u2271",
+    "NotGreaterFullEqual;": "\u2267\u0338",
+    "NotGreaterGreater;": "\u226b\u0338",
+    "NotGreaterLess;": "\u2279",
+    "NotGreaterSlantEqual;": "\u2a7e\u0338",
+    "NotGreaterTilde;": "\u2275",
+    "NotHumpDownHump;": "\u224e\u0338",
+    "NotHumpEqual;": "\u224f\u0338",
+    "NotLeftTriangle;": "\u22ea",
+    "NotLeftTriangleBar;": "\u29cf\u0338",
+    "NotLeftTriangleEqual;": "\u22ec",
+    "NotLess;": "\u226e",
+    "NotLessEqual;": "\u2270",
+    "NotLessGreater;": "\u2278",
+    "NotLessLess;": "\u226a\u0338",
+    "NotLessSlantEqual;": "\u2a7d\u0338",
+    "NotLessTilde;": "\u2274",
+    "NotNestedGreaterGreater;": "\u2aa2\u0338",
+    "NotNestedLessLess;": "\u2aa1\u0338",
+    "NotPrecedes;": "\u2280",
+    "NotPrecedesEqual;": "\u2aaf\u0338",
+    "NotPrecedesSlantEqual;": "\u22e0",
+    "NotReverseElement;": "\u220c",
+    "NotRightTriangle;": "\u22eb",
+    "NotRightTriangleBar;": "\u29d0\u0338",
+    "NotRightTriangleEqual;": "\u22ed",
+    "NotSquareSubset;": "\u228f\u0338",
+    "NotSquareSubsetEqual;": "\u22e2",
+    "NotSquareSuperset;": "\u2290\u0338",
+    "NotSquareSupersetEqual;": "\u22e3",
+    "NotSubset;": "\u2282\u20d2",
+    "NotSubsetEqual;": "\u2288",
+    "NotSucceeds;": "\u2281",
+    "NotSucceedsEqual;": "\u2ab0\u0338",
+    "NotSucceedsSlantEqual;": "\u22e1",
+    "NotSucceedsTilde;": "\u227f\u0338",
+    "NotSuperset;": "\u2283\u20d2",
+    "NotSupersetEqual;": "\u2289",
+    "NotTilde;": "\u2241",
+    "NotTildeEqual;": "\u2244",
+    "NotTildeFullEqual;": "\u2247",
+    "NotTildeTilde;": "\u2249",
+    "NotVerticalBar;": "\u2224",
+    "Nscr;": "\U0001d4a9",
+    "Ntilde": "\xd1",
+    "Ntilde;": "\xd1",
+    "Nu;": "\u039d",
+    "OElig;": "\u0152",
+    "Oacute": "\xd3",
+    "Oacute;": "\xd3",
+    "Ocirc": "\xd4",
+    "Ocirc;": "\xd4",
+    "Ocy;": "\u041e",
+    "Odblac;": "\u0150",
+    "Ofr;": "\U0001d512",
+    "Ograve": "\xd2",
+    "Ograve;": "\xd2",
+    "Omacr;": "\u014c",
+    "Omega;": "\u03a9",
+    "Omicron;": "\u039f",
+    "Oopf;": "\U0001d546",
+    "OpenCurlyDoubleQuote;": "\u201c",
+    "OpenCurlyQuote;": "\u2018",
+    "Or;": "\u2a54",
+    "Oscr;": "\U0001d4aa",
+    "Oslash": "\xd8",
+    "Oslash;": "\xd8",
+    "Otilde": "\xd5",
+    "Otilde;": "\xd5",
+    "Otimes;": "\u2a37",
+    "Ouml": "\xd6",
+    "Ouml;": "\xd6",
+    "OverBar;": "\u203e",
+    "OverBrace;": "\u23de",
+    "OverBracket;": "\u23b4",
+    "OverParenthesis;": "\u23dc",
+    "PartialD;": "\u2202",
+    "Pcy;": "\u041f",
+    "Pfr;": "\U0001d513",
+    "Phi;": "\u03a6",
+    "Pi;": "\u03a0",
+    "PlusMinus;": "\xb1",
+    "Poincareplane;": "\u210c",
+    "Popf;": "\u2119",
+    "Pr;": "\u2abb",
+    "Precedes;": "\u227a",
+    "PrecedesEqual;": "\u2aaf",
+    "PrecedesSlantEqual;": "\u227c",
+    "PrecedesTilde;": "\u227e",
+    "Prime;": "\u2033",
+    "Product;": "\u220f",
+    "Proportion;": "\u2237",
+    "Proportional;": "\u221d",
+    "Pscr;": "\U0001d4ab",
+    "Psi;": "\u03a8",
+    "QUOT": "\"",
+    "QUOT;": "\"",
+    "Qfr;": "\U0001d514",
+    "Qopf;": "\u211a",
+    "Qscr;": "\U0001d4ac",
+    "RBarr;": "\u2910",
+    "REG": "\xae",
+    "REG;": "\xae",
+    "Racute;": "\u0154",
+    "Rang;": "\u27eb",
+    "Rarr;": "\u21a0",
+    "Rarrtl;": "\u2916",
+    "Rcaron;": "\u0158",
+    "Rcedil;": "\u0156",
+    "Rcy;": "\u0420",
+    "Re;": "\u211c",
+    "ReverseElement;": "\u220b",
+    "ReverseEquilibrium;": "\u21cb",
+    "ReverseUpEquilibrium;": "\u296f",
+    "Rfr;": "\u211c",
+    "Rho;": "\u03a1",
+    "RightAngleBracket;": "\u27e9",
+    "RightArrow;": "\u2192",
+    "RightArrowBar;": "\u21e5",
+    "RightArrowLeftArrow;": "\u21c4",
+    "RightCeiling;": "\u2309",
+    "RightDoubleBracket;": "\u27e7",
+    "RightDownTeeVector;": "\u295d",
+    "RightDownVector;": "\u21c2",
+    "RightDownVectorBar;": "\u2955",
+    "RightFloor;": "\u230b",
+    "RightTee;": "\u22a2",
+    "RightTeeArrow;": "\u21a6",
+    "RightTeeVector;": "\u295b",
+    "RightTriangle;": "\u22b3",
+    "RightTriangleBar;": "\u29d0",
+    "RightTriangleEqual;": "\u22b5",
+    "RightUpDownVector;": "\u294f",
+    "RightUpTeeVector;": "\u295c",
+    "RightUpVector;": "\u21be",
+    "RightUpVectorBar;": "\u2954",
+    "RightVector;": "\u21c0",
+    "RightVectorBar;": "\u2953",
+    "Rightarrow;": "\u21d2",
+    "Ropf;": "\u211d",
+    "RoundImplies;": "\u2970",
+    "Rrightarrow;": "\u21db",
+    "Rscr;": "\u211b",
+    "Rsh;": "\u21b1",
+    "RuleDelayed;": "\u29f4",
+    "SHCHcy;": "\u0429",
+    "SHcy;": "\u0428",
+    "SOFTcy;": "\u042c",
+    "Sacute;": "\u015a",
+    "Sc;": "\u2abc",
+    "Scaron;": "\u0160",
+    "Scedil;": "\u015e",
+    "Scirc;": "\u015c",
+    "Scy;": "\u0421",
+    "Sfr;": "\U0001d516",
+    "ShortDownArrow;": "\u2193",
+    "ShortLeftArrow;": "\u2190",
+    "ShortRightArrow;": "\u2192",
+    "ShortUpArrow;": "\u2191",
+    "Sigma;": "\u03a3",
+    "SmallCircle;": "\u2218",
+    "Sopf;": "\U0001d54a",
+    "Sqrt;": "\u221a",
+    "Square;": "\u25a1",
+    "SquareIntersection;": "\u2293",
+    "SquareSubset;": "\u228f",
+    "SquareSubsetEqual;": "\u2291",
+    "SquareSuperset;": "\u2290",
+    "SquareSupersetEqual;": "\u2292",
+    "SquareUnion;": "\u2294",
+    "Sscr;": "\U0001d4ae",
+    "Star;": "\u22c6",
+    "Sub;": "\u22d0",
+    "Subset;": "\u22d0",
+    "SubsetEqual;": "\u2286",
+    "Succeeds;": "\u227b",
+    "SucceedsEqual;": "\u2ab0",
+    "SucceedsSlantEqual;": "\u227d",
+    "SucceedsTilde;": "\u227f",
+    "SuchThat;": "\u220b",
+    "Sum;": "\u2211",
+    "Sup;": "\u22d1",
+    "Superset;": "\u2283",
+    "SupersetEqual;": "\u2287",
+    "Supset;": "\u22d1",
+    "THORN": "\xde",
+    "THORN;": "\xde",
+    "TRADE;": "\u2122",
+    "TSHcy;": "\u040b",
+    "TScy;": "\u0426",
+    "Tab;": "\t",
+    "Tau;": "\u03a4",
+    "Tcaron;": "\u0164",
+    "Tcedil;": "\u0162",
+    "Tcy;": "\u0422",
+    "Tfr;": "\U0001d517",
+    "Therefore;": "\u2234",
+    "Theta;": "\u0398",
+    "ThickSpace;": "\u205f\u200a",
+    "ThinSpace;": "\u2009",
+    "Tilde;": "\u223c",
+    "TildeEqual;": "\u2243",
+    "TildeFullEqual;": "\u2245",
+    "TildeTilde;": "\u2248",
+    "Topf;": "\U0001d54b",
+    "TripleDot;": "\u20db",
+    "Tscr;": "\U0001d4af",
+    "Tstrok;": "\u0166",
+    "Uacute": "\xda",
+    "Uacute;": "\xda",
+    "Uarr;": "\u219f",
+    "Uarrocir;": "\u2949",
+    "Ubrcy;": "\u040e",
+    "Ubreve;": "\u016c",
+    "Ucirc": "\xdb",
+    "Ucirc;": "\xdb",
+    "Ucy;": "\u0423",
+    "Udblac;": "\u0170",
+    "Ufr;": "\U0001d518",
+    "Ugrave": "\xd9",
+    "Ugrave;": "\xd9",
+    "Umacr;": "\u016a",
+    "UnderBar;": "_",
+    "UnderBrace;": "\u23df",
+    "UnderBracket;": "\u23b5",
+    "UnderParenthesis;": "\u23dd",
+    "Union;": "\u22c3",
+    "UnionPlus;": "\u228e",
+    "Uogon;": "\u0172",
+    "Uopf;": "\U0001d54c",
+    "UpArrow;": "\u2191",
+    "UpArrowBar;": "\u2912",
+    "UpArrowDownArrow;": "\u21c5",
+    "UpDownArrow;": "\u2195",
+    "UpEquilibrium;": "\u296e",
+    "UpTee;": "\u22a5",
+    "UpTeeArrow;": "\u21a5",
+    "Uparrow;": "\u21d1",
+    "Updownarrow;": "\u21d5",
+    "UpperLeftArrow;": "\u2196",
+    "UpperRightArrow;": "\u2197",
+    "Upsi;": "\u03d2",
+    "Upsilon;": "\u03a5",
+    "Uring;": "\u016e",
+    "Uscr;": "\U0001d4b0",
+    "Utilde;": "\u0168",
+    "Uuml": "\xdc",
+    "Uuml;": "\xdc",
+    "VDash;": "\u22ab",
+    "Vbar;": "\u2aeb",
+    "Vcy;": "\u0412",
+    "Vdash;": "\u22a9",
+    "Vdashl;": "\u2ae6",
+    "Vee;": "\u22c1",
+    "Verbar;": "\u2016",
+    "Vert;": "\u2016",
+    "VerticalBar;": "\u2223",
+    "VerticalLine;": "|",
+    "VerticalSeparator;": "\u2758",
+    "VerticalTilde;": "\u2240",
+    "VeryThinSpace;": "\u200a",
+    "Vfr;": "\U0001d519",
+    "Vopf;": "\U0001d54d",
+    "Vscr;": "\U0001d4b1",
+    "Vvdash;": "\u22aa",
+    "Wcirc;": "\u0174",
+    "Wedge;": "\u22c0",
+    "Wfr;": "\U0001d51a",
+    "Wopf;": "\U0001d54e",
+    "Wscr;": "\U0001d4b2",
+    "Xfr;": "\U0001d51b",
+    "Xi;": "\u039e",
+    "Xopf;": "\U0001d54f",
+    "Xscr;": "\U0001d4b3",
+    "YAcy;": "\u042f",
+    "YIcy;": "\u0407",
+    "YUcy;": "\u042e",
+    "Yacute": "\xdd",
+    "Yacute;": "\xdd",
+    "Ycirc;": "\u0176",
+    "Ycy;": "\u042b",
+    "Yfr;": "\U0001d51c",
+    "Yopf;": "\U0001d550",
+    "Yscr;": "\U0001d4b4",
+    "Yuml;": "\u0178",
+    "ZHcy;": "\u0416",
+    "Zacute;": "\u0179",
+    "Zcaron;": "\u017d",
+    "Zcy;": "\u0417",
+    "Zdot;": "\u017b",
+    "ZeroWidthSpace;": "\u200b",
+    "Zeta;": "\u0396",
+    "Zfr;": "\u2128",
+    "Zopf;": "\u2124",
+    "Zscr;": "\U0001d4b5",
+    "aacute": "\xe1",
+    "aacute;": "\xe1",
+    "abreve;": "\u0103",
+    "ac;": "\u223e",
+    "acE;": "\u223e\u0333",
+    "acd;": "\u223f",
+    "acirc": "\xe2",
+    "acirc;": "\xe2",
+    "acute": "\xb4",
+    "acute;": "\xb4",
+    "acy;": "\u0430",
+    "aelig": "\xe6",
+    "aelig;": "\xe6",
+    "af;": "\u2061",
+    "afr;": "\U0001d51e",
+    "agrave": "\xe0",
+    "agrave;": "\xe0",
+    "alefsym;": "\u2135",
+    "aleph;": "\u2135",
+    "alpha;": "\u03b1",
+    "amacr;": "\u0101",
+    "amalg;": "\u2a3f",
+    "amp": "&",
+    "amp;": "&",
+    "and;": "\u2227",
+    "andand;": "\u2a55",
+    "andd;": "\u2a5c",
+    "andslope;": "\u2a58",
+    "andv;": "\u2a5a",
+    "ang;": "\u2220",
+    "ange;": "\u29a4",
+    "angle;": "\u2220",
+    "angmsd;": "\u2221",
+    "angmsdaa;": "\u29a8",
+    "angmsdab;": "\u29a9",
+    "angmsdac;": "\u29aa",
+    "angmsdad;": "\u29ab",
+    "angmsdae;": "\u29ac",
+    "angmsdaf;": "\u29ad",
+    "angmsdag;": "\u29ae",
+    "angmsdah;": "\u29af",
+    "angrt;": "\u221f",
+    "angrtvb;": "\u22be",
+    "angrtvbd;": "\u299d",
+    "angsph;": "\u2222",
+    "angst;": "\xc5",
+    "angzarr;": "\u237c",
+    "aogon;": "\u0105",
+    "aopf;": "\U0001d552",
+    "ap;": "\u2248",
+    "apE;": "\u2a70",
+    "apacir;": "\u2a6f",
+    "ape;": "\u224a",
+    "apid;": "\u224b",
+    "apos;": "'",
+    "approx;": "\u2248",
+    "approxeq;": "\u224a",
+    "aring": "\xe5",
+    "aring;": "\xe5",
+    "ascr;": "\U0001d4b6",
+    "ast;": "*",
+    "asymp;": "\u2248",
+    "asympeq;": "\u224d",
+    "atilde": "\xe3",
+    "atilde;": "\xe3",
+    "auml": "\xe4",
+    "auml;": "\xe4",
+    "awconint;": "\u2233",
+    "awint;": "\u2a11",
+    "bNot;": "\u2aed",
+    "backcong;": "\u224c",
+    "backepsilon;": "\u03f6",
+    "backprime;": "\u2035",
+    "backsim;": "\u223d",
+    "backsimeq;": "\u22cd",
+    "barvee;": "\u22bd",
+    "barwed;": "\u2305",
+    "barwedge;": "\u2305",
+    "bbrk;": "\u23b5",
+    "bbrktbrk;": "\u23b6",
+    "bcong;": "\u224c",
+    "bcy;": "\u0431",
+    "bdquo;": "\u201e",
+    "becaus;": "\u2235",
+    "because;": "\u2235",
+    "bemptyv;": "\u29b0",
+    "bepsi;": "\u03f6",
+    "bernou;": "\u212c",
+    "beta;": "\u03b2",
+    "beth;": "\u2136",
+    "between;": "\u226c",
+    "bfr;": "\U0001d51f",
+    "bigcap;": "\u22c2",
+    "bigcirc;": "\u25ef",
+    "bigcup;": "\u22c3",
+    "bigodot;": "\u2a00",
+    "bigoplus;": "\u2a01",
+    "bigotimes;": "\u2a02",
+    "bigsqcup;": "\u2a06",
+    "bigstar;": "\u2605",
+    "bigtriangledown;": "\u25bd",
+    "bigtriangleup;": "\u25b3",
+    "biguplus;": "\u2a04",
+    "bigvee;": "\u22c1",
+    "bigwedge;": "\u22c0",
+    "bkarow;": "\u290d",
+    "blacklozenge;": "\u29eb",
+    "blacksquare;": "\u25aa",
+    "blacktriangle;": "\u25b4",
+    "blacktriangledown;": "\u25be",
+    "blacktriangleleft;": "\u25c2",
+    "blacktriangleright;": "\u25b8",
+    "blank;": "\u2423",
+    "blk12;": "\u2592",
+    "blk14;": "\u2591",
+    "blk34;": "\u2593",
+    "block;": "\u2588",
+    "bne;": "=\u20e5",
+    "bnequiv;": "\u2261\u20e5",
+    "bnot;": "\u2310",
+    "bopf;": "\U0001d553",
+    "bot;": "\u22a5",
+    "bottom;": "\u22a5",
+    "bowtie;": "\u22c8",
+    "boxDL;": "\u2557",
+    "boxDR;": "\u2554",
+    "boxDl;": "\u2556",
+    "boxDr;": "\u2553",
+    "boxH;": "\u2550",
+    "boxHD;": "\u2566",
+    "boxHU;": "\u2569",
+    "boxHd;": "\u2564",
+    "boxHu;": "\u2567",
+    "boxUL;": "\u255d",
+    "boxUR;": "\u255a",
+    "boxUl;": "\u255c",
+    "boxUr;": "\u2559",
+    "boxV;": "\u2551",
+    "boxVH;": "\u256c",
+    "boxVL;": "\u2563",
+    "boxVR;": "\u2560",
+    "boxVh;": "\u256b",
+    "boxVl;": "\u2562",
+    "boxVr;": "\u255f",
+    "boxbox;": "\u29c9",
+    "boxdL;": "\u2555",
+    "boxdR;": "\u2552",
+    "boxdl;": "\u2510",
+    "boxdr;": "\u250c",
+    "boxh;": "\u2500",
+    "boxhD;": "\u2565",
+    "boxhU;": "\u2568",
+    "boxhd;": "\u252c",
+    "boxhu;": "\u2534",
+    "boxminus;": "\u229f",
+    "boxplus;": "\u229e",
+    "boxtimes;": "\u22a0",
+    "boxuL;": "\u255b",
+    "boxuR;": "\u2558",
+    "boxul;": "\u2518",
+    "boxur;": "\u2514",
+    "boxv;": "\u2502",
+    "boxvH;": "\u256a",
+    "boxvL;": "\u2561",
+    "boxvR;": "\u255e",
+    "boxvh;": "\u253c",
+    "boxvl;": "\u2524",
+    "boxvr;": "\u251c",
+    "bprime;": "\u2035",
+    "breve;": "\u02d8",
+    "brvbar": "\xa6",
+    "brvbar;": "\xa6",
+    "bscr;": "\U0001d4b7",
+    "bsemi;": "\u204f",
+    "bsim;": "\u223d",
+    "bsime;": "\u22cd",
+    "bsol;": "\\",
+    "bsolb;": "\u29c5",
+    "bsolhsub;": "\u27c8",
+    "bull;": "\u2022",
+    "bullet;": "\u2022",
+    "bump;": "\u224e",
+    "bumpE;": "\u2aae",
+    "bumpe;": "\u224f",
+    "bumpeq;": "\u224f",
+    "cacute;": "\u0107",
+    "cap;": "\u2229",
+    "capand;": "\u2a44",
+    "capbrcup;": "\u2a49",
+    "capcap;": "\u2a4b",
+    "capcup;": "\u2a47",
+    "capdot;": "\u2a40",
+    "caps;": "\u2229\ufe00",
+    "caret;": "\u2041",
+    "caron;": "\u02c7",
+    "ccaps;": "\u2a4d",
+    "ccaron;": "\u010d",
+    "ccedil": "\xe7",
+    "ccedil;": "\xe7",
+    "ccirc;": "\u0109",
+    "ccups;": "\u2a4c",
+    "ccupssm;": "\u2a50",
+    "cdot;": "\u010b",
+    "cedil": "\xb8",
+    "cedil;": "\xb8",
+    "cemptyv;": "\u29b2",
+    "cent": "\xa2",
+    "cent;": "\xa2",
+    "centerdot;": "\xb7",
+    "cfr;": "\U0001d520",
+    "chcy;": "\u0447",
+    "check;": "\u2713",
+    "checkmark;": "\u2713",
+    "chi;": "\u03c7",
+    "cir;": "\u25cb",
+    "cirE;": "\u29c3",
+    "circ;": "\u02c6",
+    "circeq;": "\u2257",
+    "circlearrowleft;": "\u21ba",
+    "circlearrowright;": "\u21bb",
+    "circledR;": "\xae",
+    "circledS;": "\u24c8",
+    "circledast;": "\u229b",
+    "circledcirc;": "\u229a",
+    "circleddash;": "\u229d",
+    "cire;": "\u2257",
+    "cirfnint;": "\u2a10",
+    "cirmid;": "\u2aef",
+    "cirscir;": "\u29c2",
+    "clubs;": "\u2663",
+    "clubsuit;": "\u2663",
+    "colon;": ":",
+    "colone;": "\u2254",
+    "coloneq;": "\u2254",
+    "comma;": ",",
+    "commat;": "@",
+    "comp;": "\u2201",
+    "compfn;": "\u2218",
+    "complement;": "\u2201",
+    "complexes;": "\u2102",
+    "cong;": "\u2245",
+    "congdot;": "\u2a6d",
+    "conint;": "\u222e",
+    "copf;": "\U0001d554",
+    "coprod;": "\u2210",
+    "copy": "\xa9",
+    "copy;": "\xa9",
+    "copysr;": "\u2117",
+    "crarr;": "\u21b5",
+    "cross;": "\u2717",
+    "cscr;": "\U0001d4b8",
+    "csub;": "\u2acf",
+    "csube;": "\u2ad1",
+    "csup;": "\u2ad0",
+    "csupe;": "\u2ad2",
+    "ctdot;": "\u22ef",
+    "cudarrl;": "\u2938",
+    "cudarrr;": "\u2935",
+    "cuepr;": "\u22de",
+    "cuesc;": "\u22df",
+    "cularr;": "\u21b6",
+    "cularrp;": "\u293d",
+    "cup;": "\u222a",
+    "cupbrcap;": "\u2a48",
+    "cupcap;": "\u2a46",
+    "cupcup;": "\u2a4a",
+    "cupdot;": "\u228d",
+    "cupor;": "\u2a45",
+    "cups;": "\u222a\ufe00",
+    "curarr;": "\u21b7",
+    "curarrm;": "\u293c",
+    "curlyeqprec;": "\u22de",
+    "curlyeqsucc;": "\u22df",
+    "curlyvee;": "\u22ce",
+    "curlywedge;": "\u22cf",
+    "curren": "\xa4",
+    "curren;": "\xa4",
+    "curvearrowleft;": "\u21b6",
+    "curvearrowright;": "\u21b7",
+    "cuvee;": "\u22ce",
+    "cuwed;": "\u22cf",
+    "cwconint;": "\u2232",
+    "cwint;": "\u2231",
+    "cylcty;": "\u232d",
+    "dArr;": "\u21d3",
+    "dHar;": "\u2965",
+    "dagger;": "\u2020",
+    "daleth;": "\u2138",
+    "darr;": "\u2193",
+    "dash;": "\u2010",
+    "dashv;": "\u22a3",
+    "dbkarow;": "\u290f",
+    "dblac;": "\u02dd",
+    "dcaron;": "\u010f",
+    "dcy;": "\u0434",
+    "dd;": "\u2146",
+    "ddagger;": "\u2021",
+    "ddarr;": "\u21ca",
+    "ddotseq;": "\u2a77",
+    "deg": "\xb0",
+    "deg;": "\xb0",
+    "delta;": "\u03b4",
+    "demptyv;": "\u29b1",
+    "dfisht;": "\u297f",
+    "dfr;": "\U0001d521",
+    "dharl;": "\u21c3",
+    "dharr;": "\u21c2",
+    "diam;": "\u22c4",
+    "diamond;": "\u22c4",
+    "diamondsuit;": "\u2666",
+    "diams;": "\u2666",
+    "die;": "\xa8",
+    "digamma;": "\u03dd",
+    "disin;": "\u22f2",
+    "div;": "\xf7",
+    "divide": "\xf7",
+    "divide;": "\xf7",
+    "divideontimes;": "\u22c7",
+    "divonx;": "\u22c7",
+    "djcy;": "\u0452",
+    "dlcorn;": "\u231e",
+    "dlcrop;": "\u230d",
+    "dollar;": "$",
+    "dopf;": "\U0001d555",
+    "dot;": "\u02d9",
+    "doteq;": "\u2250",
+    "doteqdot;": "\u2251",
+    "dotminus;": "\u2238",
+    "dotplus;": "\u2214",
+    "dotsquare;": "\u22a1",
+    "doublebarwedge;": "\u2306",
+    "downarrow;": "\u2193",
+    "downdownarrows;": "\u21ca",
+    "downharpoonleft;": "\u21c3",
+    "downharpoonright;": "\u21c2",
+    "drbkarow;": "\u2910",
+    "drcorn;": "\u231f",
+    "drcrop;": "\u230c",
+    "dscr;": "\U0001d4b9",
+    "dscy;": "\u0455",
+    "dsol;": "\u29f6",
+    "dstrok;": "\u0111",
+    "dtdot;": "\u22f1",
+    "dtri;": "\u25bf",
+    "dtrif;": "\u25be",
+    "duarr;": "\u21f5",
+    "duhar;": "\u296f",
+    "dwangle;": "\u29a6",
+    "dzcy;": "\u045f",
+    "dzigrarr;": "\u27ff",
+    "eDDot;": "\u2a77",
+    "eDot;": "\u2251",
+    "eacute": "\xe9",
+    "eacute;": "\xe9",
+    "easter;": "\u2a6e",
+    "ecaron;": "\u011b",
+    "ecir;": "\u2256",
+    "ecirc": "\xea",
+    "ecirc;": "\xea",
+    "ecolon;": "\u2255",
+    "ecy;": "\u044d",
+    "edot;": "\u0117",
+    "ee;": "\u2147",
+    "efDot;": "\u2252",
+    "efr;": "\U0001d522",
+    "eg;": "\u2a9a",
+    "egrave": "\xe8",
+    "egrave;": "\xe8",
+    "egs;": "\u2a96",
+    "egsdot;": "\u2a98",
+    "el;": "\u2a99",
+    "elinters;": "\u23e7",
+    "ell;": "\u2113",
+    "els;": "\u2a95",
+    "elsdot;": "\u2a97",
+    "emacr;": "\u0113",
+    "empty;": "\u2205",
+    "emptyset;": "\u2205",
+    "emptyv;": "\u2205",
+    "emsp13;": "\u2004",
+    "emsp14;": "\u2005",
+    "emsp;": "\u2003",
+    "eng;": "\u014b",
+    "ensp;": "\u2002",
+    "eogon;": "\u0119",
+    "eopf;": "\U0001d556",
+    "epar;": "\u22d5",
+    "eparsl;": "\u29e3",
+    "eplus;": "\u2a71",
+    "epsi;": "\u03b5",
+    "epsilon;": "\u03b5",
+    "epsiv;": "\u03f5",
+    "eqcirc;": "\u2256",
+    "eqcolon;": "\u2255",
+    "eqsim;": "\u2242",
+    "eqslantgtr;": "\u2a96",
+    "eqslantless;": "\u2a95",
+    "equals;": "=",
+    "equest;": "\u225f",
+    "equiv;": "\u2261",
+    "equivDD;": "\u2a78",
+    "eqvparsl;": "\u29e5",
+    "erDot;": "\u2253",
+    "erarr;": "\u2971",
+    "escr;": "\u212f",
+    "esdot;": "\u2250",
+    "esim;": "\u2242",
+    "eta;": "\u03b7",
+    "eth": "\xf0",
+    "eth;": "\xf0",
+    "euml": "\xeb",
+    "euml;": "\xeb",
+    "euro;": "\u20ac",
+    "excl;": "!",
+    "exist;": "\u2203",
+    "expectation;": "\u2130",
+    "exponentiale;": "\u2147",
+    "fallingdotseq;": "\u2252",
+    "fcy;": "\u0444",
+    "female;": "\u2640",
+    "ffilig;": "\ufb03",
+    "fflig;": "\ufb00",
+    "ffllig;": "\ufb04",
+    "ffr;": "\U0001d523",
+    "filig;": "\ufb01",
+    "fjlig;": "fj",
+    "flat;": "\u266d",
+    "fllig;": "\ufb02",
+    "fltns;": "\u25b1",
+    "fnof;": "\u0192",
+    "fopf;": "\U0001d557",
+    "forall;": "\u2200",
+    "fork;": "\u22d4",
+    "forkv;": "\u2ad9",
+    "fpartint;": "\u2a0d",
+    "frac12": "\xbd",
+    "frac12;": "\xbd",
+    "frac13;": "\u2153",
+    "frac14": "\xbc",
+    "frac14;": "\xbc",
+    "frac15;": "\u2155",
+    "frac16;": "\u2159",
+    "frac18;": "\u215b",
+    "frac23;": "\u2154",
+    "frac25;": "\u2156",
+    "frac34": "\xbe",
+    "frac34;": "\xbe",
+    "frac35;": "\u2157",
+    "frac38;": "\u215c",
+    "frac45;": "\u2158",
+    "frac56;": "\u215a",
+    "frac58;": "\u215d",
+    "frac78;": "\u215e",
+    "frasl;": "\u2044",
+    "frown;": "\u2322",
+    "fscr;": "\U0001d4bb",
+    "gE;": "\u2267",
+    "gEl;": "\u2a8c",
+    "gacute;": "\u01f5",
+    "gamma;": "\u03b3",
+    "gammad;": "\u03dd",
+    "gap;": "\u2a86",
+    "gbreve;": "\u011f",
+    "gcirc;": "\u011d",
+    "gcy;": "\u0433",
+    "gdot;": "\u0121",
+    "ge;": "\u2265",
+    "gel;": "\u22db",
+    "geq;": "\u2265",
+    "geqq;": "\u2267",
+    "geqslant;": "\u2a7e",
+    "ges;": "\u2a7e",
+    "gescc;": "\u2aa9",
+    "gesdot;": "\u2a80",
+    "gesdoto;": "\u2a82",
+    "gesdotol;": "\u2a84",
+    "gesl;": "\u22db\ufe00",
+    "gesles;": "\u2a94",
+    "gfr;": "\U0001d524",
+    "gg;": "\u226b",
+    "ggg;": "\u22d9",
+    "gimel;": "\u2137",
+    "gjcy;": "\u0453",
+    "gl;": "\u2277",
+    "glE;": "\u2a92",
+    "gla;": "\u2aa5",
+    "glj;": "\u2aa4",
+    "gnE;": "\u2269",
+    "gnap;": "\u2a8a",
+    "gnapprox;": "\u2a8a",
+    "gne;": "\u2a88",
+    "gneq;": "\u2a88",
+    "gneqq;": "\u2269",
+    "gnsim;": "\u22e7",
+    "gopf;": "\U0001d558",
+    "grave;": "`",
+    "gscr;": "\u210a",
+    "gsim;": "\u2273",
+    "gsime;": "\u2a8e",
+    "gsiml;": "\u2a90",
+    "gt": ">",
+    "gt;": ">",
+    "gtcc;": "\u2aa7",
+    "gtcir;": "\u2a7a",
+    "gtdot;": "\u22d7",
+    "gtlPar;": "\u2995",
+    "gtquest;": "\u2a7c",
+    "gtrapprox;": "\u2a86",
+    "gtrarr;": "\u2978",
+    "gtrdot;": "\u22d7",
+    "gtreqless;": "\u22db",
+    "gtreqqless;": "\u2a8c",
+    "gtrless;": "\u2277",
+    "gtrsim;": "\u2273",
+    "gvertneqq;": "\u2269\ufe00",
+    "gvnE;": "\u2269\ufe00",
+    "hArr;": "\u21d4",
+    "hairsp;": "\u200a",
+    "half;": "\xbd",
+    "hamilt;": "\u210b",
+    "hardcy;": "\u044a",
+    "harr;": "\u2194",
+    "harrcir;": "\u2948",
+    "harrw;": "\u21ad",
+    "hbar;": "\u210f",
+    "hcirc;": "\u0125",
+    "hearts;": "\u2665",
+    "heartsuit;": "\u2665",
+    "hellip;": "\u2026",
+    "hercon;": "\u22b9",
+    "hfr;": "\U0001d525",
+    "hksearow;": "\u2925",
+    "hkswarow;": "\u2926",
+    "hoarr;": "\u21ff",
+    "homtht;": "\u223b",
+    "hookleftarrow;": "\u21a9",
+    "hookrightarrow;": "\u21aa",
+    "hopf;": "\U0001d559",
+    "horbar;": "\u2015",
+    "hscr;": "\U0001d4bd",
+    "hslash;": "\u210f",
+    "hstrok;": "\u0127",
+    "hybull;": "\u2043",
+    "hyphen;": "\u2010",
+    "iacute": "\xed",
+    "iacute;": "\xed",
+    "ic;": "\u2063",
+    "icirc": "\xee",
+    "icirc;": "\xee",
+    "icy;": "\u0438",
+    "iecy;": "\u0435",
+    "iexcl": "\xa1",
+    "iexcl;": "\xa1",
+    "iff;": "\u21d4",
+    "ifr;": "\U0001d526",
+    "igrave": "\xec",
+    "igrave;": "\xec",
+    "ii;": "\u2148",
+    "iiiint;": "\u2a0c",
+    "iiint;": "\u222d",
+    "iinfin;": "\u29dc",
+    "iiota;": "\u2129",
+    "ijlig;": "\u0133",
+    "imacr;": "\u012b",
+    "image;": "\u2111",
+    "imagline;": "\u2110",
+    "imagpart;": "\u2111",
+    "imath;": "\u0131",
+    "imof;": "\u22b7",
+    "imped;": "\u01b5",
+    "in;": "\u2208",
+    "incare;": "\u2105",
+    "infin;": "\u221e",
+    "infintie;": "\u29dd",
+    "inodot;": "\u0131",
+    "int;": "\u222b",
+    "intcal;": "\u22ba",
+    "integers;": "\u2124",
+    "intercal;": "\u22ba",
+    "intlarhk;": "\u2a17",
+    "intprod;": "\u2a3c",
+    "iocy;": "\u0451",
+    "iogon;": "\u012f",
+    "iopf;": "\U0001d55a",
+    "iota;": "\u03b9",
+    "iprod;": "\u2a3c",
+    "iquest": "\xbf",
+    "iquest;": "\xbf",
+    "iscr;": "\U0001d4be",
+    "isin;": "\u2208",
+    "isinE;": "\u22f9",
+    "isindot;": "\u22f5",
+    "isins;": "\u22f4",
+    "isinsv;": "\u22f3",
+    "isinv;": "\u2208",
+    "it;": "\u2062",
+    "itilde;": "\u0129",
+    "iukcy;": "\u0456",
+    "iuml": "\xef",
+    "iuml;": "\xef",
+    "jcirc;": "\u0135",
+    "jcy;": "\u0439",
+    "jfr;": "\U0001d527",
+    "jmath;": "\u0237",
+    "jopf;": "\U0001d55b",
+    "jscr;": "\U0001d4bf",
+    "jsercy;": "\u0458",
+    "jukcy;": "\u0454",
+    "kappa;": "\u03ba",
+    "kappav;": "\u03f0",
+    "kcedil;": "\u0137",
+    "kcy;": "\u043a",
+    "kfr;": "\U0001d528",
+    "kgreen;": "\u0138",
+    "khcy;": "\u0445",
+    "kjcy;": "\u045c",
+    "kopf;": "\U0001d55c",
+    "kscr;": "\U0001d4c0",
+    "lAarr;": "\u21da",
+    "lArr;": "\u21d0",
+    "lAtail;": "\u291b",
+    "lBarr;": "\u290e",
+    "lE;": "\u2266",
+    "lEg;": "\u2a8b",
+    "lHar;": "\u2962",
+    "lacute;": "\u013a",
+    "laemptyv;": "\u29b4",
+    "lagran;": "\u2112",
+    "lambda;": "\u03bb",
+    "lang;": "\u27e8",
+    "langd;": "\u2991",
+    "langle;": "\u27e8",
+    "lap;": "\u2a85",
+    "laquo": "\xab",
+    "laquo;": "\xab",
+    "larr;": "\u2190",
+    "larrb;": "\u21e4",
+    "larrbfs;": "\u291f",
+    "larrfs;": "\u291d",
+    "larrhk;": "\u21a9",
+    "larrlp;": "\u21ab",
+    "larrpl;": "\u2939",
+    "larrsim;": "\u2973",
+    "larrtl;": "\u21a2",
+    "lat;": "\u2aab",
+    "latail;": "\u2919",
+    "late;": "\u2aad",
+    "lates;": "\u2aad\ufe00",
+    "lbarr;": "\u290c",
+    "lbbrk;": "\u2772",
+    "lbrace;": "{",
+    "lbrack;": "[",
+    "lbrke;": "\u298b",
+    "lbrksld;": "\u298f",
+    "lbrkslu;": "\u298d",
+    "lcaron;": "\u013e",
+    "lcedil;": "\u013c",
+    "lceil;": "\u2308",
+    "lcub;": "{",
+    "lcy;": "\u043b",
+    "ldca;": "\u2936",
+    "ldquo;": "\u201c",
+    "ldquor;": "\u201e",
+    "ldrdhar;": "\u2967",
+    "ldrushar;": "\u294b",
+    "ldsh;": "\u21b2",
+    "le;": "\u2264",
+    "leftarrow;": "\u2190",
+    "leftarrowtail;": "\u21a2",
+    "leftharpoondown;": "\u21bd",
+    "leftharpoonup;": "\u21bc",
+    "leftleftarrows;": "\u21c7",
+    "leftrightarrow;": "\u2194",
+    "leftrightarrows;": "\u21c6",
+    "leftrightharpoons;": "\u21cb",
+    "leftrightsquigarrow;": "\u21ad",
+    "leftthreetimes;": "\u22cb",
+    "leg;": "\u22da",
+    "leq;": "\u2264",
+    "leqq;": "\u2266",
+    "leqslant;": "\u2a7d",
+    "les;": "\u2a7d",
+    "lescc;": "\u2aa8",
+    "lesdot;": "\u2a7f",
+    "lesdoto;": "\u2a81",
+    "lesdotor;": "\u2a83",
+    "lesg;": "\u22da\ufe00",
+    "lesges;": "\u2a93",
+    "lessapprox;": "\u2a85",
+    "lessdot;": "\u22d6",
+    "lesseqgtr;": "\u22da",
+    "lesseqqgtr;": "\u2a8b",
+    "lessgtr;": "\u2276",
+    "lesssim;": "\u2272",
+    "lfisht;": "\u297c",
+    "lfloor;": "\u230a",
+    "lfr;": "\U0001d529",
+    "lg;": "\u2276",
+    "lgE;": "\u2a91",
+    "lhard;": "\u21bd",
+    "lharu;": "\u21bc",
+    "lharul;": "\u296a",
+    "lhblk;": "\u2584",
+    "ljcy;": "\u0459",
+    "ll;": "\u226a",
+    "llarr;": "\u21c7",
+    "llcorner;": "\u231e",
+    "llhard;": "\u296b",
+    "lltri;": "\u25fa",
+    "lmidot;": "\u0140",
+    "lmoust;": "\u23b0",
+    "lmoustache;": "\u23b0",
+    "lnE;": "\u2268",
+    "lnap;": "\u2a89",
+    "lnapprox;": "\u2a89",
+    "lne;": "\u2a87",
+    "lneq;": "\u2a87",
+    "lneqq;": "\u2268",
+    "lnsim;": "\u22e6",
+    "loang;": "\u27ec",
+    "loarr;": "\u21fd",
+    "lobrk;": "\u27e6",
+    "longleftarrow;": "\u27f5",
+    "longleftrightarrow;": "\u27f7",
+    "longmapsto;": "\u27fc",
+    "longrightarrow;": "\u27f6",
+    "looparrowleft;": "\u21ab",
+    "looparrowright;": "\u21ac",
+    "lopar;": "\u2985",
+    "lopf;": "\U0001d55d",
+    "loplus;": "\u2a2d",
+    "lotimes;": "\u2a34",
+    "lowast;": "\u2217",
+    "lowbar;": "_",
+    "loz;": "\u25ca",
+    "lozenge;": "\u25ca",
+    "lozf;": "\u29eb",
+    "lpar;": "(",
+    "lparlt;": "\u2993",
+    "lrarr;": "\u21c6",
+    "lrcorner;": "\u231f",
+    "lrhar;": "\u21cb",
+    "lrhard;": "\u296d",
+    "lrm;": "\u200e",
+    "lrtri;": "\u22bf",
+    "lsaquo;": "\u2039",
+    "lscr;": "\U0001d4c1",
+    "lsh;": "\u21b0",
+    "lsim;": "\u2272",
+    "lsime;": "\u2a8d",
+    "lsimg;": "\u2a8f",
+    "lsqb;": "[",
+    "lsquo;": "\u2018",
+    "lsquor;": "\u201a",
+    "lstrok;": "\u0142",
+    "lt": "<",
+    "lt;": "<",
+    "ltcc;": "\u2aa6",
+    "ltcir;": "\u2a79",
+    "ltdot;": "\u22d6",
+    "lthree;": "\u22cb",
+    "ltimes;": "\u22c9",
+    "ltlarr;": "\u2976",
+    "ltquest;": "\u2a7b",
+    "ltrPar;": "\u2996",
+    "ltri;": "\u25c3",
+    "ltrie;": "\u22b4",
+    "ltrif;": "\u25c2",
+    "lurdshar;": "\u294a",
+    "luruhar;": "\u2966",
+    "lvertneqq;": "\u2268\ufe00",
+    "lvnE;": "\u2268\ufe00",
+    "mDDot;": "\u223a",
+    "macr": "\xaf",
+    "macr;": "\xaf",
+    "male;": "\u2642",
+    "malt;": "\u2720",
+    "maltese;": "\u2720",
+    "map;": "\u21a6",
+    "mapsto;": "\u21a6",
+    "mapstodown;": "\u21a7",
+    "mapstoleft;": "\u21a4",
+    "mapstoup;": "\u21a5",
+    "marker;": "\u25ae",
+    "mcomma;": "\u2a29",
+    "mcy;": "\u043c",
+    "mdash;": "\u2014",
+    "measuredangle;": "\u2221",
+    "mfr;": "\U0001d52a",
+    "mho;": "\u2127",
+    "micro": "\xb5",
+    "micro;": "\xb5",
+    "mid;": "\u2223",
+    "midast;": "*",
+    "midcir;": "\u2af0",
+    "middot": "\xb7",
+    "middot;": "\xb7",
+    "minus;": "\u2212",
+    "minusb;": "\u229f",
+    "minusd;": "\u2238",
+    "minusdu;": "\u2a2a",
+    "mlcp;": "\u2adb",
+    "mldr;": "\u2026",
+    "mnplus;": "\u2213",
+    "models;": "\u22a7",
+    "mopf;": "\U0001d55e",
+    "mp;": "\u2213",
+    "mscr;": "\U0001d4c2",
+    "mstpos;": "\u223e",
+    "mu;": "\u03bc",
+    "multimap;": "\u22b8",
+    "mumap;": "\u22b8",
+    "nGg;": "\u22d9\u0338",
+    "nGt;": "\u226b\u20d2",
+    "nGtv;": "\u226b\u0338",
+    "nLeftarrow;": "\u21cd",
+    "nLeftrightarrow;": "\u21ce",
+    "nLl;": "\u22d8\u0338",
+    "nLt;": "\u226a\u20d2",
+    "nLtv;": "\u226a\u0338",
+    "nRightarrow;": "\u21cf",
+    "nVDash;": "\u22af",
+    "nVdash;": "\u22ae",
+    "nabla;": "\u2207",
+    "nacute;": "\u0144",
+    "nang;": "\u2220\u20d2",
+    "nap;": "\u2249",
+    "napE;": "\u2a70\u0338",
+    "napid;": "\u224b\u0338",
+    "napos;": "\u0149",
+    "napprox;": "\u2249",
+    "natur;": "\u266e",
+    "natural;": "\u266e",
+    "naturals;": "\u2115",
+    "nbsp": "\xa0",
+    "nbsp;": "\xa0",
+    "nbump;": "\u224e\u0338",
+    "nbumpe;": "\u224f\u0338",
+    "ncap;": "\u2a43",
+    "ncaron;": "\u0148",
+    "ncedil;": "\u0146",
+    "ncong;": "\u2247",
+    "ncongdot;": "\u2a6d\u0338",
+    "ncup;": "\u2a42",
+    "ncy;": "\u043d",
+    "ndash;": "\u2013",
+    "ne;": "\u2260",
+    "neArr;": "\u21d7",
+    "nearhk;": "\u2924",
+    "nearr;": "\u2197",
+    "nearrow;": "\u2197",
+    "nedot;": "\u2250\u0338",
+    "nequiv;": "\u2262",
+    "nesear;": "\u2928",
+    "nesim;": "\u2242\u0338",
+    "nexist;": "\u2204",
+    "nexists;": "\u2204",
+    "nfr;": "\U0001d52b",
+    "ngE;": "\u2267\u0338",
+    "nge;": "\u2271",
+    "ngeq;": "\u2271",
+    "ngeqq;": "\u2267\u0338",
+    "ngeqslant;": "\u2a7e\u0338",
+    "nges;": "\u2a7e\u0338",
+    "ngsim;": "\u2275",
+    "ngt;": "\u226f",
+    "ngtr;": "\u226f",
+    "nhArr;": "\u21ce",
+    "nharr;": "\u21ae",
+    "nhpar;": "\u2af2",
+    "ni;": "\u220b",
+    "nis;": "\u22fc",
+    "nisd;": "\u22fa",
+    "niv;": "\u220b",
+    "njcy;": "\u045a",
+    "nlArr;": "\u21cd",
+    "nlE;": "\u2266\u0338",
+    "nlarr;": "\u219a",
+    "nldr;": "\u2025",
+    "nle;": "\u2270",
+    "nleftarrow;": "\u219a",
+    "nleftrightarrow;": "\u21ae",
+    "nleq;": "\u2270",
+    "nleqq;": "\u2266\u0338",
+    "nleqslant;": "\u2a7d\u0338",
+    "nles;": "\u2a7d\u0338",
+    "nless;": "\u226e",
+    "nlsim;": "\u2274",
+    "nlt;": "\u226e",
+    "nltri;": "\u22ea",
+    "nltrie;": "\u22ec",
+    "nmid;": "\u2224",
+    "nopf;": "\U0001d55f",
+    "not": "\xac",
+    "not;": "\xac",
+    "notin;": "\u2209",
+    "notinE;": "\u22f9\u0338",
+    "notindot;": "\u22f5\u0338",
+    "notinva;": "\u2209",
+    "notinvb;": "\u22f7",
+    "notinvc;": "\u22f6",
+    "notni;": "\u220c",
+    "notniva;": "\u220c",
+    "notnivb;": "\u22fe",
+    "notnivc;": "\u22fd",
+    "npar;": "\u2226",
+    "nparallel;": "\u2226",
+    "nparsl;": "\u2afd\u20e5",
+    "npart;": "\u2202\u0338",
+    "npolint;": "\u2a14",
+    "npr;": "\u2280",
+    "nprcue;": "\u22e0",
+    "npre;": "\u2aaf\u0338",
+    "nprec;": "\u2280",
+    "npreceq;": "\u2aaf\u0338",
+    "nrArr;": "\u21cf",
+    "nrarr;": "\u219b",
+    "nrarrc;": "\u2933\u0338",
+    "nrarrw;": "\u219d\u0338",
+    "nrightarrow;": "\u219b",
+    "nrtri;": "\u22eb",
+    "nrtrie;": "\u22ed",
+    "nsc;": "\u2281",
+    "nsccue;": "\u22e1",
+    "nsce;": "\u2ab0\u0338",
+    "nscr;": "\U0001d4c3",
+    "nshortmid;": "\u2224",
+    "nshortparallel;": "\u2226",
+    "nsim;": "\u2241",
+    "nsime;": "\u2244",
+    "nsimeq;": "\u2244",
+    "nsmid;": "\u2224",
+    "nspar;": "\u2226",
+    "nsqsube;": "\u22e2",
+    "nsqsupe;": "\u22e3",
+    "nsub;": "\u2284",
+    "nsubE;": "\u2ac5\u0338",
+    "nsube;": "\u2288",
+    "nsubset;": "\u2282\u20d2",
+    "nsubseteq;": "\u2288",
+    "nsubseteqq;": "\u2ac5\u0338",
+    "nsucc;": "\u2281",
+    "nsucceq;": "\u2ab0\u0338",
+    "nsup;": "\u2285",
+    "nsupE;": "\u2ac6\u0338",
+    "nsupe;": "\u2289",
+    "nsupset;": "\u2283\u20d2",
+    "nsupseteq;": "\u2289",
+    "nsupseteqq;": "\u2ac6\u0338",
+    "ntgl;": "\u2279",
+    "ntilde": "\xf1",
+    "ntilde;": "\xf1",
+    "ntlg;": "\u2278",
+    "ntriangleleft;": "\u22ea",
+    "ntrianglelefteq;": "\u22ec",
+    "ntriangleright;": "\u22eb",
+    "ntrianglerighteq;": "\u22ed",
+    "nu;": "\u03bd",
+    "num;": "#",
+    "numero;": "\u2116",
+    "numsp;": "\u2007",
+    "nvDash;": "\u22ad",
+    "nvHarr;": "\u2904",
+    "nvap;": "\u224d\u20d2",
+    "nvdash;": "\u22ac",
+    "nvge;": "\u2265\u20d2",
+    "nvgt;": ">\u20d2",
+    "nvinfin;": "\u29de",
+    "nvlArr;": "\u2902",
+    "nvle;": "\u2264\u20d2",
+    "nvlt;": "<\u20d2",
+    "nvltrie;": "\u22b4\u20d2",
+    "nvrArr;": "\u2903",
+    "nvrtrie;": "\u22b5\u20d2",
+    "nvsim;": "\u223c\u20d2",
+    "nwArr;": "\u21d6",
+    "nwarhk;": "\u2923",
+    "nwarr;": "\u2196",
+    "nwarrow;": "\u2196",
+    "nwnear;": "\u2927",
+    "oS;": "\u24c8",
+    "oacute": "\xf3",
+    "oacute;": "\xf3",
+    "oast;": "\u229b",
+    "ocir;": "\u229a",
+    "ocirc": "\xf4",
+    "ocirc;": "\xf4",
+    "ocy;": "\u043e",
+    "odash;": "\u229d",
+    "odblac;": "\u0151",
+    "odiv;": "\u2a38",
+    "odot;": "\u2299",
+    "odsold;": "\u29bc",
+    "oelig;": "\u0153",
+    "ofcir;": "\u29bf",
+    "ofr;": "\U0001d52c",
+    "ogon;": "\u02db",
+    "ograve": "\xf2",
+    "ograve;": "\xf2",
+    "ogt;": "\u29c1",
+    "ohbar;": "\u29b5",
+    "ohm;": "\u03a9",
+    "oint;": "\u222e",
+    "olarr;": "\u21ba",
+    "olcir;": "\u29be",
+    "olcross;": "\u29bb",
+    "oline;": "\u203e",
+    "olt;": "\u29c0",
+    "omacr;": "\u014d",
+    "omega;": "\u03c9",
+    "omicron;": "\u03bf",
+    "omid;": "\u29b6",
+    "ominus;": "\u2296",
+    "oopf;": "\U0001d560",
+    "opar;": "\u29b7",
+    "operp;": "\u29b9",
+    "oplus;": "\u2295",
+    "or;": "\u2228",
+    "orarr;": "\u21bb",
+    "ord;": "\u2a5d",
+    "order;": "\u2134",
+    "orderof;": "\u2134",
+    "ordf": "\xaa",
+    "ordf;": "\xaa",
+    "ordm": "\xba",
+    "ordm;": "\xba",
+    "origof;": "\u22b6",
+    "oror;": "\u2a56",
+    "orslope;": "\u2a57",
+    "orv;": "\u2a5b",
+    "oscr;": "\u2134",
+    "oslash": "\xf8",
+    "oslash;": "\xf8",
+    "osol;": "\u2298",
+    "otilde": "\xf5",
+    "otilde;": "\xf5",
+    "otimes;": "\u2297",
+    "otimesas;": "\u2a36",
+    "ouml": "\xf6",
+    "ouml;": "\xf6",
+    "ovbar;": "\u233d",
+    "par;": "\u2225",
+    "para": "\xb6",
+    "para;": "\xb6",
+    "parallel;": "\u2225",
+    "parsim;": "\u2af3",
+    "parsl;": "\u2afd",
+    "part;": "\u2202",
+    "pcy;": "\u043f",
+    "percnt;": "%",
+    "period;": ".",
+    "permil;": "\u2030",
+    "perp;": "\u22a5",
+    "pertenk;": "\u2031",
+    "pfr;": "\U0001d52d",
+    "phi;": "\u03c6",
+    "phiv;": "\u03d5",
+    "phmmat;": "\u2133",
+    "phone;": "\u260e",
+    "pi;": "\u03c0",
+    "pitchfork;": "\u22d4",
+    "piv;": "\u03d6",
+    "planck;": "\u210f",
+    "planckh;": "\u210e",
+    "plankv;": "\u210f",
+    "plus;": "+",
+    "plusacir;": "\u2a23",
+    "plusb;": "\u229e",
+    "pluscir;": "\u2a22",
+    "plusdo;": "\u2214",
+    "plusdu;": "\u2a25",
+    "pluse;": "\u2a72",
+    "plusmn": "\xb1",
+    "plusmn;": "\xb1",
+    "plussim;": "\u2a26",
+    "plustwo;": "\u2a27",
+    "pm;": "\xb1",
+    "pointint;": "\u2a15",
+    "popf;": "\U0001d561",
+    "pound": "\xa3",
+    "pound;": "\xa3",
+    "pr;": "\u227a",
+    "prE;": "\u2ab3",
+    "prap;": "\u2ab7",
+    "prcue;": "\u227c",
+    "pre;": "\u2aaf",
+    "prec;": "\u227a",
+    "precapprox;": "\u2ab7",
+    "preccurlyeq;": "\u227c",
+    "preceq;": "\u2aaf",
+    "precnapprox;": "\u2ab9",
+    "precneqq;": "\u2ab5",
+    "precnsim;": "\u22e8",
+    "precsim;": "\u227e",
+    "prime;": "\u2032",
+    "primes;": "\u2119",
+    "prnE;": "\u2ab5",
+    "prnap;": "\u2ab9",
+    "prnsim;": "\u22e8",
+    "prod;": "\u220f",
+    "profalar;": "\u232e",
+    "profline;": "\u2312",
+    "profsurf;": "\u2313",
+    "prop;": "\u221d",
+    "propto;": "\u221d",
+    "prsim;": "\u227e",
+    "prurel;": "\u22b0",
+    "pscr;": "\U0001d4c5",
+    "psi;": "\u03c8",
+    "puncsp;": "\u2008",
+    "qfr;": "\U0001d52e",
+    "qint;": "\u2a0c",
+    "qopf;": "\U0001d562",
+    "qprime;": "\u2057",
+    "qscr;": "\U0001d4c6",
+    "quaternions;": "\u210d",
+    "quatint;": "\u2a16",
+    "quest;": "?",
+    "questeq;": "\u225f",
+    "quot": "\"",
+    "quot;": "\"",
+    "rAarr;": "\u21db",
+    "rArr;": "\u21d2",
+    "rAtail;": "\u291c",
+    "rBarr;": "\u290f",
+    "rHar;": "\u2964",
+    "race;": "\u223d\u0331",
+    "racute;": "\u0155",
+    "radic;": "\u221a",
+    "raemptyv;": "\u29b3",
+    "rang;": "\u27e9",
+    "rangd;": "\u2992",
+    "range;": "\u29a5",
+    "rangle;": "\u27e9",
+    "raquo": "\xbb",
+    "raquo;": "\xbb",
+    "rarr;": "\u2192",
+    "rarrap;": "\u2975",
+    "rarrb;": "\u21e5",
+    "rarrbfs;": "\u2920",
+    "rarrc;": "\u2933",
+    "rarrfs;": "\u291e",
+    "rarrhk;": "\u21aa",
+    "rarrlp;": "\u21ac",
+    "rarrpl;": "\u2945",
+    "rarrsim;": "\u2974",
+    "rarrtl;": "\u21a3",
+    "rarrw;": "\u219d",
+    "ratail;": "\u291a",
+    "ratio;": "\u2236",
+    "rationals;": "\u211a",
+    "rbarr;": "\u290d",
+    "rbbrk;": "\u2773",
+    "rbrace;": "}",
+    "rbrack;": "]",
+    "rbrke;": "\u298c",
+    "rbrksld;": "\u298e",
+    "rbrkslu;": "\u2990",
+    "rcaron;": "\u0159",
+    "rcedil;": "\u0157",
+    "rceil;": "\u2309",
+    "rcub;": "}",
+    "rcy;": "\u0440",
+    "rdca;": "\u2937",
+    "rdldhar;": "\u2969",
+    "rdquo;": "\u201d",
+    "rdquor;": "\u201d",
+    "rdsh;": "\u21b3",
+    "real;": "\u211c",
+    "realine;": "\u211b",
+    "realpart;": "\u211c",
+    "reals;": "\u211d",
+    "rect;": "\u25ad",
+    "reg": "\xae",
+    "reg;": "\xae",
+    "rfisht;": "\u297d",
+    "rfloor;": "\u230b",
+    "rfr;": "\U0001d52f",
+    "rhard;": "\u21c1",
+    "rharu;": "\u21c0",
+    "rharul;": "\u296c",
+    "rho;": "\u03c1",
+    "rhov;": "\u03f1",
+    "rightarrow;": "\u2192",
+    "rightarrowtail;": "\u21a3",
+    "rightharpoondown;": "\u21c1",
+    "rightharpoonup;": "\u21c0",
+    "rightleftarrows;": "\u21c4",
+    "rightleftharpoons;": "\u21cc",
+    "rightrightarrows;": "\u21c9",
+    "rightsquigarrow;": "\u219d",
+    "rightthreetimes;": "\u22cc",
+    "ring;": "\u02da",
+    "risingdotseq;": "\u2253",
+    "rlarr;": "\u21c4",
+    "rlhar;": "\u21cc",
+    "rlm;": "\u200f",
+    "rmoust;": "\u23b1",
+    "rmoustache;": "\u23b1",
+    "rnmid;": "\u2aee",
+    "roang;": "\u27ed",
+    "roarr;": "\u21fe",
+    "robrk;": "\u27e7",
+    "ropar;": "\u2986",
+    "ropf;": "\U0001d563",
+    "roplus;": "\u2a2e",
+    "rotimes;": "\u2a35",
+    "rpar;": ")",
+    "rpargt;": "\u2994",
+    "rppolint;": "\u2a12",
+    "rrarr;": "\u21c9",
+    "rsaquo;": "\u203a",
+    "rscr;": "\U0001d4c7",
+    "rsh;": "\u21b1",
+    "rsqb;": "]",
+    "rsquo;": "\u2019",
+    "rsquor;": "\u2019",
+    "rthree;": "\u22cc",
+    "rtimes;": "\u22ca",
+    "rtri;": "\u25b9",
+    "rtrie;": "\u22b5",
+    "rtrif;": "\u25b8",
+    "rtriltri;": "\u29ce",
+    "ruluhar;": "\u2968",
+    "rx;": "\u211e",
+    "sacute;": "\u015b",
+    "sbquo;": "\u201a",
+    "sc;": "\u227b",
+    "scE;": "\u2ab4",
+    "scap;": "\u2ab8",
+    "scaron;": "\u0161",
+    "sccue;": "\u227d",
+    "sce;": "\u2ab0",
+    "scedil;": "\u015f",
+    "scirc;": "\u015d",
+    "scnE;": "\u2ab6",
+    "scnap;": "\u2aba",
+    "scnsim;": "\u22e9",
+    "scpolint;": "\u2a13",
+    "scsim;": "\u227f",
+    "scy;": "\u0441",
+    "sdot;": "\u22c5",
+    "sdotb;": "\u22a1",
+    "sdote;": "\u2a66",
+    "seArr;": "\u21d8",
+    "searhk;": "\u2925",
+    "searr;": "\u2198",
+    "searrow;": "\u2198",
+    "sect": "\xa7",
+    "sect;": "\xa7",
+    "semi;": ";",
+    "seswar;": "\u2929",
+    "setminus;": "\u2216",
+    "setmn;": "\u2216",
+    "sext;": "\u2736",
+    "sfr;": "\U0001d530",
+    "sfrown;": "\u2322",
+    "sharp;": "\u266f",
+    "shchcy;": "\u0449",
+    "shcy;": "\u0448",
+    "shortmid;": "\u2223",
+    "shortparallel;": "\u2225",
+    "shy": "\xad",
+    "shy;": "\xad",
+    "sigma;": "\u03c3",
+    "sigmaf;": "\u03c2",
+    "sigmav;": "\u03c2",
+    "sim;": "\u223c",
+    "simdot;": "\u2a6a",
+    "sime;": "\u2243",
+    "simeq;": "\u2243",
+    "simg;": "\u2a9e",
+    "simgE;": "\u2aa0",
+    "siml;": "\u2a9d",
+    "simlE;": "\u2a9f",
+    "simne;": "\u2246",
+    "simplus;": "\u2a24",
+    "simrarr;": "\u2972",
+    "slarr;": "\u2190",
+    "smallsetminus;": "\u2216",
+    "smashp;": "\u2a33",
+    "smeparsl;": "\u29e4",
+    "smid;": "\u2223",
+    "smile;": "\u2323",
+    "smt;": "\u2aaa",
+    "smte;": "\u2aac",
+    "smtes;": "\u2aac\ufe00",
+    "softcy;": "\u044c",
+    "sol;": "/",
+    "solb;": "\u29c4",
+    "solbar;": "\u233f",
+    "sopf;": "\U0001d564",
+    "spades;": "\u2660",
+    "spadesuit;": "\u2660",
+    "spar;": "\u2225",
+    "sqcap;": "\u2293",
+    "sqcaps;": "\u2293\ufe00",
+    "sqcup;": "\u2294",
+    "sqcups;": "\u2294\ufe00",
+    "sqsub;": "\u228f",
+    "sqsube;": "\u2291",
+    "sqsubset;": "\u228f",
+    "sqsubseteq;": "\u2291",
+    "sqsup;": "\u2290",
+    "sqsupe;": "\u2292",
+    "sqsupset;": "\u2290",
+    "sqsupseteq;": "\u2292",
+    "squ;": "\u25a1",
+    "square;": "\u25a1",
+    "squarf;": "\u25aa",
+    "squf;": "\u25aa",
+    "srarr;": "\u2192",
+    "sscr;": "\U0001d4c8",
+    "ssetmn;": "\u2216",
+    "ssmile;": "\u2323",
+    "sstarf;": "\u22c6",
+    "star;": "\u2606",
+    "starf;": "\u2605",
+    "straightepsilon;": "\u03f5",
+    "straightphi;": "\u03d5",
+    "strns;": "\xaf",
+    "sub;": "\u2282",
+    "subE;": "\u2ac5",
+    "subdot;": "\u2abd",
+    "sube;": "\u2286",
+    "subedot;": "\u2ac3",
+    "submult;": "\u2ac1",
+    "subnE;": "\u2acb",
+    "subne;": "\u228a",
+    "subplus;": "\u2abf",
+    "subrarr;": "\u2979",
+    "subset;": "\u2282",
+    "subseteq;": "\u2286",
+    "subseteqq;": "\u2ac5",
+    "subsetneq;": "\u228a",
+    "subsetneqq;": "\u2acb",
+    "subsim;": "\u2ac7",
+    "subsub;": "\u2ad5",
+    "subsup;": "\u2ad3",
+    "succ;": "\u227b",
+    "succapprox;": "\u2ab8",
+    "succcurlyeq;": "\u227d",
+    "succeq;": "\u2ab0",
+    "succnapprox;": "\u2aba",
+    "succneqq;": "\u2ab6",
+    "succnsim;": "\u22e9",
+    "succsim;": "\u227f",
+    "sum;": "\u2211",
+    "sung;": "\u266a",
+    "sup1": "\xb9",
+    "sup1;": "\xb9",
+    "sup2": "\xb2",
+    "sup2;": "\xb2",
+    "sup3": "\xb3",
+    "sup3;": "\xb3",
+    "sup;": "\u2283",
+    "supE;": "\u2ac6",
+    "supdot;": "\u2abe",
+    "supdsub;": "\u2ad8",
+    "supe;": "\u2287",
+    "supedot;": "\u2ac4",
+    "suphsol;": "\u27c9",
+    "suphsub;": "\u2ad7",
+    "suplarr;": "\u297b",
+    "supmult;": "\u2ac2",
+    "supnE;": "\u2acc",
+    "supne;": "\u228b",
+    "supplus;": "\u2ac0",
+    "supset;": "\u2283",
+    "supseteq;": "\u2287",
+    "supseteqq;": "\u2ac6",
+    "supsetneq;": "\u228b",
+    "supsetneqq;": "\u2acc",
+    "supsim;": "\u2ac8",
+    "supsub;": "\u2ad4",
+    "supsup;": "\u2ad6",
+    "swArr;": "\u21d9",
+    "swarhk;": "\u2926",
+    "swarr;": "\u2199",
+    "swarrow;": "\u2199",
+    "swnwar;": "\u292a",
+    "szlig": "\xdf",
+    "szlig;": "\xdf",
+    "target;": "\u2316",
+    "tau;": "\u03c4",
+    "tbrk;": "\u23b4",
+    "tcaron;": "\u0165",
+    "tcedil;": "\u0163",
+    "tcy;": "\u0442",
+    "tdot;": "\u20db",
+    "telrec;": "\u2315",
+    "tfr;": "\U0001d531",
+    "there4;": "\u2234",
+    "therefore;": "\u2234",
+    "theta;": "\u03b8",
+    "thetasym;": "\u03d1",
+    "thetav;": "\u03d1",
+    "thickapprox;": "\u2248",
+    "thicksim;": "\u223c",
+    "thinsp;": "\u2009",
+    "thkap;": "\u2248",
+    "thksim;": "\u223c",
+    "thorn": "\xfe",
+    "thorn;": "\xfe",
+    "tilde;": "\u02dc",
+    "times": "\xd7",
+    "times;": "\xd7",
+    "timesb;": "\u22a0",
+    "timesbar;": "\u2a31",
+    "timesd;": "\u2a30",
+    "tint;": "\u222d",
+    "toea;": "\u2928",
+    "top;": "\u22a4",
+    "topbot;": "\u2336",
+    "topcir;": "\u2af1",
+    "topf;": "\U0001d565",
+    "topfork;": "\u2ada",
+    "tosa;": "\u2929",
+    "tprime;": "\u2034",
+    "trade;": "\u2122",
+    "triangle;": "\u25b5",
+    "triangledown;": "\u25bf",
+    "triangleleft;": "\u25c3",
+    "trianglelefteq;": "\u22b4",
+    "triangleq;": "\u225c",
+    "triangleright;": "\u25b9",
+    "trianglerighteq;": "\u22b5",
+    "tridot;": "\u25ec",
+    "trie;": "\u225c",
+    "triminus;": "\u2a3a",
+    "triplus;": "\u2a39",
+    "trisb;": "\u29cd",
+    "tritime;": "\u2a3b",
+    "trpezium;": "\u23e2",
+    "tscr;": "\U0001d4c9",
+    "tscy;": "\u0446",
+    "tshcy;": "\u045b",
+    "tstrok;": "\u0167",
+    "twixt;": "\u226c",
+    "twoheadleftarrow;": "\u219e",
+    "twoheadrightarrow;": "\u21a0",
+    "uArr;": "\u21d1",
+    "uHar;": "\u2963",
+    "uacute": "\xfa",
+    "uacute;": "\xfa",
+    "uarr;": "\u2191",
+    "ubrcy;": "\u045e",
+    "ubreve;": "\u016d",
+    "ucirc": "\xfb",
+    "ucirc;": "\xfb",
+    "ucy;": "\u0443",
+    "udarr;": "\u21c5",
+    "udblac;": "\u0171",
+    "udhar;": "\u296e",
+    "ufisht;": "\u297e",
+    "ufr;": "\U0001d532",
+    "ugrave": "\xf9",
+    "ugrave;": "\xf9",
+    "uharl;": "\u21bf",
+    "uharr;": "\u21be",
+    "uhblk;": "\u2580",
+    "ulcorn;": "\u231c",
+    "ulcorner;": "\u231c",
+    "ulcrop;": "\u230f",
+    "ultri;": "\u25f8",
+    "umacr;": "\u016b",
+    "uml": "\xa8",
+    "uml;": "\xa8",
+    "uogon;": "\u0173",
+    "uopf;": "\U0001d566",
+    "uparrow;": "\u2191",
+    "updownarrow;": "\u2195",
+    "upharpoonleft;": "\u21bf",
+    "upharpoonright;": "\u21be",
+    "uplus;": "\u228e",
+    "upsi;": "\u03c5",
+    "upsih;": "\u03d2",
+    "upsilon;": "\u03c5",
+    "upuparrows;": "\u21c8",
+    "urcorn;": "\u231d",
+    "urcorner;": "\u231d",
+    "urcrop;": "\u230e",
+    "uring;": "\u016f",
+    "urtri;": "\u25f9",
+    "uscr;": "\U0001d4ca",
+    "utdot;": "\u22f0",
+    "utilde;": "\u0169",
+    "utri;": "\u25b5",
+    "utrif;": "\u25b4",
+    "uuarr;": "\u21c8",
+    "uuml": "\xfc",
+    "uuml;": "\xfc",
+    "uwangle;": "\u29a7",
+    "vArr;": "\u21d5",
+    "vBar;": "\u2ae8",
+    "vBarv;": "\u2ae9",
+    "vDash;": "\u22a8",
+    "vangrt;": "\u299c",
+    "varepsilon;": "\u03f5",
+    "varkappa;": "\u03f0",
+    "varnothing;": "\u2205",
+    "varphi;": "\u03d5",
+    "varpi;": "\u03d6",
+    "varpropto;": "\u221d",
+    "varr;": "\u2195",
+    "varrho;": "\u03f1",
+    "varsigma;": "\u03c2",
+    "varsubsetneq;": "\u228a\ufe00",
+    "varsubsetneqq;": "\u2acb\ufe00",
+    "varsupsetneq;": "\u228b\ufe00",
+    "varsupsetneqq;": "\u2acc\ufe00",
+    "vartheta;": "\u03d1",
+    "vartriangleleft;": "\u22b2",
+    "vartriangleright;": "\u22b3",
+    "vcy;": "\u0432",
+    "vdash;": "\u22a2",
+    "vee;": "\u2228",
+    "veebar;": "\u22bb",
+    "veeeq;": "\u225a",
+    "vellip;": "\u22ee",
+    "verbar;": "|",
+    "vert;": "|",
+    "vfr;": "\U0001d533",
+    "vltri;": "\u22b2",
+    "vnsub;": "\u2282\u20d2",
+    "vnsup;": "\u2283\u20d2",
+    "vopf;": "\U0001d567",
+    "vprop;": "\u221d",
+    "vrtri;": "\u22b3",
+    "vscr;": "\U0001d4cb",
+    "vsubnE;": "\u2acb\ufe00",
+    "vsubne;": "\u228a\ufe00",
+    "vsupnE;": "\u2acc\ufe00",
+    "vsupne;": "\u228b\ufe00",
+    "vzigzag;": "\u299a",
+    "wcirc;": "\u0175",
+    "wedbar;": "\u2a5f",
+    "wedge;": "\u2227",
+    "wedgeq;": "\u2259",
+    "weierp;": "\u2118",
+    "wfr;": "\U0001d534",
+    "wopf;": "\U0001d568",
+    "wp;": "\u2118",
+    "wr;": "\u2240",
+    "wreath;": "\u2240",
+    "wscr;": "\U0001d4cc",
+    "xcap;": "\u22c2",
+    "xcirc;": "\u25ef",
+    "xcup;": "\u22c3",
+    "xdtri;": "\u25bd",
+    "xfr;": "\U0001d535",
+    "xhArr;": "\u27fa",
+    "xharr;": "\u27f7",
+    "xi;": "\u03be",
+    "xlArr;": "\u27f8",
+    "xlarr;": "\u27f5",
+    "xmap;": "\u27fc",
+    "xnis;": "\u22fb",
+    "xodot;": "\u2a00",
+    "xopf;": "\U0001d569",
+    "xoplus;": "\u2a01",
+    "xotime;": "\u2a02",
+    "xrArr;": "\u27f9",
+    "xrarr;": "\u27f6",
+    "xscr;": "\U0001d4cd",
+    "xsqcup;": "\u2a06",
+    "xuplus;": "\u2a04",
+    "xutri;": "\u25b3",
+    "xvee;": "\u22c1",
+    "xwedge;": "\u22c0",
+    "yacute": "\xfd",
+    "yacute;": "\xfd",
+    "yacy;": "\u044f",
+    "ycirc;": "\u0177",
+    "ycy;": "\u044b",
+    "yen": "\xa5",
+    "yen;": "\xa5",
+    "yfr;": "\U0001d536",
+    "yicy;": "\u0457",
+    "yopf;": "\U0001d56a",
+    "yscr;": "\U0001d4ce",
+    "yucy;": "\u044e",
+    "yuml": "\xff",
+    "yuml;": "\xff",
+    "zacute;": "\u017a",
+    "zcaron;": "\u017e",
+    "zcy;": "\u0437",
+    "zdot;": "\u017c",
+    "zeetrf;": "\u2128",
+    "zeta;": "\u03b6",
+    "zfr;": "\U0001d537",
+    "zhcy;": "\u0436",
+    "zigrarr;": "\u21dd",
+    "zopf;": "\U0001d56b",
+    "zscr;": "\U0001d4cf",
+    "zwj;": "\u200d",
+    "zwnj;": "\u200c",
+}
+
+replacementCharacters = {
+    0x0: "\uFFFD",
+    0x0d: "\u000D",
+    0x80: "\u20AC",
+    0x81: "\u0081",
+    0x81: "\u0081",
+    0x82: "\u201A",
+    0x83: "\u0192",
+    0x84: "\u201E",
+    0x85: "\u2026",
+    0x86: "\u2020",
+    0x87: "\u2021",
+    0x88: "\u02C6",
+    0x89: "\u2030",
+    0x8A: "\u0160",
+    0x8B: "\u2039",
+    0x8C: "\u0152",
+    0x8D: "\u008D",
+    0x8E: "\u017D",
+    0x8F: "\u008F",
+    0x90: "\u0090",
+    0x91: "\u2018",
+    0x92: "\u2019",
+    0x93: "\u201C",
+    0x94: "\u201D",
+    0x95: "\u2022",
+    0x96: "\u2013",
+    0x97: "\u2014",
+    0x98: "\u02DC",
+    0x99: "\u2122",
+    0x9A: "\u0161",
+    0x9B: "\u203A",
+    0x9C: "\u0153",
+    0x9D: "\u009D",
+    0x9E: "\u017E",
+    0x9F: "\u0178",
+}
+
+encodings = {
+    '437': 'cp437',
+    '850': 'cp850',
+    '852': 'cp852',
+    '855': 'cp855',
+    '857': 'cp857',
+    '860': 'cp860',
+    '861': 'cp861',
+    '862': 'cp862',
+    '863': 'cp863',
+    '865': 'cp865',
+    '866': 'cp866',
+    '869': 'cp869',
+    'ansix341968': 'ascii',
+    'ansix341986': 'ascii',
+    'arabic': 'iso8859-6',
+    'ascii': 'ascii',
+    'asmo708': 'iso8859-6',
+    'big5': 'big5',
+    'big5hkscs': 'big5hkscs',
+    'chinese': 'gbk',
+    'cp037': 'cp037',
+    'cp1026': 'cp1026',
+    'cp154': 'ptcp154',
+    'cp367': 'ascii',
+    'cp424': 'cp424',
+    'cp437': 'cp437',
+    'cp500': 'cp500',
+    'cp775': 'cp775',
+    'cp819': 'windows-1252',
+    'cp850': 'cp850',
+    'cp852': 'cp852',
+    'cp855': 'cp855',
+    'cp857': 'cp857',
+    'cp860': 'cp860',
+    'cp861': 'cp861',
+    'cp862': 'cp862',
+    'cp863': 'cp863',
+    'cp864': 'cp864',
+    'cp865': 'cp865',
+    'cp866': 'cp866',
+    'cp869': 'cp869',
+    'cp936': 'gbk',
+    'cpgr': 'cp869',
+    'cpis': 'cp861',
+    'csascii': 'ascii',
+    'csbig5': 'big5',
+    'cseuckr': 'cp949',
+    'cseucpkdfmtjapanese': 'euc_jp',
+    'csgb2312': 'gbk',
+    'cshproman8': 'hp-roman8',
+    'csibm037': 'cp037',
+    'csibm1026': 'cp1026',
+    'csibm424': 'cp424',
+    'csibm500': 'cp500',
+    'csibm855': 'cp855',
+    'csibm857': 'cp857',
+    'csibm860': 'cp860',
+    'csibm861': 'cp861',
+    'csibm863': 'cp863',
+    'csibm864': 'cp864',
+    'csibm865': 'cp865',
+    'csibm866': 'cp866',
+    'csibm869': 'cp869',
+    'csiso2022jp': 'iso2022_jp',
+    'csiso2022jp2': 'iso2022_jp_2',
+    'csiso2022kr': 'iso2022_kr',
+    'csiso58gb231280': 'gbk',
+    'csisolatin1': 'windows-1252',
+    'csisolatin2': 'iso8859-2',
+    'csisolatin3': 'iso8859-3',
+    'csisolatin4': 'iso8859-4',
+    'csisolatin5': 'windows-1254',
+    'csisolatin6': 'iso8859-10',
+    'csisolatinarabic': 'iso8859-6',
+    'csisolatincyrillic': 'iso8859-5',
+    'csisolatingreek': 'iso8859-7',
+    'csisolatinhebrew': 'iso8859-8',
+    'cskoi8r': 'koi8-r',
+    'csksc56011987': 'cp949',
+    'cspc775baltic': 'cp775',
+    'cspc850multilingual': 'cp850',
+    'cspc862latinhebrew': 'cp862',
+    'cspc8codepage437': 'cp437',
+    'cspcp852': 'cp852',
+    'csptcp154': 'ptcp154',
+    'csshiftjis': 'shift_jis',
+    'csunicode11utf7': 'utf-7',
+    'cyrillic': 'iso8859-5',
+    'cyrillicasian': 'ptcp154',
+    'ebcdiccpbe': 'cp500',
+    'ebcdiccpca': 'cp037',
+    'ebcdiccpch': 'cp500',
+    'ebcdiccphe': 'cp424',
+    'ebcdiccpnl': 'cp037',
+    'ebcdiccpus': 'cp037',
+    'ebcdiccpwt': 'cp037',
+    'ecma114': 'iso8859-6',
+    'ecma118': 'iso8859-7',
+    'elot928': 'iso8859-7',
+    'eucjp': 'euc_jp',
+    'euckr': 'cp949',
+    'extendedunixcodepackedformatforjapanese': 'euc_jp',
+    'gb18030': 'gb18030',
+    'gb2312': 'gbk',
+    'gb231280': 'gbk',
+    'gbk': 'gbk',
+    'greek': 'iso8859-7',
+    'greek8': 'iso8859-7',
+    'hebrew': 'iso8859-8',
+    'hproman8': 'hp-roman8',
+    'hzgb2312': 'hz',
+    'ibm037': 'cp037',
+    'ibm1026': 'cp1026',
+    'ibm367': 'ascii',
+    'ibm424': 'cp424',
+    'ibm437': 'cp437',
+    'ibm500': 'cp500',
+    'ibm775': 'cp775',
+    'ibm819': 'windows-1252',
+    'ibm850': 'cp850',
+    'ibm852': 'cp852',
+    'ibm855': 'cp855',
+    'ibm857': 'cp857',
+    'ibm860': 'cp860',
+    'ibm861': 'cp861',
+    'ibm862': 'cp862',
+    'ibm863': 'cp863',
+    'ibm864': 'cp864',
+    'ibm865': 'cp865',
+    'ibm866': 'cp866',
+    'ibm869': 'cp869',
+    'iso2022jp': 'iso2022_jp',
+    'iso2022jp2': 'iso2022_jp_2',
+    'iso2022kr': 'iso2022_kr',
+    'iso646irv1991': 'ascii',
+    'iso646us': 'ascii',
+    'iso88591': 'windows-1252',
+    'iso885910': 'iso8859-10',
+    'iso8859101992': 'iso8859-10',
+    'iso885911987': 'windows-1252',
+    'iso885913': 'iso8859-13',
+    'iso885914': 'iso8859-14',
+    'iso8859141998': 'iso8859-14',
+    'iso885915': 'iso8859-15',
+    'iso885916': 'iso8859-16',
+    'iso8859162001': 'iso8859-16',
+    'iso88592': 'iso8859-2',
+    'iso885921987': 'iso8859-2',
+    'iso88593': 'iso8859-3',
+    'iso885931988': 'iso8859-3',
+    'iso88594': 'iso8859-4',
+    'iso885941988': 'iso8859-4',
+    'iso88595': 'iso8859-5',
+    'iso885951988': 'iso8859-5',
+    'iso88596': 'iso8859-6',
+    'iso885961987': 'iso8859-6',
+    'iso88597': 'iso8859-7',
+    'iso885971987': 'iso8859-7',
+    'iso88598': 'iso8859-8',
+    'iso885981988': 'iso8859-8',
+    'iso88599': 'windows-1254',
+    'iso885991989': 'windows-1254',
+    'isoceltic': 'iso8859-14',
+    'isoir100': 'windows-1252',
+    'isoir101': 'iso8859-2',
+    'isoir109': 'iso8859-3',
+    'isoir110': 'iso8859-4',
+    'isoir126': 'iso8859-7',
+    'isoir127': 'iso8859-6',
+    'isoir138': 'iso8859-8',
+    'isoir144': 'iso8859-5',
+    'isoir148': 'windows-1254',
+    'isoir149': 'cp949',
+    'isoir157': 'iso8859-10',
+    'isoir199': 'iso8859-14',
+    'isoir226': 'iso8859-16',
+    'isoir58': 'gbk',
+    'isoir6': 'ascii',
+    'koi8r': 'koi8-r',
+    'koi8u': 'koi8-u',
+    'korean': 'cp949',
+    'ksc5601': 'cp949',
+    'ksc56011987': 'cp949',
+    'ksc56011989': 'cp949',
+    'l1': 'windows-1252',
+    'l10': 'iso8859-16',
+    'l2': 'iso8859-2',
+    'l3': 'iso8859-3',
+    'l4': 'iso8859-4',
+    'l5': 'windows-1254',
+    'l6': 'iso8859-10',
+    'l8': 'iso8859-14',
+    'latin1': 'windows-1252',
+    'latin10': 'iso8859-16',
+    'latin2': 'iso8859-2',
+    'latin3': 'iso8859-3',
+    'latin4': 'iso8859-4',
+    'latin5': 'windows-1254',
+    'latin6': 'iso8859-10',
+    'latin8': 'iso8859-14',
+    'latin9': 'iso8859-15',
+    'ms936': 'gbk',
+    'mskanji': 'shift_jis',
+    'pt154': 'ptcp154',
+    'ptcp154': 'ptcp154',
+    'r8': 'hp-roman8',
+    'roman8': 'hp-roman8',
+    'shiftjis': 'shift_jis',
+    'tis620': 'cp874',
+    'unicode11utf7': 'utf-7',
+    'us': 'ascii',
+    'usascii': 'ascii',
+    'utf16': 'utf-16',
+    'utf16be': 'utf-16-be',
+    'utf16le': 'utf-16-le',
+    'utf8': 'utf-8',
+    'windows1250': 'cp1250',
+    'windows1251': 'cp1251',
+    'windows1252': 'cp1252',
+    'windows1253': 'cp1253',
+    'windows1254': 'cp1254',
+    'windows1255': 'cp1255',
+    'windows1256': 'cp1256',
+    'windows1257': 'cp1257',
+    'windows1258': 'cp1258',
+    'windows936': 'gbk',
+    'x-x-big5': 'big5'}
+
+tokenTypes = {
+    "Doctype": 0,
+    "Characters": 1,
+    "SpaceCharacters": 2,
+    "StartTag": 3,
+    "EndTag": 4,
+    "EmptyTag": 5,
+    "Comment": 6,
+    "ParseError": 7
+}
+
+tagTokenTypes = frozenset((tokenTypes["StartTag"], tokenTypes["EndTag"],
+                           tokenTypes["EmptyTag"]))
+
+
+prefixes = dict([(v, k) for k, v in namespaces.items()])
+prefixes["http://www.w3.org/1998/Math/MathML"] = "math"
+
+
+class DataLossWarning(UserWarning):
+    pass
+
+
+class ReparseException(Exception):
+    pass
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/__init__.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/_base.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/_base.py
new file mode 100644
index 0000000..c7dbaed
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/_base.py
@@ -0,0 +1,12 @@
+from __future__ import absolute_import, division, unicode_literals
+
+
+class Filter(object):
+    def __init__(self, source):
+        self.source = source
+
+    def __iter__(self):
+        return iter(self.source)
+
+    def __getattr__(self, name):
+        return getattr(self.source, name)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/alphabeticalattributes.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/alphabeticalattributes.py
new file mode 100644
index 0000000..fed6996
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/alphabeticalattributes.py
@@ -0,0 +1,20 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from . import _base
+
+try:
+    from collections import OrderedDict
+except ImportError:
+    from ordereddict import OrderedDict
+
+
+class Filter(_base.Filter):
+    def __iter__(self):
+        for token in _base.Filter.__iter__(self):
+            if token["type"] in ("StartTag", "EmptyTag"):
+                attrs = OrderedDict()
+                for name, value in sorted(token["data"].items(),
+                                          key=lambda x: x[0]):
+                    attrs[name] = value
+                token["data"] = attrs
+            yield token
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/inject_meta_charset.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/inject_meta_charset.py
new file mode 100644
index 0000000..ca33b70b
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/inject_meta_charset.py
@@ -0,0 +1,65 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from . import _base
+
+
+class Filter(_base.Filter):
+    def __init__(self, source, encoding):
+        _base.Filter.__init__(self, source)
+        self.encoding = encoding
+
+    def __iter__(self):
+        state = "pre_head"
+        meta_found = (self.encoding is None)
+        pending = []
+
+        for token in _base.Filter.__iter__(self):
+            type = token["type"]
+            if type == "StartTag":
+                if token["name"].lower() == "head":
+                    state = "in_head"
+
+            elif type == "EmptyTag":
+                if token["name"].lower() == "meta":
+                    # replace charset with actual encoding
+                    has_http_equiv_content_type = False
+                    for (namespace, name), value in token["data"].items():
+                        if namespace is not None:
+                            continue
+                        elif name.lower() == 'charset':
+                            token["data"][(namespace, name)] = self.encoding
+                            meta_found = True
+                            break
+                        elif name == 'http-equiv' and value.lower() == 'content-type':
+                            has_http_equiv_content_type = True
+                    else:
+                        if has_http_equiv_content_type and (None, "content") in token["data"]:
+                            token["data"][(None, "content")] = 'text/html; charset=%s' % self.encoding
+                            meta_found = True
+
+                elif token["name"].lower() == "head" and not meta_found:
+                    # insert meta into empty head
+                    yield {"type": "StartTag", "name": "head",
+                           "data": token["data"]}
+                    yield {"type": "EmptyTag", "name": "meta",
+                           "data": {(None, "charset"): self.encoding}}
+                    yield {"type": "EndTag", "name": "head"}
+                    meta_found = True
+                    continue
+
+            elif type == "EndTag":
+                if token["name"].lower() == "head" and pending:
+                    # insert meta into head (if necessary) and flush pending queue
+                    yield pending.pop(0)
+                    if not meta_found:
+                        yield {"type": "EmptyTag", "name": "meta",
+                               "data": {(None, "charset"): self.encoding}}
+                    while pending:
+                        yield pending.pop(0)
+                    meta_found = True
+                    state = "post_head"
+
+            if state == "in_head":
+                pending.append(token)
+            else:
+                yield token
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/lint.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/lint.py
new file mode 100644
index 0000000..7cc99a4
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/lint.py
@@ -0,0 +1,93 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from gettext import gettext
+_ = gettext
+
+from . import _base
+from ..constants import cdataElements, rcdataElements, voidElements
+
+from ..constants import spaceCharacters
+spaceCharacters = "".join(spaceCharacters)
+
+
+class LintError(Exception):
+    pass
+
+
+class Filter(_base.Filter):
+    def __iter__(self):
+        open_elements = []
+        contentModelFlag = "PCDATA"
+        for token in _base.Filter.__iter__(self):
+            type = token["type"]
+            if type in ("StartTag", "EmptyTag"):
+                name = token["name"]
+                if contentModelFlag != "PCDATA":
+                    raise LintError(_("StartTag not in PCDATA content model flag: %(tag)s") % {"tag": name})
+                if not isinstance(name, str):
+                    raise LintError(_("Tag name is not a string: %(tag)r") % {"tag": name})
+                if not name:
+                    raise LintError(_("Empty tag name"))
+                if type == "StartTag" and name in voidElements:
+                    raise LintError(_("Void element reported as StartTag token: %(tag)s") % {"tag": name})
+                elif type == "EmptyTag" and name not in voidElements:
+                    raise LintError(_("Non-void element reported as EmptyTag token: %(tag)s") % {"tag": token["name"]})
+                if type == "StartTag":
+                    open_elements.append(name)
+                for name, value in token["data"]:
+                    if not isinstance(name, str):
+                        raise LintError(_("Attribute name is not a string: %(name)r") % {"name": name})
+                    if not name:
+                        raise LintError(_("Empty attribute name"))
+                    if not isinstance(value, str):
+                        raise LintError(_("Attribute value is not a string: %(value)r") % {"value": value})
+                if name in cdataElements:
+                    contentModelFlag = "CDATA"
+                elif name in rcdataElements:
+                    contentModelFlag = "RCDATA"
+                elif name == "plaintext":
+                    contentModelFlag = "PLAINTEXT"
+
+            elif type == "EndTag":
+                name = token["name"]
+                if not isinstance(name, str):
+                    raise LintError(_("Tag name is not a string: %(tag)r") % {"tag": name})
+                if not name:
+                    raise LintError(_("Empty tag name"))
+                if name in voidElements:
+                    raise LintError(_("Void element reported as EndTag token: %(tag)s") % {"tag": name})
+                start_name = open_elements.pop()
+                if start_name != name:
+                    raise LintError(_("EndTag (%(end)s) does not match StartTag (%(start)s)") % {"end": name, "start": start_name})
+                contentModelFlag = "PCDATA"
+
+            elif type == "Comment":
+                if contentModelFlag != "PCDATA":
+                    raise LintError(_("Comment not in PCDATA content model flag"))
+
+            elif type in ("Characters", "SpaceCharacters"):
+                data = token["data"]
+                if not isinstance(data, str):
+                    raise LintError(_("Attribute name is not a string: %(name)r") % {"name": data})
+                if not data:
+                    raise LintError(_("%(type)s token with empty data") % {"type": type})
+                if type == "SpaceCharacters":
+                    data = data.strip(spaceCharacters)
+                    if data:
+                        raise LintError(_("Non-space character(s) found in SpaceCharacters token: %(token)r") % {"token": data})
+
+            elif type == "Doctype":
+                name = token["name"]
+                if contentModelFlag != "PCDATA":
+                    raise LintError(_("Doctype not in PCDATA content model flag: %(name)s") % {"name": name})
+                if not isinstance(name, str):
+                    raise LintError(_("Tag name is not a string: %(tag)r") % {"tag": name})
+                # XXX: what to do with token["data"] ?
+
+            elif type in ("ParseError", "SerializeError"):
+                pass
+
+            else:
+                raise LintError(_("Unknown token type: %(type)s") % {"type": type})
+
+            yield token
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/optionaltags.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/optionaltags.py
new file mode 100644
index 0000000..fefe0b3
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/optionaltags.py
@@ -0,0 +1,205 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from . import _base
+
+
+class Filter(_base.Filter):
+    def slider(self):
+        previous1 = previous2 = None
+        for token in self.source:
+            if previous1 is not None:
+                yield previous2, previous1, token
+            previous2 = previous1
+            previous1 = token
+        yield previous2, previous1, None
+
+    def __iter__(self):
+        for previous, token, next in self.slider():
+            type = token["type"]
+            if type == "StartTag":
+                if (token["data"] or
+                        not self.is_optional_start(token["name"], previous, next)):
+                    yield token
+            elif type == "EndTag":
+                if not self.is_optional_end(token["name"], next):
+                    yield token
+            else:
+                yield token
+
+    def is_optional_start(self, tagname, previous, next):
+        type = next and next["type"] or None
+        if tagname in 'html':
+            # An html element's start tag may be omitted if the first thing
+            # inside the html element is not a space character or a comment.
+            return type not in ("Comment", "SpaceCharacters")
+        elif tagname == 'head':
+            # A head element's start tag may be omitted if the first thing
+            # inside the head element is an element.
+            # XXX: we also omit the start tag if the head element is empty
+            if type in ("StartTag", "EmptyTag"):
+                return True
+            elif type == "EndTag":
+                return next["name"] == "head"
+        elif tagname == 'body':
+            # A body element's start tag may be omitted if the first thing
+            # inside the body element is not a space character or a comment,
+            # except if the first thing inside the body element is a script
+            # or style element and the node immediately preceding the body
+            # element is a head element whose end tag has been omitted.
+            if type in ("Comment", "SpaceCharacters"):
+                return False
+            elif type == "StartTag":
+                # XXX: we do not look at the preceding event, so we never omit
+                # the body element's start tag if it's followed by a script or
+                # a style element.
+                return next["name"] not in ('script', 'style')
+            else:
+                return True
+        elif tagname == 'colgroup':
+            # A colgroup element's start tag may be omitted if the first thing
+            # inside the colgroup element is a col element, and if the element
+            # is not immediately preceeded by another colgroup element whose
+            # end tag has been omitted.
+            if type in ("StartTag", "EmptyTag"):
+                # XXX: we do not look at the preceding event, so instead we never
+                # omit the colgroup element's end tag when it is immediately
+                # followed by another colgroup element. See is_optional_end.
+                return next["name"] == "col"
+            else:
+                return False
+        elif tagname == 'tbody':
+            # A tbody element's start tag may be omitted if the first thing
+            # inside the tbody element is a tr element, and if the element is
+            # not immediately preceeded by a tbody, thead, or tfoot element
+            # whose end tag has been omitted.
+            if type == "StartTag":
+                # omit the thead and tfoot elements' end tag when they are
+                # immediately followed by a tbody element. See is_optional_end.
+                if previous and previous['type'] == 'EndTag' and \
+                        previous['name'] in ('tbody', 'thead', 'tfoot'):
+                    return False
+                return next["name"] == 'tr'
+            else:
+                return False
+        return False
+
+    def is_optional_end(self, tagname, next):
+        type = next and next["type"] or None
+        if tagname in ('html', 'head', 'body'):
+            # An html element's end tag may be omitted if the html element
+            # is not immediately followed by a space character or a comment.
+            return type not in ("Comment", "SpaceCharacters")
+        elif tagname in ('li', 'optgroup', 'tr'):
+            # A li element's end tag may be omitted if the li element is
+            # immediately followed by another li element or if there is
+            # no more content in the parent element.
+            # An optgroup element's end tag may be omitted if the optgroup
+            # element is immediately followed by another optgroup element,
+            # or if there is no more content in the parent element.
+            # A tr element's end tag may be omitted if the tr element is
+            # immediately followed by another tr element, or if there is
+            # no more content in the parent element.
+            if type == "StartTag":
+                return next["name"] == tagname
+            else:
+                return type == "EndTag" or type is None
+        elif tagname in ('dt', 'dd'):
+            # A dt element's end tag may be omitted if the dt element is
+            # immediately followed by another dt element or a dd element.
+            # A dd element's end tag may be omitted if the dd element is
+            # immediately followed by another dd element or a dt element,
+            # or if there is no more content in the parent element.
+            if type == "StartTag":
+                return next["name"] in ('dt', 'dd')
+            elif tagname == 'dd':
+                return type == "EndTag" or type is None
+            else:
+                return False
+        elif tagname == 'p':
+            # A p element's end tag may be omitted if the p element is
+            # immediately followed by an address, article, aside,
+            # blockquote, datagrid, dialog, dir, div, dl, fieldset,
+            # footer, form, h1, h2, h3, h4, h5, h6, header, hr, menu,
+            # nav, ol, p, pre, section, table, or ul, element, or if
+            # there is no more content in the parent element.
+            if type in ("StartTag", "EmptyTag"):
+                return next["name"] in ('address', 'article', 'aside',
+                                        'blockquote', 'datagrid', 'dialog',
+                                        'dir', 'div', 'dl', 'fieldset', 'footer',
+                                        'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
+                                        'header', 'hr', 'menu', 'nav', 'ol',
+                                        'p', 'pre', 'section', 'table', 'ul')
+            else:
+                return type == "EndTag" or type is None
+        elif tagname == 'option':
+            # An option element's end tag may be omitted if the option
+            # element is immediately followed by another option element,
+            # or if it is immediately followed by an <code>optgroup</code>
+            # element, or if there is no more content in the parent
+            # element.
+            if type == "StartTag":
+                return next["name"] in ('option', 'optgroup')
+            else:
+                return type == "EndTag" or type is None
+        elif tagname in ('rt', 'rp'):
+            # An rt element's end tag may be omitted if the rt element is
+            # immediately followed by an rt or rp element, or if there is
+            # no more content in the parent element.
+            # An rp element's end tag may be omitted if the rp element is
+            # immediately followed by an rt or rp element, or if there is
+            # no more content in the parent element.
+            if type == "StartTag":
+                return next["name"] in ('rt', 'rp')
+            else:
+                return type == "EndTag" or type is None
+        elif tagname == 'colgroup':
+            # A colgroup element's end tag may be omitted if the colgroup
+            # element is not immediately followed by a space character or
+            # a comment.
+            if type in ("Comment", "SpaceCharacters"):
+                return False
+            elif type == "StartTag":
+                # XXX: we also look for an immediately following colgroup
+                # element. See is_optional_start.
+                return next["name"] != 'colgroup'
+            else:
+                return True
+        elif tagname in ('thead', 'tbody'):
+            # A thead element's end tag may be omitted if the thead element
+            # is immediately followed by a tbody or tfoot element.
+            # A tbody element's end tag may be omitted if the tbody element
+            # is immediately followed by a tbody or tfoot element, or if
+            # there is no more content in the parent element.
+            # A tfoot element's end tag may be omitted if the tfoot element
+            # is immediately followed by a tbody element, or if there is no
+            # more content in the parent element.
+            # XXX: we never omit the end tag when the following element is
+            # a tbody. See is_optional_start.
+            if type == "StartTag":
+                return next["name"] in ['tbody', 'tfoot']
+            elif tagname == 'tbody':
+                return type == "EndTag" or type is None
+            else:
+                return False
+        elif tagname == 'tfoot':
+            # A tfoot element's end tag may be omitted if the tfoot element
+            # is immediately followed by a tbody element, or if there is no
+            # more content in the parent element.
+            # XXX: we never omit the end tag when the following element is
+            # a tbody. See is_optional_start.
+            if type == "StartTag":
+                return next["name"] == 'tbody'
+            else:
+                return type == "EndTag" or type is None
+        elif tagname in ('td', 'th'):
+            # A td element's end tag may be omitted if the td element is
+            # immediately followed by a td or th element, or if there is
+            # no more content in the parent element.
+            # A th element's end tag may be omitted if the th element is
+            # immediately followed by a td or th element, or if there is
+            # no more content in the parent element.
+            if type == "StartTag":
+                return next["name"] in ('td', 'th')
+            else:
+                return type == "EndTag" or type is None
+        return False
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/sanitizer.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/sanitizer.py
new file mode 100644
index 0000000..b206b54e
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/sanitizer.py
@@ -0,0 +1,12 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from . import _base
+from ..sanitizer import HTMLSanitizerMixin
+
+
+class Filter(_base.Filter, HTMLSanitizerMixin):
+    def __iter__(self):
+        for token in _base.Filter.__iter__(self):
+            token = self.sanitize_token(token)
+            if token:
+                yield token
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/whitespace.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/whitespace.py
new file mode 100644
index 0000000..dfc60ee
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/filters/whitespace.py
@@ -0,0 +1,38 @@
+from __future__ import absolute_import, division, unicode_literals
+
+import re
+
+from . import _base
+from ..constants import rcdataElements, spaceCharacters
+spaceCharacters = "".join(spaceCharacters)
+
+SPACES_REGEX = re.compile("[%s]+" % spaceCharacters)
+
+
+class Filter(_base.Filter):
+
+    spacePreserveElements = frozenset(["pre", "textarea"] + list(rcdataElements))
+
+    def __iter__(self):
+        preserve = 0
+        for token in _base.Filter.__iter__(self):
+            type = token["type"]
+            if type == "StartTag" \
+                    and (preserve or token["name"] in self.spacePreserveElements):
+                preserve += 1
+
+            elif type == "EndTag" and preserve:
+                preserve -= 1
+
+            elif not preserve and type == "SpaceCharacters" and token["data"]:
+                # Test on token["data"] above to not introduce spaces where there were not
+                token["data"] = " "
+
+            elif not preserve and type == "Characters":
+                token["data"] = collapse_spaces(token["data"])
+
+            yield token
+
+
+def collapse_spaces(text):
+    return SPACES_REGEX.sub(' ', text)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/html5parser.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/html5parser.py
new file mode 100644
index 0000000..5b9ce7d7
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/html5parser.py
@@ -0,0 +1,2723 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import with_metaclass
+
+import types
+
+from . import inputstream
+from . import tokenizer
+
+from . import treebuilders
+from .treebuilders._base import Marker
+
+from . import utils
+from . import constants
+from .constants import spaceCharacters, asciiUpper2Lower
+from .constants import specialElements
+from .constants import headingElements
+from .constants import cdataElements, rcdataElements
+from .constants import tokenTypes, ReparseException, namespaces
+from .constants import htmlIntegrationPointElements, mathmlTextIntegrationPointElements
+from .constants import adjustForeignAttributes as adjustForeignAttributesMap
+
+
+def parse(doc, treebuilder="etree", encoding=None,
+          namespaceHTMLElements=True):
+    """Parse a string or file-like object into a tree"""
+    tb = treebuilders.getTreeBuilder(treebuilder)
+    p = HTMLParser(tb, namespaceHTMLElements=namespaceHTMLElements)
+    return p.parse(doc, encoding=encoding)
+
+
+def parseFragment(doc, container="div", treebuilder="etree", encoding=None,
+                  namespaceHTMLElements=True):
+    tb = treebuilders.getTreeBuilder(treebuilder)
+    p = HTMLParser(tb, namespaceHTMLElements=namespaceHTMLElements)
+    return p.parseFragment(doc, container=container, encoding=encoding)
+
+
+def method_decorator_metaclass(function):
+    class Decorated(type):
+        def __new__(meta, classname, bases, classDict):
+            for attributeName, attribute in classDict.items():
+                if isinstance(attribute, types.FunctionType):
+                    attribute = function(attribute)
+
+                classDict[attributeName] = attribute
+            return type.__new__(meta, classname, bases, classDict)
+    return Decorated
+
+
+class HTMLParser(object):
+    """HTML parser. Generates a tree structure from a stream of (possibly
+        malformed) HTML"""
+
+    def __init__(self, tree=None, tokenizer=tokenizer.HTMLTokenizer,
+                 strict=False, namespaceHTMLElements=True, debug=False):
+        """
+        strict - raise an exception when a parse error is encountered
+
+        tree - a treebuilder class controlling the type of tree that will be
+        returned. Built in treebuilders can be accessed through
+        html5lib.treebuilders.getTreeBuilder(treeType)
+
+        tokenizer - a class that provides a stream of tokens to the treebuilder.
+        This may be replaced for e.g. a sanitizer which converts some tags to
+        text
+        """
+
+        # Raise an exception on the first error encountered
+        self.strict = strict
+
+        if tree is None:
+            tree = treebuilders.getTreeBuilder("etree")
+        self.tree = tree(namespaceHTMLElements)
+        self.tokenizer_class = tokenizer
+        self.errors = []
+
+        self.phases = dict([(name, cls(self, self.tree)) for name, cls in
+                            getPhases(debug).items()])
+
+    def _parse(self, stream, innerHTML=False, container="div",
+               encoding=None, parseMeta=True, useChardet=True, **kwargs):
+
+        self.innerHTMLMode = innerHTML
+        self.container = container
+        self.tokenizer = self.tokenizer_class(stream, encoding=encoding,
+                                              parseMeta=parseMeta,
+                                              useChardet=useChardet,
+                                              parser=self, **kwargs)
+        self.reset()
+
+        while True:
+            try:
+                self.mainLoop()
+                break
+            except ReparseException:
+                self.reset()
+
+    def reset(self):
+        self.tree.reset()
+        self.firstStartTag = False
+        self.errors = []
+        self.log = []  # only used with debug mode
+        # "quirks" / "limited quirks" / "no quirks"
+        self.compatMode = "no quirks"
+
+        if self.innerHTMLMode:
+            self.innerHTML = self.container.lower()
+
+            if self.innerHTML in cdataElements:
+                self.tokenizer.state = self.tokenizer.rcdataState
+            elif self.innerHTML in rcdataElements:
+                self.tokenizer.state = self.tokenizer.rawtextState
+            elif self.innerHTML == 'plaintext':
+                self.tokenizer.state = self.tokenizer.plaintextState
+            else:
+                # state already is data state
+                # self.tokenizer.state = self.tokenizer.dataState
+                pass
+            self.phase = self.phases["beforeHtml"]
+            self.phase.insertHtmlElement()
+            self.resetInsertionMode()
+        else:
+            self.innerHTML = False
+            self.phase = self.phases["initial"]
+
+        self.lastPhase = None
+
+        self.beforeRCDataPhase = None
+
+        self.framesetOK = True
+
+    @property
+    def documentEncoding(self):
+        """The name of the character encoding
+        that was used to decode the input stream,
+        or :obj:`None` if that is not determined yet.
+
+        """
+        if not hasattr(self, 'tokenizer'):
+            return None
+        return self.tokenizer.stream.charEncoding[0]
+
+    def isHTMLIntegrationPoint(self, element):
+        if (element.name == "annotation-xml" and
+                element.namespace == namespaces["mathml"]):
+            return ("encoding" in element.attributes and
+                    element.attributes["encoding"].translate(
+                        asciiUpper2Lower) in
+                    ("text/html", "application/xhtml+xml"))
+        else:
+            return (element.namespace, element.name) in htmlIntegrationPointElements
+
+    def isMathMLTextIntegrationPoint(self, element):
+        return (element.namespace, element.name) in mathmlTextIntegrationPointElements
+
+    def mainLoop(self):
+        CharactersToken = tokenTypes["Characters"]
+        SpaceCharactersToken = tokenTypes["SpaceCharacters"]
+        StartTagToken = tokenTypes["StartTag"]
+        EndTagToken = tokenTypes["EndTag"]
+        CommentToken = tokenTypes["Comment"]
+        DoctypeToken = tokenTypes["Doctype"]
+        ParseErrorToken = tokenTypes["ParseError"]
+
+        for token in self.normalizedTokens():
+            new_token = token
+            while new_token is not None:
+                currentNode = self.tree.openElements[-1] if self.tree.openElements else None
+                currentNodeNamespace = currentNode.namespace if currentNode else None
+                currentNodeName = currentNode.name if currentNode else None
+
+                type = new_token["type"]
+
+                if type == ParseErrorToken:
+                    self.parseError(new_token["data"], new_token.get("datavars", {}))
+                    new_token = None
+                else:
+                    if (len(self.tree.openElements) == 0 or
+                        currentNodeNamespace == self.tree.defaultNamespace or
+                        (self.isMathMLTextIntegrationPoint(currentNode) and
+                         ((type == StartTagToken and
+                           token["name"] not in frozenset(["mglyph", "malignmark"])) or
+                          type in (CharactersToken, SpaceCharactersToken))) or
+                        (currentNodeNamespace == namespaces["mathml"] and
+                         currentNodeName == "annotation-xml" and
+                         token["name"] == "svg") or
+                        (self.isHTMLIntegrationPoint(currentNode) and
+                         type in (StartTagToken, CharactersToken, SpaceCharactersToken))):
+                        phase = self.phase
+                    else:
+                        phase = self.phases["inForeignContent"]
+
+                    if type == CharactersToken:
+                        new_token = phase.processCharacters(new_token)
+                    elif type == SpaceCharactersToken:
+                        new_token = phase.processSpaceCharacters(new_token)
+                    elif type == StartTagToken:
+                        new_token = phase.processStartTag(new_token)
+                    elif type == EndTagToken:
+                        new_token = phase.processEndTag(new_token)
+                    elif type == CommentToken:
+                        new_token = phase.processComment(new_token)
+                    elif type == DoctypeToken:
+                        new_token = phase.processDoctype(new_token)
+
+            if (type == StartTagToken and token["selfClosing"]
+                    and not token["selfClosingAcknowledged"]):
+                self.parseError("non-void-element-with-trailing-solidus",
+                                {"name": token["name"]})
+
+        # When the loop finishes it's EOF
+        reprocess = True
+        phases = []
+        while reprocess:
+            phases.append(self.phase)
+            reprocess = self.phase.processEOF()
+            if reprocess:
+                assert self.phase not in phases
+
+    def normalizedTokens(self):
+        for token in self.tokenizer:
+            yield self.normalizeToken(token)
+
+    def parse(self, stream, encoding=None, parseMeta=True, useChardet=True):
+        """Parse a HTML document into a well-formed tree
+
+        stream - a filelike object or string containing the HTML to be parsed
+
+        The optional encoding parameter must be a string that indicates
+        the encoding.  If specified, that encoding will be used,
+        regardless of any BOM or later declaration (such as in a meta
+        element)
+        """
+        self._parse(stream, innerHTML=False, encoding=encoding,
+                    parseMeta=parseMeta, useChardet=useChardet)
+        return self.tree.getDocument()
+
+    def parseFragment(self, stream, container="div", encoding=None,
+                      parseMeta=False, useChardet=True):
+        """Parse a HTML fragment into a well-formed tree fragment
+
+        container - name of the element we're setting the innerHTML property
+        if set to None, default to 'div'
+
+        stream - a filelike object or string containing the HTML to be parsed
+
+        The optional encoding parameter must be a string that indicates
+        the encoding.  If specified, that encoding will be used,
+        regardless of any BOM or later declaration (such as in a meta
+        element)
+        """
+        self._parse(stream, True, container=container, encoding=encoding)
+        return self.tree.getFragment()
+
+    def parseError(self, errorcode="XXX-undefined-error", datavars={}):
+        # XXX The idea is to make errorcode mandatory.
+        self.errors.append((self.tokenizer.stream.position(), errorcode, datavars))
+        if self.strict:
+            raise ParseError
+
+    def normalizeToken(self, token):
+        """ HTML5 specific normalizations to the token stream """
+
+        if token["type"] == tokenTypes["StartTag"]:
+            token["data"] = dict(token["data"][::-1])
+
+        return token
+
+    def adjustMathMLAttributes(self, token):
+        replacements = {"definitionurl": "definitionURL"}
+        for k, v in replacements.items():
+            if k in token["data"]:
+                token["data"][v] = token["data"][k]
+                del token["data"][k]
+
+    def adjustSVGAttributes(self, token):
+        replacements = {
+            "attributename": "attributeName",
+            "attributetype": "attributeType",
+            "basefrequency": "baseFrequency",
+            "baseprofile": "baseProfile",
+            "calcmode": "calcMode",
+            "clippathunits": "clipPathUnits",
+            "contentscripttype": "contentScriptType",
+            "contentstyletype": "contentStyleType",
+            "diffuseconstant": "diffuseConstant",
+            "edgemode": "edgeMode",
+            "externalresourcesrequired": "externalResourcesRequired",
+            "filterres": "filterRes",
+            "filterunits": "filterUnits",
+            "glyphref": "glyphRef",
+            "gradienttransform": "gradientTransform",
+            "gradientunits": "gradientUnits",
+            "kernelmatrix": "kernelMatrix",
+            "kernelunitlength": "kernelUnitLength",
+            "keypoints": "keyPoints",
+            "keysplines": "keySplines",
+            "keytimes": "keyTimes",
+            "lengthadjust": "lengthAdjust",
+            "limitingconeangle": "limitingConeAngle",
+            "markerheight": "markerHeight",
+            "markerunits": "markerUnits",
+            "markerwidth": "markerWidth",
+            "maskcontentunits": "maskContentUnits",
+            "maskunits": "maskUnits",
+            "numoctaves": "numOctaves",
+            "pathlength": "pathLength",
+            "patterncontentunits": "patternContentUnits",
+            "patterntransform": "patternTransform",
+            "patternunits": "patternUnits",
+            "pointsatx": "pointsAtX",
+            "pointsaty": "pointsAtY",
+            "pointsatz": "pointsAtZ",
+            "preservealpha": "preserveAlpha",
+            "preserveaspectratio": "preserveAspectRatio",
+            "primitiveunits": "primitiveUnits",
+            "refx": "refX",
+            "refy": "refY",
+            "repeatcount": "repeatCount",
+            "repeatdur": "repeatDur",
+            "requiredextensions": "requiredExtensions",
+            "requiredfeatures": "requiredFeatures",
+            "specularconstant": "specularConstant",
+            "specularexponent": "specularExponent",
+            "spreadmethod": "spreadMethod",
+            "startoffset": "startOffset",
+            "stddeviation": "stdDeviation",
+            "stitchtiles": "stitchTiles",
+            "surfacescale": "surfaceScale",
+            "systemlanguage": "systemLanguage",
+            "tablevalues": "tableValues",
+            "targetx": "targetX",
+            "targety": "targetY",
+            "textlength": "textLength",
+            "viewbox": "viewBox",
+            "viewtarget": "viewTarget",
+            "xchannelselector": "xChannelSelector",
+            "ychannelselector": "yChannelSelector",
+            "zoomandpan": "zoomAndPan"
+        }
+        for originalName in list(token["data"].keys()):
+            if originalName in replacements:
+                svgName = replacements[originalName]
+                token["data"][svgName] = token["data"][originalName]
+                del token["data"][originalName]
+
+    def adjustForeignAttributes(self, token):
+        replacements = adjustForeignAttributesMap
+
+        for originalName in token["data"].keys():
+            if originalName in replacements:
+                foreignName = replacements[originalName]
+                token["data"][foreignName] = token["data"][originalName]
+                del token["data"][originalName]
+
+    def reparseTokenNormal(self, token):
+        self.parser.phase()
+
+    def resetInsertionMode(self):
+        # The name of this method is mostly historical. (It's also used in the
+        # specification.)
+        last = False
+        newModes = {
+            "select": "inSelect",
+            "td": "inCell",
+            "th": "inCell",
+            "tr": "inRow",
+            "tbody": "inTableBody",
+            "thead": "inTableBody",
+            "tfoot": "inTableBody",
+            "caption": "inCaption",
+            "colgroup": "inColumnGroup",
+            "table": "inTable",
+            "head": "inBody",
+            "body": "inBody",
+            "frameset": "inFrameset",
+            "html": "beforeHead"
+        }
+        for node in self.tree.openElements[::-1]:
+            nodeName = node.name
+            new_phase = None
+            if node == self.tree.openElements[0]:
+                assert self.innerHTML
+                last = True
+                nodeName = self.innerHTML
+            # Check for conditions that should only happen in the innerHTML
+            # case
+            if nodeName in ("select", "colgroup", "head", "html"):
+                assert self.innerHTML
+
+            if not last and node.namespace != self.tree.defaultNamespace:
+                continue
+
+            if nodeName in newModes:
+                new_phase = self.phases[newModes[nodeName]]
+                break
+            elif last:
+                new_phase = self.phases["inBody"]
+                break
+
+        self.phase = new_phase
+
+    def parseRCDataRawtext(self, token, contentType):
+        """Generic RCDATA/RAWTEXT Parsing algorithm
+        contentType - RCDATA or RAWTEXT
+        """
+        assert contentType in ("RAWTEXT", "RCDATA")
+
+        self.tree.insertElement(token)
+
+        if contentType == "RAWTEXT":
+            self.tokenizer.state = self.tokenizer.rawtextState
+        else:
+            self.tokenizer.state = self.tokenizer.rcdataState
+
+        self.originalPhase = self.phase
+
+        self.phase = self.phases["text"]
+
+
+def getPhases(debug):
+    def log(function):
+        """Logger that records which phase processes each token"""
+        type_names = dict((value, key) for key, value in
+                          constants.tokenTypes.items())
+
+        def wrapped(self, *args, **kwargs):
+            if function.__name__.startswith("process") and len(args) > 0:
+                token = args[0]
+                try:
+                    info = {"type": type_names[token['type']]}
+                except:
+                    raise
+                if token['type'] in constants.tagTokenTypes:
+                    info["name"] = token['name']
+
+                self.parser.log.append((self.parser.tokenizer.state.__name__,
+                                        self.parser.phase.__class__.__name__,
+                                        self.__class__.__name__,
+                                        function.__name__,
+                                        info))
+                return function(self, *args, **kwargs)
+            else:
+                return function(self, *args, **kwargs)
+        return wrapped
+
+    def getMetaclass(use_metaclass, metaclass_func):
+        if use_metaclass:
+            return method_decorator_metaclass(metaclass_func)
+        else:
+            return type
+
+    class Phase(with_metaclass(getMetaclass(debug, log))):
+        """Base class for helper object that implements each phase of processing
+        """
+
+        def __init__(self, parser, tree):
+            self.parser = parser
+            self.tree = tree
+
+        def processEOF(self):
+            raise NotImplementedError
+
+        def processComment(self, token):
+            # For most phases the following is correct. Where it's not it will be
+            # overridden.
+            self.tree.insertComment(token, self.tree.openElements[-1])
+
+        def processDoctype(self, token):
+            self.parser.parseError("unexpected-doctype")
+
+        def processCharacters(self, token):
+            self.tree.insertText(token["data"])
+
+        def processSpaceCharacters(self, token):
+            self.tree.insertText(token["data"])
+
+        def processStartTag(self, token):
+            return self.startTagHandler[token["name"]](token)
+
+        def startTagHtml(self, token):
+            if not self.parser.firstStartTag and token["name"] == "html":
+                self.parser.parseError("non-html-root")
+            # XXX Need a check here to see if the first start tag token emitted is
+            # this token... If it's not, invoke self.parser.parseError().
+            for attr, value in token["data"].items():
+                if attr not in self.tree.openElements[0].attributes:
+                    self.tree.openElements[0].attributes[attr] = value
+            self.parser.firstStartTag = False
+
+        def processEndTag(self, token):
+            return self.endTagHandler[token["name"]](token)
+
+    class InitialPhase(Phase):
+        def processSpaceCharacters(self, token):
+            pass
+
+        def processComment(self, token):
+            self.tree.insertComment(token, self.tree.document)
+
+        def processDoctype(self, token):
+            name = token["name"]
+            publicId = token["publicId"]
+            systemId = token["systemId"]
+            correct = token["correct"]
+
+            if (name != "html" or publicId is not None or
+                    systemId is not None and systemId != "about:legacy-compat"):
+                self.parser.parseError("unknown-doctype")
+
+            if publicId is None:
+                publicId = ""
+
+            self.tree.insertDoctype(token)
+
+            if publicId != "":
+                publicId = publicId.translate(asciiUpper2Lower)
+
+            if (not correct or token["name"] != "html"
+                or publicId.startswith(
+                    ("+//silmaril//dtd html pro v0r11 19970101//",
+                     "-//advasoft ltd//dtd html 3.0 aswedit + extensions//",
+                     "-//as//dtd html 3.0 aswedit + extensions//",
+                     "-//ietf//dtd html 2.0 level 1//",
+                     "-//ietf//dtd html 2.0 level 2//",
+                     "-//ietf//dtd html 2.0 strict level 1//",
+                     "-//ietf//dtd html 2.0 strict level 2//",
+                     "-//ietf//dtd html 2.0 strict//",
+                     "-//ietf//dtd html 2.0//",
+                     "-//ietf//dtd html 2.1e//",
+                     "-//ietf//dtd html 3.0//",
+                     "-//ietf//dtd html 3.2 final//",
+                     "-//ietf//dtd html 3.2//",
+                     "-//ietf//dtd html 3//",
+                     "-//ietf//dtd html level 0//",
+                     "-//ietf//dtd html level 1//",
+                     "-//ietf//dtd html level 2//",
+                     "-//ietf//dtd html level 3//",
+                     "-//ietf//dtd html strict level 0//",
+                     "-//ietf//dtd html strict level 1//",
+                     "-//ietf//dtd html strict level 2//",
+                     "-//ietf//dtd html strict level 3//",
+                     "-//ietf//dtd html strict//",
+                     "-//ietf//dtd html//",
+                     "-//metrius//dtd metrius presentational//",
+                     "-//microsoft//dtd internet explorer 2.0 html strict//",
+                     "-//microsoft//dtd internet explorer 2.0 html//",
+                     "-//microsoft//dtd internet explorer 2.0 tables//",
+                     "-//microsoft//dtd internet explorer 3.0 html strict//",
+                     "-//microsoft//dtd internet explorer 3.0 html//",
+                     "-//microsoft//dtd internet explorer 3.0 tables//",
+                     "-//netscape comm. corp.//dtd html//",
+                     "-//netscape comm. corp.//dtd strict html//",
+                     "-//o'reilly and associates//dtd html 2.0//",
+                     "-//o'reilly and associates//dtd html extended 1.0//",
+                     "-//o'reilly and associates//dtd html extended relaxed 1.0//",
+                     "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//",
+                     "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//",
+                     "-//spyglass//dtd html 2.0 extended//",
+                     "-//sq//dtd html 2.0 hotmetal + extensions//",
+                     "-//sun microsystems corp.//dtd hotjava html//",
+                     "-//sun microsystems corp.//dtd hotjava strict html//",
+                     "-//w3c//dtd html 3 1995-03-24//",
+                     "-//w3c//dtd html 3.2 draft//",
+                     "-//w3c//dtd html 3.2 final//",
+                     "-//w3c//dtd html 3.2//",
+                     "-//w3c//dtd html 3.2s draft//",
+                     "-//w3c//dtd html 4.0 frameset//",
+                     "-//w3c//dtd html 4.0 transitional//",
+                     "-//w3c//dtd html experimental 19960712//",
+                     "-//w3c//dtd html experimental 970421//",
+                     "-//w3c//dtd w3 html//",
+                     "-//w3o//dtd w3 html 3.0//",
+                     "-//webtechs//dtd mozilla html 2.0//",
+                     "-//webtechs//dtd mozilla html//"))
+                or publicId in
+                    ("-//w3o//dtd w3 html strict 3.0//en//",
+                     "-/w3c/dtd html 4.0 transitional/en",
+                     "html")
+                or publicId.startswith(
+                    ("-//w3c//dtd html 4.01 frameset//",
+                     "-//w3c//dtd html 4.01 transitional//")) and
+                    systemId is None
+                    or systemId and systemId.lower() == "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd"):
+                self.parser.compatMode = "quirks"
+            elif (publicId.startswith(
+                    ("-//w3c//dtd xhtml 1.0 frameset//",
+                     "-//w3c//dtd xhtml 1.0 transitional//"))
+                  or publicId.startswith(
+                      ("-//w3c//dtd html 4.01 frameset//",
+                       "-//w3c//dtd html 4.01 transitional//")) and
+                  systemId is not None):
+                self.parser.compatMode = "limited quirks"
+
+            self.parser.phase = self.parser.phases["beforeHtml"]
+
+        def anythingElse(self):
+            self.parser.compatMode = "quirks"
+            self.parser.phase = self.parser.phases["beforeHtml"]
+
+        def processCharacters(self, token):
+            self.parser.parseError("expected-doctype-but-got-chars")
+            self.anythingElse()
+            return token
+
+        def processStartTag(self, token):
+            self.parser.parseError("expected-doctype-but-got-start-tag",
+                                   {"name": token["name"]})
+            self.anythingElse()
+            return token
+
+        def processEndTag(self, token):
+            self.parser.parseError("expected-doctype-but-got-end-tag",
+                                   {"name": token["name"]})
+            self.anythingElse()
+            return token
+
+        def processEOF(self):
+            self.parser.parseError("expected-doctype-but-got-eof")
+            self.anythingElse()
+            return True
+
+    class BeforeHtmlPhase(Phase):
+        # helper methods
+        def insertHtmlElement(self):
+            self.tree.insertRoot(impliedTagToken("html", "StartTag"))
+            self.parser.phase = self.parser.phases["beforeHead"]
+
+        # other
+        def processEOF(self):
+            self.insertHtmlElement()
+            return True
+
+        def processComment(self, token):
+            self.tree.insertComment(token, self.tree.document)
+
+        def processSpaceCharacters(self, token):
+            pass
+
+        def processCharacters(self, token):
+            self.insertHtmlElement()
+            return token
+
+        def processStartTag(self, token):
+            if token["name"] == "html":
+                self.parser.firstStartTag = True
+            self.insertHtmlElement()
+            return token
+
+        def processEndTag(self, token):
+            if token["name"] not in ("head", "body", "html", "br"):
+                self.parser.parseError("unexpected-end-tag-before-html",
+                                       {"name": token["name"]})
+            else:
+                self.insertHtmlElement()
+                return token
+
+    class BeforeHeadPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("head", self.startTagHead)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                (("head", "body", "html", "br"), self.endTagImplyHead)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def processEOF(self):
+            self.startTagHead(impliedTagToken("head", "StartTag"))
+            return True
+
+        def processSpaceCharacters(self, token):
+            pass
+
+        def processCharacters(self, token):
+            self.startTagHead(impliedTagToken("head", "StartTag"))
+            return token
+
+        def startTagHtml(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagHead(self, token):
+            self.tree.insertElement(token)
+            self.tree.headPointer = self.tree.openElements[-1]
+            self.parser.phase = self.parser.phases["inHead"]
+
+        def startTagOther(self, token):
+            self.startTagHead(impliedTagToken("head", "StartTag"))
+            return token
+
+        def endTagImplyHead(self, token):
+            self.startTagHead(impliedTagToken("head", "StartTag"))
+            return token
+
+        def endTagOther(self, token):
+            self.parser.parseError("end-tag-after-implied-root",
+                                   {"name": token["name"]})
+
+    class InHeadPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("title", self.startTagTitle),
+                (("noscript", "noframes", "style"), self.startTagNoScriptNoFramesStyle),
+                ("script", self.startTagScript),
+                (("base", "basefont", "bgsound", "command", "link"),
+                 self.startTagBaseLinkCommand),
+                ("meta", self.startTagMeta),
+                ("head", self.startTagHead)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self. endTagHandler = utils.MethodDispatcher([
+                ("head", self.endTagHead),
+                (("br", "html", "body"), self.endTagHtmlBodyBr)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        # the real thing
+        def processEOF(self):
+            self.anythingElse()
+            return True
+
+        def processCharacters(self, token):
+            self.anythingElse()
+            return token
+
+        def startTagHtml(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagHead(self, token):
+            self.parser.parseError("two-heads-are-not-better-than-one")
+
+        def startTagBaseLinkCommand(self, token):
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+            token["selfClosingAcknowledged"] = True
+
+        def startTagMeta(self, token):
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+            token["selfClosingAcknowledged"] = True
+
+            attributes = token["data"]
+            if self.parser.tokenizer.stream.charEncoding[1] == "tentative":
+                if "charset" in attributes:
+                    self.parser.tokenizer.stream.changeEncoding(attributes["charset"])
+                elif ("content" in attributes and
+                      "http-equiv" in attributes and
+                      attributes["http-equiv"].lower() == "content-type"):
+                    # Encoding it as UTF-8 here is a hack, as really we should pass
+                    # the abstract Unicode string, and just use the
+                    # ContentAttrParser on that, but using UTF-8 allows all chars
+                    # to be encoded and as a ASCII-superset works.
+                    data = inputstream.EncodingBytes(attributes["content"].encode("utf-8"))
+                    parser = inputstream.ContentAttrParser(data)
+                    codec = parser.parse()
+                    self.parser.tokenizer.stream.changeEncoding(codec)
+
+        def startTagTitle(self, token):
+            self.parser.parseRCDataRawtext(token, "RCDATA")
+
+        def startTagNoScriptNoFramesStyle(self, token):
+            # Need to decide whether to implement the scripting-disabled case
+            self.parser.parseRCDataRawtext(token, "RAWTEXT")
+
+        def startTagScript(self, token):
+            self.tree.insertElement(token)
+            self.parser.tokenizer.state = self.parser.tokenizer.scriptDataState
+            self.parser.originalPhase = self.parser.phase
+            self.parser.phase = self.parser.phases["text"]
+
+        def startTagOther(self, token):
+            self.anythingElse()
+            return token
+
+        def endTagHead(self, token):
+            node = self.parser.tree.openElements.pop()
+            assert node.name == "head", "Expected head got %s" % node.name
+            self.parser.phase = self.parser.phases["afterHead"]
+
+        def endTagHtmlBodyBr(self, token):
+            self.anythingElse()
+            return token
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+        def anythingElse(self):
+            self.endTagHead(impliedTagToken("head"))
+
+    # XXX If we implement a parser for which scripting is disabled we need to
+    # implement this phase.
+    #
+    # class InHeadNoScriptPhase(Phase):
+    class AfterHeadPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("body", self.startTagBody),
+                ("frameset", self.startTagFrameset),
+                (("base", "basefont", "bgsound", "link", "meta", "noframes", "script",
+                  "style", "title"),
+                 self.startTagFromHead),
+                ("head", self.startTagHead)
+            ])
+            self.startTagHandler.default = self.startTagOther
+            self.endTagHandler = utils.MethodDispatcher([(("body", "html", "br"),
+                                                          self.endTagHtmlBodyBr)])
+            self.endTagHandler.default = self.endTagOther
+
+        def processEOF(self):
+            self.anythingElse()
+            return True
+
+        def processCharacters(self, token):
+            self.anythingElse()
+            return token
+
+        def startTagHtml(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagBody(self, token):
+            self.parser.framesetOK = False
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inBody"]
+
+        def startTagFrameset(self, token):
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inFrameset"]
+
+        def startTagFromHead(self, token):
+            self.parser.parseError("unexpected-start-tag-out-of-my-head",
+                                   {"name": token["name"]})
+            self.tree.openElements.append(self.tree.headPointer)
+            self.parser.phases["inHead"].processStartTag(token)
+            for node in self.tree.openElements[::-1]:
+                if node.name == "head":
+                    self.tree.openElements.remove(node)
+                    break
+
+        def startTagHead(self, token):
+            self.parser.parseError("unexpected-start-tag", {"name": token["name"]})
+
+        def startTagOther(self, token):
+            self.anythingElse()
+            return token
+
+        def endTagHtmlBodyBr(self, token):
+            self.anythingElse()
+            return token
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+        def anythingElse(self):
+            self.tree.insertElement(impliedTagToken("body", "StartTag"))
+            self.parser.phase = self.parser.phases["inBody"]
+            self.parser.framesetOK = True
+
+    class InBodyPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#parsing-main-inbody
+        # the really-really-really-very crazy mode
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            # Keep a ref to this for special handling of whitespace in <pre>
+            self.processSpaceCharactersNonPre = self.processSpaceCharacters
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                (("base", "basefont", "bgsound", "command", "link", "meta",
+                  "noframes", "script", "style", "title"),
+                 self.startTagProcessInHead),
+                ("body", self.startTagBody),
+                ("frameset", self.startTagFrameset),
+                (("address", "article", "aside", "blockquote", "center", "details",
+                  "details", "dir", "div", "dl", "fieldset", "figcaption", "figure",
+                  "footer", "header", "hgroup", "main", "menu", "nav", "ol", "p",
+                  "section", "summary", "ul"),
+                 self.startTagCloseP),
+                (headingElements, self.startTagHeading),
+                (("pre", "listing"), self.startTagPreListing),
+                ("form", self.startTagForm),
+                (("li", "dd", "dt"), self.startTagListItem),
+                ("plaintext", self.startTagPlaintext),
+                ("a", self.startTagA),
+                (("b", "big", "code", "em", "font", "i", "s", "small", "strike",
+                  "strong", "tt", "u"), self.startTagFormatting),
+                ("nobr", self.startTagNobr),
+                ("button", self.startTagButton),
+                (("applet", "marquee", "object"), self.startTagAppletMarqueeObject),
+                ("xmp", self.startTagXmp),
+                ("table", self.startTagTable),
+                (("area", "br", "embed", "img", "keygen", "wbr"),
+                 self.startTagVoidFormatting),
+                (("param", "source", "track"), self.startTagParamSource),
+                ("input", self.startTagInput),
+                ("hr", self.startTagHr),
+                ("image", self.startTagImage),
+                ("isindex", self.startTagIsIndex),
+                ("textarea", self.startTagTextarea),
+                ("iframe", self.startTagIFrame),
+                (("noembed", "noframes", "noscript"), self.startTagRawtext),
+                ("select", self.startTagSelect),
+                (("rp", "rt"), self.startTagRpRt),
+                (("option", "optgroup"), self.startTagOpt),
+                (("math"), self.startTagMath),
+                (("svg"), self.startTagSvg),
+                (("caption", "col", "colgroup", "frame", "head",
+                  "tbody", "td", "tfoot", "th", "thead",
+                  "tr"), self.startTagMisplaced)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("body", self.endTagBody),
+                ("html", self.endTagHtml),
+                (("address", "article", "aside", "blockquote", "button", "center",
+                  "details", "dialog", "dir", "div", "dl", "fieldset", "figcaption", "figure",
+                  "footer", "header", "hgroup", "listing", "main", "menu", "nav", "ol", "pre",
+                  "section", "summary", "ul"), self.endTagBlock),
+                ("form", self.endTagForm),
+                ("p", self.endTagP),
+                (("dd", "dt", "li"), self.endTagListItem),
+                (headingElements, self.endTagHeading),
+                (("a", "b", "big", "code", "em", "font", "i", "nobr", "s", "small",
+                  "strike", "strong", "tt", "u"), self.endTagFormatting),
+                (("applet", "marquee", "object"), self.endTagAppletMarqueeObject),
+                ("br", self.endTagBr),
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def isMatchingFormattingElement(self, node1, node2):
+            if node1.name != node2.name or node1.namespace != node2.namespace:
+                return False
+            elif len(node1.attributes) != len(node2.attributes):
+                return False
+            else:
+                attributes1 = sorted(node1.attributes.items())
+                attributes2 = sorted(node2.attributes.items())
+                for attr1, attr2 in zip(attributes1, attributes2):
+                    if attr1 != attr2:
+                        return False
+            return True
+
+        # helper
+        def addFormattingElement(self, token):
+            self.tree.insertElement(token)
+            element = self.tree.openElements[-1]
+
+            matchingElements = []
+            for node in self.tree.activeFormattingElements[::-1]:
+                if node is Marker:
+                    break
+                elif self.isMatchingFormattingElement(node, element):
+                    matchingElements.append(node)
+
+            assert len(matchingElements) <= 3
+            if len(matchingElements) == 3:
+                self.tree.activeFormattingElements.remove(matchingElements[-1])
+            self.tree.activeFormattingElements.append(element)
+
+        # the real deal
+        def processEOF(self):
+            allowed_elements = frozenset(("dd", "dt", "li", "p", "tbody", "td",
+                                          "tfoot", "th", "thead", "tr", "body",
+                                          "html"))
+            for node in self.tree.openElements[::-1]:
+                if node.name not in allowed_elements:
+                    self.parser.parseError("expected-closing-tag-but-got-eof")
+                    break
+            # Stop parsing
+
+        def processSpaceCharactersDropNewline(self, token):
+            # Sometimes (start of <pre>, <listing>, and <textarea> blocks) we
+            # want to drop leading newlines
+            data = token["data"]
+            self.processSpaceCharacters = self.processSpaceCharactersNonPre
+            if (data.startswith("\n") and
+                self.tree.openElements[-1].name in ("pre", "listing", "textarea")
+                    and not self.tree.openElements[-1].hasContent()):
+                data = data[1:]
+            if data:
+                self.tree.reconstructActiveFormattingElements()
+                self.tree.insertText(data)
+
+        def processCharacters(self, token):
+            if token["data"] == "\u0000":
+                # The tokenizer should always emit null on its own
+                return
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertText(token["data"])
+            # This must be bad for performance
+            if (self.parser.framesetOK and
+                any([char not in spaceCharacters
+                     for char in token["data"]])):
+                self.parser.framesetOK = False
+
+        def processSpaceCharacters(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertText(token["data"])
+
+        def startTagProcessInHead(self, token):
+            return self.parser.phases["inHead"].processStartTag(token)
+
+        def startTagBody(self, token):
+            self.parser.parseError("unexpected-start-tag", {"name": "body"})
+            if (len(self.tree.openElements) == 1
+                    or self.tree.openElements[1].name != "body"):
+                assert self.parser.innerHTML
+            else:
+                self.parser.framesetOK = False
+                for attr, value in token["data"].items():
+                    if attr not in self.tree.openElements[1].attributes:
+                        self.tree.openElements[1].attributes[attr] = value
+
+        def startTagFrameset(self, token):
+            self.parser.parseError("unexpected-start-tag", {"name": "frameset"})
+            if (len(self.tree.openElements) == 1 or self.tree.openElements[1].name != "body"):
+                assert self.parser.innerHTML
+            elif not self.parser.framesetOK:
+                pass
+            else:
+                if self.tree.openElements[1].parent:
+                    self.tree.openElements[1].parent.removeChild(self.tree.openElements[1])
+                while self.tree.openElements[-1].name != "html":
+                    self.tree.openElements.pop()
+                self.tree.insertElement(token)
+                self.parser.phase = self.parser.phases["inFrameset"]
+
+        def startTagCloseP(self, token):
+            if self.tree.elementInScope("p", variant="button"):
+                self.endTagP(impliedTagToken("p"))
+            self.tree.insertElement(token)
+
+        def startTagPreListing(self, token):
+            if self.tree.elementInScope("p", variant="button"):
+                self.endTagP(impliedTagToken("p"))
+            self.tree.insertElement(token)
+            self.parser.framesetOK = False
+            self.processSpaceCharacters = self.processSpaceCharactersDropNewline
+
+        def startTagForm(self, token):
+            if self.tree.formPointer:
+                self.parser.parseError("unexpected-start-tag", {"name": "form"})
+            else:
+                if self.tree.elementInScope("p", variant="button"):
+                    self.endTagP(impliedTagToken("p"))
+                self.tree.insertElement(token)
+                self.tree.formPointer = self.tree.openElements[-1]
+
+        def startTagListItem(self, token):
+            self.parser.framesetOK = False
+
+            stopNamesMap = {"li": ["li"],
+                            "dt": ["dt", "dd"],
+                            "dd": ["dt", "dd"]}
+            stopNames = stopNamesMap[token["name"]]
+            for node in reversed(self.tree.openElements):
+                if node.name in stopNames:
+                    self.parser.phase.processEndTag(
+                        impliedTagToken(node.name, "EndTag"))
+                    break
+                if (node.nameTuple in specialElements and
+                        node.name not in ("address", "div", "p")):
+                    break
+
+            if self.tree.elementInScope("p", variant="button"):
+                self.parser.phase.processEndTag(
+                    impliedTagToken("p", "EndTag"))
+
+            self.tree.insertElement(token)
+
+        def startTagPlaintext(self, token):
+            if self.tree.elementInScope("p", variant="button"):
+                self.endTagP(impliedTagToken("p"))
+            self.tree.insertElement(token)
+            self.parser.tokenizer.state = self.parser.tokenizer.plaintextState
+
+        def startTagHeading(self, token):
+            if self.tree.elementInScope("p", variant="button"):
+                self.endTagP(impliedTagToken("p"))
+            if self.tree.openElements[-1].name in headingElements:
+                self.parser.parseError("unexpected-start-tag", {"name": token["name"]})
+                self.tree.openElements.pop()
+            self.tree.insertElement(token)
+
+        def startTagA(self, token):
+            afeAElement = self.tree.elementInActiveFormattingElements("a")
+            if afeAElement:
+                self.parser.parseError("unexpected-start-tag-implies-end-tag",
+                                       {"startName": "a", "endName": "a"})
+                self.endTagFormatting(impliedTagToken("a"))
+                if afeAElement in self.tree.openElements:
+                    self.tree.openElements.remove(afeAElement)
+                if afeAElement in self.tree.activeFormattingElements:
+                    self.tree.activeFormattingElements.remove(afeAElement)
+            self.tree.reconstructActiveFormattingElements()
+            self.addFormattingElement(token)
+
+        def startTagFormatting(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.addFormattingElement(token)
+
+        def startTagNobr(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            if self.tree.elementInScope("nobr"):
+                self.parser.parseError("unexpected-start-tag-implies-end-tag",
+                                       {"startName": "nobr", "endName": "nobr"})
+                self.processEndTag(impliedTagToken("nobr"))
+                # XXX Need tests that trigger the following
+                self.tree.reconstructActiveFormattingElements()
+            self.addFormattingElement(token)
+
+        def startTagButton(self, token):
+            if self.tree.elementInScope("button"):
+                self.parser.parseError("unexpected-start-tag-implies-end-tag",
+                                       {"startName": "button", "endName": "button"})
+                self.processEndTag(impliedTagToken("button"))
+                return token
+            else:
+                self.tree.reconstructActiveFormattingElements()
+                self.tree.insertElement(token)
+                self.parser.framesetOK = False
+
+        def startTagAppletMarqueeObject(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertElement(token)
+            self.tree.activeFormattingElements.append(Marker)
+            self.parser.framesetOK = False
+
+        def startTagXmp(self, token):
+            if self.tree.elementInScope("p", variant="button"):
+                self.endTagP(impliedTagToken("p"))
+            self.tree.reconstructActiveFormattingElements()
+            self.parser.framesetOK = False
+            self.parser.parseRCDataRawtext(token, "RAWTEXT")
+
+        def startTagTable(self, token):
+            if self.parser.compatMode != "quirks":
+                if self.tree.elementInScope("p", variant="button"):
+                    self.processEndTag(impliedTagToken("p"))
+            self.tree.insertElement(token)
+            self.parser.framesetOK = False
+            self.parser.phase = self.parser.phases["inTable"]
+
+        def startTagVoidFormatting(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+            token["selfClosingAcknowledged"] = True
+            self.parser.framesetOK = False
+
+        def startTagInput(self, token):
+            framesetOK = self.parser.framesetOK
+            self.startTagVoidFormatting(token)
+            if ("type" in token["data"] and
+                    token["data"]["type"].translate(asciiUpper2Lower) == "hidden"):
+                # input type=hidden doesn't change framesetOK
+                self.parser.framesetOK = framesetOK
+
+        def startTagParamSource(self, token):
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+            token["selfClosingAcknowledged"] = True
+
+        def startTagHr(self, token):
+            if self.tree.elementInScope("p", variant="button"):
+                self.endTagP(impliedTagToken("p"))
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+            token["selfClosingAcknowledged"] = True
+            self.parser.framesetOK = False
+
+        def startTagImage(self, token):
+            # No really...
+            self.parser.parseError("unexpected-start-tag-treated-as",
+                                   {"originalName": "image", "newName": "img"})
+            self.processStartTag(impliedTagToken("img", "StartTag",
+                                                 attributes=token["data"],
+                                                 selfClosing=token["selfClosing"]))
+
+        def startTagIsIndex(self, token):
+            self.parser.parseError("deprecated-tag", {"name": "isindex"})
+            if self.tree.formPointer:
+                return
+            form_attrs = {}
+            if "action" in token["data"]:
+                form_attrs["action"] = token["data"]["action"]
+            self.processStartTag(impliedTagToken("form", "StartTag",
+                                                 attributes=form_attrs))
+            self.processStartTag(impliedTagToken("hr", "StartTag"))
+            self.processStartTag(impliedTagToken("label", "StartTag"))
+            # XXX Localization ...
+            if "prompt" in token["data"]:
+                prompt = token["data"]["prompt"]
+            else:
+                prompt = "This is a searchable index. Enter search keywords: "
+            self.processCharacters(
+                {"type": tokenTypes["Characters"], "data": prompt})
+            attributes = token["data"].copy()
+            if "action" in attributes:
+                del attributes["action"]
+            if "prompt" in attributes:
+                del attributes["prompt"]
+            attributes["name"] = "isindex"
+            self.processStartTag(impliedTagToken("input", "StartTag",
+                                                 attributes=attributes,
+                                                 selfClosing=token["selfClosing"]))
+            self.processEndTag(impliedTagToken("label"))
+            self.processStartTag(impliedTagToken("hr", "StartTag"))
+            self.processEndTag(impliedTagToken("form"))
+
+        def startTagTextarea(self, token):
+            self.tree.insertElement(token)
+            self.parser.tokenizer.state = self.parser.tokenizer.rcdataState
+            self.processSpaceCharacters = self.processSpaceCharactersDropNewline
+            self.parser.framesetOK = False
+
+        def startTagIFrame(self, token):
+            self.parser.framesetOK = False
+            self.startTagRawtext(token)
+
+        def startTagRawtext(self, token):
+            """iframe, noembed noframes, noscript(if scripting enabled)"""
+            self.parser.parseRCDataRawtext(token, "RAWTEXT")
+
+        def startTagOpt(self, token):
+            if self.tree.openElements[-1].name == "option":
+                self.parser.phase.processEndTag(impliedTagToken("option"))
+            self.tree.reconstructActiveFormattingElements()
+            self.parser.tree.insertElement(token)
+
+        def startTagSelect(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertElement(token)
+            self.parser.framesetOK = False
+            if self.parser.phase in (self.parser.phases["inTable"],
+                                     self.parser.phases["inCaption"],
+                                     self.parser.phases["inColumnGroup"],
+                                     self.parser.phases["inTableBody"],
+                                     self.parser.phases["inRow"],
+                                     self.parser.phases["inCell"]):
+                self.parser.phase = self.parser.phases["inSelectInTable"]
+            else:
+                self.parser.phase = self.parser.phases["inSelect"]
+
+        def startTagRpRt(self, token):
+            if self.tree.elementInScope("ruby"):
+                self.tree.generateImpliedEndTags()
+                if self.tree.openElements[-1].name != "ruby":
+                    self.parser.parseError()
+            self.tree.insertElement(token)
+
+        def startTagMath(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.parser.adjustMathMLAttributes(token)
+            self.parser.adjustForeignAttributes(token)
+            token["namespace"] = namespaces["mathml"]
+            self.tree.insertElement(token)
+            # Need to get the parse error right for the case where the token
+            # has a namespace not equal to the xmlns attribute
+            if token["selfClosing"]:
+                self.tree.openElements.pop()
+                token["selfClosingAcknowledged"] = True
+
+        def startTagSvg(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.parser.adjustSVGAttributes(token)
+            self.parser.adjustForeignAttributes(token)
+            token["namespace"] = namespaces["svg"]
+            self.tree.insertElement(token)
+            # Need to get the parse error right for the case where the token
+            # has a namespace not equal to the xmlns attribute
+            if token["selfClosing"]:
+                self.tree.openElements.pop()
+                token["selfClosingAcknowledged"] = True
+
+        def startTagMisplaced(self, token):
+            """ Elements that should be children of other elements that have a
+            different insertion mode; here they are ignored
+            "caption", "col", "colgroup", "frame", "frameset", "head",
+            "option", "optgroup", "tbody", "td", "tfoot", "th", "thead",
+            "tr", "noscript"
+            """
+            self.parser.parseError("unexpected-start-tag-ignored", {"name": token["name"]})
+
+        def startTagOther(self, token):
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertElement(token)
+
+        def endTagP(self, token):
+            if not self.tree.elementInScope("p", variant="button"):
+                self.startTagCloseP(impliedTagToken("p", "StartTag"))
+                self.parser.parseError("unexpected-end-tag", {"name": "p"})
+                self.endTagP(impliedTagToken("p", "EndTag"))
+            else:
+                self.tree.generateImpliedEndTags("p")
+                if self.tree.openElements[-1].name != "p":
+                    self.parser.parseError("unexpected-end-tag", {"name": "p"})
+                node = self.tree.openElements.pop()
+                while node.name != "p":
+                    node = self.tree.openElements.pop()
+
+        def endTagBody(self, token):
+            if not self.tree.elementInScope("body"):
+                self.parser.parseError()
+                return
+            elif self.tree.openElements[-1].name != "body":
+                for node in self.tree.openElements[2:]:
+                    if node.name not in frozenset(("dd", "dt", "li", "optgroup",
+                                                   "option", "p", "rp", "rt",
+                                                   "tbody", "td", "tfoot",
+                                                   "th", "thead", "tr", "body",
+                                                   "html")):
+                        # Not sure this is the correct name for the parse error
+                        self.parser.parseError(
+                            "expected-one-end-tag-but-got-another",
+                            {"expectedName": "body", "gotName": node.name})
+                        break
+            self.parser.phase = self.parser.phases["afterBody"]
+
+        def endTagHtml(self, token):
+            # We repeat the test for the body end tag token being ignored here
+            if self.tree.elementInScope("body"):
+                self.endTagBody(impliedTagToken("body"))
+                return token
+
+        def endTagBlock(self, token):
+            # Put us back in the right whitespace handling mode
+            if token["name"] == "pre":
+                self.processSpaceCharacters = self.processSpaceCharactersNonPre
+            inScope = self.tree.elementInScope(token["name"])
+            if inScope:
+                self.tree.generateImpliedEndTags()
+            if self.tree.openElements[-1].name != token["name"]:
+                self.parser.parseError("end-tag-too-early", {"name": token["name"]})
+            if inScope:
+                node = self.tree.openElements.pop()
+                while node.name != token["name"]:
+                    node = self.tree.openElements.pop()
+
+        def endTagForm(self, token):
+            node = self.tree.formPointer
+            self.tree.formPointer = None
+            if node is None or not self.tree.elementInScope(node):
+                self.parser.parseError("unexpected-end-tag",
+                                       {"name": "form"})
+            else:
+                self.tree.generateImpliedEndTags()
+                if self.tree.openElements[-1] != node:
+                    self.parser.parseError("end-tag-too-early-ignored",
+                                           {"name": "form"})
+                self.tree.openElements.remove(node)
+
+        def endTagListItem(self, token):
+            if token["name"] == "li":
+                variant = "list"
+            else:
+                variant = None
+            if not self.tree.elementInScope(token["name"], variant=variant):
+                self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+            else:
+                self.tree.generateImpliedEndTags(exclude=token["name"])
+                if self.tree.openElements[-1].name != token["name"]:
+                    self.parser.parseError(
+                        "end-tag-too-early",
+                        {"name": token["name"]})
+                node = self.tree.openElements.pop()
+                while node.name != token["name"]:
+                    node = self.tree.openElements.pop()
+
+        def endTagHeading(self, token):
+            for item in headingElements:
+                if self.tree.elementInScope(item):
+                    self.tree.generateImpliedEndTags()
+                    break
+            if self.tree.openElements[-1].name != token["name"]:
+                self.parser.parseError("end-tag-too-early", {"name": token["name"]})
+
+            for item in headingElements:
+                if self.tree.elementInScope(item):
+                    item = self.tree.openElements.pop()
+                    while item.name not in headingElements:
+                        item = self.tree.openElements.pop()
+                    break
+
+        def endTagFormatting(self, token):
+            """The much-feared adoption agency algorithm"""
+            # http://svn.whatwg.org/webapps/complete.html#adoptionAgency revision 7867
+            # XXX Better parseError messages appreciated.
+
+            # Step 1
+            outerLoopCounter = 0
+
+            # Step 2
+            while outerLoopCounter < 8:
+
+                # Step 3
+                outerLoopCounter += 1
+
+                # Step 4:
+
+                # Let the formatting element be the last element in
+                # the list of active formatting elements that:
+                # - is between the end of the list and the last scope
+                # marker in the list, if any, or the start of the list
+                # otherwise, and
+                # - has the same tag name as the token.
+                formattingElement = self.tree.elementInActiveFormattingElements(
+                    token["name"])
+                if (not formattingElement or
+                    (formattingElement in self.tree.openElements and
+                     not self.tree.elementInScope(formattingElement.name))):
+                    # If there is no such node, then abort these steps
+                    # and instead act as described in the "any other
+                    # end tag" entry below.
+                    self.endTagOther(token)
+                    return
+
+                # Otherwise, if there is such a node, but that node is
+                # not in the stack of open elements, then this is a
+                # parse error; remove the element from the list, and
+                # abort these steps.
+                elif formattingElement not in self.tree.openElements:
+                    self.parser.parseError("adoption-agency-1.2", {"name": token["name"]})
+                    self.tree.activeFormattingElements.remove(formattingElement)
+                    return
+
+                # Otherwise, if there is such a node, and that node is
+                # also in the stack of open elements, but the element
+                # is not in scope, then this is a parse error; ignore
+                # the token, and abort these steps.
+                elif not self.tree.elementInScope(formattingElement.name):
+                    self.parser.parseError("adoption-agency-4.4", {"name": token["name"]})
+                    return
+
+                # Otherwise, there is a formatting element and that
+                # element is in the stack and is in scope. If the
+                # element is not the current node, this is a parse
+                # error. In any case, proceed with the algorithm as
+                # written in the following steps.
+                else:
+                    if formattingElement != self.tree.openElements[-1]:
+                        self.parser.parseError("adoption-agency-1.3", {"name": token["name"]})
+
+                # Step 5:
+
+                # Let the furthest block be the topmost node in the
+                # stack of open elements that is lower in the stack
+                # than the formatting element, and is an element in
+                # the special category. There might not be one.
+                afeIndex = self.tree.openElements.index(formattingElement)
+                furthestBlock = None
+                for element in self.tree.openElements[afeIndex:]:
+                    if element.nameTuple in specialElements:
+                        furthestBlock = element
+                        break
+
+                # Step 6:
+
+                # If there is no furthest block, then the UA must
+                # first pop all the nodes from the bottom of the stack
+                # of open elements, from the current node up to and
+                # including the formatting element, then remove the
+                # formatting element from the list of active
+                # formatting elements, and finally abort these steps.
+                if furthestBlock is None:
+                    element = self.tree.openElements.pop()
+                    while element != formattingElement:
+                        element = self.tree.openElements.pop()
+                    self.tree.activeFormattingElements.remove(element)
+                    return
+
+                # Step 7
+                commonAncestor = self.tree.openElements[afeIndex - 1]
+
+                # Step 8:
+                # The bookmark is supposed to help us identify where to reinsert
+                # nodes in step 15. We have to ensure that we reinsert nodes after
+                # the node before the active formatting element. Note the bookmark
+                # can move in step 9.7
+                bookmark = self.tree.activeFormattingElements.index(formattingElement)
+
+                # Step 9
+                lastNode = node = furthestBlock
+                innerLoopCounter = 0
+
+                index = self.tree.openElements.index(node)
+                while innerLoopCounter < 3:
+                    innerLoopCounter += 1
+                    # Node is element before node in open elements
+                    index -= 1
+                    node = self.tree.openElements[index]
+                    if node not in self.tree.activeFormattingElements:
+                        self.tree.openElements.remove(node)
+                        continue
+                    # Step 9.6
+                    if node == formattingElement:
+                        break
+                    # Step 9.7
+                    if lastNode == furthestBlock:
+                        bookmark = self.tree.activeFormattingElements.index(node) + 1
+                    # Step 9.8
+                    clone = node.cloneNode()
+                    # Replace node with clone
+                    self.tree.activeFormattingElements[
+                        self.tree.activeFormattingElements.index(node)] = clone
+                    self.tree.openElements[
+                        self.tree.openElements.index(node)] = clone
+                    node = clone
+                    # Step 9.9
+                    # Remove lastNode from its parents, if any
+                    if lastNode.parent:
+                        lastNode.parent.removeChild(lastNode)
+                    node.appendChild(lastNode)
+                    # Step 9.10
+                    lastNode = node
+
+                # Step 10
+                # Foster parent lastNode if commonAncestor is a
+                # table, tbody, tfoot, thead, or tr we need to foster
+                # parent the lastNode
+                if lastNode.parent:
+                    lastNode.parent.removeChild(lastNode)
+
+                if commonAncestor.name in frozenset(("table", "tbody", "tfoot", "thead", "tr")):
+                    parent, insertBefore = self.tree.getTableMisnestedNodePosition()
+                    parent.insertBefore(lastNode, insertBefore)
+                else:
+                    commonAncestor.appendChild(lastNode)
+
+                # Step 11
+                clone = formattingElement.cloneNode()
+
+                # Step 12
+                furthestBlock.reparentChildren(clone)
+
+                # Step 13
+                furthestBlock.appendChild(clone)
+
+                # Step 14
+                self.tree.activeFormattingElements.remove(formattingElement)
+                self.tree.activeFormattingElements.insert(bookmark, clone)
+
+                # Step 15
+                self.tree.openElements.remove(formattingElement)
+                self.tree.openElements.insert(
+                    self.tree.openElements.index(furthestBlock) + 1, clone)
+
+        def endTagAppletMarqueeObject(self, token):
+            if self.tree.elementInScope(token["name"]):
+                self.tree.generateImpliedEndTags()
+            if self.tree.openElements[-1].name != token["name"]:
+                self.parser.parseError("end-tag-too-early", {"name": token["name"]})
+
+            if self.tree.elementInScope(token["name"]):
+                element = self.tree.openElements.pop()
+                while element.name != token["name"]:
+                    element = self.tree.openElements.pop()
+                self.tree.clearActiveFormattingElements()
+
+        def endTagBr(self, token):
+            self.parser.parseError("unexpected-end-tag-treated-as",
+                                   {"originalName": "br", "newName": "br element"})
+            self.tree.reconstructActiveFormattingElements()
+            self.tree.insertElement(impliedTagToken("br", "StartTag"))
+            self.tree.openElements.pop()
+
+        def endTagOther(self, token):
+            for node in self.tree.openElements[::-1]:
+                if node.name == token["name"]:
+                    self.tree.generateImpliedEndTags(exclude=token["name"])
+                    if self.tree.openElements[-1].name != token["name"]:
+                        self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+                    while self.tree.openElements.pop() != node:
+                        pass
+                    break
+                else:
+                    if node.nameTuple in specialElements:
+                        self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+                        break
+
+    class TextPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+            self.startTagHandler = utils.MethodDispatcher([])
+            self.startTagHandler.default = self.startTagOther
+            self.endTagHandler = utils.MethodDispatcher([
+                ("script", self.endTagScript)])
+            self.endTagHandler.default = self.endTagOther
+
+        def processCharacters(self, token):
+            self.tree.insertText(token["data"])
+
+        def processEOF(self):
+            self.parser.parseError("expected-named-closing-tag-but-got-eof",
+                                   {"name": self.tree.openElements[-1].name})
+            self.tree.openElements.pop()
+            self.parser.phase = self.parser.originalPhase
+            return True
+
+        def startTagOther(self, token):
+            assert False, "Tried to process start tag %s in RCDATA/RAWTEXT mode" % token['name']
+
+        def endTagScript(self, token):
+            node = self.tree.openElements.pop()
+            assert node.name == "script"
+            self.parser.phase = self.parser.originalPhase
+            # The rest of this method is all stuff that only happens if
+            # document.write works
+
+        def endTagOther(self, token):
+            self.tree.openElements.pop()
+            self.parser.phase = self.parser.originalPhase
+
+    class InTablePhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-table
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("caption", self.startTagCaption),
+                ("colgroup", self.startTagColgroup),
+                ("col", self.startTagCol),
+                (("tbody", "tfoot", "thead"), self.startTagRowGroup),
+                (("td", "th", "tr"), self.startTagImplyTbody),
+                ("table", self.startTagTable),
+                (("style", "script"), self.startTagStyleScript),
+                ("input", self.startTagInput),
+                ("form", self.startTagForm)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("table", self.endTagTable),
+                (("body", "caption", "col", "colgroup", "html", "tbody", "td",
+                  "tfoot", "th", "thead", "tr"), self.endTagIgnore)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        # helper methods
+        def clearStackToTableContext(self):
+            # "clear the stack back to a table context"
+            while self.tree.openElements[-1].name not in ("table", "html"):
+                # self.parser.parseError("unexpected-implied-end-tag-in-table",
+                #  {"name":  self.tree.openElements[-1].name})
+                self.tree.openElements.pop()
+            # When the current node is <html> it's an innerHTML case
+
+        # processing methods
+        def processEOF(self):
+            if self.tree.openElements[-1].name != "html":
+                self.parser.parseError("eof-in-table")
+            else:
+                assert self.parser.innerHTML
+            # Stop parsing
+
+        def processSpaceCharacters(self, token):
+            originalPhase = self.parser.phase
+            self.parser.phase = self.parser.phases["inTableText"]
+            self.parser.phase.originalPhase = originalPhase
+            self.parser.phase.processSpaceCharacters(token)
+
+        def processCharacters(self, token):
+            originalPhase = self.parser.phase
+            self.parser.phase = self.parser.phases["inTableText"]
+            self.parser.phase.originalPhase = originalPhase
+            self.parser.phase.processCharacters(token)
+
+        def insertText(self, token):
+            # If we get here there must be at least one non-whitespace character
+            # Do the table magic!
+            self.tree.insertFromTable = True
+            self.parser.phases["inBody"].processCharacters(token)
+            self.tree.insertFromTable = False
+
+        def startTagCaption(self, token):
+            self.clearStackToTableContext()
+            self.tree.activeFormattingElements.append(Marker)
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inCaption"]
+
+        def startTagColgroup(self, token):
+            self.clearStackToTableContext()
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inColumnGroup"]
+
+        def startTagCol(self, token):
+            self.startTagColgroup(impliedTagToken("colgroup", "StartTag"))
+            return token
+
+        def startTagRowGroup(self, token):
+            self.clearStackToTableContext()
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inTableBody"]
+
+        def startTagImplyTbody(self, token):
+            self.startTagRowGroup(impliedTagToken("tbody", "StartTag"))
+            return token
+
+        def startTagTable(self, token):
+            self.parser.parseError("unexpected-start-tag-implies-end-tag",
+                                   {"startName": "table", "endName": "table"})
+            self.parser.phase.processEndTag(impliedTagToken("table"))
+            if not self.parser.innerHTML:
+                return token
+
+        def startTagStyleScript(self, token):
+            return self.parser.phases["inHead"].processStartTag(token)
+
+        def startTagInput(self, token):
+            if ("type" in token["data"] and
+                    token["data"]["type"].translate(asciiUpper2Lower) == "hidden"):
+                self.parser.parseError("unexpected-hidden-input-in-table")
+                self.tree.insertElement(token)
+                # XXX associate with form
+                self.tree.openElements.pop()
+            else:
+                self.startTagOther(token)
+
+        def startTagForm(self, token):
+            self.parser.parseError("unexpected-form-in-table")
+            if self.tree.formPointer is None:
+                self.tree.insertElement(token)
+                self.tree.formPointer = self.tree.openElements[-1]
+                self.tree.openElements.pop()
+
+        def startTagOther(self, token):
+            self.parser.parseError("unexpected-start-tag-implies-table-voodoo", {"name": token["name"]})
+            # Do the table magic!
+            self.tree.insertFromTable = True
+            self.parser.phases["inBody"].processStartTag(token)
+            self.tree.insertFromTable = False
+
+        def endTagTable(self, token):
+            if self.tree.elementInScope("table", variant="table"):
+                self.tree.generateImpliedEndTags()
+                if self.tree.openElements[-1].name != "table":
+                    self.parser.parseError("end-tag-too-early-named",
+                                           {"gotName": "table",
+                                            "expectedName": self.tree.openElements[-1].name})
+                while self.tree.openElements[-1].name != "table":
+                    self.tree.openElements.pop()
+                self.tree.openElements.pop()
+                self.parser.resetInsertionMode()
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def endTagIgnore(self, token):
+            self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag-implies-table-voodoo", {"name": token["name"]})
+            # Do the table magic!
+            self.tree.insertFromTable = True
+            self.parser.phases["inBody"].processEndTag(token)
+            self.tree.insertFromTable = False
+
+    class InTableTextPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+            self.originalPhase = None
+            self.characterTokens = []
+
+        def flushCharacters(self):
+            data = "".join([item["data"] for item in self.characterTokens])
+            if any([item not in spaceCharacters for item in data]):
+                token = {"type": tokenTypes["Characters"], "data": data}
+                self.parser.phases["inTable"].insertText(token)
+            elif data:
+                self.tree.insertText(data)
+            self.characterTokens = []
+
+        def processComment(self, token):
+            self.flushCharacters()
+            self.parser.phase = self.originalPhase
+            return token
+
+        def processEOF(self):
+            self.flushCharacters()
+            self.parser.phase = self.originalPhase
+            return True
+
+        def processCharacters(self, token):
+            if token["data"] == "\u0000":
+                return
+            self.characterTokens.append(token)
+
+        def processSpaceCharacters(self, token):
+            # pretty sure we should never reach here
+            self.characterTokens.append(token)
+    #        assert False
+
+        def processStartTag(self, token):
+            self.flushCharacters()
+            self.parser.phase = self.originalPhase
+            return token
+
+        def processEndTag(self, token):
+            self.flushCharacters()
+            self.parser.phase = self.originalPhase
+            return token
+
+    class InCaptionPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-caption
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                (("caption", "col", "colgroup", "tbody", "td", "tfoot", "th",
+                  "thead", "tr"), self.startTagTableElement)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("caption", self.endTagCaption),
+                ("table", self.endTagTable),
+                (("body", "col", "colgroup", "html", "tbody", "td", "tfoot", "th",
+                  "thead", "tr"), self.endTagIgnore)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def ignoreEndTagCaption(self):
+            return not self.tree.elementInScope("caption", variant="table")
+
+        def processEOF(self):
+            self.parser.phases["inBody"].processEOF()
+
+        def processCharacters(self, token):
+            return self.parser.phases["inBody"].processCharacters(token)
+
+        def startTagTableElement(self, token):
+            self.parser.parseError()
+            # XXX Have to duplicate logic here to find out if the tag is ignored
+            ignoreEndTag = self.ignoreEndTagCaption()
+            self.parser.phase.processEndTag(impliedTagToken("caption"))
+            if not ignoreEndTag:
+                return token
+
+        def startTagOther(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def endTagCaption(self, token):
+            if not self.ignoreEndTagCaption():
+                # AT this code is quite similar to endTagTable in "InTable"
+                self.tree.generateImpliedEndTags()
+                if self.tree.openElements[-1].name != "caption":
+                    self.parser.parseError("expected-one-end-tag-but-got-another",
+                                           {"gotName": "caption",
+                                            "expectedName": self.tree.openElements[-1].name})
+                while self.tree.openElements[-1].name != "caption":
+                    self.tree.openElements.pop()
+                self.tree.openElements.pop()
+                self.tree.clearActiveFormattingElements()
+                self.parser.phase = self.parser.phases["inTable"]
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def endTagTable(self, token):
+            self.parser.parseError()
+            ignoreEndTag = self.ignoreEndTagCaption()
+            self.parser.phase.processEndTag(impliedTagToken("caption"))
+            if not ignoreEndTag:
+                return token
+
+        def endTagIgnore(self, token):
+            self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+        def endTagOther(self, token):
+            return self.parser.phases["inBody"].processEndTag(token)
+
+    class InColumnGroupPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-column
+
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("col", self.startTagCol)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("colgroup", self.endTagColgroup),
+                ("col", self.endTagCol)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def ignoreEndTagColgroup(self):
+            return self.tree.openElements[-1].name == "html"
+
+        def processEOF(self):
+            if self.tree.openElements[-1].name == "html":
+                assert self.parser.innerHTML
+                return
+            else:
+                ignoreEndTag = self.ignoreEndTagColgroup()
+                self.endTagColgroup(impliedTagToken("colgroup"))
+                if not ignoreEndTag:
+                    return True
+
+        def processCharacters(self, token):
+            ignoreEndTag = self.ignoreEndTagColgroup()
+            self.endTagColgroup(impliedTagToken("colgroup"))
+            if not ignoreEndTag:
+                return token
+
+        def startTagCol(self, token):
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+
+        def startTagOther(self, token):
+            ignoreEndTag = self.ignoreEndTagColgroup()
+            self.endTagColgroup(impliedTagToken("colgroup"))
+            if not ignoreEndTag:
+                return token
+
+        def endTagColgroup(self, token):
+            if self.ignoreEndTagColgroup():
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+            else:
+                self.tree.openElements.pop()
+                self.parser.phase = self.parser.phases["inTable"]
+
+        def endTagCol(self, token):
+            self.parser.parseError("no-end-tag", {"name": "col"})
+
+        def endTagOther(self, token):
+            ignoreEndTag = self.ignoreEndTagColgroup()
+            self.endTagColgroup(impliedTagToken("colgroup"))
+            if not ignoreEndTag:
+                return token
+
+    class InTableBodyPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-table0
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("tr", self.startTagTr),
+                (("td", "th"), self.startTagTableCell),
+                (("caption", "col", "colgroup", "tbody", "tfoot", "thead"),
+                 self.startTagTableOther)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                (("tbody", "tfoot", "thead"), self.endTagTableRowGroup),
+                ("table", self.endTagTable),
+                (("body", "caption", "col", "colgroup", "html", "td", "th",
+                  "tr"), self.endTagIgnore)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        # helper methods
+        def clearStackToTableBodyContext(self):
+            while self.tree.openElements[-1].name not in ("tbody", "tfoot",
+                                                          "thead", "html"):
+                # self.parser.parseError("unexpected-implied-end-tag-in-table",
+                #  {"name": self.tree.openElements[-1].name})
+                self.tree.openElements.pop()
+            if self.tree.openElements[-1].name == "html":
+                assert self.parser.innerHTML
+
+        # the rest
+        def processEOF(self):
+            self.parser.phases["inTable"].processEOF()
+
+        def processSpaceCharacters(self, token):
+            return self.parser.phases["inTable"].processSpaceCharacters(token)
+
+        def processCharacters(self, token):
+            return self.parser.phases["inTable"].processCharacters(token)
+
+        def startTagTr(self, token):
+            self.clearStackToTableBodyContext()
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inRow"]
+
+        def startTagTableCell(self, token):
+            self.parser.parseError("unexpected-cell-in-table-body",
+                                   {"name": token["name"]})
+            self.startTagTr(impliedTagToken("tr", "StartTag"))
+            return token
+
+        def startTagTableOther(self, token):
+            # XXX AT Any ideas on how to share this with endTagTable?
+            if (self.tree.elementInScope("tbody", variant="table") or
+                self.tree.elementInScope("thead", variant="table") or
+                    self.tree.elementInScope("tfoot", variant="table")):
+                self.clearStackToTableBodyContext()
+                self.endTagTableRowGroup(
+                    impliedTagToken(self.tree.openElements[-1].name))
+                return token
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def startTagOther(self, token):
+            return self.parser.phases["inTable"].processStartTag(token)
+
+        def endTagTableRowGroup(self, token):
+            if self.tree.elementInScope(token["name"], variant="table"):
+                self.clearStackToTableBodyContext()
+                self.tree.openElements.pop()
+                self.parser.phase = self.parser.phases["inTable"]
+            else:
+                self.parser.parseError("unexpected-end-tag-in-table-body",
+                                       {"name": token["name"]})
+
+        def endTagTable(self, token):
+            if (self.tree.elementInScope("tbody", variant="table") or
+                self.tree.elementInScope("thead", variant="table") or
+                    self.tree.elementInScope("tfoot", variant="table")):
+                self.clearStackToTableBodyContext()
+                self.endTagTableRowGroup(
+                    impliedTagToken(self.tree.openElements[-1].name))
+                return token
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def endTagIgnore(self, token):
+            self.parser.parseError("unexpected-end-tag-in-table-body",
+                                   {"name": token["name"]})
+
+        def endTagOther(self, token):
+            return self.parser.phases["inTable"].processEndTag(token)
+
+    class InRowPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-row
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                (("td", "th"), self.startTagTableCell),
+                (("caption", "col", "colgroup", "tbody", "tfoot", "thead",
+                  "tr"), self.startTagTableOther)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("tr", self.endTagTr),
+                ("table", self.endTagTable),
+                (("tbody", "tfoot", "thead"), self.endTagTableRowGroup),
+                (("body", "caption", "col", "colgroup", "html", "td", "th"),
+                 self.endTagIgnore)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        # helper methods (XXX unify this with other table helper methods)
+        def clearStackToTableRowContext(self):
+            while self.tree.openElements[-1].name not in ("tr", "html"):
+                self.parser.parseError("unexpected-implied-end-tag-in-table-row",
+                                       {"name": self.tree.openElements[-1].name})
+                self.tree.openElements.pop()
+
+        def ignoreEndTagTr(self):
+            return not self.tree.elementInScope("tr", variant="table")
+
+        # the rest
+        def processEOF(self):
+            self.parser.phases["inTable"].processEOF()
+
+        def processSpaceCharacters(self, token):
+            return self.parser.phases["inTable"].processSpaceCharacters(token)
+
+        def processCharacters(self, token):
+            return self.parser.phases["inTable"].processCharacters(token)
+
+        def startTagTableCell(self, token):
+            self.clearStackToTableRowContext()
+            self.tree.insertElement(token)
+            self.parser.phase = self.parser.phases["inCell"]
+            self.tree.activeFormattingElements.append(Marker)
+
+        def startTagTableOther(self, token):
+            ignoreEndTag = self.ignoreEndTagTr()
+            self.endTagTr(impliedTagToken("tr"))
+            # XXX how are we sure it's always ignored in the innerHTML case?
+            if not ignoreEndTag:
+                return token
+
+        def startTagOther(self, token):
+            return self.parser.phases["inTable"].processStartTag(token)
+
+        def endTagTr(self, token):
+            if not self.ignoreEndTagTr():
+                self.clearStackToTableRowContext()
+                self.tree.openElements.pop()
+                self.parser.phase = self.parser.phases["inTableBody"]
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def endTagTable(self, token):
+            ignoreEndTag = self.ignoreEndTagTr()
+            self.endTagTr(impliedTagToken("tr"))
+            # Reprocess the current tag if the tr end tag was not ignored
+            # XXX how are we sure it's always ignored in the innerHTML case?
+            if not ignoreEndTag:
+                return token
+
+        def endTagTableRowGroup(self, token):
+            if self.tree.elementInScope(token["name"], variant="table"):
+                self.endTagTr(impliedTagToken("tr"))
+                return token
+            else:
+                self.parser.parseError()
+
+        def endTagIgnore(self, token):
+            self.parser.parseError("unexpected-end-tag-in-table-row",
+                                   {"name": token["name"]})
+
+        def endTagOther(self, token):
+            return self.parser.phases["inTable"].processEndTag(token)
+
+    class InCellPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-cell
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                (("caption", "col", "colgroup", "tbody", "td", "tfoot", "th",
+                  "thead", "tr"), self.startTagTableOther)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                (("td", "th"), self.endTagTableCell),
+                (("body", "caption", "col", "colgroup", "html"), self.endTagIgnore),
+                (("table", "tbody", "tfoot", "thead", "tr"), self.endTagImply)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        # helper
+        def closeCell(self):
+            if self.tree.elementInScope("td", variant="table"):
+                self.endTagTableCell(impliedTagToken("td"))
+            elif self.tree.elementInScope("th", variant="table"):
+                self.endTagTableCell(impliedTagToken("th"))
+
+        # the rest
+        def processEOF(self):
+            self.parser.phases["inBody"].processEOF()
+
+        def processCharacters(self, token):
+            return self.parser.phases["inBody"].processCharacters(token)
+
+        def startTagTableOther(self, token):
+            if (self.tree.elementInScope("td", variant="table") or
+                    self.tree.elementInScope("th", variant="table")):
+                self.closeCell()
+                return token
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def startTagOther(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def endTagTableCell(self, token):
+            if self.tree.elementInScope(token["name"], variant="table"):
+                self.tree.generateImpliedEndTags(token["name"])
+                if self.tree.openElements[-1].name != token["name"]:
+                    self.parser.parseError("unexpected-cell-end-tag",
+                                           {"name": token["name"]})
+                    while True:
+                        node = self.tree.openElements.pop()
+                        if node.name == token["name"]:
+                            break
+                else:
+                    self.tree.openElements.pop()
+                self.tree.clearActiveFormattingElements()
+                self.parser.phase = self.parser.phases["inRow"]
+            else:
+                self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+        def endTagIgnore(self, token):
+            self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+        def endTagImply(self, token):
+            if self.tree.elementInScope(token["name"], variant="table"):
+                self.closeCell()
+                return token
+            else:
+                # sometimes innerHTML case
+                self.parser.parseError()
+
+        def endTagOther(self, token):
+            return self.parser.phases["inBody"].processEndTag(token)
+
+    class InSelectPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("option", self.startTagOption),
+                ("optgroup", self.startTagOptgroup),
+                ("select", self.startTagSelect),
+                (("input", "keygen", "textarea"), self.startTagInput),
+                ("script", self.startTagScript)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("option", self.endTagOption),
+                ("optgroup", self.endTagOptgroup),
+                ("select", self.endTagSelect)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-select
+        def processEOF(self):
+            if self.tree.openElements[-1].name != "html":
+                self.parser.parseError("eof-in-select")
+            else:
+                assert self.parser.innerHTML
+
+        def processCharacters(self, token):
+            if token["data"] == "\u0000":
+                return
+            self.tree.insertText(token["data"])
+
+        def startTagOption(self, token):
+            # We need to imply </option> if <option> is the current node.
+            if self.tree.openElements[-1].name == "option":
+                self.tree.openElements.pop()
+            self.tree.insertElement(token)
+
+        def startTagOptgroup(self, token):
+            if self.tree.openElements[-1].name == "option":
+                self.tree.openElements.pop()
+            if self.tree.openElements[-1].name == "optgroup":
+                self.tree.openElements.pop()
+            self.tree.insertElement(token)
+
+        def startTagSelect(self, token):
+            self.parser.parseError("unexpected-select-in-select")
+            self.endTagSelect(impliedTagToken("select"))
+
+        def startTagInput(self, token):
+            self.parser.parseError("unexpected-input-in-select")
+            if self.tree.elementInScope("select", variant="select"):
+                self.endTagSelect(impliedTagToken("select"))
+                return token
+            else:
+                assert self.parser.innerHTML
+
+        def startTagScript(self, token):
+            return self.parser.phases["inHead"].processStartTag(token)
+
+        def startTagOther(self, token):
+            self.parser.parseError("unexpected-start-tag-in-select",
+                                   {"name": token["name"]})
+
+        def endTagOption(self, token):
+            if self.tree.openElements[-1].name == "option":
+                self.tree.openElements.pop()
+            else:
+                self.parser.parseError("unexpected-end-tag-in-select",
+                                       {"name": "option"})
+
+        def endTagOptgroup(self, token):
+            # </optgroup> implicitly closes <option>
+            if (self.tree.openElements[-1].name == "option" and
+                    self.tree.openElements[-2].name == "optgroup"):
+                self.tree.openElements.pop()
+            # It also closes </optgroup>
+            if self.tree.openElements[-1].name == "optgroup":
+                self.tree.openElements.pop()
+            # But nothing else
+            else:
+                self.parser.parseError("unexpected-end-tag-in-select",
+                                       {"name": "optgroup"})
+
+        def endTagSelect(self, token):
+            if self.tree.elementInScope("select", variant="select"):
+                node = self.tree.openElements.pop()
+                while node.name != "select":
+                    node = self.tree.openElements.pop()
+                self.parser.resetInsertionMode()
+            else:
+                # innerHTML case
+                assert self.parser.innerHTML
+                self.parser.parseError()
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag-in-select",
+                                   {"name": token["name"]})
+
+    class InSelectInTablePhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                (("caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th"),
+                 self.startTagTable)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                (("caption", "table", "tbody", "tfoot", "thead", "tr", "td", "th"),
+                 self.endTagTable)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def processEOF(self):
+            self.parser.phases["inSelect"].processEOF()
+
+        def processCharacters(self, token):
+            return self.parser.phases["inSelect"].processCharacters(token)
+
+        def startTagTable(self, token):
+            self.parser.parseError("unexpected-table-element-start-tag-in-select-in-table", {"name": token["name"]})
+            self.endTagOther(impliedTagToken("select"))
+            return token
+
+        def startTagOther(self, token):
+            return self.parser.phases["inSelect"].processStartTag(token)
+
+        def endTagTable(self, token):
+            self.parser.parseError("unexpected-table-element-end-tag-in-select-in-table", {"name": token["name"]})
+            if self.tree.elementInScope(token["name"], variant="table"):
+                self.endTagOther(impliedTagToken("select"))
+                return token
+
+        def endTagOther(self, token):
+            return self.parser.phases["inSelect"].processEndTag(token)
+
+    class InForeignContentPhase(Phase):
+        breakoutElements = frozenset(["b", "big", "blockquote", "body", "br",
+                                      "center", "code", "dd", "div", "dl", "dt",
+                                      "em", "embed", "h1", "h2", "h3",
+                                      "h4", "h5", "h6", "head", "hr", "i", "img",
+                                      "li", "listing", "menu", "meta", "nobr",
+                                      "ol", "p", "pre", "ruby", "s", "small",
+                                      "span", "strong", "strike", "sub", "sup",
+                                      "table", "tt", "u", "ul", "var"])
+
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+        def adjustSVGTagNames(self, token):
+            replacements = {"altglyph": "altGlyph",
+                            "altglyphdef": "altGlyphDef",
+                            "altglyphitem": "altGlyphItem",
+                            "animatecolor": "animateColor",
+                            "animatemotion": "animateMotion",
+                            "animatetransform": "animateTransform",
+                            "clippath": "clipPath",
+                            "feblend": "feBlend",
+                            "fecolormatrix": "feColorMatrix",
+                            "fecomponenttransfer": "feComponentTransfer",
+                            "fecomposite": "feComposite",
+                            "feconvolvematrix": "feConvolveMatrix",
+                            "fediffuselighting": "feDiffuseLighting",
+                            "fedisplacementmap": "feDisplacementMap",
+                            "fedistantlight": "feDistantLight",
+                            "feflood": "feFlood",
+                            "fefunca": "feFuncA",
+                            "fefuncb": "feFuncB",
+                            "fefuncg": "feFuncG",
+                            "fefuncr": "feFuncR",
+                            "fegaussianblur": "feGaussianBlur",
+                            "feimage": "feImage",
+                            "femerge": "feMerge",
+                            "femergenode": "feMergeNode",
+                            "femorphology": "feMorphology",
+                            "feoffset": "feOffset",
+                            "fepointlight": "fePointLight",
+                            "fespecularlighting": "feSpecularLighting",
+                            "fespotlight": "feSpotLight",
+                            "fetile": "feTile",
+                            "feturbulence": "feTurbulence",
+                            "foreignobject": "foreignObject",
+                            "glyphref": "glyphRef",
+                            "lineargradient": "linearGradient",
+                            "radialgradient": "radialGradient",
+                            "textpath": "textPath"}
+
+            if token["name"] in replacements:
+                token["name"] = replacements[token["name"]]
+
+        def processCharacters(self, token):
+            if token["data"] == "\u0000":
+                token["data"] = "\uFFFD"
+            elif (self.parser.framesetOK and
+                  any(char not in spaceCharacters for char in token["data"])):
+                self.parser.framesetOK = False
+            Phase.processCharacters(self, token)
+
+        def processStartTag(self, token):
+            currentNode = self.tree.openElements[-1]
+            if (token["name"] in self.breakoutElements or
+                (token["name"] == "font" and
+                 set(token["data"].keys()) & set(["color", "face", "size"]))):
+                self.parser.parseError("unexpected-html-element-in-foreign-content",
+                                       {"name": token["name"]})
+                while (self.tree.openElements[-1].namespace !=
+                       self.tree.defaultNamespace and
+                       not self.parser.isHTMLIntegrationPoint(self.tree.openElements[-1]) and
+                       not self.parser.isMathMLTextIntegrationPoint(self.tree.openElements[-1])):
+                    self.tree.openElements.pop()
+                return token
+
+            else:
+                if currentNode.namespace == namespaces["mathml"]:
+                    self.parser.adjustMathMLAttributes(token)
+                elif currentNode.namespace == namespaces["svg"]:
+                    self.adjustSVGTagNames(token)
+                    self.parser.adjustSVGAttributes(token)
+                self.parser.adjustForeignAttributes(token)
+                token["namespace"] = currentNode.namespace
+                self.tree.insertElement(token)
+                if token["selfClosing"]:
+                    self.tree.openElements.pop()
+                    token["selfClosingAcknowledged"] = True
+
+        def processEndTag(self, token):
+            nodeIndex = len(self.tree.openElements) - 1
+            node = self.tree.openElements[-1]
+            if node.name != token["name"]:
+                self.parser.parseError("unexpected-end-tag", {"name": token["name"]})
+
+            while True:
+                if node.name.translate(asciiUpper2Lower) == token["name"]:
+                    # XXX this isn't in the spec but it seems necessary
+                    if self.parser.phase == self.parser.phases["inTableText"]:
+                        self.parser.phase.flushCharacters()
+                        self.parser.phase = self.parser.phase.originalPhase
+                    while self.tree.openElements.pop() != node:
+                        assert self.tree.openElements
+                    new_token = None
+                    break
+                nodeIndex -= 1
+
+                node = self.tree.openElements[nodeIndex]
+                if node.namespace != self.tree.defaultNamespace:
+                    continue
+                else:
+                    new_token = self.parser.phase.processEndTag(token)
+                    break
+            return new_token
+
+    class AfterBodyPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([("html", self.endTagHtml)])
+            self.endTagHandler.default = self.endTagOther
+
+        def processEOF(self):
+            # Stop parsing
+            pass
+
+        def processComment(self, token):
+            # This is needed because data is to be appended to the <html> element
+            # here and not to whatever is currently open.
+            self.tree.insertComment(token, self.tree.openElements[0])
+
+        def processCharacters(self, token):
+            self.parser.parseError("unexpected-char-after-body")
+            self.parser.phase = self.parser.phases["inBody"]
+            return token
+
+        def startTagHtml(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagOther(self, token):
+            self.parser.parseError("unexpected-start-tag-after-body",
+                                   {"name": token["name"]})
+            self.parser.phase = self.parser.phases["inBody"]
+            return token
+
+        def endTagHtml(self, name):
+            if self.parser.innerHTML:
+                self.parser.parseError("unexpected-end-tag-after-body-innerhtml")
+            else:
+                self.parser.phase = self.parser.phases["afterAfterBody"]
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag-after-body",
+                                   {"name": token["name"]})
+            self.parser.phase = self.parser.phases["inBody"]
+            return token
+
+    class InFramesetPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#in-frameset
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("frameset", self.startTagFrameset),
+                ("frame", self.startTagFrame),
+                ("noframes", self.startTagNoframes)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("frameset", self.endTagFrameset)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def processEOF(self):
+            if self.tree.openElements[-1].name != "html":
+                self.parser.parseError("eof-in-frameset")
+            else:
+                assert self.parser.innerHTML
+
+        def processCharacters(self, token):
+            self.parser.parseError("unexpected-char-in-frameset")
+
+        def startTagFrameset(self, token):
+            self.tree.insertElement(token)
+
+        def startTagFrame(self, token):
+            self.tree.insertElement(token)
+            self.tree.openElements.pop()
+
+        def startTagNoframes(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagOther(self, token):
+            self.parser.parseError("unexpected-start-tag-in-frameset",
+                                   {"name": token["name"]})
+
+        def endTagFrameset(self, token):
+            if self.tree.openElements[-1].name == "html":
+                # innerHTML case
+                self.parser.parseError("unexpected-frameset-in-frameset-innerhtml")
+            else:
+                self.tree.openElements.pop()
+            if (not self.parser.innerHTML and
+                    self.tree.openElements[-1].name != "frameset"):
+                # If we're not in innerHTML mode and the the current node is not a
+                # "frameset" element (anymore) then switch.
+                self.parser.phase = self.parser.phases["afterFrameset"]
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag-in-frameset",
+                                   {"name": token["name"]})
+
+    class AfterFramesetPhase(Phase):
+        # http://www.whatwg.org/specs/web-apps/current-work/#after3
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("noframes", self.startTagNoframes)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+            self.endTagHandler = utils.MethodDispatcher([
+                ("html", self.endTagHtml)
+            ])
+            self.endTagHandler.default = self.endTagOther
+
+        def processEOF(self):
+            # Stop parsing
+            pass
+
+        def processCharacters(self, token):
+            self.parser.parseError("unexpected-char-after-frameset")
+
+        def startTagNoframes(self, token):
+            return self.parser.phases["inHead"].processStartTag(token)
+
+        def startTagOther(self, token):
+            self.parser.parseError("unexpected-start-tag-after-frameset",
+                                   {"name": token["name"]})
+
+        def endTagHtml(self, token):
+            self.parser.phase = self.parser.phases["afterAfterFrameset"]
+
+        def endTagOther(self, token):
+            self.parser.parseError("unexpected-end-tag-after-frameset",
+                                   {"name": token["name"]})
+
+    class AfterAfterBodyPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+        def processEOF(self):
+            pass
+
+        def processComment(self, token):
+            self.tree.insertComment(token, self.tree.document)
+
+        def processSpaceCharacters(self, token):
+            return self.parser.phases["inBody"].processSpaceCharacters(token)
+
+        def processCharacters(self, token):
+            self.parser.parseError("expected-eof-but-got-char")
+            self.parser.phase = self.parser.phases["inBody"]
+            return token
+
+        def startTagHtml(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagOther(self, token):
+            self.parser.parseError("expected-eof-but-got-start-tag",
+                                   {"name": token["name"]})
+            self.parser.phase = self.parser.phases["inBody"]
+            return token
+
+        def processEndTag(self, token):
+            self.parser.parseError("expected-eof-but-got-end-tag",
+                                   {"name": token["name"]})
+            self.parser.phase = self.parser.phases["inBody"]
+            return token
+
+    class AfterAfterFramesetPhase(Phase):
+        def __init__(self, parser, tree):
+            Phase.__init__(self, parser, tree)
+
+            self.startTagHandler = utils.MethodDispatcher([
+                ("html", self.startTagHtml),
+                ("noframes", self.startTagNoFrames)
+            ])
+            self.startTagHandler.default = self.startTagOther
+
+        def processEOF(self):
+            pass
+
+        def processComment(self, token):
+            self.tree.insertComment(token, self.tree.document)
+
+        def processSpaceCharacters(self, token):
+            return self.parser.phases["inBody"].processSpaceCharacters(token)
+
+        def processCharacters(self, token):
+            self.parser.parseError("expected-eof-but-got-char")
+
+        def startTagHtml(self, token):
+            return self.parser.phases["inBody"].processStartTag(token)
+
+        def startTagNoFrames(self, token):
+            return self.parser.phases["inHead"].processStartTag(token)
+
+        def startTagOther(self, token):
+            self.parser.parseError("expected-eof-but-got-start-tag",
+                                   {"name": token["name"]})
+
+        def processEndTag(self, token):
+            self.parser.parseError("expected-eof-but-got-end-tag",
+                                   {"name": token["name"]})
+
+    return {
+        "initial": InitialPhase,
+        "beforeHtml": BeforeHtmlPhase,
+        "beforeHead": BeforeHeadPhase,
+        "inHead": InHeadPhase,
+        # XXX "inHeadNoscript": InHeadNoScriptPhase,
+        "afterHead": AfterHeadPhase,
+        "inBody": InBodyPhase,
+        "text": TextPhase,
+        "inTable": InTablePhase,
+        "inTableText": InTableTextPhase,
+        "inCaption": InCaptionPhase,
+        "inColumnGroup": InColumnGroupPhase,
+        "inTableBody": InTableBodyPhase,
+        "inRow": InRowPhase,
+        "inCell": InCellPhase,
+        "inSelect": InSelectPhase,
+        "inSelectInTable": InSelectInTablePhase,
+        "inForeignContent": InForeignContentPhase,
+        "afterBody": AfterBodyPhase,
+        "inFrameset": InFramesetPhase,
+        "afterFrameset": AfterFramesetPhase,
+        "afterAfterBody": AfterAfterBodyPhase,
+        "afterAfterFrameset": AfterAfterFramesetPhase,
+        # XXX after after frameset
+    }
+
+
+def impliedTagToken(name, type="EndTag", attributes=None,
+                    selfClosing=False):
+    if attributes is None:
+        attributes = {}
+    return {"type": tokenTypes[type], "name": name, "data": attributes,
+            "selfClosing": selfClosing}
+
+
+class ParseError(Exception):
+    """Error in parsed document"""
+    pass
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/ihatexml.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/ihatexml.py
new file mode 100644
index 0000000..0fc79308
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/ihatexml.py
@@ -0,0 +1,285 @@
+from __future__ import absolute_import, division, unicode_literals
+
+import re
+import warnings
+
+from .constants import DataLossWarning
+
+baseChar = """
+[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
+[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
+[#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] |
+[#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 |
+[#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] |
+[#x03D0-#x03D6] | #x03DA | #x03DC | #x03DE | #x03E0 | [#x03E2-#x03F3] |
+[#x0401-#x040C] | [#x040E-#x044F] | [#x0451-#x045C] | [#x045E-#x0481] |
+[#x0490-#x04C4] | [#x04C7-#x04C8] | [#x04CB-#x04CC] | [#x04D0-#x04EB] |
+[#x04EE-#x04F5] | [#x04F8-#x04F9] | [#x0531-#x0556] | #x0559 |
+[#x0561-#x0586] | [#x05D0-#x05EA] | [#x05F0-#x05F2] | [#x0621-#x063A] |
+[#x0641-#x064A] | [#x0671-#x06B7] | [#x06BA-#x06BE] | [#x06C0-#x06CE] |
+[#x06D0-#x06D3] | #x06D5 | [#x06E5-#x06E6] | [#x0905-#x0939] | #x093D |
+[#x0958-#x0961] | [#x0985-#x098C] | [#x098F-#x0990] | [#x0993-#x09A8] |
+[#x09AA-#x09B0] | #x09B2 | [#x09B6-#x09B9] | [#x09DC-#x09DD] |
+[#x09DF-#x09E1] | [#x09F0-#x09F1] | [#x0A05-#x0A0A] | [#x0A0F-#x0A10] |
+[#x0A13-#x0A28] | [#x0A2A-#x0A30] | [#x0A32-#x0A33] | [#x0A35-#x0A36] |
+[#x0A38-#x0A39] | [#x0A59-#x0A5C] | #x0A5E | [#x0A72-#x0A74] |
+[#x0A85-#x0A8B] | #x0A8D | [#x0A8F-#x0A91] | [#x0A93-#x0AA8] |
+[#x0AAA-#x0AB0] | [#x0AB2-#x0AB3] | [#x0AB5-#x0AB9] | #x0ABD | #x0AE0 |
+[#x0B05-#x0B0C] | [#x0B0F-#x0B10] | [#x0B13-#x0B28] | [#x0B2A-#x0B30] |
+[#x0B32-#x0B33] | [#x0B36-#x0B39] | #x0B3D | [#x0B5C-#x0B5D] |
+[#x0B5F-#x0B61] | [#x0B85-#x0B8A] | [#x0B8E-#x0B90] | [#x0B92-#x0B95] |
+[#x0B99-#x0B9A] | #x0B9C | [#x0B9E-#x0B9F] | [#x0BA3-#x0BA4] |
+[#x0BA8-#x0BAA] | [#x0BAE-#x0BB5] | [#x0BB7-#x0BB9] | [#x0C05-#x0C0C] |
+[#x0C0E-#x0C10] | [#x0C12-#x0C28] | [#x0C2A-#x0C33] | [#x0C35-#x0C39] |
+[#x0C60-#x0C61] | [#x0C85-#x0C8C] | [#x0C8E-#x0C90] | [#x0C92-#x0CA8] |
+[#x0CAA-#x0CB3] | [#x0CB5-#x0CB9] | #x0CDE | [#x0CE0-#x0CE1] |
+[#x0D05-#x0D0C] | [#x0D0E-#x0D10] | [#x0D12-#x0D28] | [#x0D2A-#x0D39] |
+[#x0D60-#x0D61] | [#x0E01-#x0E2E] | #x0E30 | [#x0E32-#x0E33] |
+[#x0E40-#x0E45] | [#x0E81-#x0E82] | #x0E84 | [#x0E87-#x0E88] | #x0E8A |
+#x0E8D | [#x0E94-#x0E97] | [#x0E99-#x0E9F] | [#x0EA1-#x0EA3] | #x0EA5 |
+#x0EA7 | [#x0EAA-#x0EAB] | [#x0EAD-#x0EAE] | #x0EB0 | [#x0EB2-#x0EB3] |
+#x0EBD | [#x0EC0-#x0EC4] | [#x0F40-#x0F47] | [#x0F49-#x0F69] |
+[#x10A0-#x10C5] | [#x10D0-#x10F6] | #x1100 | [#x1102-#x1103] |
+[#x1105-#x1107] | #x1109 | [#x110B-#x110C] | [#x110E-#x1112] | #x113C |
+#x113E | #x1140 | #x114C | #x114E | #x1150 | [#x1154-#x1155] | #x1159 |
+[#x115F-#x1161] | #x1163 | #x1165 | #x1167 | #x1169 | [#x116D-#x116E] |
+[#x1172-#x1173] | #x1175 | #x119E | #x11A8 | #x11AB | [#x11AE-#x11AF] |
+[#x11B7-#x11B8] | #x11BA | [#x11BC-#x11C2] | #x11EB | #x11F0 | #x11F9 |
+[#x1E00-#x1E9B] | [#x1EA0-#x1EF9] | [#x1F00-#x1F15] | [#x1F18-#x1F1D] |
+[#x1F20-#x1F45] | [#x1F48-#x1F4D] | [#x1F50-#x1F57] | #x1F59 | #x1F5B |
+#x1F5D | [#x1F5F-#x1F7D] | [#x1F80-#x1FB4] | [#x1FB6-#x1FBC] | #x1FBE |
+[#x1FC2-#x1FC4] | [#x1FC6-#x1FCC] | [#x1FD0-#x1FD3] | [#x1FD6-#x1FDB] |
+[#x1FE0-#x1FEC] | [#x1FF2-#x1FF4] | [#x1FF6-#x1FFC] | #x2126 |
+[#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] |
+[#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]"""
+
+ideographic = """[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]"""
+
+combiningCharacter = """
+[#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] |
+[#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 |
+[#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] |
+[#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] |
+#x093C | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] |
+[#x0981-#x0983] | #x09BC | #x09BE | #x09BF | [#x09C0-#x09C4] |
+[#x09C7-#x09C8] | [#x09CB-#x09CD] | #x09D7 | [#x09E2-#x09E3] | #x0A02 |
+#x0A3C | #x0A3E | #x0A3F | [#x0A40-#x0A42] | [#x0A47-#x0A48] |
+[#x0A4B-#x0A4D] | [#x0A70-#x0A71] | [#x0A81-#x0A83] | #x0ABC |
+[#x0ABE-#x0AC5] | [#x0AC7-#x0AC9] | [#x0ACB-#x0ACD] | [#x0B01-#x0B03] |
+#x0B3C | [#x0B3E-#x0B43] | [#x0B47-#x0B48] | [#x0B4B-#x0B4D] |
+[#x0B56-#x0B57] | [#x0B82-#x0B83] | [#x0BBE-#x0BC2] | [#x0BC6-#x0BC8] |
+[#x0BCA-#x0BCD] | #x0BD7 | [#x0C01-#x0C03] | [#x0C3E-#x0C44] |
+[#x0C46-#x0C48] | [#x0C4A-#x0C4D] | [#x0C55-#x0C56] | [#x0C82-#x0C83] |
+[#x0CBE-#x0CC4] | [#x0CC6-#x0CC8] | [#x0CCA-#x0CCD] | [#x0CD5-#x0CD6] |
+[#x0D02-#x0D03] | [#x0D3E-#x0D43] | [#x0D46-#x0D48] | [#x0D4A-#x0D4D] |
+#x0D57 | #x0E31 | [#x0E34-#x0E3A] | [#x0E47-#x0E4E] | #x0EB1 |
+[#x0EB4-#x0EB9] | [#x0EBB-#x0EBC] | [#x0EC8-#x0ECD] | [#x0F18-#x0F19] |
+#x0F35 | #x0F37 | #x0F39 | #x0F3E | #x0F3F | [#x0F71-#x0F84] |
+[#x0F86-#x0F8B] | [#x0F90-#x0F95] | #x0F97 | [#x0F99-#x0FAD] |
+[#x0FB1-#x0FB7] | #x0FB9 | [#x20D0-#x20DC] | #x20E1 | [#x302A-#x302F] |
+#x3099 | #x309A"""
+
+digit = """
+[#x0030-#x0039] | [#x0660-#x0669] | [#x06F0-#x06F9] | [#x0966-#x096F] |
+[#x09E6-#x09EF] | [#x0A66-#x0A6F] | [#x0AE6-#x0AEF] | [#x0B66-#x0B6F] |
+[#x0BE7-#x0BEF] | [#x0C66-#x0C6F] | [#x0CE6-#x0CEF] | [#x0D66-#x0D6F] |
+[#x0E50-#x0E59] | [#x0ED0-#x0ED9] | [#x0F20-#x0F29]"""
+
+extender = """
+#x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 | #x0E46 | #x0EC6 | #x3005 |
+#[#x3031-#x3035] | [#x309D-#x309E] | [#x30FC-#x30FE]"""
+
+letter = " | ".join([baseChar, ideographic])
+
+# Without the
+name = " | ".join([letter, digit, ".", "-", "_", combiningCharacter,
+                   extender])
+nameFirst = " | ".join([letter, "_"])
+
+reChar = re.compile(r"#x([\d|A-F]{4,4})")
+reCharRange = re.compile(r"\[#x([\d|A-F]{4,4})-#x([\d|A-F]{4,4})\]")
+
+
+def charStringToList(chars):
+    charRanges = [item.strip() for item in chars.split(" | ")]
+    rv = []
+    for item in charRanges:
+        foundMatch = False
+        for regexp in (reChar, reCharRange):
+            match = regexp.match(item)
+            if match is not None:
+                rv.append([hexToInt(item) for item in match.groups()])
+                if len(rv[-1]) == 1:
+                    rv[-1] = rv[-1] * 2
+                foundMatch = True
+                break
+        if not foundMatch:
+            assert len(item) == 1
+
+            rv.append([ord(item)] * 2)
+    rv = normaliseCharList(rv)
+    return rv
+
+
+def normaliseCharList(charList):
+    charList = sorted(charList)
+    for item in charList:
+        assert item[1] >= item[0]
+    rv = []
+    i = 0
+    while i < len(charList):
+        j = 1
+        rv.append(charList[i])
+        while i + j < len(charList) and charList[i + j][0] <= rv[-1][1] + 1:
+            rv[-1][1] = charList[i + j][1]
+            j += 1
+        i += j
+    return rv
+
+# We don't really support characters above the BMP :(
+max_unicode = int("FFFF", 16)
+
+
+def missingRanges(charList):
+    rv = []
+    if charList[0] != 0:
+        rv.append([0, charList[0][0] - 1])
+    for i, item in enumerate(charList[:-1]):
+        rv.append([item[1] + 1, charList[i + 1][0] - 1])
+    if charList[-1][1] != max_unicode:
+        rv.append([charList[-1][1] + 1, max_unicode])
+    return rv
+
+
+def listToRegexpStr(charList):
+    rv = []
+    for item in charList:
+        if item[0] == item[1]:
+            rv.append(escapeRegexp(chr(item[0])))
+        else:
+            rv.append(escapeRegexp(chr(item[0])) + "-" +
+                      escapeRegexp(chr(item[1])))
+    return "[%s]" % "".join(rv)
+
+
+def hexToInt(hex_str):
+    return int(hex_str, 16)
+
+
+def escapeRegexp(string):
+    specialCharacters = (".", "^", "$", "*", "+", "?", "{", "}",
+                         "[", "]", "|", "(", ")", "-")
+    for char in specialCharacters:
+        string = string.replace(char, "\\" + char)
+
+    return string
+
+# output from the above
+nonXmlNameBMPRegexp = re.compile('[\x00-,/:-@\\[-\\^`\\{-\xb6\xb8-\xbf\xd7\xf7\u0132-\u0133\u013f-\u0140\u0149\u017f\u01c4-\u01cc\u01f1-\u01f3\u01f6-\u01f9\u0218-\u024f\u02a9-\u02ba\u02c2-\u02cf\u02d2-\u02ff\u0346-\u035f\u0362-\u0385\u038b\u038d\u03a2\u03cf\u03d7-\u03d9\u03db\u03dd\u03df\u03e1\u03f4-\u0400\u040d\u0450\u045d\u0482\u0487-\u048f\u04c5-\u04c6\u04c9-\u04ca\u04cd-\u04cf\u04ec-\u04ed\u04f6-\u04f7\u04fa-\u0530\u0557-\u0558\u055a-\u0560\u0587-\u0590\u05a2\u05ba\u05be\u05c0\u05c3\u05c5-\u05cf\u05eb-\u05ef\u05f3-\u0620\u063b-\u063f\u0653-\u065f\u066a-\u066f\u06b8-\u06b9\u06bf\u06cf\u06d4\u06e9\u06ee-\u06ef\u06fa-\u0900\u0904\u093a-\u093b\u094e-\u0950\u0955-\u0957\u0964-\u0965\u0970-\u0980\u0984\u098d-\u098e\u0991-\u0992\u09a9\u09b1\u09b3-\u09b5\u09ba-\u09bb\u09bd\u09c5-\u09c6\u09c9-\u09ca\u09ce-\u09d6\u09d8-\u09db\u09de\u09e4-\u09e5\u09f2-\u0a01\u0a03-\u0a04\u0a0b-\u0a0e\u0a11-\u0a12\u0a29\u0a31\u0a34\u0a37\u0a3a-\u0a3b\u0a3d\u0a43-\u0a46\u0a49-\u0a4a\u0a4e-\u0a58\u0a5d\u0a5f-\u0a65\u0a75-\u0a80\u0a84\u0a8c\u0a8e\u0a92\u0aa9\u0ab1\u0ab4\u0aba-\u0abb\u0ac6\u0aca\u0ace-\u0adf\u0ae1-\u0ae5\u0af0-\u0b00\u0b04\u0b0d-\u0b0e\u0b11-\u0b12\u0b29\u0b31\u0b34-\u0b35\u0b3a-\u0b3b\u0b44-\u0b46\u0b49-\u0b4a\u0b4e-\u0b55\u0b58-\u0b5b\u0b5e\u0b62-\u0b65\u0b70-\u0b81\u0b84\u0b8b-\u0b8d\u0b91\u0b96-\u0b98\u0b9b\u0b9d\u0ba0-\u0ba2\u0ba5-\u0ba7\u0bab-\u0bad\u0bb6\u0bba-\u0bbd\u0bc3-\u0bc5\u0bc9\u0bce-\u0bd6\u0bd8-\u0be6\u0bf0-\u0c00\u0c04\u0c0d\u0c11\u0c29\u0c34\u0c3a-\u0c3d\u0c45\u0c49\u0c4e-\u0c54\u0c57-\u0c5f\u0c62-\u0c65\u0c70-\u0c81\u0c84\u0c8d\u0c91\u0ca9\u0cb4\u0cba-\u0cbd\u0cc5\u0cc9\u0cce-\u0cd4\u0cd7-\u0cdd\u0cdf\u0ce2-\u0ce5\u0cf0-\u0d01\u0d04\u0d0d\u0d11\u0d29\u0d3a-\u0d3d\u0d44-\u0d45\u0d49\u0d4e-\u0d56\u0d58-\u0d5f\u0d62-\u0d65\u0d70-\u0e00\u0e2f\u0e3b-\u0e3f\u0e4f\u0e5a-\u0e80\u0e83\u0e85-\u0e86\u0e89\u0e8b-\u0e8c\u0e8e-\u0e93\u0e98\u0ea0\u0ea4\u0ea6\u0ea8-\u0ea9\u0eac\u0eaf\u0eba\u0ebe-\u0ebf\u0ec5\u0ec7\u0ece-\u0ecf\u0eda-\u0f17\u0f1a-\u0f1f\u0f2a-\u0f34\u0f36\u0f38\u0f3a-\u0f3d\u0f48\u0f6a-\u0f70\u0f85\u0f8c-\u0f8f\u0f96\u0f98\u0fae-\u0fb0\u0fb8\u0fba-\u109f\u10c6-\u10cf\u10f7-\u10ff\u1101\u1104\u1108\u110a\u110d\u1113-\u113b\u113d\u113f\u1141-\u114b\u114d\u114f\u1151-\u1153\u1156-\u1158\u115a-\u115e\u1162\u1164\u1166\u1168\u116a-\u116c\u116f-\u1171\u1174\u1176-\u119d\u119f-\u11a7\u11a9-\u11aa\u11ac-\u11ad\u11b0-\u11b6\u11b9\u11bb\u11c3-\u11ea\u11ec-\u11ef\u11f1-\u11f8\u11fa-\u1dff\u1e9c-\u1e9f\u1efa-\u1eff\u1f16-\u1f17\u1f1e-\u1f1f\u1f46-\u1f47\u1f4e-\u1f4f\u1f58\u1f5a\u1f5c\u1f5e\u1f7e-\u1f7f\u1fb5\u1fbd\u1fbf-\u1fc1\u1fc5\u1fcd-\u1fcf\u1fd4-\u1fd5\u1fdc-\u1fdf\u1fed-\u1ff1\u1ff5\u1ffd-\u20cf\u20dd-\u20e0\u20e2-\u2125\u2127-\u2129\u212c-\u212d\u212f-\u217f\u2183-\u3004\u3006\u3008-\u3020\u3030\u3036-\u3040\u3095-\u3098\u309b-\u309c\u309f-\u30a0\u30fb\u30ff-\u3104\u312d-\u4dff\u9fa6-\uabff\ud7a4-\uffff]')
+
+nonXmlNameFirstBMPRegexp = re.compile('[\x00-@\\[-\\^`\\{-\xbf\xd7\xf7\u0132-\u0133\u013f-\u0140\u0149\u017f\u01c4-\u01cc\u01f1-\u01f3\u01f6-\u01f9\u0218-\u024f\u02a9-\u02ba\u02c2-\u0385\u0387\u038b\u038d\u03a2\u03cf\u03d7-\u03d9\u03db\u03dd\u03df\u03e1\u03f4-\u0400\u040d\u0450\u045d\u0482-\u048f\u04c5-\u04c6\u04c9-\u04ca\u04cd-\u04cf\u04ec-\u04ed\u04f6-\u04f7\u04fa-\u0530\u0557-\u0558\u055a-\u0560\u0587-\u05cf\u05eb-\u05ef\u05f3-\u0620\u063b-\u0640\u064b-\u0670\u06b8-\u06b9\u06bf\u06cf\u06d4\u06d6-\u06e4\u06e7-\u0904\u093a-\u093c\u093e-\u0957\u0962-\u0984\u098d-\u098e\u0991-\u0992\u09a9\u09b1\u09b3-\u09b5\u09ba-\u09db\u09de\u09e2-\u09ef\u09f2-\u0a04\u0a0b-\u0a0e\u0a11-\u0a12\u0a29\u0a31\u0a34\u0a37\u0a3a-\u0a58\u0a5d\u0a5f-\u0a71\u0a75-\u0a84\u0a8c\u0a8e\u0a92\u0aa9\u0ab1\u0ab4\u0aba-\u0abc\u0abe-\u0adf\u0ae1-\u0b04\u0b0d-\u0b0e\u0b11-\u0b12\u0b29\u0b31\u0b34-\u0b35\u0b3a-\u0b3c\u0b3e-\u0b5b\u0b5e\u0b62-\u0b84\u0b8b-\u0b8d\u0b91\u0b96-\u0b98\u0b9b\u0b9d\u0ba0-\u0ba2\u0ba5-\u0ba7\u0bab-\u0bad\u0bb6\u0bba-\u0c04\u0c0d\u0c11\u0c29\u0c34\u0c3a-\u0c5f\u0c62-\u0c84\u0c8d\u0c91\u0ca9\u0cb4\u0cba-\u0cdd\u0cdf\u0ce2-\u0d04\u0d0d\u0d11\u0d29\u0d3a-\u0d5f\u0d62-\u0e00\u0e2f\u0e31\u0e34-\u0e3f\u0e46-\u0e80\u0e83\u0e85-\u0e86\u0e89\u0e8b-\u0e8c\u0e8e-\u0e93\u0e98\u0ea0\u0ea4\u0ea6\u0ea8-\u0ea9\u0eac\u0eaf\u0eb1\u0eb4-\u0ebc\u0ebe-\u0ebf\u0ec5-\u0f3f\u0f48\u0f6a-\u109f\u10c6-\u10cf\u10f7-\u10ff\u1101\u1104\u1108\u110a\u110d\u1113-\u113b\u113d\u113f\u1141-\u114b\u114d\u114f\u1151-\u1153\u1156-\u1158\u115a-\u115e\u1162\u1164\u1166\u1168\u116a-\u116c\u116f-\u1171\u1174\u1176-\u119d\u119f-\u11a7\u11a9-\u11aa\u11ac-\u11ad\u11b0-\u11b6\u11b9\u11bb\u11c3-\u11ea\u11ec-\u11ef\u11f1-\u11f8\u11fa-\u1dff\u1e9c-\u1e9f\u1efa-\u1eff\u1f16-\u1f17\u1f1e-\u1f1f\u1f46-\u1f47\u1f4e-\u1f4f\u1f58\u1f5a\u1f5c\u1f5e\u1f7e-\u1f7f\u1fb5\u1fbd\u1fbf-\u1fc1\u1fc5\u1fcd-\u1fcf\u1fd4-\u1fd5\u1fdc-\u1fdf\u1fed-\u1ff1\u1ff5\u1ffd-\u2125\u2127-\u2129\u212c-\u212d\u212f-\u217f\u2183-\u3006\u3008-\u3020\u302a-\u3040\u3095-\u30a0\u30fb-\u3104\u312d-\u4dff\u9fa6-\uabff\ud7a4-\uffff]')
+
+# Simpler things
+nonPubidCharRegexp = re.compile("[^\x20\x0D\x0Aa-zA-Z0-9\-\'()+,./:=?;!*#@$_%]")
+
+
+class InfosetFilter(object):
+    replacementRegexp = re.compile(r"U[\dA-F]{5,5}")
+
+    def __init__(self, replaceChars=None,
+                 dropXmlnsLocalName=False,
+                 dropXmlnsAttrNs=False,
+                 preventDoubleDashComments=False,
+                 preventDashAtCommentEnd=False,
+                 replaceFormFeedCharacters=True,
+                 preventSingleQuotePubid=False):
+
+        self.dropXmlnsLocalName = dropXmlnsLocalName
+        self.dropXmlnsAttrNs = dropXmlnsAttrNs
+
+        self.preventDoubleDashComments = preventDoubleDashComments
+        self.preventDashAtCommentEnd = preventDashAtCommentEnd
+
+        self.replaceFormFeedCharacters = replaceFormFeedCharacters
+
+        self.preventSingleQuotePubid = preventSingleQuotePubid
+
+        self.replaceCache = {}
+
+    def coerceAttribute(self, name, namespace=None):
+        if self.dropXmlnsLocalName and name.startswith("xmlns:"):
+            warnings.warn("Attributes cannot begin with xmlns", DataLossWarning)
+            return None
+        elif (self.dropXmlnsAttrNs and
+              namespace == "http://www.w3.org/2000/xmlns/"):
+            warnings.warn("Attributes cannot be in the xml namespace", DataLossWarning)
+            return None
+        else:
+            return self.toXmlName(name)
+
+    def coerceElement(self, name, namespace=None):
+        return self.toXmlName(name)
+
+    def coerceComment(self, data):
+        if self.preventDoubleDashComments:
+            while "--" in data:
+                warnings.warn("Comments cannot contain adjacent dashes", DataLossWarning)
+                data = data.replace("--", "- -")
+        return data
+
+    def coerceCharacters(self, data):
+        if self.replaceFormFeedCharacters:
+            for i in range(data.count("\x0C")):
+                warnings.warn("Text cannot contain U+000C", DataLossWarning)
+            data = data.replace("\x0C", " ")
+        # Other non-xml characters
+        return data
+
+    def coercePubid(self, data):
+        dataOutput = data
+        for char in nonPubidCharRegexp.findall(data):
+            warnings.warn("Coercing non-XML pubid", DataLossWarning)
+            replacement = self.getReplacementCharacter(char)
+            dataOutput = dataOutput.replace(char, replacement)
+        if self.preventSingleQuotePubid and dataOutput.find("'") >= 0:
+            warnings.warn("Pubid cannot contain single quote", DataLossWarning)
+            dataOutput = dataOutput.replace("'", self.getReplacementCharacter("'"))
+        return dataOutput
+
+    def toXmlName(self, name):
+        nameFirst = name[0]
+        nameRest = name[1:]
+        m = nonXmlNameFirstBMPRegexp.match(nameFirst)
+        if m:
+            warnings.warn("Coercing non-XML name", DataLossWarning)
+            nameFirstOutput = self.getReplacementCharacter(nameFirst)
+        else:
+            nameFirstOutput = nameFirst
+
+        nameRestOutput = nameRest
+        replaceChars = set(nonXmlNameBMPRegexp.findall(nameRest))
+        for char in replaceChars:
+            warnings.warn("Coercing non-XML name", DataLossWarning)
+            replacement = self.getReplacementCharacter(char)
+            nameRestOutput = nameRestOutput.replace(char, replacement)
+        return nameFirstOutput + nameRestOutput
+
+    def getReplacementCharacter(self, char):
+        if char in self.replaceCache:
+            replacement = self.replaceCache[char]
+        else:
+            replacement = self.escapeChar(char)
+        return replacement
+
+    def fromXmlName(self, name):
+        for item in set(self.replacementRegexp.findall(name)):
+            name = name.replace(item, self.unescapeChar(item))
+        return name
+
+    def escapeChar(self, char):
+        replacement = "U%05X" % ord(char)
+        self.replaceCache[char] = replacement
+        return replacement
+
+    def unescapeChar(self, charcode):
+        return chr(int(charcode[1:], 16))
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/inputstream.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/inputstream.py
new file mode 100644
index 0000000..9e03b93
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/inputstream.py
@@ -0,0 +1,886 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type
+from six.moves import http_client
+
+import codecs
+import re
+
+from .constants import EOF, spaceCharacters, asciiLetters, asciiUppercase
+from .constants import encodings, ReparseException
+from . import utils
+
+from io import StringIO
+
+try:
+    from io import BytesIO
+except ImportError:
+    BytesIO = StringIO
+
+try:
+    from io import BufferedIOBase
+except ImportError:
+    class BufferedIOBase(object):
+        pass
+
+# Non-unicode versions of constants for use in the pre-parser
+spaceCharactersBytes = frozenset([item.encode("ascii") for item in spaceCharacters])
+asciiLettersBytes = frozenset([item.encode("ascii") for item in asciiLetters])
+asciiUppercaseBytes = frozenset([item.encode("ascii") for item in asciiUppercase])
+spacesAngleBrackets = spaceCharactersBytes | frozenset([b">", b"<"])
+
+invalid_unicode_re = re.compile("[\u0001-\u0008\u000B\u000E-\u001F\u007F-\u009F\uD800-\uDFFF\uFDD0-\uFDEF\uFFFE\uFFFF\U0001FFFE\U0001FFFF\U0002FFFE\U0002FFFF\U0003FFFE\U0003FFFF\U0004FFFE\U0004FFFF\U0005FFFE\U0005FFFF\U0006FFFE\U0006FFFF\U0007FFFE\U0007FFFF\U0008FFFE\U0008FFFF\U0009FFFE\U0009FFFF\U000AFFFE\U000AFFFF\U000BFFFE\U000BFFFF\U000CFFFE\U000CFFFF\U000DFFFE\U000DFFFF\U000EFFFE\U000EFFFF\U000FFFFE\U000FFFFF\U0010FFFE\U0010FFFF]")
+
+non_bmp_invalid_codepoints = set([0x1FFFE, 0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE,
+                                  0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE, 0x5FFFF,
+                                  0x6FFFE, 0x6FFFF, 0x7FFFE, 0x7FFFF, 0x8FFFE,
+                                  0x8FFFF, 0x9FFFE, 0x9FFFF, 0xAFFFE, 0xAFFFF,
+                                  0xBFFFE, 0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
+                                  0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE, 0xFFFFF,
+                                  0x10FFFE, 0x10FFFF])
+
+ascii_punctuation_re = re.compile("[\u0009-\u000D\u0020-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u007E]")
+
+# Cache for charsUntil()
+charsUntilRegEx = {}
+
+
+class BufferedStream(object):
+    """Buffering for streams that do not have buffering of their own
+
+    The buffer is implemented as a list of chunks on the assumption that
+    joining many strings will be slow since it is O(n**2)
+    """
+
+    def __init__(self, stream):
+        self.stream = stream
+        self.buffer = []
+        self.position = [-1, 0]  # chunk number, offset
+
+    def tell(self):
+        pos = 0
+        for chunk in self.buffer[:self.position[0]]:
+            pos += len(chunk)
+        pos += self.position[1]
+        return pos
+
+    def seek(self, pos):
+        assert pos <= self._bufferedBytes()
+        offset = pos
+        i = 0
+        while len(self.buffer[i]) < offset:
+            offset -= len(self.buffer[i])
+            i += 1
+        self.position = [i, offset]
+
+    def read(self, bytes):
+        if not self.buffer:
+            return self._readStream(bytes)
+        elif (self.position[0] == len(self.buffer) and
+              self.position[1] == len(self.buffer[-1])):
+            return self._readStream(bytes)
+        else:
+            return self._readFromBuffer(bytes)
+
+    def _bufferedBytes(self):
+        return sum([len(item) for item in self.buffer])
+
+    def _readStream(self, bytes):
+        data = self.stream.read(bytes)
+        self.buffer.append(data)
+        self.position[0] += 1
+        self.position[1] = len(data)
+        return data
+
+    def _readFromBuffer(self, bytes):
+        remainingBytes = bytes
+        rv = []
+        bufferIndex = self.position[0]
+        bufferOffset = self.position[1]
+        while bufferIndex < len(self.buffer) and remainingBytes != 0:
+            assert remainingBytes > 0
+            bufferedData = self.buffer[bufferIndex]
+
+            if remainingBytes <= len(bufferedData) - bufferOffset:
+                bytesToRead = remainingBytes
+                self.position = [bufferIndex, bufferOffset + bytesToRead]
+            else:
+                bytesToRead = len(bufferedData) - bufferOffset
+                self.position = [bufferIndex, len(bufferedData)]
+                bufferIndex += 1
+            rv.append(bufferedData[bufferOffset:bufferOffset + bytesToRead])
+            remainingBytes -= bytesToRead
+
+            bufferOffset = 0
+
+        if remainingBytes:
+            rv.append(self._readStream(remainingBytes))
+
+        return b"".join(rv)
+
+
+def HTMLInputStream(source, encoding=None, parseMeta=True, chardet=True):
+    if isinstance(source, http_client.HTTPResponse):
+        # Work around Python bug #20007: read(0) closes the connection.
+        # http://bugs.python.org/issue20007
+        isUnicode = False
+    elif hasattr(source, "read"):
+        isUnicode = isinstance(source.read(0), text_type)
+    else:
+        isUnicode = isinstance(source, text_type)
+
+    if isUnicode:
+        if encoding is not None:
+            raise TypeError("Cannot explicitly set an encoding with a unicode string")
+
+        return HTMLUnicodeInputStream(source)
+    else:
+        return HTMLBinaryInputStream(source, encoding, parseMeta, chardet)
+
+
+class HTMLUnicodeInputStream(object):
+    """Provides a unicode stream of characters to the HTMLTokenizer.
+
+    This class takes care of character encoding and removing or replacing
+    incorrect byte-sequences and also provides column and line tracking.
+
+    """
+
+    _defaultChunkSize = 10240
+
+    def __init__(self, source):
+        """Initialises the HTMLInputStream.
+
+        HTMLInputStream(source, [encoding]) -> Normalized stream from source
+        for use by html5lib.
+
+        source can be either a file-object, local filename or a string.
+
+        The optional encoding parameter must be a string that indicates
+        the encoding.  If specified, that encoding will be used,
+        regardless of any BOM or later declaration (such as in a meta
+        element)
+
+        parseMeta - Look for a <meta> element containing encoding information
+
+        """
+
+        # Craziness
+        if len("\U0010FFFF") == 1:
+            self.reportCharacterErrors = self.characterErrorsUCS4
+            self.replaceCharactersRegexp = re.compile("[\uD800-\uDFFF]")
+        else:
+            self.reportCharacterErrors = self.characterErrorsUCS2
+            self.replaceCharactersRegexp = re.compile("([\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF])")
+
+        # List of where new lines occur
+        self.newLines = [0]
+
+        self.charEncoding = ("utf-8", "certain")
+        self.dataStream = self.openStream(source)
+
+        self.reset()
+
+    def reset(self):
+        self.chunk = ""
+        self.chunkSize = 0
+        self.chunkOffset = 0
+        self.errors = []
+
+        # number of (complete) lines in previous chunks
+        self.prevNumLines = 0
+        # number of columns in the last line of the previous chunk
+        self.prevNumCols = 0
+
+        # Deal with CR LF and surrogates split over chunk boundaries
+        self._bufferedCharacter = None
+
+    def openStream(self, source):
+        """Produces a file object from source.
+
+        source can be either a file object, local filename or a string.
+
+        """
+        # Already a file object
+        if hasattr(source, 'read'):
+            stream = source
+        else:
+            stream = StringIO(source)
+
+        return stream
+
+    def _position(self, offset):
+        chunk = self.chunk
+        nLines = chunk.count('\n', 0, offset)
+        positionLine = self.prevNumLines + nLines
+        lastLinePos = chunk.rfind('\n', 0, offset)
+        if lastLinePos == -1:
+            positionColumn = self.prevNumCols + offset
+        else:
+            positionColumn = offset - (lastLinePos + 1)
+        return (positionLine, positionColumn)
+
+    def position(self):
+        """Returns (line, col) of the current position in the stream."""
+        line, col = self._position(self.chunkOffset)
+        return (line + 1, col)
+
+    def char(self):
+        """ Read one character from the stream or queue if available. Return
+            EOF when EOF is reached.
+        """
+        # Read a new chunk from the input stream if necessary
+        if self.chunkOffset >= self.chunkSize:
+            if not self.readChunk():
+                return EOF
+
+        chunkOffset = self.chunkOffset
+        char = self.chunk[chunkOffset]
+        self.chunkOffset = chunkOffset + 1
+
+        return char
+
+    def readChunk(self, chunkSize=None):
+        if chunkSize is None:
+            chunkSize = self._defaultChunkSize
+
+        self.prevNumLines, self.prevNumCols = self._position(self.chunkSize)
+
+        self.chunk = ""
+        self.chunkSize = 0
+        self.chunkOffset = 0
+
+        data = self.dataStream.read(chunkSize)
+
+        # Deal with CR LF and surrogates broken across chunks
+        if self._bufferedCharacter:
+            data = self._bufferedCharacter + data
+            self._bufferedCharacter = None
+        elif not data:
+            # We have no more data, bye-bye stream
+            return False
+
+        if len(data) > 1:
+            lastv = ord(data[-1])
+            if lastv == 0x0D or 0xD800 <= lastv <= 0xDBFF:
+                self._bufferedCharacter = data[-1]
+                data = data[:-1]
+
+        self.reportCharacterErrors(data)
+
+        # Replace invalid characters
+        # Note U+0000 is dealt with in the tokenizer
+        data = self.replaceCharactersRegexp.sub("\ufffd", data)
+
+        data = data.replace("\r\n", "\n")
+        data = data.replace("\r", "\n")
+
+        self.chunk = data
+        self.chunkSize = len(data)
+
+        return True
+
+    def characterErrorsUCS4(self, data):
+        for i in range(len(invalid_unicode_re.findall(data))):
+            self.errors.append("invalid-codepoint")
+
+    def characterErrorsUCS2(self, data):
+        # Someone picked the wrong compile option
+        # You lose
+        skip = False
+        for match in invalid_unicode_re.finditer(data):
+            if skip:
+                continue
+            codepoint = ord(match.group())
+            pos = match.start()
+            # Pretty sure there should be endianness issues here
+            if utils.isSurrogatePair(data[pos:pos + 2]):
+                # We have a surrogate pair!
+                char_val = utils.surrogatePairToCodepoint(data[pos:pos + 2])
+                if char_val in non_bmp_invalid_codepoints:
+                    self.errors.append("invalid-codepoint")
+                skip = True
+            elif (codepoint >= 0xD800 and codepoint <= 0xDFFF and
+                  pos == len(data) - 1):
+                self.errors.append("invalid-codepoint")
+            else:
+                skip = False
+                self.errors.append("invalid-codepoint")
+
+    def charsUntil(self, characters, opposite=False):
+        """ Returns a string of characters from the stream up to but not
+        including any character in 'characters' or EOF. 'characters' must be
+        a container that supports the 'in' method and iteration over its
+        characters.
+        """
+
+        # Use a cache of regexps to find the required characters
+        try:
+            chars = charsUntilRegEx[(characters, opposite)]
+        except KeyError:
+            if __debug__:
+                for c in characters:
+                    assert(ord(c) < 128)
+            regex = "".join(["\\x%02x" % ord(c) for c in characters])
+            if not opposite:
+                regex = "^%s" % regex
+            chars = charsUntilRegEx[(characters, opposite)] = re.compile("[%s]+" % regex)
+
+        rv = []
+
+        while True:
+            # Find the longest matching prefix
+            m = chars.match(self.chunk, self.chunkOffset)
+            if m is None:
+                # If nothing matched, and it wasn't because we ran out of chunk,
+                # then stop
+                if self.chunkOffset != self.chunkSize:
+                    break
+            else:
+                end = m.end()
+                # If not the whole chunk matched, return everything
+                # up to the part that didn't match
+                if end != self.chunkSize:
+                    rv.append(self.chunk[self.chunkOffset:end])
+                    self.chunkOffset = end
+                    break
+            # If the whole remainder of the chunk matched,
+            # use it all and read the next chunk
+            rv.append(self.chunk[self.chunkOffset:])
+            if not self.readChunk():
+                # Reached EOF
+                break
+
+        r = "".join(rv)
+        return r
+
+    def unget(self, char):
+        # Only one character is allowed to be ungotten at once - it must
+        # be consumed again before any further call to unget
+        if char is not None:
+            if self.chunkOffset == 0:
+                # unget is called quite rarely, so it's a good idea to do
+                # more work here if it saves a bit of work in the frequently
+                # called char and charsUntil.
+                # So, just prepend the ungotten character onto the current
+                # chunk:
+                self.chunk = char + self.chunk
+                self.chunkSize += 1
+            else:
+                self.chunkOffset -= 1
+                assert self.chunk[self.chunkOffset] == char
+
+
+class HTMLBinaryInputStream(HTMLUnicodeInputStream):
+    """Provides a unicode stream of characters to the HTMLTokenizer.
+
+    This class takes care of character encoding and removing or replacing
+    incorrect byte-sequences and also provides column and line tracking.
+
+    """
+
+    def __init__(self, source, encoding=None, parseMeta=True, chardet=True):
+        """Initialises the HTMLInputStream.
+
+        HTMLInputStream(source, [encoding]) -> Normalized stream from source
+        for use by html5lib.
+
+        source can be either a file-object, local filename or a string.
+
+        The optional encoding parameter must be a string that indicates
+        the encoding.  If specified, that encoding will be used,
+        regardless of any BOM or later declaration (such as in a meta
+        element)
+
+        parseMeta - Look for a <meta> element containing encoding information
+
+        """
+        # Raw Stream - for unicode objects this will encode to utf-8 and set
+        #              self.charEncoding as appropriate
+        self.rawStream = self.openStream(source)
+
+        HTMLUnicodeInputStream.__init__(self, self.rawStream)
+
+        self.charEncoding = (codecName(encoding), "certain")
+
+        # Encoding Information
+        # Number of bytes to use when looking for a meta element with
+        # encoding information
+        self.numBytesMeta = 512
+        # Number of bytes to use when using detecting encoding using chardet
+        self.numBytesChardet = 100
+        # Encoding to use if no other information can be found
+        self.defaultEncoding = "windows-1252"
+
+        # Detect encoding iff no explicit "transport level" encoding is supplied
+        if (self.charEncoding[0] is None):
+            self.charEncoding = self.detectEncoding(parseMeta, chardet)
+
+        # Call superclass
+        self.reset()
+
+    def reset(self):
+        self.dataStream = codecs.getreader(self.charEncoding[0])(self.rawStream,
+                                                                 'replace')
+        HTMLUnicodeInputStream.reset(self)
+
+    def openStream(self, source):
+        """Produces a file object from source.
+
+        source can be either a file object, local filename or a string.
+
+        """
+        # Already a file object
+        if hasattr(source, 'read'):
+            stream = source
+        else:
+            stream = BytesIO(source)
+
+        try:
+            stream.seek(stream.tell())
+        except:
+            stream = BufferedStream(stream)
+
+        return stream
+
+    def detectEncoding(self, parseMeta=True, chardet=True):
+        # First look for a BOM
+        # This will also read past the BOM if present
+        encoding = self.detectBOM()
+        confidence = "certain"
+        # If there is no BOM need to look for meta elements with encoding
+        # information
+        if encoding is None and parseMeta:
+            encoding = self.detectEncodingMeta()
+            confidence = "tentative"
+        # Guess with chardet, if avaliable
+        if encoding is None and chardet:
+            confidence = "tentative"
+            try:
+                try:
+                    from charade.universaldetector import UniversalDetector
+                except ImportError:
+                    from chardet.universaldetector import UniversalDetector
+                buffers = []
+                detector = UniversalDetector()
+                while not detector.done:
+                    buffer = self.rawStream.read(self.numBytesChardet)
+                    assert isinstance(buffer, bytes)
+                    if not buffer:
+                        break
+                    buffers.append(buffer)
+                    detector.feed(buffer)
+                detector.close()
+                encoding = detector.result['encoding']
+                self.rawStream.seek(0)
+            except ImportError:
+                pass
+        # If all else fails use the default encoding
+        if encoding is None:
+            confidence = "tentative"
+            encoding = self.defaultEncoding
+
+        # Substitute for equivalent encodings:
+        encodingSub = {"iso-8859-1": "windows-1252"}
+
+        if encoding.lower() in encodingSub:
+            encoding = encodingSub[encoding.lower()]
+
+        return encoding, confidence
+
+    def changeEncoding(self, newEncoding):
+        assert self.charEncoding[1] != "certain"
+        newEncoding = codecName(newEncoding)
+        if newEncoding in ("utf-16", "utf-16-be", "utf-16-le"):
+            newEncoding = "utf-8"
+        if newEncoding is None:
+            return
+        elif newEncoding == self.charEncoding[0]:
+            self.charEncoding = (self.charEncoding[0], "certain")
+        else:
+            self.rawStream.seek(0)
+            self.reset()
+            self.charEncoding = (newEncoding, "certain")
+            raise ReparseException("Encoding changed from %s to %s" % (self.charEncoding[0], newEncoding))
+
+    def detectBOM(self):
+        """Attempts to detect at BOM at the start of the stream. If
+        an encoding can be determined from the BOM return the name of the
+        encoding otherwise return None"""
+        bomDict = {
+            codecs.BOM_UTF8: 'utf-8',
+            codecs.BOM_UTF16_LE: 'utf-16-le', codecs.BOM_UTF16_BE: 'utf-16-be',
+            codecs.BOM_UTF32_LE: 'utf-32-le', codecs.BOM_UTF32_BE: 'utf-32-be'
+        }
+
+        # Go to beginning of file and read in 4 bytes
+        string = self.rawStream.read(4)
+        assert isinstance(string, bytes)
+
+        # Try detecting the BOM using bytes from the string
+        encoding = bomDict.get(string[:3])         # UTF-8
+        seek = 3
+        if not encoding:
+            # Need to detect UTF-32 before UTF-16
+            encoding = bomDict.get(string)         # UTF-32
+            seek = 4
+            if not encoding:
+                encoding = bomDict.get(string[:2])  # UTF-16
+                seek = 2
+
+        # Set the read position past the BOM if one was found, otherwise
+        # set it to the start of the stream
+        self.rawStream.seek(encoding and seek or 0)
+
+        return encoding
+
+    def detectEncodingMeta(self):
+        """Report the encoding declared by the meta element
+        """
+        buffer = self.rawStream.read(self.numBytesMeta)
+        assert isinstance(buffer, bytes)
+        parser = EncodingParser(buffer)
+        self.rawStream.seek(0)
+        encoding = parser.getEncoding()
+
+        if encoding in ("utf-16", "utf-16-be", "utf-16-le"):
+            encoding = "utf-8"
+
+        return encoding
+
+
+class EncodingBytes(bytes):
+    """String-like object with an associated position and various extra methods
+    If the position is ever greater than the string length then an exception is
+    raised"""
+    def __new__(self, value):
+        assert isinstance(value, bytes)
+        return bytes.__new__(self, value.lower())
+
+    def __init__(self, value):
+        self._position = -1
+
+    def __iter__(self):
+        return self
+
+    def __next__(self):
+        p = self._position = self._position + 1
+        if p >= len(self):
+            raise StopIteration
+        elif p < 0:
+            raise TypeError
+        return self[p:p + 1]
+
+    def next(self):
+        # Py2 compat
+        return self.__next__()
+
+    def previous(self):
+        p = self._position
+        if p >= len(self):
+            raise StopIteration
+        elif p < 0:
+            raise TypeError
+        self._position = p = p - 1
+        return self[p:p + 1]
+
+    def setPosition(self, position):
+        if self._position >= len(self):
+            raise StopIteration
+        self._position = position
+
+    def getPosition(self):
+        if self._position >= len(self):
+            raise StopIteration
+        if self._position >= 0:
+            return self._position
+        else:
+            return None
+
+    position = property(getPosition, setPosition)
+
+    def getCurrentByte(self):
+        return self[self.position:self.position + 1]
+
+    currentByte = property(getCurrentByte)
+
+    def skip(self, chars=spaceCharactersBytes):
+        """Skip past a list of characters"""
+        p = self.position               # use property for the error-checking
+        while p < len(self):
+            c = self[p:p + 1]
+            if c not in chars:
+                self._position = p
+                return c
+            p += 1
+        self._position = p
+        return None
+
+    def skipUntil(self, chars):
+        p = self.position
+        while p < len(self):
+            c = self[p:p + 1]
+            if c in chars:
+                self._position = p
+                return c
+            p += 1
+        self._position = p
+        return None
+
+    def matchBytes(self, bytes):
+        """Look for a sequence of bytes at the start of a string. If the bytes
+        are found return True and advance the position to the byte after the
+        match. Otherwise return False and leave the position alone"""
+        p = self.position
+        data = self[p:p + len(bytes)]
+        rv = data.startswith(bytes)
+        if rv:
+            self.position += len(bytes)
+        return rv
+
+    def jumpTo(self, bytes):
+        """Look for the next sequence of bytes matching a given sequence. If
+        a match is found advance the position to the last byte of the match"""
+        newPosition = self[self.position:].find(bytes)
+        if newPosition > -1:
+            # XXX: This is ugly, but I can't see a nicer way to fix this.
+            if self._position == -1:
+                self._position = 0
+            self._position += (newPosition + len(bytes) - 1)
+            return True
+        else:
+            raise StopIteration
+
+
+class EncodingParser(object):
+    """Mini parser for detecting character encoding from meta elements"""
+
+    def __init__(self, data):
+        """string - the data to work on for encoding detection"""
+        self.data = EncodingBytes(data)
+        self.encoding = None
+
+    def getEncoding(self):
+        methodDispatch = (
+            (b"<!--", self.handleComment),
+            (b"<meta", self.handleMeta),
+            (b"</", self.handlePossibleEndTag),
+            (b"<!", self.handleOther),
+            (b"<?", self.handleOther),
+            (b"<", self.handlePossibleStartTag))
+        for byte in self.data:
+            keepParsing = True
+            for key, method in methodDispatch:
+                if self.data.matchBytes(key):
+                    try:
+                        keepParsing = method()
+                        break
+                    except StopIteration:
+                        keepParsing = False
+                        break
+            if not keepParsing:
+                break
+
+        return self.encoding
+
+    def handleComment(self):
+        """Skip over comments"""
+        return self.data.jumpTo(b"-->")
+
+    def handleMeta(self):
+        if self.data.currentByte not in spaceCharactersBytes:
+            # if we have <meta not followed by a space so just keep going
+            return True
+        # We have a valid meta element we want to search for attributes
+        hasPragma = False
+        pendingEncoding = None
+        while True:
+            # Try to find the next attribute after the current position
+            attr = self.getAttribute()
+            if attr is None:
+                return True
+            else:
+                if attr[0] == b"http-equiv":
+                    hasPragma = attr[1] == b"content-type"
+                    if hasPragma and pendingEncoding is not None:
+                        self.encoding = pendingEncoding
+                        return False
+                elif attr[0] == b"charset":
+                    tentativeEncoding = attr[1]
+                    codec = codecName(tentativeEncoding)
+                    if codec is not None:
+                        self.encoding = codec
+                        return False
+                elif attr[0] == b"content":
+                    contentParser = ContentAttrParser(EncodingBytes(attr[1]))
+                    tentativeEncoding = contentParser.parse()
+                    if tentativeEncoding is not None:
+                        codec = codecName(tentativeEncoding)
+                        if codec is not None:
+                            if hasPragma:
+                                self.encoding = codec
+                                return False
+                            else:
+                                pendingEncoding = codec
+
+    def handlePossibleStartTag(self):
+        return self.handlePossibleTag(False)
+
+    def handlePossibleEndTag(self):
+        next(self.data)
+        return self.handlePossibleTag(True)
+
+    def handlePossibleTag(self, endTag):
+        data = self.data
+        if data.currentByte not in asciiLettersBytes:
+            # If the next byte is not an ascii letter either ignore this
+            # fragment (possible start tag case) or treat it according to
+            # handleOther
+            if endTag:
+                data.previous()
+                self.handleOther()
+            return True
+
+        c = data.skipUntil(spacesAngleBrackets)
+        if c == b"<":
+            # return to the first step in the overall "two step" algorithm
+            # reprocessing the < byte
+            data.previous()
+        else:
+            # Read all attributes
+            attr = self.getAttribute()
+            while attr is not None:
+                attr = self.getAttribute()
+        return True
+
+    def handleOther(self):
+        return self.data.jumpTo(b">")
+
+    def getAttribute(self):
+        """Return a name,value pair for the next attribute in the stream,
+        if one is found, or None"""
+        data = self.data
+        # Step 1 (skip chars)
+        c = data.skip(spaceCharactersBytes | frozenset([b"/"]))
+        assert c is None or len(c) == 1
+        # Step 2
+        if c in (b">", None):
+            return None
+        # Step 3
+        attrName = []
+        attrValue = []
+        # Step 4 attribute name
+        while True:
+            if c == b"=" and attrName:
+                break
+            elif c in spaceCharactersBytes:
+                # Step 6!
+                c = data.skip()
+                break
+            elif c in (b"/", b">"):
+                return b"".join(attrName), b""
+            elif c in asciiUppercaseBytes:
+                attrName.append(c.lower())
+            elif c is None:
+                return None
+            else:
+                attrName.append(c)
+            # Step 5
+            c = next(data)
+        # Step 7
+        if c != b"=":
+            data.previous()
+            return b"".join(attrName), b""
+        # Step 8
+        next(data)
+        # Step 9
+        c = data.skip()
+        # Step 10
+        if c in (b"'", b'"'):
+            # 10.1
+            quoteChar = c
+            while True:
+                # 10.2
+                c = next(data)
+                # 10.3
+                if c == quoteChar:
+                    next(data)
+                    return b"".join(attrName), b"".join(attrValue)
+                # 10.4
+                elif c in asciiUppercaseBytes:
+                    attrValue.append(c.lower())
+                # 10.5
+                else:
+                    attrValue.append(c)
+        elif c == b">":
+            return b"".join(attrName), b""
+        elif c in asciiUppercaseBytes:
+            attrValue.append(c.lower())
+        elif c is None:
+            return None
+        else:
+            attrValue.append(c)
+        # Step 11
+        while True:
+            c = next(data)
+            if c in spacesAngleBrackets:
+                return b"".join(attrName), b"".join(attrValue)
+            elif c in asciiUppercaseBytes:
+                attrValue.append(c.lower())
+            elif c is None:
+                return None
+            else:
+                attrValue.append(c)
+
+
+class ContentAttrParser(object):
+    def __init__(self, data):
+        assert isinstance(data, bytes)
+        self.data = data
+
+    def parse(self):
+        try:
+            # Check if the attr name is charset
+            # otherwise return
+            self.data.jumpTo(b"charset")
+            self.data.position += 1
+            self.data.skip()
+            if not self.data.currentByte == b"=":
+                # If there is no = sign keep looking for attrs
+                return None
+            self.data.position += 1
+            self.data.skip()
+            # Look for an encoding between matching quote marks
+            if self.data.currentByte in (b'"', b"'"):
+                quoteMark = self.data.currentByte
+                self.data.position += 1
+                oldPosition = self.data.position
+                if self.data.jumpTo(quoteMark):
+                    return self.data[oldPosition:self.data.position]
+                else:
+                    return None
+            else:
+                # Unquoted value
+                oldPosition = self.data.position
+                try:
+                    self.data.skipUntil(spaceCharactersBytes)
+                    return self.data[oldPosition:self.data.position]
+                except StopIteration:
+                    # Return the whole remaining value
+                    return self.data[oldPosition:]
+        except StopIteration:
+            return None
+
+
+def codecName(encoding):
+    """Return the python codec name corresponding to an encoding or None if the
+    string doesn't correspond to a valid encoding."""
+    if isinstance(encoding, bytes):
+        try:
+            encoding = encoding.decode("ascii")
+        except UnicodeDecodeError:
+            return None
+    if encoding:
+        canonicalName = ascii_punctuation_re.sub("", encoding).lower()
+        return encodings.get(canonicalName, None)
+    else:
+        return None
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/sanitizer.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/sanitizer.py
new file mode 100644
index 0000000..469d9b4
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/sanitizer.py
@@ -0,0 +1,271 @@
+from __future__ import absolute_import, division, unicode_literals
+
+import re
+from xml.sax.saxutils import escape, unescape
+
+from .tokenizer import HTMLTokenizer
+from .constants import tokenTypes
+
+
+class HTMLSanitizerMixin(object):
+    """ sanitization of XHTML+MathML+SVG and of inline style attributes."""
+
+    acceptable_elements = ['a', 'abbr', 'acronym', 'address', 'area',
+                           'article', 'aside', 'audio', 'b', 'big', 'blockquote', 'br', 'button',
+                           'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup',
+                           'command', 'datagrid', 'datalist', 'dd', 'del', 'details', 'dfn',
+                           'dialog', 'dir', 'div', 'dl', 'dt', 'em', 'event-source', 'fieldset',
+                           'figcaption', 'figure', 'footer', 'font', 'form', 'header', 'h1',
+                           'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'input', 'ins',
+                           'keygen', 'kbd', 'label', 'legend', 'li', 'm', 'map', 'menu', 'meter',
+                           'multicol', 'nav', 'nextid', 'ol', 'output', 'optgroup', 'option',
+                           'p', 'pre', 'progress', 'q', 's', 'samp', 'section', 'select',
+                           'small', 'sound', 'source', 'spacer', 'span', 'strike', 'strong',
+                           'sub', 'sup', 'table', 'tbody', 'td', 'textarea', 'time', 'tfoot',
+                           'th', 'thead', 'tr', 'tt', 'u', 'ul', 'var', 'video']
+
+    mathml_elements = ['maction', 'math', 'merror', 'mfrac', 'mi',
+                       'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom',
+                       'mprescripts', 'mroot', 'mrow', 'mspace', 'msqrt', 'mstyle', 'msub',
+                       'msubsup', 'msup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder',
+                       'munderover', 'none']
+
+    svg_elements = ['a', 'animate', 'animateColor', 'animateMotion',
+                    'animateTransform', 'clipPath', 'circle', 'defs', 'desc', 'ellipse',
+                    'font-face', 'font-face-name', 'font-face-src', 'g', 'glyph', 'hkern',
+                    'linearGradient', 'line', 'marker', 'metadata', 'missing-glyph',
+                    'mpath', 'path', 'polygon', 'polyline', 'radialGradient', 'rect',
+                    'set', 'stop', 'svg', 'switch', 'text', 'title', 'tspan', 'use']
+
+    acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey',
+                             'action', 'align', 'alt', 'autocomplete', 'autofocus', 'axis',
+                             'background', 'balance', 'bgcolor', 'bgproperties', 'border',
+                             'bordercolor', 'bordercolordark', 'bordercolorlight', 'bottompadding',
+                             'cellpadding', 'cellspacing', 'ch', 'challenge', 'char', 'charoff',
+                             'choff', 'charset', 'checked', 'cite', 'class', 'clear', 'color',
+                             'cols', 'colspan', 'compact', 'contenteditable', 'controls', 'coords',
+                             'data', 'datafld', 'datapagesize', 'datasrc', 'datetime', 'default',
+                             'delay', 'dir', 'disabled', 'draggable', 'dynsrc', 'enctype', 'end',
+                             'face', 'for', 'form', 'frame', 'galleryimg', 'gutter', 'headers',
+                             'height', 'hidefocus', 'hidden', 'high', 'href', 'hreflang', 'hspace',
+                             'icon', 'id', 'inputmode', 'ismap', 'keytype', 'label', 'leftspacing',
+                             'lang', 'list', 'longdesc', 'loop', 'loopcount', 'loopend',
+                             'loopstart', 'low', 'lowsrc', 'max', 'maxlength', 'media', 'method',
+                             'min', 'multiple', 'name', 'nohref', 'noshade', 'nowrap', 'open',
+                             'optimum', 'pattern', 'ping', 'point-size', 'poster', 'pqg', 'preload',
+                             'prompt', 'radiogroup', 'readonly', 'rel', 'repeat-max', 'repeat-min',
+                             'replace', 'required', 'rev', 'rightspacing', 'rows', 'rowspan',
+                             'rules', 'scope', 'selected', 'shape', 'size', 'span', 'src', 'start',
+                             'step', 'style', 'summary', 'suppress', 'tabindex', 'target',
+                             'template', 'title', 'toppadding', 'type', 'unselectable', 'usemap',
+                             'urn', 'valign', 'value', 'variable', 'volume', 'vspace', 'vrml',
+                             'width', 'wrap', 'xml:lang']
+
+    mathml_attributes = ['actiontype', 'align', 'columnalign', 'columnalign',
+                         'columnalign', 'columnlines', 'columnspacing', 'columnspan', 'depth',
+                         'display', 'displaystyle', 'equalcolumns', 'equalrows', 'fence',
+                         'fontstyle', 'fontweight', 'frame', 'height', 'linethickness', 'lspace',
+                         'mathbackground', 'mathcolor', 'mathvariant', 'mathvariant', 'maxsize',
+                         'minsize', 'other', 'rowalign', 'rowalign', 'rowalign', 'rowlines',
+                         'rowspacing', 'rowspan', 'rspace', 'scriptlevel', 'selection',
+                         'separator', 'stretchy', 'width', 'width', 'xlink:href', 'xlink:show',
+                         'xlink:type', 'xmlns', 'xmlns:xlink']
+
+    svg_attributes = ['accent-height', 'accumulate', 'additive', 'alphabetic',
+                      'arabic-form', 'ascent', 'attributeName', 'attributeType',
+                      'baseProfile', 'bbox', 'begin', 'by', 'calcMode', 'cap-height',
+                      'class', 'clip-path', 'color', 'color-rendering', 'content', 'cx',
+                      'cy', 'd', 'dx', 'dy', 'descent', 'display', 'dur', 'end', 'fill',
+                      'fill-opacity', 'fill-rule', 'font-family', 'font-size',
+                      'font-stretch', 'font-style', 'font-variant', 'font-weight', 'from',
+                      'fx', 'fy', 'g1', 'g2', 'glyph-name', 'gradientUnits', 'hanging',
+                      'height', 'horiz-adv-x', 'horiz-origin-x', 'id', 'ideographic', 'k',
+                      'keyPoints', 'keySplines', 'keyTimes', 'lang', 'marker-end',
+                      'marker-mid', 'marker-start', 'markerHeight', 'markerUnits',
+                      'markerWidth', 'mathematical', 'max', 'min', 'name', 'offset',
+                      'opacity', 'orient', 'origin', 'overline-position',
+                      'overline-thickness', 'panose-1', 'path', 'pathLength', 'points',
+                      'preserveAspectRatio', 'r', 'refX', 'refY', 'repeatCount',
+                      'repeatDur', 'requiredExtensions', 'requiredFeatures', 'restart',
+                      'rotate', 'rx', 'ry', 'slope', 'stemh', 'stemv', 'stop-color',
+                      'stop-opacity', 'strikethrough-position', 'strikethrough-thickness',
+                      'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap',
+                      'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity',
+                      'stroke-width', 'systemLanguage', 'target', 'text-anchor', 'to',
+                      'transform', 'type', 'u1', 'u2', 'underline-position',
+                      'underline-thickness', 'unicode', 'unicode-range', 'units-per-em',
+                      'values', 'version', 'viewBox', 'visibility', 'width', 'widths', 'x',
+                      'x-height', 'x1', 'x2', 'xlink:actuate', 'xlink:arcrole',
+                      'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type',
+                      'xml:base', 'xml:lang', 'xml:space', 'xmlns', 'xmlns:xlink', 'y',
+                      'y1', 'y2', 'zoomAndPan']
+
+    attr_val_is_uri = ['href', 'src', 'cite', 'action', 'longdesc', 'poster',
+                       'xlink:href', 'xml:base']
+
+    svg_attr_val_allows_ref = ['clip-path', 'color-profile', 'cursor', 'fill',
+                               'filter', 'marker', 'marker-start', 'marker-mid', 'marker-end',
+                               'mask', 'stroke']
+
+    svg_allow_local_href = ['altGlyph', 'animate', 'animateColor',
+                            'animateMotion', 'animateTransform', 'cursor', 'feImage', 'filter',
+                            'linearGradient', 'pattern', 'radialGradient', 'textpath', 'tref',
+                            'set', 'use']
+
+    acceptable_css_properties = ['azimuth', 'background-color',
+                                 'border-bottom-color', 'border-collapse', 'border-color',
+                                 'border-left-color', 'border-right-color', 'border-top-color', 'clear',
+                                 'color', 'cursor', 'direction', 'display', 'elevation', 'float', 'font',
+                                 'font-family', 'font-size', 'font-style', 'font-variant', 'font-weight',
+                                 'height', 'letter-spacing', 'line-height', 'overflow', 'pause',
+                                 'pause-after', 'pause-before', 'pitch', 'pitch-range', 'richness',
+                                 'speak', 'speak-header', 'speak-numeral', 'speak-punctuation',
+                                 'speech-rate', 'stress', 'text-align', 'text-decoration', 'text-indent',
+                                 'unicode-bidi', 'vertical-align', 'voice-family', 'volume',
+                                 'white-space', 'width']
+
+    acceptable_css_keywords = ['auto', 'aqua', 'black', 'block', 'blue',
+                               'bold', 'both', 'bottom', 'brown', 'center', 'collapse', 'dashed',
+                               'dotted', 'fuchsia', 'gray', 'green', '!important', 'italic', 'left',
+                               'lime', 'maroon', 'medium', 'none', 'navy', 'normal', 'nowrap', 'olive',
+                               'pointer', 'purple', 'red', 'right', 'solid', 'silver', 'teal', 'top',
+                               'transparent', 'underline', 'white', 'yellow']
+
+    acceptable_svg_properties = ['fill', 'fill-opacity', 'fill-rule',
+                                 'stroke', 'stroke-width', 'stroke-linecap', 'stroke-linejoin',
+                                 'stroke-opacity']
+
+    acceptable_protocols = ['ed2k', 'ftp', 'http', 'https', 'irc',
+                            'mailto', 'news', 'gopher', 'nntp', 'telnet', 'webcal',
+                            'xmpp', 'callto', 'feed', 'urn', 'aim', 'rsync', 'tag',
+                            'ssh', 'sftp', 'rtsp', 'afs']
+
+    # subclasses may define their own versions of these constants
+    allowed_elements = acceptable_elements + mathml_elements + svg_elements
+    allowed_attributes = acceptable_attributes + mathml_attributes + svg_attributes
+    allowed_css_properties = acceptable_css_properties
+    allowed_css_keywords = acceptable_css_keywords
+    allowed_svg_properties = acceptable_svg_properties
+    allowed_protocols = acceptable_protocols
+
+    # Sanitize the +html+, escaping all elements not in ALLOWED_ELEMENTS, and
+    # stripping out all # attributes not in ALLOWED_ATTRIBUTES. Style
+    # attributes are parsed, and a restricted set, # specified by
+    # ALLOWED_CSS_PROPERTIES and ALLOWED_CSS_KEYWORDS, are allowed through.
+    # attributes in ATTR_VAL_IS_URI are scanned, and only URI schemes specified
+    # in ALLOWED_PROTOCOLS are allowed.
+    #
+    #   sanitize_html('<script> do_nasty_stuff() </script>')
+    #    => &lt;script> do_nasty_stuff() &lt;/script>
+    #   sanitize_html('<a href="javascript: sucker();">Click here for $100</a>')
+    #    => <a>Click here for $100</a>
+    def sanitize_token(self, token):
+
+        # accommodate filters which use token_type differently
+        token_type = token["type"]
+        if token_type in list(tokenTypes.keys()):
+            token_type = tokenTypes[token_type]
+
+        if token_type in (tokenTypes["StartTag"], tokenTypes["EndTag"],
+                          tokenTypes["EmptyTag"]):
+            if token["name"] in self.allowed_elements:
+                return self.allowed_token(token, token_type)
+            else:
+                return self.disallowed_token(token, token_type)
+        elif token_type == tokenTypes["Comment"]:
+            pass
+        else:
+            return token
+
+    def allowed_token(self, token, token_type):
+        if "data" in token:
+            attrs = dict([(name, val) for name, val in
+                          token["data"][::-1]
+                          if name in self.allowed_attributes])
+            for attr in self.attr_val_is_uri:
+                if attr not in attrs:
+                    continue
+                val_unescaped = re.sub("[`\000-\040\177-\240\s]+", '',
+                                       unescape(attrs[attr])).lower()
+                # remove replacement characters from unescaped characters
+                val_unescaped = val_unescaped.replace("\ufffd", "")
+                if (re.match("^[a-z0-9][-+.a-z0-9]*:", val_unescaped) and
+                    (val_unescaped.split(':')[0] not in
+                     self.allowed_protocols)):
+                    del attrs[attr]
+            for attr in self.svg_attr_val_allows_ref:
+                if attr in attrs:
+                    attrs[attr] = re.sub(r'url\s*\(\s*[^#\s][^)]+?\)',
+                                         ' ',
+                                         unescape(attrs[attr]))
+            if (token["name"] in self.svg_allow_local_href and
+                'xlink:href' in attrs and re.search('^\s*[^#\s].*',
+                                                    attrs['xlink:href'])):
+                del attrs['xlink:href']
+            if 'style' in attrs:
+                attrs['style'] = self.sanitize_css(attrs['style'])
+            token["data"] = [[name, val] for name, val in list(attrs.items())]
+        return token
+
+    def disallowed_token(self, token, token_type):
+        if token_type == tokenTypes["EndTag"]:
+            token["data"] = "</%s>" % token["name"]
+        elif token["data"]:
+            attrs = ''.join([' %s="%s"' % (k, escape(v)) for k, v in token["data"]])
+            token["data"] = "<%s%s>" % (token["name"], attrs)
+        else:
+            token["data"] = "<%s>" % token["name"]
+        if token.get("selfClosing"):
+            token["data"] = token["data"][:-1] + "/>"
+
+        if token["type"] in list(tokenTypes.keys()):
+            token["type"] = "Characters"
+        else:
+            token["type"] = tokenTypes["Characters"]
+
+        del token["name"]
+        return token
+
+    def sanitize_css(self, style):
+        # disallow urls
+        style = re.compile('url\s*\(\s*[^\s)]+?\s*\)\s*').sub(' ', style)
+
+        # gauntlet
+        if not re.match("""^([:,;#%.\sa-zA-Z0-9!]|\w-\w|'[\s\w]+'|"[\s\w]+"|\([\d,\s]+\))*$""", style):
+            return ''
+        if not re.match("^\s*([-\w]+\s*:[^:;]*(;\s*|$))*$", style):
+            return ''
+
+        clean = []
+        for prop, value in re.findall("([-\w]+)\s*:\s*([^:;]*)", style):
+            if not value:
+                continue
+            if prop.lower() in self.allowed_css_properties:
+                clean.append(prop + ': ' + value + ';')
+            elif prop.split('-')[0].lower() in ['background', 'border', 'margin',
+                                                'padding']:
+                for keyword in value.split():
+                    if keyword not in self.acceptable_css_keywords and \
+                            not re.match("^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$", keyword):
+                        break
+                else:
+                    clean.append(prop + ': ' + value + ';')
+            elif prop.lower() in self.allowed_svg_properties:
+                clean.append(prop + ': ' + value + ';')
+
+        return ' '.join(clean)
+
+
+class HTMLSanitizer(HTMLTokenizer, HTMLSanitizerMixin):
+    def __init__(self, stream, encoding=None, parseMeta=True, useChardet=True,
+                 lowercaseElementName=False, lowercaseAttrName=False, parser=None):
+        # Change case matching defaults as we only output lowercase html anyway
+        # This solution doesn't seem ideal...
+        HTMLTokenizer.__init__(self, stream, encoding, parseMeta, useChardet,
+                               lowercaseElementName, lowercaseAttrName, parser=parser)
+
+    def __iter__(self):
+        for token in HTMLTokenizer.__iter__(self):
+            token = self.sanitize_token(token)
+            if token:
+                yield token
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/serializer/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/serializer/__init__.py
new file mode 100644
index 0000000..8380839
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/serializer/__init__.py
@@ -0,0 +1,16 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from .. import treewalkers
+
+from .htmlserializer import HTMLSerializer
+
+
+def serialize(input, tree="etree", format="html", encoding=None,
+              **serializer_opts):
+    # XXX: Should we cache this?
+    walker = treewalkers.getTreeWalker(tree)
+    if format == "html":
+        s = HTMLSerializer(**serializer_opts)
+    else:
+        raise ValueError("type must be html")
+    return s.render(walker(input), encoding)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/serializer/htmlserializer.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/serializer/htmlserializer.py
new file mode 100644
index 0000000..4a891ff5
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/serializer/htmlserializer.py
@@ -0,0 +1,320 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type
+
+import gettext
+_ = gettext.gettext
+
+try:
+    from functools import reduce
+except ImportError:
+    pass
+
+from ..constants import voidElements, booleanAttributes, spaceCharacters
+from ..constants import rcdataElements, entities, xmlEntities
+from .. import utils
+from xml.sax.saxutils import escape
+
+spaceCharacters = "".join(spaceCharacters)
+
+try:
+    from codecs import register_error, xmlcharrefreplace_errors
+except ImportError:
+    unicode_encode_errors = "strict"
+else:
+    unicode_encode_errors = "htmlentityreplace"
+
+    encode_entity_map = {}
+    is_ucs4 = len("\U0010FFFF") == 1
+    for k, v in list(entities.items()):
+        # skip multi-character entities
+        if ((is_ucs4 and len(v) > 1) or
+                (not is_ucs4 and len(v) > 2)):
+            continue
+        if v != "&":
+            if len(v) == 2:
+                v = utils.surrogatePairToCodepoint(v)
+            else:
+                v = ord(v)
+            if v not in encode_entity_map or k.islower():
+                # prefer &lt; over &LT; and similarly for &amp;, &gt;, etc.
+                encode_entity_map[v] = k
+
+    def htmlentityreplace_errors(exc):
+        if isinstance(exc, (UnicodeEncodeError, UnicodeTranslateError)):
+            res = []
+            codepoints = []
+            skip = False
+            for i, c in enumerate(exc.object[exc.start:exc.end]):
+                if skip:
+                    skip = False
+                    continue
+                index = i + exc.start
+                if utils.isSurrogatePair(exc.object[index:min([exc.end, index + 2])]):
+                    codepoint = utils.surrogatePairToCodepoint(exc.object[index:index + 2])
+                    skip = True
+                else:
+                    codepoint = ord(c)
+                codepoints.append(codepoint)
+            for cp in codepoints:
+                e = encode_entity_map.get(cp)
+                if e:
+                    res.append("&")
+                    res.append(e)
+                    if not e.endswith(";"):
+                        res.append(";")
+                else:
+                    res.append("&#x%s;" % (hex(cp)[2:]))
+            return ("".join(res), exc.end)
+        else:
+            return xmlcharrefreplace_errors(exc)
+
+    register_error(unicode_encode_errors, htmlentityreplace_errors)
+
+    del register_error
+
+
+class HTMLSerializer(object):
+
+    # attribute quoting options
+    quote_attr_values = False
+    quote_char = '"'
+    use_best_quote_char = True
+
+    # tag syntax options
+    omit_optional_tags = True
+    minimize_boolean_attributes = True
+    use_trailing_solidus = False
+    space_before_trailing_solidus = True
+
+    # escaping options
+    escape_lt_in_attrs = False
+    escape_rcdata = False
+    resolve_entities = True
+
+    # miscellaneous options
+    alphabetical_attributes = False
+    inject_meta_charset = True
+    strip_whitespace = False
+    sanitize = False
+
+    options = ("quote_attr_values", "quote_char", "use_best_quote_char",
+               "omit_optional_tags", "minimize_boolean_attributes",
+               "use_trailing_solidus", "space_before_trailing_solidus",
+               "escape_lt_in_attrs", "escape_rcdata", "resolve_entities",
+               "alphabetical_attributes", "inject_meta_charset",
+               "strip_whitespace", "sanitize")
+
+    def __init__(self, **kwargs):
+        """Initialize HTMLSerializer.
+
+        Keyword options (default given first unless specified) include:
+
+        inject_meta_charset=True|False
+          Whether it insert a meta element to define the character set of the
+          document.
+        quote_attr_values=True|False
+          Whether to quote attribute values that don't require quoting
+          per HTML5 parsing rules.
+        quote_char=u'"'|u"'"
+          Use given quote character for attribute quoting. Default is to
+          use double quote unless attribute value contains a double quote,
+          in which case single quotes are used instead.
+        escape_lt_in_attrs=False|True
+          Whether to escape < in attribute values.
+        escape_rcdata=False|True
+          Whether to escape characters that need to be escaped within normal
+          elements within rcdata elements such as style.
+        resolve_entities=True|False
+          Whether to resolve named character entities that appear in the
+          source tree. The XML predefined entities &lt; &gt; &amp; &quot; &apos;
+          are unaffected by this setting.
+        strip_whitespace=False|True
+          Whether to remove semantically meaningless whitespace. (This
+          compresses all whitespace to a single space except within pre.)
+        minimize_boolean_attributes=True|False
+          Shortens boolean attributes to give just the attribute value,
+          for example <input disabled="disabled"> becomes <input disabled>.
+        use_trailing_solidus=False|True
+          Includes a close-tag slash at the end of the start tag of void
+          elements (empty elements whose end tag is forbidden). E.g. <hr/>.
+        space_before_trailing_solidus=True|False
+          Places a space immediately before the closing slash in a tag
+          using a trailing solidus. E.g. <hr />. Requires use_trailing_solidus.
+        sanitize=False|True
+          Strip all unsafe or unknown constructs from output.
+          See `html5lib user documentation`_
+        omit_optional_tags=True|False
+          Omit start/end tags that are optional.
+        alphabetical_attributes=False|True
+          Reorder attributes to be in alphabetical order.
+
+        .. _html5lib user documentation: http://code.google.com/p/html5lib/wiki/UserDocumentation
+        """
+        if 'quote_char' in kwargs:
+            self.use_best_quote_char = False
+        for attr in self.options:
+            setattr(self, attr, kwargs.get(attr, getattr(self, attr)))
+        self.errors = []
+        self.strict = False
+
+    def encode(self, string):
+        assert(isinstance(string, text_type))
+        if self.encoding:
+            return string.encode(self.encoding, unicode_encode_errors)
+        else:
+            return string
+
+    def encodeStrict(self, string):
+        assert(isinstance(string, text_type))
+        if self.encoding:
+            return string.encode(self.encoding, "strict")
+        else:
+            return string
+
+    def serialize(self, treewalker, encoding=None):
+        self.encoding = encoding
+        in_cdata = False
+        self.errors = []
+
+        if encoding and self.inject_meta_charset:
+            from ..filters.inject_meta_charset import Filter
+            treewalker = Filter(treewalker, encoding)
+        # WhitespaceFilter should be used before OptionalTagFilter
+        # for maximum efficiently of this latter filter
+        if self.strip_whitespace:
+            from ..filters.whitespace import Filter
+            treewalker = Filter(treewalker)
+        if self.sanitize:
+            from ..filters.sanitizer import Filter
+            treewalker = Filter(treewalker)
+        if self.omit_optional_tags:
+            from ..filters.optionaltags import Filter
+            treewalker = Filter(treewalker)
+        # Alphabetical attributes must be last, as other filters
+        # could add attributes and alter the order
+        if self.alphabetical_attributes:
+            from ..filters.alphabeticalattributes import Filter
+            treewalker = Filter(treewalker)
+
+        for token in treewalker:
+            type = token["type"]
+            if type == "Doctype":
+                doctype = "<!DOCTYPE %s" % token["name"]
+
+                if token["publicId"]:
+                    doctype += ' PUBLIC "%s"' % token["publicId"]
+                elif token["systemId"]:
+                    doctype += " SYSTEM"
+                if token["systemId"]:
+                    if token["systemId"].find('"') >= 0:
+                        if token["systemId"].find("'") >= 0:
+                            self.serializeError(_("System identifer contains both single and double quote characters"))
+                        quote_char = "'"
+                    else:
+                        quote_char = '"'
+                    doctype += " %s%s%s" % (quote_char, token["systemId"], quote_char)
+
+                doctype += ">"
+                yield self.encodeStrict(doctype)
+
+            elif type in ("Characters", "SpaceCharacters"):
+                if type == "SpaceCharacters" or in_cdata:
+                    if in_cdata and token["data"].find("</") >= 0:
+                        self.serializeError(_("Unexpected </ in CDATA"))
+                    yield self.encode(token["data"])
+                else:
+                    yield self.encode(escape(token["data"]))
+
+            elif type in ("StartTag", "EmptyTag"):
+                name = token["name"]
+                yield self.encodeStrict("<%s" % name)
+                if name in rcdataElements and not self.escape_rcdata:
+                    in_cdata = True
+                elif in_cdata:
+                    self.serializeError(_("Unexpected child element of a CDATA element"))
+                for (attr_namespace, attr_name), attr_value in token["data"].items():
+                    # TODO: Add namespace support here
+                    k = attr_name
+                    v = attr_value
+                    yield self.encodeStrict(' ')
+
+                    yield self.encodeStrict(k)
+                    if not self.minimize_boolean_attributes or \
+                        (k not in booleanAttributes.get(name, tuple())
+                         and k not in booleanAttributes.get("", tuple())):
+                        yield self.encodeStrict("=")
+                        if self.quote_attr_values or not v:
+                            quote_attr = True
+                        else:
+                            quote_attr = reduce(lambda x, y: x or (y in v),
+                                                spaceCharacters + ">\"'=", False)
+                        v = v.replace("&", "&amp;")
+                        if self.escape_lt_in_attrs:
+                            v = v.replace("<", "&lt;")
+                        if quote_attr:
+                            quote_char = self.quote_char
+                            if self.use_best_quote_char:
+                                if "'" in v and '"' not in v:
+                                    quote_char = '"'
+                                elif '"' in v and "'" not in v:
+                                    quote_char = "'"
+                            if quote_char == "'":
+                                v = v.replace("'", "&#39;")
+                            else:
+                                v = v.replace('"', "&quot;")
+                            yield self.encodeStrict(quote_char)
+                            yield self.encode(v)
+                            yield self.encodeStrict(quote_char)
+                        else:
+                            yield self.encode(v)
+                if name in voidElements and self.use_trailing_solidus:
+                    if self.space_before_trailing_solidus:
+                        yield self.encodeStrict(" /")
+                    else:
+                        yield self.encodeStrict("/")
+                yield self.encode(">")
+
+            elif type == "EndTag":
+                name = token["name"]
+                if name in rcdataElements:
+                    in_cdata = False
+                elif in_cdata:
+                    self.serializeError(_("Unexpected child element of a CDATA element"))
+                yield self.encodeStrict("</%s>" % name)
+
+            elif type == "Comment":
+                data = token["data"]
+                if data.find("--") >= 0:
+                    self.serializeError(_("Comment contains --"))
+                yield self.encodeStrict("<!--%s-->" % token["data"])
+
+            elif type == "Entity":
+                name = token["name"]
+                key = name + ";"
+                if key not in entities:
+                    self.serializeError(_("Entity %s not recognized" % name))
+                if self.resolve_entities and key not in xmlEntities:
+                    data = entities[key]
+                else:
+                    data = "&%s;" % name
+                yield self.encodeStrict(data)
+
+            else:
+                self.serializeError(token["data"])
+
+    def render(self, treewalker, encoding=None):
+        if encoding:
+            return b"".join(list(self.serialize(treewalker, encoding)))
+        else:
+            return "".join(list(self.serialize(treewalker)))
+
+    def serializeError(self, data="XXX ERROR MESSAGE NEEDED"):
+        # XXX The idea is to make data mandatory.
+        self.errors.append(data)
+        if self.strict:
+            raise SerializeError
+
+
+def SerializeError(Exception):
+    """Error in serialized tree"""
+    pass
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/tokenizer.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/tokenizer.py
new file mode 100644
index 0000000..7977457
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/tokenizer.py
@@ -0,0 +1,1731 @@
+from __future__ import absolute_import, division, unicode_literals
+
+try:
+    chr = unichr # flake8: noqa
+except NameError:
+    pass
+
+from collections import deque
+
+from .constants import spaceCharacters
+from .constants import entities
+from .constants import asciiLetters, asciiUpper2Lower
+from .constants import digits, hexDigits, EOF
+from .constants import tokenTypes, tagTokenTypes
+from .constants import replacementCharacters
+
+from .inputstream import HTMLInputStream
+
+from .trie import Trie
+
+entitiesTrie = Trie(entities)
+
+
+class HTMLTokenizer(object):
+    """ This class takes care of tokenizing HTML.
+
+    * self.currentToken
+      Holds the token that is currently being processed.
+
+    * self.state
+      Holds a reference to the method to be invoked... XXX
+
+    * self.stream
+      Points to HTMLInputStream object.
+    """
+
+    def __init__(self, stream, encoding=None, parseMeta=True, useChardet=True,
+                 lowercaseElementName=True, lowercaseAttrName=True, parser=None):
+
+        self.stream = HTMLInputStream(stream, encoding, parseMeta, useChardet)
+        self.parser = parser
+
+        # Perform case conversions?
+        self.lowercaseElementName = lowercaseElementName
+        self.lowercaseAttrName = lowercaseAttrName
+
+        # Setup the initial tokenizer state
+        self.escapeFlag = False
+        self.lastFourChars = []
+        self.state = self.dataState
+        self.escape = False
+
+        # The current token being created
+        self.currentToken = None
+        super(HTMLTokenizer, self).__init__()
+
+    def __iter__(self):
+        """ This is where the magic happens.
+
+        We do our usually processing through the states and when we have a token
+        to return we yield the token which pauses processing until the next token
+        is requested.
+        """
+        self.tokenQueue = deque([])
+        # Start processing. When EOF is reached self.state will return False
+        # instead of True and the loop will terminate.
+        while self.state():
+            while self.stream.errors:
+                yield {"type": tokenTypes["ParseError"], "data": self.stream.errors.pop(0)}
+            while self.tokenQueue:
+                yield self.tokenQueue.popleft()
+
+    def consumeNumberEntity(self, isHex):
+        """This function returns either U+FFFD or the character based on the
+        decimal or hexadecimal representation. It also discards ";" if present.
+        If not present self.tokenQueue.append({"type": tokenTypes["ParseError"]}) is invoked.
+        """
+
+        allowed = digits
+        radix = 10
+        if isHex:
+            allowed = hexDigits
+            radix = 16
+
+        charStack = []
+
+        # Consume all the characters that are in range while making sure we
+        # don't hit an EOF.
+        c = self.stream.char()
+        while c in allowed and c is not EOF:
+            charStack.append(c)
+            c = self.stream.char()
+
+        # Convert the set of characters consumed to an int.
+        charAsInt = int("".join(charStack), radix)
+
+        # Certain characters get replaced with others
+        if charAsInt in replacementCharacters:
+            char = replacementCharacters[charAsInt]
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "illegal-codepoint-for-numeric-entity",
+                                    "datavars": {"charAsInt": charAsInt}})
+        elif ((0xD800 <= charAsInt <= 0xDFFF) or
+              (charAsInt > 0x10FFFF)):
+            char = "\uFFFD"
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "illegal-codepoint-for-numeric-entity",
+                                    "datavars": {"charAsInt": charAsInt}})
+        else:
+            # Should speed up this check somehow (e.g. move the set to a constant)
+            if ((0x0001 <= charAsInt <= 0x0008) or
+                (0x000E <= charAsInt <= 0x001F) or
+                (0x007F <= charAsInt <= 0x009F) or
+                (0xFDD0 <= charAsInt <= 0xFDEF) or
+                charAsInt in frozenset([0x000B, 0xFFFE, 0xFFFF, 0x1FFFE,
+                                        0x1FFFF, 0x2FFFE, 0x2FFFF, 0x3FFFE,
+                                        0x3FFFF, 0x4FFFE, 0x4FFFF, 0x5FFFE,
+                                        0x5FFFF, 0x6FFFE, 0x6FFFF, 0x7FFFE,
+                                        0x7FFFF, 0x8FFFE, 0x8FFFF, 0x9FFFE,
+                                        0x9FFFF, 0xAFFFE, 0xAFFFF, 0xBFFFE,
+                                        0xBFFFF, 0xCFFFE, 0xCFFFF, 0xDFFFE,
+                                        0xDFFFF, 0xEFFFE, 0xEFFFF, 0xFFFFE,
+                                        0xFFFFF, 0x10FFFE, 0x10FFFF])):
+                self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                        "data":
+                                        "illegal-codepoint-for-numeric-entity",
+                                        "datavars": {"charAsInt": charAsInt}})
+            try:
+                # Try/except needed as UCS-2 Python builds' unichar only works
+                # within the BMP.
+                char = chr(charAsInt)
+            except ValueError:
+                v = charAsInt - 0x10000
+                char = chr(0xD800 | (v >> 10)) + chr(0xDC00 | (v & 0x3FF))
+
+        # Discard the ; if present. Otherwise, put it back on the queue and
+        # invoke parseError on parser.
+        if c != ";":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "numeric-entity-without-semicolon"})
+            self.stream.unget(c)
+
+        return char
+
+    def consumeEntity(self, allowedChar=None, fromAttribute=False):
+        # Initialise to the default output for when no entity is matched
+        output = "&"
+
+        charStack = [self.stream.char()]
+        if (charStack[0] in spaceCharacters or charStack[0] in (EOF, "<", "&")
+                or (allowedChar is not None and allowedChar == charStack[0])):
+            self.stream.unget(charStack[0])
+
+        elif charStack[0] == "#":
+            # Read the next character to see if it's hex or decimal
+            hex = False
+            charStack.append(self.stream.char())
+            if charStack[-1] in ("x", "X"):
+                hex = True
+                charStack.append(self.stream.char())
+
+            # charStack[-1] should be the first digit
+            if (hex and charStack[-1] in hexDigits) \
+                    or (not hex and charStack[-1] in digits):
+                # At least one digit found, so consume the whole number
+                self.stream.unget(charStack[-1])
+                output = self.consumeNumberEntity(hex)
+            else:
+                # No digits found
+                self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                        "data": "expected-numeric-entity"})
+                self.stream.unget(charStack.pop())
+                output = "&" + "".join(charStack)
+
+        else:
+            # At this point in the process might have named entity. Entities
+            # are stored in the global variable "entities".
+            #
+            # Consume characters and compare to these to a substring of the
+            # entity names in the list until the substring no longer matches.
+            while (charStack[-1] is not EOF):
+                if not entitiesTrie.has_keys_with_prefix("".join(charStack)):
+                    break
+                charStack.append(self.stream.char())
+
+            # At this point we have a string that starts with some characters
+            # that may match an entity
+            # Try to find the longest entity the string will match to take care
+            # of &noti for instance.
+            try:
+                entityName = entitiesTrie.longest_prefix("".join(charStack[:-1]))
+                entityLength = len(entityName)
+            except KeyError:
+                entityName = None
+
+            if entityName is not None:
+                if entityName[-1] != ";":
+                    self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                            "named-entity-without-semicolon"})
+                if (entityName[-1] != ";" and fromAttribute and
+                    (charStack[entityLength] in asciiLetters or
+                     charStack[entityLength] in digits or
+                     charStack[entityLength] == "=")):
+                    self.stream.unget(charStack.pop())
+                    output = "&" + "".join(charStack)
+                else:
+                    output = entities[entityName]
+                    self.stream.unget(charStack.pop())
+                    output += "".join(charStack[entityLength:])
+            else:
+                self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                        "expected-named-entity"})
+                self.stream.unget(charStack.pop())
+                output = "&" + "".join(charStack)
+
+        if fromAttribute:
+            self.currentToken["data"][-1][1] += output
+        else:
+            if output in spaceCharacters:
+                tokenType = "SpaceCharacters"
+            else:
+                tokenType = "Characters"
+            self.tokenQueue.append({"type": tokenTypes[tokenType], "data": output})
+
+    def processEntityInAttribute(self, allowedChar):
+        """This method replaces the need for "entityInAttributeValueState".
+        """
+        self.consumeEntity(allowedChar=allowedChar, fromAttribute=True)
+
+    def emitCurrentToken(self):
+        """This method is a generic handler for emitting the tags. It also sets
+        the state to "data" because that's what's needed after a token has been
+        emitted.
+        """
+        token = self.currentToken
+        # Add token to the queue to be yielded
+        if (token["type"] in tagTokenTypes):
+            if self.lowercaseElementName:
+                token["name"] = token["name"].translate(asciiUpper2Lower)
+            if token["type"] == tokenTypes["EndTag"]:
+                if token["data"]:
+                    self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                            "data": "attributes-in-end-tag"})
+                if token["selfClosing"]:
+                    self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                            "data": "self-closing-flag-on-end-tag"})
+        self.tokenQueue.append(token)
+        self.state = self.dataState
+
+    # Below are the various tokenizer states worked out.
+    def dataState(self):
+        data = self.stream.char()
+        if data == "&":
+            self.state = self.entityDataState
+        elif data == "<":
+            self.state = self.tagOpenState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\u0000"})
+        elif data is EOF:
+            # Tokenization ends.
+            return False
+        elif data in spaceCharacters:
+            # Directly after emitting a token you switch back to the "data
+            # state". At that point spaceCharacters are important so they are
+            # emitted separately.
+            self.tokenQueue.append({"type": tokenTypes["SpaceCharacters"], "data":
+                                    data + self.stream.charsUntil(spaceCharacters, True)})
+            # No need to update lastFourChars here, since the first space will
+            # have already been appended to lastFourChars and will have broken
+            # any <!-- or --> sequences
+        else:
+            chars = self.stream.charsUntil(("&", "<", "\u0000"))
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
+                                    data + chars})
+        return True
+
+    def entityDataState(self):
+        self.consumeEntity()
+        self.state = self.dataState
+        return True
+
+    def rcdataState(self):
+        data = self.stream.char()
+        if data == "&":
+            self.state = self.characterReferenceInRcdata
+        elif data == "<":
+            self.state = self.rcdataLessThanSignState
+        elif data == EOF:
+            # Tokenization ends.
+            return False
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+        elif data in spaceCharacters:
+            # Directly after emitting a token you switch back to the "data
+            # state". At that point spaceCharacters are important so they are
+            # emitted separately.
+            self.tokenQueue.append({"type": tokenTypes["SpaceCharacters"], "data":
+                                    data + self.stream.charsUntil(spaceCharacters, True)})
+            # No need to update lastFourChars here, since the first space will
+            # have already been appended to lastFourChars and will have broken
+            # any <!-- or --> sequences
+        else:
+            chars = self.stream.charsUntil(("&", "<", "\u0000"))
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
+                                    data + chars})
+        return True
+
+    def characterReferenceInRcdata(self):
+        self.consumeEntity()
+        self.state = self.rcdataState
+        return True
+
+    def rawtextState(self):
+        data = self.stream.char()
+        if data == "<":
+            self.state = self.rawtextLessThanSignState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+        elif data == EOF:
+            # Tokenization ends.
+            return False
+        else:
+            chars = self.stream.charsUntil(("<", "\u0000"))
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
+                                    data + chars})
+        return True
+
+    def scriptDataState(self):
+        data = self.stream.char()
+        if data == "<":
+            self.state = self.scriptDataLessThanSignState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+        elif data == EOF:
+            # Tokenization ends.
+            return False
+        else:
+            chars = self.stream.charsUntil(("<", "\u0000"))
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
+                                    data + chars})
+        return True
+
+    def plaintextState(self):
+        data = self.stream.char()
+        if data == EOF:
+            # Tokenization ends.
+            return False
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
+                                    data + self.stream.charsUntil("\u0000")})
+        return True
+
+    def tagOpenState(self):
+        data = self.stream.char()
+        if data == "!":
+            self.state = self.markupDeclarationOpenState
+        elif data == "/":
+            self.state = self.closeTagOpenState
+        elif data in asciiLetters:
+            self.currentToken = {"type": tokenTypes["StartTag"],
+                                 "name": data, "data": [],
+                                 "selfClosing": False,
+                                 "selfClosingAcknowledged": False}
+            self.state = self.tagNameState
+        elif data == ">":
+            # XXX In theory it could be something besides a tag name. But
+            # do we really care?
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-tag-name-but-got-right-bracket"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<>"})
+            self.state = self.dataState
+        elif data == "?":
+            # XXX In theory it could be something besides a tag name. But
+            # do we really care?
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-tag-name-but-got-question-mark"})
+            self.stream.unget(data)
+            self.state = self.bogusCommentState
+        else:
+            # XXX
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-tag-name"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.stream.unget(data)
+            self.state = self.dataState
+        return True
+
+    def closeTagOpenState(self):
+        data = self.stream.char()
+        if data in asciiLetters:
+            self.currentToken = {"type": tokenTypes["EndTag"], "name": data,
+                                 "data": [], "selfClosing": False}
+            self.state = self.tagNameState
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-closing-tag-but-got-right-bracket"})
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-closing-tag-but-got-eof"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
+            self.state = self.dataState
+        else:
+            # XXX data can be _'_...
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-closing-tag-but-got-char",
+                                    "datavars": {"data": data}})
+            self.stream.unget(data)
+            self.state = self.bogusCommentState
+        return True
+
+    def tagNameState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.beforeAttributeNameState
+        elif data == ">":
+            self.emitCurrentToken()
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-tag-name"})
+            self.state = self.dataState
+        elif data == "/":
+            self.state = self.selfClosingStartTagState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["name"] += "\uFFFD"
+        else:
+            self.currentToken["name"] += data
+            # (Don't use charsUntil here, because tag names are
+            # very short and it's faster to not do anything fancy)
+        return True
+
+    def rcdataLessThanSignState(self):
+        data = self.stream.char()
+        if data == "/":
+            self.temporaryBuffer = ""
+            self.state = self.rcdataEndTagOpenState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.stream.unget(data)
+            self.state = self.rcdataState
+        return True
+
+    def rcdataEndTagOpenState(self):
+        data = self.stream.char()
+        if data in asciiLetters:
+            self.temporaryBuffer += data
+            self.state = self.rcdataEndTagNameState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
+            self.stream.unget(data)
+            self.state = self.rcdataState
+        return True
+
+    def rcdataEndTagNameState(self):
+        appropriate = self.currentToken and self.currentToken["name"].lower() == self.temporaryBuffer.lower()
+        data = self.stream.char()
+        if data in spaceCharacters and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.beforeAttributeNameState
+        elif data == "/" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.selfClosingStartTagState
+        elif data == ">" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.emitCurrentToken()
+            self.state = self.dataState
+        elif data in asciiLetters:
+            self.temporaryBuffer += data
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "</" + self.temporaryBuffer})
+            self.stream.unget(data)
+            self.state = self.rcdataState
+        return True
+
+    def rawtextLessThanSignState(self):
+        data = self.stream.char()
+        if data == "/":
+            self.temporaryBuffer = ""
+            self.state = self.rawtextEndTagOpenState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.stream.unget(data)
+            self.state = self.rawtextState
+        return True
+
+    def rawtextEndTagOpenState(self):
+        data = self.stream.char()
+        if data in asciiLetters:
+            self.temporaryBuffer += data
+            self.state = self.rawtextEndTagNameState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
+            self.stream.unget(data)
+            self.state = self.rawtextState
+        return True
+
+    def rawtextEndTagNameState(self):
+        appropriate = self.currentToken and self.currentToken["name"].lower() == self.temporaryBuffer.lower()
+        data = self.stream.char()
+        if data in spaceCharacters and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.beforeAttributeNameState
+        elif data == "/" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.selfClosingStartTagState
+        elif data == ">" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.emitCurrentToken()
+            self.state = self.dataState
+        elif data in asciiLetters:
+            self.temporaryBuffer += data
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "</" + self.temporaryBuffer})
+            self.stream.unget(data)
+            self.state = self.rawtextState
+        return True
+
+    def scriptDataLessThanSignState(self):
+        data = self.stream.char()
+        if data == "/":
+            self.temporaryBuffer = ""
+            self.state = self.scriptDataEndTagOpenState
+        elif data == "!":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<!"})
+            self.state = self.scriptDataEscapeStartState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.stream.unget(data)
+            self.state = self.scriptDataState
+        return True
+
+    def scriptDataEndTagOpenState(self):
+        data = self.stream.char()
+        if data in asciiLetters:
+            self.temporaryBuffer += data
+            self.state = self.scriptDataEndTagNameState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
+            self.stream.unget(data)
+            self.state = self.scriptDataState
+        return True
+
+    def scriptDataEndTagNameState(self):
+        appropriate = self.currentToken and self.currentToken["name"].lower() == self.temporaryBuffer.lower()
+        data = self.stream.char()
+        if data in spaceCharacters and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.beforeAttributeNameState
+        elif data == "/" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.selfClosingStartTagState
+        elif data == ">" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.emitCurrentToken()
+            self.state = self.dataState
+        elif data in asciiLetters:
+            self.temporaryBuffer += data
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "</" + self.temporaryBuffer})
+            self.stream.unget(data)
+            self.state = self.scriptDataState
+        return True
+
+    def scriptDataEscapeStartState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+            self.state = self.scriptDataEscapeStartDashState
+        else:
+            self.stream.unget(data)
+            self.state = self.scriptDataState
+        return True
+
+    def scriptDataEscapeStartDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+            self.state = self.scriptDataEscapedDashDashState
+        else:
+            self.stream.unget(data)
+            self.state = self.scriptDataState
+        return True
+
+    def scriptDataEscapedState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+            self.state = self.scriptDataEscapedDashState
+        elif data == "<":
+            self.state = self.scriptDataEscapedLessThanSignState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+        elif data == EOF:
+            self.state = self.dataState
+        else:
+            chars = self.stream.charsUntil(("<", "-", "\u0000"))
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data":
+                                    data + chars})
+        return True
+
+    def scriptDataEscapedDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+            self.state = self.scriptDataEscapedDashDashState
+        elif data == "<":
+            self.state = self.scriptDataEscapedLessThanSignState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+            self.state = self.scriptDataEscapedState
+        elif data == EOF:
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            self.state = self.scriptDataEscapedState
+        return True
+
+    def scriptDataEscapedDashDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+        elif data == "<":
+            self.state = self.scriptDataEscapedLessThanSignState
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ">"})
+            self.state = self.scriptDataState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+            self.state = self.scriptDataEscapedState
+        elif data == EOF:
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            self.state = self.scriptDataEscapedState
+        return True
+
+    def scriptDataEscapedLessThanSignState(self):
+        data = self.stream.char()
+        if data == "/":
+            self.temporaryBuffer = ""
+            self.state = self.scriptDataEscapedEndTagOpenState
+        elif data in asciiLetters:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<" + data})
+            self.temporaryBuffer = data
+            self.state = self.scriptDataDoubleEscapeStartState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.stream.unget(data)
+            self.state = self.scriptDataEscapedState
+        return True
+
+    def scriptDataEscapedEndTagOpenState(self):
+        data = self.stream.char()
+        if data in asciiLetters:
+            self.temporaryBuffer = data
+            self.state = self.scriptDataEscapedEndTagNameState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "</"})
+            self.stream.unget(data)
+            self.state = self.scriptDataEscapedState
+        return True
+
+    def scriptDataEscapedEndTagNameState(self):
+        appropriate = self.currentToken and self.currentToken["name"].lower() == self.temporaryBuffer.lower()
+        data = self.stream.char()
+        if data in spaceCharacters and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.beforeAttributeNameState
+        elif data == "/" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.state = self.selfClosingStartTagState
+        elif data == ">" and appropriate:
+            self.currentToken = {"type": tokenTypes["EndTag"],
+                                 "name": self.temporaryBuffer,
+                                 "data": [], "selfClosing": False}
+            self.emitCurrentToken()
+            self.state = self.dataState
+        elif data in asciiLetters:
+            self.temporaryBuffer += data
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "</" + self.temporaryBuffer})
+            self.stream.unget(data)
+            self.state = self.scriptDataEscapedState
+        return True
+
+    def scriptDataDoubleEscapeStartState(self):
+        data = self.stream.char()
+        if data in (spaceCharacters | frozenset(("/", ">"))):
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            if self.temporaryBuffer.lower() == "script":
+                self.state = self.scriptDataDoubleEscapedState
+            else:
+                self.state = self.scriptDataEscapedState
+        elif data in asciiLetters:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            self.temporaryBuffer += data
+        else:
+            self.stream.unget(data)
+            self.state = self.scriptDataEscapedState
+        return True
+
+    def scriptDataDoubleEscapedState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+            self.state = self.scriptDataDoubleEscapedDashState
+        elif data == "<":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.state = self.scriptDataDoubleEscapedLessThanSignState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+        elif data == EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-script-in-script"})
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+        return True
+
+    def scriptDataDoubleEscapedDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+            self.state = self.scriptDataDoubleEscapedDashDashState
+        elif data == "<":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.state = self.scriptDataDoubleEscapedLessThanSignState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+            self.state = self.scriptDataDoubleEscapedState
+        elif data == EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-script-in-script"})
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            self.state = self.scriptDataDoubleEscapedState
+        return True
+
+    def scriptDataDoubleEscapedDashDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "-"})
+        elif data == "<":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "<"})
+            self.state = self.scriptDataDoubleEscapedLessThanSignState
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": ">"})
+            self.state = self.scriptDataState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": "\uFFFD"})
+            self.state = self.scriptDataDoubleEscapedState
+        elif data == EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-script-in-script"})
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            self.state = self.scriptDataDoubleEscapedState
+        return True
+
+    def scriptDataDoubleEscapedLessThanSignState(self):
+        data = self.stream.char()
+        if data == "/":
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": "/"})
+            self.temporaryBuffer = ""
+            self.state = self.scriptDataDoubleEscapeEndState
+        else:
+            self.stream.unget(data)
+            self.state = self.scriptDataDoubleEscapedState
+        return True
+
+    def scriptDataDoubleEscapeEndState(self):
+        data = self.stream.char()
+        if data in (spaceCharacters | frozenset(("/", ">"))):
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            if self.temporaryBuffer.lower() == "script":
+                self.state = self.scriptDataEscapedState
+            else:
+                self.state = self.scriptDataDoubleEscapedState
+        elif data in asciiLetters:
+            self.tokenQueue.append({"type": tokenTypes["Characters"], "data": data})
+            self.temporaryBuffer += data
+        else:
+            self.stream.unget(data)
+            self.state = self.scriptDataDoubleEscapedState
+        return True
+
+    def beforeAttributeNameState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.stream.charsUntil(spaceCharacters, True)
+        elif data in asciiLetters:
+            self.currentToken["data"].append([data, ""])
+            self.state = self.attributeNameState
+        elif data == ">":
+            self.emitCurrentToken()
+        elif data == "/":
+            self.state = self.selfClosingStartTagState
+        elif data in ("'", '"', "=", "<"):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "invalid-character-in-attribute-name"})
+            self.currentToken["data"].append([data, ""])
+            self.state = self.attributeNameState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"].append(["\uFFFD", ""])
+            self.state = self.attributeNameState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-attribute-name-but-got-eof"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"].append([data, ""])
+            self.state = self.attributeNameState
+        return True
+
+    def attributeNameState(self):
+        data = self.stream.char()
+        leavingThisState = True
+        emitToken = False
+        if data == "=":
+            self.state = self.beforeAttributeValueState
+        elif data in asciiLetters:
+            self.currentToken["data"][-1][0] += data +\
+                self.stream.charsUntil(asciiLetters, True)
+            leavingThisState = False
+        elif data == ">":
+            # XXX If we emit here the attributes are converted to a dict
+            # without being checked and when the code below runs we error
+            # because data is a dict not a list
+            emitToken = True
+        elif data in spaceCharacters:
+            self.state = self.afterAttributeNameState
+        elif data == "/":
+            self.state = self.selfClosingStartTagState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"][-1][0] += "\uFFFD"
+            leavingThisState = False
+        elif data in ("'", '"', "<"):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data":
+                                    "invalid-character-in-attribute-name"})
+            self.currentToken["data"][-1][0] += data
+            leavingThisState = False
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "eof-in-attribute-name"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"][-1][0] += data
+            leavingThisState = False
+
+        if leavingThisState:
+            # Attributes are not dropped at this stage. That happens when the
+            # start tag token is emitted so values can still be safely appended
+            # to attributes, but we do want to report the parse error in time.
+            if self.lowercaseAttrName:
+                self.currentToken["data"][-1][0] = (
+                    self.currentToken["data"][-1][0].translate(asciiUpper2Lower))
+            for name, value in self.currentToken["data"][:-1]:
+                if self.currentToken["data"][-1][0] == name:
+                    self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                            "duplicate-attribute"})
+                    break
+            # XXX Fix for above XXX
+            if emitToken:
+                self.emitCurrentToken()
+        return True
+
+    def afterAttributeNameState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.stream.charsUntil(spaceCharacters, True)
+        elif data == "=":
+            self.state = self.beforeAttributeValueState
+        elif data == ">":
+            self.emitCurrentToken()
+        elif data in asciiLetters:
+            self.currentToken["data"].append([data, ""])
+            self.state = self.attributeNameState
+        elif data == "/":
+            self.state = self.selfClosingStartTagState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"].append(["\uFFFD", ""])
+            self.state = self.attributeNameState
+        elif data in ("'", '"', "<"):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "invalid-character-after-attribute-name"})
+            self.currentToken["data"].append([data, ""])
+            self.state = self.attributeNameState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-end-of-tag-but-got-eof"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"].append([data, ""])
+            self.state = self.attributeNameState
+        return True
+
+    def beforeAttributeValueState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.stream.charsUntil(spaceCharacters, True)
+        elif data == "\"":
+            self.state = self.attributeValueDoubleQuotedState
+        elif data == "&":
+            self.state = self.attributeValueUnQuotedState
+            self.stream.unget(data)
+        elif data == "'":
+            self.state = self.attributeValueSingleQuotedState
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-attribute-value-but-got-right-bracket"})
+            self.emitCurrentToken()
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"][-1][1] += "\uFFFD"
+            self.state = self.attributeValueUnQuotedState
+        elif data in ("=", "<", "`"):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "equals-in-unquoted-attribute-value"})
+            self.currentToken["data"][-1][1] += data
+            self.state = self.attributeValueUnQuotedState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-attribute-value-but-got-eof"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"][-1][1] += data
+            self.state = self.attributeValueUnQuotedState
+        return True
+
+    def attributeValueDoubleQuotedState(self):
+        data = self.stream.char()
+        if data == "\"":
+            self.state = self.afterAttributeValueState
+        elif data == "&":
+            self.processEntityInAttribute('"')
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"][-1][1] += "\uFFFD"
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-attribute-value-double-quote"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"][-1][1] += data +\
+                self.stream.charsUntil(("\"", "&", "\u0000"))
+        return True
+
+    def attributeValueSingleQuotedState(self):
+        data = self.stream.char()
+        if data == "'":
+            self.state = self.afterAttributeValueState
+        elif data == "&":
+            self.processEntityInAttribute("'")
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"][-1][1] += "\uFFFD"
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-attribute-value-single-quote"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"][-1][1] += data +\
+                self.stream.charsUntil(("'", "&", "\u0000"))
+        return True
+
+    def attributeValueUnQuotedState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.beforeAttributeNameState
+        elif data == "&":
+            self.processEntityInAttribute(">")
+        elif data == ">":
+            self.emitCurrentToken()
+        elif data in ('"', "'", "=", "<", "`"):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-character-in-unquoted-attribute-value"})
+            self.currentToken["data"][-1][1] += data
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"][-1][1] += "\uFFFD"
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-attribute-value-no-quotes"})
+            self.state = self.dataState
+        else:
+            self.currentToken["data"][-1][1] += data + self.stream.charsUntil(
+                frozenset(("&", ">", '"', "'", "=", "<", "`", "\u0000")) | spaceCharacters)
+        return True
+
+    def afterAttributeValueState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.beforeAttributeNameState
+        elif data == ">":
+            self.emitCurrentToken()
+        elif data == "/":
+            self.state = self.selfClosingStartTagState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-EOF-after-attribute-value"})
+            self.stream.unget(data)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-character-after-attribute-value"})
+            self.stream.unget(data)
+            self.state = self.beforeAttributeNameState
+        return True
+
+    def selfClosingStartTagState(self):
+        data = self.stream.char()
+        if data == ">":
+            self.currentToken["selfClosing"] = True
+            self.emitCurrentToken()
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data":
+                                    "unexpected-EOF-after-solidus-in-tag"})
+            self.stream.unget(data)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-character-after-solidus-in-tag"})
+            self.stream.unget(data)
+            self.state = self.beforeAttributeNameState
+        return True
+
+    def bogusCommentState(self):
+        # Make a new comment token and give it as value all the characters
+        # until the first > or EOF (charsUntil checks for EOF automatically)
+        # and emit it.
+        data = self.stream.charsUntil(">")
+        data = data.replace("\u0000", "\uFFFD")
+        self.tokenQueue.append(
+            {"type": tokenTypes["Comment"], "data": data})
+
+        # Eat the character directly after the bogus comment which is either a
+        # ">" or an EOF.
+        self.stream.char()
+        self.state = self.dataState
+        return True
+
+    def markupDeclarationOpenState(self):
+        charStack = [self.stream.char()]
+        if charStack[-1] == "-":
+            charStack.append(self.stream.char())
+            if charStack[-1] == "-":
+                self.currentToken = {"type": tokenTypes["Comment"], "data": ""}
+                self.state = self.commentStartState
+                return True
+        elif charStack[-1] in ('d', 'D'):
+            matched = True
+            for expected in (('o', 'O'), ('c', 'C'), ('t', 'T'),
+                             ('y', 'Y'), ('p', 'P'), ('e', 'E')):
+                charStack.append(self.stream.char())
+                if charStack[-1] not in expected:
+                    matched = False
+                    break
+            if matched:
+                self.currentToken = {"type": tokenTypes["Doctype"],
+                                     "name": "",
+                                     "publicId": None, "systemId": None,
+                                     "correct": True}
+                self.state = self.doctypeState
+                return True
+        elif (charStack[-1] == "[" and
+              self.parser is not None and
+              self.parser.tree.openElements and
+              self.parser.tree.openElements[-1].namespace != self.parser.tree.defaultNamespace):
+            matched = True
+            for expected in ["C", "D", "A", "T", "A", "["]:
+                charStack.append(self.stream.char())
+                if charStack[-1] != expected:
+                    matched = False
+                    break
+            if matched:
+                self.state = self.cdataSectionState
+                return True
+
+        self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                "expected-dashes-or-doctype"})
+
+        while charStack:
+            self.stream.unget(charStack.pop())
+        self.state = self.bogusCommentState
+        return True
+
+    def commentStartState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.state = self.commentStartDashState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"] += "\uFFFD"
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "incorrect-comment"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-comment"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["data"] += data
+            self.state = self.commentState
+        return True
+
+    def commentStartDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.state = self.commentEndState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"] += "-\uFFFD"
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "incorrect-comment"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-comment"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["data"] += "-" + data
+            self.state = self.commentState
+        return True
+
+    def commentState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.state = self.commentEndDashState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"] += "\uFFFD"
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "eof-in-comment"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["data"] += data + \
+                self.stream.charsUntil(("-", "\u0000"))
+        return True
+
+    def commentEndDashState(self):
+        data = self.stream.char()
+        if data == "-":
+            self.state = self.commentEndState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"] += "-\uFFFD"
+            self.state = self.commentState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-comment-end-dash"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["data"] += "-" + data
+            self.state = self.commentState
+        return True
+
+    def commentEndState(self):
+        data = self.stream.char()
+        if data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"] += "--\uFFFD"
+            self.state = self.commentState
+        elif data == "!":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-bang-after-double-dash-in-comment"})
+            self.state = self.commentEndBangState
+        elif data == "-":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-dash-after-double-dash-in-comment"})
+            self.currentToken["data"] += data
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-comment-double-dash"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            # XXX
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-comment"})
+            self.currentToken["data"] += "--" + data
+            self.state = self.commentState
+        return True
+
+    def commentEndBangState(self):
+        data = self.stream.char()
+        if data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data == "-":
+            self.currentToken["data"] += "--!"
+            self.state = self.commentEndDashState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["data"] += "--!\uFFFD"
+            self.state = self.commentState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-comment-end-bang-state"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["data"] += "--!" + data
+            self.state = self.commentState
+        return True
+
+    def doctypeState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.beforeDoctypeNameState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-doctype-name-but-got-eof"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "need-space-after-doctype"})
+            self.stream.unget(data)
+            self.state = self.beforeDoctypeNameState
+        return True
+
+    def beforeDoctypeNameState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            pass
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-doctype-name-but-got-right-bracket"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["name"] = "\uFFFD"
+            self.state = self.doctypeNameState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-doctype-name-but-got-eof"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["name"] = data
+            self.state = self.doctypeNameState
+        return True
+
+    def doctypeNameState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.currentToken["name"] = self.currentToken["name"].translate(asciiUpper2Lower)
+            self.state = self.afterDoctypeNameState
+        elif data == ">":
+            self.currentToken["name"] = self.currentToken["name"].translate(asciiUpper2Lower)
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["name"] += "\uFFFD"
+            self.state = self.doctypeNameState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype-name"})
+            self.currentToken["correct"] = False
+            self.currentToken["name"] = self.currentToken["name"].translate(asciiUpper2Lower)
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["name"] += data
+        return True
+
+    def afterDoctypeNameState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            pass
+        elif data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.currentToken["correct"] = False
+            self.stream.unget(data)
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            if data in ("p", "P"):
+                matched = True
+                for expected in (("u", "U"), ("b", "B"), ("l", "L"),
+                                 ("i", "I"), ("c", "C")):
+                    data = self.stream.char()
+                    if data not in expected:
+                        matched = False
+                        break
+                if matched:
+                    self.state = self.afterDoctypePublicKeywordState
+                    return True
+            elif data in ("s", "S"):
+                matched = True
+                for expected in (("y", "Y"), ("s", "S"), ("t", "T"),
+                                 ("e", "E"), ("m", "M")):
+                    data = self.stream.char()
+                    if data not in expected:
+                        matched = False
+                        break
+                if matched:
+                    self.state = self.afterDoctypeSystemKeywordState
+                    return True
+
+            # All the characters read before the current 'data' will be
+            # [a-zA-Z], so they're garbage in the bogus doctype and can be
+            # discarded; only the latest character might be '>' or EOF
+            # and needs to be ungetted
+            self.stream.unget(data)
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "expected-space-or-right-bracket-in-doctype", "datavars":
+                                    {"data": data}})
+            self.currentToken["correct"] = False
+            self.state = self.bogusDoctypeState
+
+        return True
+
+    def afterDoctypePublicKeywordState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.beforeDoctypePublicIdentifierState
+        elif data in ("'", '"'):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.stream.unget(data)
+            self.state = self.beforeDoctypePublicIdentifierState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.stream.unget(data)
+            self.state = self.beforeDoctypePublicIdentifierState
+        return True
+
+    def beforeDoctypePublicIdentifierState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            pass
+        elif data == "\"":
+            self.currentToken["publicId"] = ""
+            self.state = self.doctypePublicIdentifierDoubleQuotedState
+        elif data == "'":
+            self.currentToken["publicId"] = ""
+            self.state = self.doctypePublicIdentifierSingleQuotedState
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-end-of-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["correct"] = False
+            self.state = self.bogusDoctypeState
+        return True
+
+    def doctypePublicIdentifierDoubleQuotedState(self):
+        data = self.stream.char()
+        if data == "\"":
+            self.state = self.afterDoctypePublicIdentifierState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["publicId"] += "\uFFFD"
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-end-of-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["publicId"] += data
+        return True
+
+    def doctypePublicIdentifierSingleQuotedState(self):
+        data = self.stream.char()
+        if data == "'":
+            self.state = self.afterDoctypePublicIdentifierState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["publicId"] += "\uFFFD"
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-end-of-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["publicId"] += data
+        return True
+
+    def afterDoctypePublicIdentifierState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.betweenDoctypePublicAndSystemIdentifiersState
+        elif data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data == '"':
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["systemId"] = ""
+            self.state = self.doctypeSystemIdentifierDoubleQuotedState
+        elif data == "'":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["systemId"] = ""
+            self.state = self.doctypeSystemIdentifierSingleQuotedState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["correct"] = False
+            self.state = self.bogusDoctypeState
+        return True
+
+    def betweenDoctypePublicAndSystemIdentifiersState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            pass
+        elif data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data == '"':
+            self.currentToken["systemId"] = ""
+            self.state = self.doctypeSystemIdentifierDoubleQuotedState
+        elif data == "'":
+            self.currentToken["systemId"] = ""
+            self.state = self.doctypeSystemIdentifierSingleQuotedState
+        elif data == EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["correct"] = False
+            self.state = self.bogusDoctypeState
+        return True
+
+    def afterDoctypeSystemKeywordState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            self.state = self.beforeDoctypeSystemIdentifierState
+        elif data in ("'", '"'):
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.stream.unget(data)
+            self.state = self.beforeDoctypeSystemIdentifierState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.stream.unget(data)
+            self.state = self.beforeDoctypeSystemIdentifierState
+        return True
+
+    def beforeDoctypeSystemIdentifierState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            pass
+        elif data == "\"":
+            self.currentToken["systemId"] = ""
+            self.state = self.doctypeSystemIdentifierDoubleQuotedState
+        elif data == "'":
+            self.currentToken["systemId"] = ""
+            self.state = self.doctypeSystemIdentifierSingleQuotedState
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.currentToken["correct"] = False
+            self.state = self.bogusDoctypeState
+        return True
+
+    def doctypeSystemIdentifierDoubleQuotedState(self):
+        data = self.stream.char()
+        if data == "\"":
+            self.state = self.afterDoctypeSystemIdentifierState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["systemId"] += "\uFFFD"
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-end-of-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["systemId"] += data
+        return True
+
+    def doctypeSystemIdentifierSingleQuotedState(self):
+        data = self.stream.char()
+        if data == "'":
+            self.state = self.afterDoctypeSystemIdentifierState
+        elif data == "\u0000":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                    "data": "invalid-codepoint"})
+            self.currentToken["systemId"] += "\uFFFD"
+        elif data == ">":
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-end-of-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.currentToken["systemId"] += data
+        return True
+
+    def afterDoctypeSystemIdentifierState(self):
+        data = self.stream.char()
+        if data in spaceCharacters:
+            pass
+        elif data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "eof-in-doctype"})
+            self.currentToken["correct"] = False
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            self.tokenQueue.append({"type": tokenTypes["ParseError"], "data":
+                                    "unexpected-char-in-doctype"})
+            self.state = self.bogusDoctypeState
+        return True
+
+    def bogusDoctypeState(self):
+        data = self.stream.char()
+        if data == ">":
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        elif data is EOF:
+            # XXX EMIT
+            self.stream.unget(data)
+            self.tokenQueue.append(self.currentToken)
+            self.state = self.dataState
+        else:
+            pass
+        return True
+
+    def cdataSectionState(self):
+        data = []
+        while True:
+            data.append(self.stream.charsUntil("]"))
+            data.append(self.stream.charsUntil(">"))
+            char = self.stream.char()
+            if char == EOF:
+                break
+            else:
+                assert char == ">"
+                if data[-1][-2:] == "]]":
+                    data[-1] = data[-1][:-2]
+                    break
+                else:
+                    data.append(char)
+
+        data = "".join(data)
+        # Deal with null here rather than in the parser
+        nullCount = data.count("\u0000")
+        if nullCount > 0:
+            for i in range(nullCount):
+                self.tokenQueue.append({"type": tokenTypes["ParseError"],
+                                        "data": "invalid-codepoint"})
+            data = data.replace("\u0000", "\uFFFD")
+        if data:
+            self.tokenQueue.append({"type": tokenTypes["Characters"],
+                                    "data": data})
+        self.state = self.dataState
+        return True
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treeadapters/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treeadapters/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treeadapters/__init__.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treeadapters/sax.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treeadapters/sax.py
new file mode 100644
index 0000000..ad47df95
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treeadapters/sax.py
@@ -0,0 +1,44 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from xml.sax.xmlreader import AttributesNSImpl
+
+from ..constants import adjustForeignAttributes, unadjustForeignAttributes
+
+prefix_mapping = {}
+for prefix, localName, namespace in adjustForeignAttributes.values():
+    if prefix is not None:
+        prefix_mapping[prefix] = namespace
+
+
+def to_sax(walker, handler):
+    """Call SAX-like content handler based on treewalker walker"""
+    handler.startDocument()
+    for prefix, namespace in prefix_mapping.items():
+        handler.startPrefixMapping(prefix, namespace)
+
+    for token in walker:
+        type = token["type"]
+        if type == "Doctype":
+            continue
+        elif type in ("StartTag", "EmptyTag"):
+            attrs = AttributesNSImpl(token["data"],
+                                     unadjustForeignAttributes)
+            handler.startElementNS((token["namespace"], token["name"]),
+                                   token["name"],
+                                   attrs)
+            if type == "EmptyTag":
+                handler.endElementNS((token["namespace"], token["name"]),
+                                     token["name"])
+        elif type == "EndTag":
+            handler.endElementNS((token["namespace"], token["name"]),
+                                 token["name"])
+        elif type in ("Characters", "SpaceCharacters"):
+            handler.characters(token["data"])
+        elif type == "Comment":
+            pass
+        else:
+            assert False, "Unknown token type"
+
+    for prefix, namespace in prefix_mapping.items():
+        handler.endPrefixMapping(prefix)
+    handler.endDocument()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/__init__.py
new file mode 100644
index 0000000..6a6b2a4c
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/__init__.py
@@ -0,0 +1,76 @@
+"""A collection of modules for building different kinds of tree from
+HTML documents.
+
+To create a treebuilder for a new type of tree, you need to do
+implement several things:
+
+1) A set of classes for various types of elements: Document, Doctype,
+Comment, Element. These must implement the interface of
+_base.treebuilders.Node (although comment nodes have a different
+signature for their constructor, see treebuilders.etree.Comment)
+Textual content may also be implemented as another node type, or not, as
+your tree implementation requires.
+
+2) A treebuilder object (called TreeBuilder by convention) that
+inherits from treebuilders._base.TreeBuilder. This has 4 required attributes:
+documentClass - the class to use for the bottommost node of a document
+elementClass - the class to use for HTML Elements
+commentClass - the class to use for comments
+doctypeClass - the class to use for doctypes
+It also has one required method:
+getDocument - Returns the root node of the complete document tree
+
+3) If you wish to run the unit tests, you must also create a
+testSerializer method on your treebuilder which accepts a node and
+returns a string containing Node and its children serialized according
+to the format used in the unittests
+"""
+
+from __future__ import absolute_import, division, unicode_literals
+
+from ..utils import default_etree
+
+treeBuilderCache = {}
+
+
+def getTreeBuilder(treeType, implementation=None, **kwargs):
+    """Get a TreeBuilder class for various types of tree with built-in support
+
+    treeType - the name of the tree type required (case-insensitive). Supported
+               values are:
+
+               "dom" - A generic builder for DOM implementations, defaulting to
+                       a xml.dom.minidom based implementation.
+               "etree" - A generic builder for tree implementations exposing an
+                         ElementTree-like interface, defaulting to
+                         xml.etree.cElementTree if available and
+                         xml.etree.ElementTree if not.
+               "lxml" - A etree-based builder for lxml.etree, handling
+                        limitations of lxml's implementation.
+
+    implementation - (Currently applies to the "etree" and "dom" tree types). A
+                      module implementing the tree type e.g.
+                      xml.etree.ElementTree or xml.etree.cElementTree."""
+
+    treeType = treeType.lower()
+    if treeType not in treeBuilderCache:
+        if treeType == "dom":
+            from . import dom
+            # Come up with a sane default (pref. from the stdlib)
+            if implementation is None:
+                from xml.dom import minidom
+                implementation = minidom
+            # NEVER cache here, caching is done in the dom submodule
+            return dom.getDomModule(implementation, **kwargs).TreeBuilder
+        elif treeType == "lxml":
+            from . import etree_lxml
+            treeBuilderCache[treeType] = etree_lxml.TreeBuilder
+        elif treeType == "etree":
+            from . import etree
+            if implementation is None:
+                implementation = default_etree
+            # NEVER cache here, caching is done in the etree submodule
+            return etree.getETreeModule(implementation, **kwargs).TreeBuilder
+        else:
+            raise ValueError("""Unrecognised treebuilder "%s" """ % treeType)
+    return treeBuilderCache.get(treeType)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/_base.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/_base.py
new file mode 100644
index 0000000..8b97cc11
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/_base.py
@@ -0,0 +1,377 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type
+
+from ..constants import scopingElements, tableInsertModeElements, namespaces
+
+# The scope markers are inserted when entering object elements,
+# marquees, table cells, and table captions, and are used to prevent formatting
+# from "leaking" into tables, object elements, and marquees.
+Marker = None
+
+listElementsMap = {
+    None: (frozenset(scopingElements), False),
+    "button": (frozenset(scopingElements | set([(namespaces["html"], "button")])), False),
+    "list": (frozenset(scopingElements | set([(namespaces["html"], "ol"),
+                                              (namespaces["html"], "ul")])), False),
+    "table": (frozenset([(namespaces["html"], "html"),
+                         (namespaces["html"], "table")]), False),
+    "select": (frozenset([(namespaces["html"], "optgroup"),
+                          (namespaces["html"], "option")]), True)
+}
+
+
+class Node(object):
+    def __init__(self, name):
+        """Node representing an item in the tree.
+        name - The tag name associated with the node
+        parent - The parent of the current node (or None for the document node)
+        value - The value of the current node (applies to text nodes and
+        comments
+        attributes - a dict holding name, value pairs for attributes of the node
+        childNodes - a list of child nodes of the current node. This must
+        include all elements but not necessarily other node types
+        _flags - A list of miscellaneous flags that can be set on the node
+        """
+        self.name = name
+        self.parent = None
+        self.value = None
+        self.attributes = {}
+        self.childNodes = []
+        self._flags = []
+
+    def __str__(self):
+        attributesStr = " ".join(["%s=\"%s\"" % (name, value)
+                                  for name, value in
+                                  self.attributes.items()])
+        if attributesStr:
+            return "<%s %s>" % (self.name, attributesStr)
+        else:
+            return "<%s>" % (self.name)
+
+    def __repr__(self):
+        return "<%s>" % (self.name)
+
+    def appendChild(self, node):
+        """Insert node as a child of the current node
+        """
+        raise NotImplementedError
+
+    def insertText(self, data, insertBefore=None):
+        """Insert data as text in the current node, positioned before the
+        start of node insertBefore or to the end of the node's text.
+        """
+        raise NotImplementedError
+
+    def insertBefore(self, node, refNode):
+        """Insert node as a child of the current node, before refNode in the
+        list of child nodes. Raises ValueError if refNode is not a child of
+        the current node"""
+        raise NotImplementedError
+
+    def removeChild(self, node):
+        """Remove node from the children of the current node
+        """
+        raise NotImplementedError
+
+    def reparentChildren(self, newParent):
+        """Move all the children of the current node to newParent.
+        This is needed so that trees that don't store text as nodes move the
+        text in the correct way
+        """
+        # XXX - should this method be made more general?
+        for child in self.childNodes:
+            newParent.appendChild(child)
+        self.childNodes = []
+
+    def cloneNode(self):
+        """Return a shallow copy of the current node i.e. a node with the same
+        name and attributes but with no parent or child nodes
+        """
+        raise NotImplementedError
+
+    def hasContent(self):
+        """Return true if the node has children or text, false otherwise
+        """
+        raise NotImplementedError
+
+
+class ActiveFormattingElements(list):
+    def append(self, node):
+        equalCount = 0
+        if node != Marker:
+            for element in self[::-1]:
+                if element == Marker:
+                    break
+                if self.nodesEqual(element, node):
+                    equalCount += 1
+                if equalCount == 3:
+                    self.remove(element)
+                    break
+        list.append(self, node)
+
+    def nodesEqual(self, node1, node2):
+        if not node1.nameTuple == node2.nameTuple:
+            return False
+
+        if not node1.attributes == node2.attributes:
+            return False
+
+        return True
+
+
+class TreeBuilder(object):
+    """Base treebuilder implementation
+    documentClass - the class to use for the bottommost node of a document
+    elementClass - the class to use for HTML Elements
+    commentClass - the class to use for comments
+    doctypeClass - the class to use for doctypes
+    """
+
+    # Document class
+    documentClass = None
+
+    # The class to use for creating a node
+    elementClass = None
+
+    # The class to use for creating comments
+    commentClass = None
+
+    # The class to use for creating doctypes
+    doctypeClass = None
+
+    # Fragment class
+    fragmentClass = None
+
+    def __init__(self, namespaceHTMLElements):
+        if namespaceHTMLElements:
+            self.defaultNamespace = "http://www.w3.org/1999/xhtml"
+        else:
+            self.defaultNamespace = None
+        self.reset()
+
+    def reset(self):
+        self.openElements = []
+        self.activeFormattingElements = ActiveFormattingElements()
+
+        # XXX - rename these to headElement, formElement
+        self.headPointer = None
+        self.formPointer = None
+
+        self.insertFromTable = False
+
+        self.document = self.documentClass()
+
+    def elementInScope(self, target, variant=None):
+
+        # If we pass a node in we match that. if we pass a string
+        # match any node with that name
+        exactNode = hasattr(target, "nameTuple")
+
+        listElements, invert = listElementsMap[variant]
+
+        for node in reversed(self.openElements):
+            if (node.name == target and not exactNode or
+                    node == target and exactNode):
+                return True
+            elif (invert ^ (node.nameTuple in listElements)):
+                return False
+
+        assert False  # We should never reach this point
+
+    def reconstructActiveFormattingElements(self):
+        # Within this algorithm the order of steps described in the
+        # specification is not quite the same as the order of steps in the
+        # code. It should still do the same though.
+
+        # Step 1: stop the algorithm when there's nothing to do.
+        if not self.activeFormattingElements:
+            return
+
+        # Step 2 and step 3: we start with the last element. So i is -1.
+        i = len(self.activeFormattingElements) - 1
+        entry = self.activeFormattingElements[i]
+        if entry == Marker or entry in self.openElements:
+            return
+
+        # Step 6
+        while entry != Marker and entry not in self.openElements:
+            if i == 0:
+                # This will be reset to 0 below
+                i = -1
+                break
+            i -= 1
+            # Step 5: let entry be one earlier in the list.
+            entry = self.activeFormattingElements[i]
+
+        while True:
+            # Step 7
+            i += 1
+
+            # Step 8
+            entry = self.activeFormattingElements[i]
+            clone = entry.cloneNode()  # Mainly to get a new copy of the attributes
+
+            # Step 9
+            element = self.insertElement({"type": "StartTag",
+                                          "name": clone.name,
+                                          "namespace": clone.namespace,
+                                          "data": clone.attributes})
+
+            # Step 10
+            self.activeFormattingElements[i] = element
+
+            # Step 11
+            if element == self.activeFormattingElements[-1]:
+                break
+
+    def clearActiveFormattingElements(self):
+        entry = self.activeFormattingElements.pop()
+        while self.activeFormattingElements and entry != Marker:
+            entry = self.activeFormattingElements.pop()
+
+    def elementInActiveFormattingElements(self, name):
+        """Check if an element exists between the end of the active
+        formatting elements and the last marker. If it does, return it, else
+        return false"""
+
+        for item in self.activeFormattingElements[::-1]:
+            # Check for Marker first because if it's a Marker it doesn't have a
+            # name attribute.
+            if item == Marker:
+                break
+            elif item.name == name:
+                return item
+        return False
+
+    def insertRoot(self, token):
+        element = self.createElement(token)
+        self.openElements.append(element)
+        self.document.appendChild(element)
+
+    def insertDoctype(self, token):
+        name = token["name"]
+        publicId = token["publicId"]
+        systemId = token["systemId"]
+
+        doctype = self.doctypeClass(name, publicId, systemId)
+        self.document.appendChild(doctype)
+
+    def insertComment(self, token, parent=None):
+        if parent is None:
+            parent = self.openElements[-1]
+        parent.appendChild(self.commentClass(token["data"]))
+
+    def createElement(self, token):
+        """Create an element but don't insert it anywhere"""
+        name = token["name"]
+        namespace = token.get("namespace", self.defaultNamespace)
+        element = self.elementClass(name, namespace)
+        element.attributes = token["data"]
+        return element
+
+    def _getInsertFromTable(self):
+        return self._insertFromTable
+
+    def _setInsertFromTable(self, value):
+        """Switch the function used to insert an element from the
+        normal one to the misnested table one and back again"""
+        self._insertFromTable = value
+        if value:
+            self.insertElement = self.insertElementTable
+        else:
+            self.insertElement = self.insertElementNormal
+
+    insertFromTable = property(_getInsertFromTable, _setInsertFromTable)
+
+    def insertElementNormal(self, token):
+        name = token["name"]
+        assert isinstance(name, text_type), "Element %s not unicode" % name
+        namespace = token.get("namespace", self.defaultNamespace)
+        element = self.elementClass(name, namespace)
+        element.attributes = token["data"]
+        self.openElements[-1].appendChild(element)
+        self.openElements.append(element)
+        return element
+
+    def insertElementTable(self, token):
+        """Create an element and insert it into the tree"""
+        element = self.createElement(token)
+        if self.openElements[-1].name not in tableInsertModeElements:
+            return self.insertElementNormal(token)
+        else:
+            # We should be in the InTable mode. This means we want to do
+            # special magic element rearranging
+            parent, insertBefore = self.getTableMisnestedNodePosition()
+            if insertBefore is None:
+                parent.appendChild(element)
+            else:
+                parent.insertBefore(element, insertBefore)
+            self.openElements.append(element)
+        return element
+
+    def insertText(self, data, parent=None):
+        """Insert text data."""
+        if parent is None:
+            parent = self.openElements[-1]
+
+        if (not self.insertFromTable or (self.insertFromTable and
+                                         self.openElements[-1].name
+                                         not in tableInsertModeElements)):
+            parent.insertText(data)
+        else:
+            # We should be in the InTable mode. This means we want to do
+            # special magic element rearranging
+            parent, insertBefore = self.getTableMisnestedNodePosition()
+            parent.insertText(data, insertBefore)
+
+    def getTableMisnestedNodePosition(self):
+        """Get the foster parent element, and sibling to insert before
+        (or None) when inserting a misnested table node"""
+        # The foster parent element is the one which comes before the most
+        # recently opened table element
+        # XXX - this is really inelegant
+        lastTable = None
+        fosterParent = None
+        insertBefore = None
+        for elm in self.openElements[::-1]:
+            if elm.name == "table":
+                lastTable = elm
+                break
+        if lastTable:
+            # XXX - we should really check that this parent is actually a
+            # node here
+            if lastTable.parent:
+                fosterParent = lastTable.parent
+                insertBefore = lastTable
+            else:
+                fosterParent = self.openElements[
+                    self.openElements.index(lastTable) - 1]
+        else:
+            fosterParent = self.openElements[0]
+        return fosterParent, insertBefore
+
+    def generateImpliedEndTags(self, exclude=None):
+        name = self.openElements[-1].name
+        # XXX td, th and tr are not actually needed
+        if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt"))
+                and name != exclude):
+            self.openElements.pop()
+            # XXX This is not entirely what the specification says. We should
+            # investigate it more closely.
+            self.generateImpliedEndTags(exclude)
+
+    def getDocument(self):
+        "Return the final tree"
+        return self.document
+
+    def getFragment(self):
+        "Return the final fragment"
+        # assert self.innerHTML
+        fragment = self.fragmentClass()
+        self.openElements[0].reparentChildren(fragment)
+        return fragment
+
+    def testSerializer(self, node):
+        """Serialize the subtree of node in the format required by unit tests
+        node - the node from which to start serializing"""
+        raise NotImplementedError
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/dom.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/dom.py
new file mode 100644
index 0000000..234233b7
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/dom.py
@@ -0,0 +1,227 @@
+from __future__ import absolute_import, division, unicode_literals
+
+
+from xml.dom import minidom, Node
+import weakref
+
+from . import _base
+from .. import constants
+from ..constants import namespaces
+from ..utils import moduleFactoryFactory
+
+
+def getDomBuilder(DomImplementation):
+    Dom = DomImplementation
+
+    class AttrList(object):
+        def __init__(self, element):
+            self.element = element
+
+        def __iter__(self):
+            return list(self.element.attributes.items()).__iter__()
+
+        def __setitem__(self, name, value):
+            self.element.setAttribute(name, value)
+
+        def __len__(self):
+            return len(list(self.element.attributes.items()))
+
+        def items(self):
+            return [(item[0], item[1]) for item in
+                    list(self.element.attributes.items())]
+
+        def keys(self):
+            return list(self.element.attributes.keys())
+
+        def __getitem__(self, name):
+            return self.element.getAttribute(name)
+
+        def __contains__(self, name):
+            if isinstance(name, tuple):
+                raise NotImplementedError
+            else:
+                return self.element.hasAttribute(name)
+
+    class NodeBuilder(_base.Node):
+        def __init__(self, element):
+            _base.Node.__init__(self, element.nodeName)
+            self.element = element
+
+        namespace = property(lambda self: hasattr(self.element, "namespaceURI")
+                             and self.element.namespaceURI or None)
+
+        def appendChild(self, node):
+            node.parent = self
+            self.element.appendChild(node.element)
+
+        def insertText(self, data, insertBefore=None):
+            text = self.element.ownerDocument.createTextNode(data)
+            if insertBefore:
+                self.element.insertBefore(text, insertBefore.element)
+            else:
+                self.element.appendChild(text)
+
+        def insertBefore(self, node, refNode):
+            self.element.insertBefore(node.element, refNode.element)
+            node.parent = self
+
+        def removeChild(self, node):
+            if node.element.parentNode == self.element:
+                self.element.removeChild(node.element)
+            node.parent = None
+
+        def reparentChildren(self, newParent):
+            while self.element.hasChildNodes():
+                child = self.element.firstChild
+                self.element.removeChild(child)
+                newParent.element.appendChild(child)
+            self.childNodes = []
+
+        def getAttributes(self):
+            return AttrList(self.element)
+
+        def setAttributes(self, attributes):
+            if attributes:
+                for name, value in list(attributes.items()):
+                    if isinstance(name, tuple):
+                        if name[0] is not None:
+                            qualifiedName = (name[0] + ":" + name[1])
+                        else:
+                            qualifiedName = name[1]
+                        self.element.setAttributeNS(name[2], qualifiedName,
+                                                    value)
+                    else:
+                        self.element.setAttribute(
+                            name, value)
+        attributes = property(getAttributes, setAttributes)
+
+        def cloneNode(self):
+            return NodeBuilder(self.element.cloneNode(False))
+
+        def hasContent(self):
+            return self.element.hasChildNodes()
+
+        def getNameTuple(self):
+            if self.namespace is None:
+                return namespaces["html"], self.name
+            else:
+                return self.namespace, self.name
+
+        nameTuple = property(getNameTuple)
+
+    class TreeBuilder(_base.TreeBuilder):
+        def documentClass(self):
+            self.dom = Dom.getDOMImplementation().createDocument(None, None, None)
+            return weakref.proxy(self)
+
+        def insertDoctype(self, token):
+            name = token["name"]
+            publicId = token["publicId"]
+            systemId = token["systemId"]
+
+            domimpl = Dom.getDOMImplementation()
+            doctype = domimpl.createDocumentType(name, publicId, systemId)
+            self.document.appendChild(NodeBuilder(doctype))
+            if Dom == minidom:
+                doctype.ownerDocument = self.dom
+
+        def elementClass(self, name, namespace=None):
+            if namespace is None and self.defaultNamespace is None:
+                node = self.dom.createElement(name)
+            else:
+                node = self.dom.createElementNS(namespace, name)
+
+            return NodeBuilder(node)
+
+        def commentClass(self, data):
+            return NodeBuilder(self.dom.createComment(data))
+
+        def fragmentClass(self):
+            return NodeBuilder(self.dom.createDocumentFragment())
+
+        def appendChild(self, node):
+            self.dom.appendChild(node.element)
+
+        def testSerializer(self, element):
+            return testSerializer(element)
+
+        def getDocument(self):
+            return self.dom
+
+        def getFragment(self):
+            return _base.TreeBuilder.getFragment(self).element
+
+        def insertText(self, data, parent=None):
+            data = data
+            if parent != self:
+                _base.TreeBuilder.insertText(self, data, parent)
+            else:
+                # HACK: allow text nodes as children of the document node
+                if hasattr(self.dom, '_child_node_types'):
+                    if Node.TEXT_NODE not in self.dom._child_node_types:
+                        self.dom._child_node_types = list(self.dom._child_node_types)
+                        self.dom._child_node_types.append(Node.TEXT_NODE)
+                self.dom.appendChild(self.dom.createTextNode(data))
+
+        implementation = DomImplementation
+        name = None
+
+    def testSerializer(element):
+        element.normalize()
+        rv = []
+
+        def serializeElement(element, indent=0):
+            if element.nodeType == Node.DOCUMENT_TYPE_NODE:
+                if element.name:
+                    if element.publicId or element.systemId:
+                        publicId = element.publicId or ""
+                        systemId = element.systemId or ""
+                        rv.append("""|%s<!DOCTYPE %s "%s" "%s">""" %
+                                  (' ' * indent, element.name, publicId, systemId))
+                    else:
+                        rv.append("|%s<!DOCTYPE %s>" % (' ' * indent, element.name))
+                else:
+                    rv.append("|%s<!DOCTYPE >" % (' ' * indent,))
+            elif element.nodeType == Node.DOCUMENT_NODE:
+                rv.append("#document")
+            elif element.nodeType == Node.DOCUMENT_FRAGMENT_NODE:
+                rv.append("#document-fragment")
+            elif element.nodeType == Node.COMMENT_NODE:
+                rv.append("|%s<!-- %s -->" % (' ' * indent, element.nodeValue))
+            elif element.nodeType == Node.TEXT_NODE:
+                rv.append("|%s\"%s\"" % (' ' * indent, element.nodeValue))
+            else:
+                if (hasattr(element, "namespaceURI") and
+                        element.namespaceURI is not None):
+                    name = "%s %s" % (constants.prefixes[element.namespaceURI],
+                                      element.nodeName)
+                else:
+                    name = element.nodeName
+                rv.append("|%s<%s>" % (' ' * indent, name))
+                if element.hasAttributes():
+                    attributes = []
+                    for i in range(len(element.attributes)):
+                        attr = element.attributes.item(i)
+                        name = attr.nodeName
+                        value = attr.value
+                        ns = attr.namespaceURI
+                        if ns:
+                            name = "%s %s" % (constants.prefixes[ns], attr.localName)
+                        else:
+                            name = attr.nodeName
+                        attributes.append((name, value))
+
+                    for name, value in sorted(attributes):
+                        rv.append('|%s%s="%s"' % (' ' * (indent + 2), name, value))
+            indent += 2
+            for child in element.childNodes:
+                serializeElement(child, indent)
+        serializeElement(element, 0)
+
+        return "\n".join(rv)
+
+    return locals()
+
+
+# The actual means to get a module!
+getDomModule = moduleFactoryFactory(getDomBuilder)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/etree.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/etree.py
new file mode 100644
index 0000000..2c8ed19f
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/etree.py
@@ -0,0 +1,337 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type
+
+import re
+
+from . import _base
+from .. import ihatexml
+from .. import constants
+from ..constants import namespaces
+from ..utils import moduleFactoryFactory
+
+tag_regexp = re.compile("{([^}]*)}(.*)")
+
+
+def getETreeBuilder(ElementTreeImplementation, fullTree=False):
+    ElementTree = ElementTreeImplementation
+    ElementTreeCommentType = ElementTree.Comment("asd").tag
+
+    class Element(_base.Node):
+        def __init__(self, name, namespace=None):
+            self._name = name
+            self._namespace = namespace
+            self._element = ElementTree.Element(self._getETreeTag(name,
+                                                                  namespace))
+            if namespace is None:
+                self.nameTuple = namespaces["html"], self._name
+            else:
+                self.nameTuple = self._namespace, self._name
+            self.parent = None
+            self._childNodes = []
+            self._flags = []
+
+        def _getETreeTag(self, name, namespace):
+            if namespace is None:
+                etree_tag = name
+            else:
+                etree_tag = "{%s}%s" % (namespace, name)
+            return etree_tag
+
+        def _setName(self, name):
+            self._name = name
+            self._element.tag = self._getETreeTag(self._name, self._namespace)
+
+        def _getName(self):
+            return self._name
+
+        name = property(_getName, _setName)
+
+        def _setNamespace(self, namespace):
+            self._namespace = namespace
+            self._element.tag = self._getETreeTag(self._name, self._namespace)
+
+        def _getNamespace(self):
+            return self._namespace
+
+        namespace = property(_getNamespace, _setNamespace)
+
+        def _getAttributes(self):
+            return self._element.attrib
+
+        def _setAttributes(self, attributes):
+            # Delete existing attributes first
+            # XXX - there may be a better way to do this...
+            for key in list(self._element.attrib.keys()):
+                del self._element.attrib[key]
+            for key, value in attributes.items():
+                if isinstance(key, tuple):
+                    name = "{%s}%s" % (key[2], key[1])
+                else:
+                    name = key
+                self._element.set(name, value)
+
+        attributes = property(_getAttributes, _setAttributes)
+
+        def _getChildNodes(self):
+            return self._childNodes
+
+        def _setChildNodes(self, value):
+            del self._element[:]
+            self._childNodes = []
+            for element in value:
+                self.insertChild(element)
+
+        childNodes = property(_getChildNodes, _setChildNodes)
+
+        def hasContent(self):
+            """Return true if the node has children or text"""
+            return bool(self._element.text or len(self._element))
+
+        def appendChild(self, node):
+            self._childNodes.append(node)
+            self._element.append(node._element)
+            node.parent = self
+
+        def insertBefore(self, node, refNode):
+            index = list(self._element).index(refNode._element)
+            self._element.insert(index, node._element)
+            node.parent = self
+
+        def removeChild(self, node):
+            self._element.remove(node._element)
+            node.parent = None
+
+        def insertText(self, data, insertBefore=None):
+            if not(len(self._element)):
+                if not self._element.text:
+                    self._element.text = ""
+                self._element.text += data
+            elif insertBefore is None:
+                # Insert the text as the tail of the last child element
+                if not self._element[-1].tail:
+                    self._element[-1].tail = ""
+                self._element[-1].tail += data
+            else:
+                # Insert the text before the specified node
+                children = list(self._element)
+                index = children.index(insertBefore._element)
+                if index > 0:
+                    if not self._element[index - 1].tail:
+                        self._element[index - 1].tail = ""
+                    self._element[index - 1].tail += data
+                else:
+                    if not self._element.text:
+                        self._element.text = ""
+                    self._element.text += data
+
+        def cloneNode(self):
+            element = type(self)(self.name, self.namespace)
+            for name, value in self.attributes.items():
+                element.attributes[name] = value
+            return element
+
+        def reparentChildren(self, newParent):
+            if newParent.childNodes:
+                newParent.childNodes[-1]._element.tail += self._element.text
+            else:
+                if not newParent._element.text:
+                    newParent._element.text = ""
+                if self._element.text is not None:
+                    newParent._element.text += self._element.text
+            self._element.text = ""
+            _base.Node.reparentChildren(self, newParent)
+
+    class Comment(Element):
+        def __init__(self, data):
+            # Use the superclass constructor to set all properties on the
+            # wrapper element
+            self._element = ElementTree.Comment(data)
+            self.parent = None
+            self._childNodes = []
+            self._flags = []
+
+        def _getData(self):
+            return self._element.text
+
+        def _setData(self, value):
+            self._element.text = value
+
+        data = property(_getData, _setData)
+
+    class DocumentType(Element):
+        def __init__(self, name, publicId, systemId):
+            Element.__init__(self, "<!DOCTYPE>")
+            self._element.text = name
+            self.publicId = publicId
+            self.systemId = systemId
+
+        def _getPublicId(self):
+            return self._element.get("publicId", "")
+
+        def _setPublicId(self, value):
+            if value is not None:
+                self._element.set("publicId", value)
+
+        publicId = property(_getPublicId, _setPublicId)
+
+        def _getSystemId(self):
+            return self._element.get("systemId", "")
+
+        def _setSystemId(self, value):
+            if value is not None:
+                self._element.set("systemId", value)
+
+        systemId = property(_getSystemId, _setSystemId)
+
+    class Document(Element):
+        def __init__(self):
+            Element.__init__(self, "DOCUMENT_ROOT")
+
+    class DocumentFragment(Element):
+        def __init__(self):
+            Element.__init__(self, "DOCUMENT_FRAGMENT")
+
+    def testSerializer(element):
+        rv = []
+
+        def serializeElement(element, indent=0):
+            if not(hasattr(element, "tag")):
+                element = element.getroot()
+            if element.tag == "<!DOCTYPE>":
+                if element.get("publicId") or element.get("systemId"):
+                    publicId = element.get("publicId") or ""
+                    systemId = element.get("systemId") or ""
+                    rv.append("""<!DOCTYPE %s "%s" "%s">""" %
+                              (element.text, publicId, systemId))
+                else:
+                    rv.append("<!DOCTYPE %s>" % (element.text,))
+            elif element.tag == "DOCUMENT_ROOT":
+                rv.append("#document")
+                if element.text is not None:
+                    rv.append("|%s\"%s\"" % (' ' * (indent + 2), element.text))
+                if element.tail is not None:
+                    raise TypeError("Document node cannot have tail")
+                if hasattr(element, "attrib") and len(element.attrib):
+                    raise TypeError("Document node cannot have attributes")
+            elif element.tag == ElementTreeCommentType:
+                rv.append("|%s<!-- %s -->" % (' ' * indent, element.text))
+            else:
+                assert isinstance(element.tag, text_type), \
+                    "Expected unicode, got %s, %s" % (type(element.tag), element.tag)
+                nsmatch = tag_regexp.match(element.tag)
+
+                if nsmatch is None:
+                    name = element.tag
+                else:
+                    ns, name = nsmatch.groups()
+                    prefix = constants.prefixes[ns]
+                    name = "%s %s" % (prefix, name)
+                rv.append("|%s<%s>" % (' ' * indent, name))
+
+                if hasattr(element, "attrib"):
+                    attributes = []
+                    for name, value in element.attrib.items():
+                        nsmatch = tag_regexp.match(name)
+                        if nsmatch is not None:
+                            ns, name = nsmatch.groups()
+                            prefix = constants.prefixes[ns]
+                            attr_string = "%s %s" % (prefix, name)
+                        else:
+                            attr_string = name
+                        attributes.append((attr_string, value))
+
+                    for name, value in sorted(attributes):
+                        rv.append('|%s%s="%s"' % (' ' * (indent + 2), name, value))
+                if element.text:
+                    rv.append("|%s\"%s\"" % (' ' * (indent + 2), element.text))
+            indent += 2
+            for child in element:
+                serializeElement(child, indent)
+            if element.tail:
+                rv.append("|%s\"%s\"" % (' ' * (indent - 2), element.tail))
+        serializeElement(element, 0)
+
+        return "\n".join(rv)
+
+    def tostring(element):
+        """Serialize an element and its child nodes to a string"""
+        rv = []
+        filter = ihatexml.InfosetFilter()
+
+        def serializeElement(element):
+            if isinstance(element, ElementTree.ElementTree):
+                element = element.getroot()
+
+            if element.tag == "<!DOCTYPE>":
+                if element.get("publicId") or element.get("systemId"):
+                    publicId = element.get("publicId") or ""
+                    systemId = element.get("systemId") or ""
+                    rv.append("""<!DOCTYPE %s PUBLIC "%s" "%s">""" %
+                              (element.text, publicId, systemId))
+                else:
+                    rv.append("<!DOCTYPE %s>" % (element.text,))
+            elif element.tag == "DOCUMENT_ROOT":
+                if element.text is not None:
+                    rv.append(element.text)
+                if element.tail is not None:
+                    raise TypeError("Document node cannot have tail")
+                if hasattr(element, "attrib") and len(element.attrib):
+                    raise TypeError("Document node cannot have attributes")
+
+                for child in element:
+                    serializeElement(child)
+
+            elif element.tag == ElementTreeCommentType:
+                rv.append("<!--%s-->" % (element.text,))
+            else:
+                # This is assumed to be an ordinary element
+                if not element.attrib:
+                    rv.append("<%s>" % (filter.fromXmlName(element.tag),))
+                else:
+                    attr = " ".join(["%s=\"%s\"" % (
+                        filter.fromXmlName(name), value)
+                        for name, value in element.attrib.items()])
+                    rv.append("<%s %s>" % (element.tag, attr))
+                if element.text:
+                    rv.append(element.text)
+
+                for child in element:
+                    serializeElement(child)
+
+                rv.append("</%s>" % (element.tag,))
+
+            if element.tail:
+                rv.append(element.tail)
+
+        serializeElement(element)
+
+        return "".join(rv)
+
+    class TreeBuilder(_base.TreeBuilder):
+        documentClass = Document
+        doctypeClass = DocumentType
+        elementClass = Element
+        commentClass = Comment
+        fragmentClass = DocumentFragment
+        implementation = ElementTreeImplementation
+
+        def testSerializer(self, element):
+            return testSerializer(element)
+
+        def getDocument(self):
+            if fullTree:
+                return self.document._element
+            else:
+                if self.defaultNamespace is not None:
+                    return self.document._element.find(
+                        "{%s}html" % self.defaultNamespace)
+                else:
+                    return self.document._element.find("html")
+
+        def getFragment(self):
+            return _base.TreeBuilder.getFragment(self)._element
+
+    return locals()
+
+
+getETreeModule = moduleFactoryFactory(getETreeBuilder)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/etree_lxml.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/etree_lxml.py
new file mode 100644
index 0000000..35d08ef
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treebuilders/etree_lxml.py
@@ -0,0 +1,369 @@
+"""Module for supporting the lxml.etree library. The idea here is to use as much
+of the native library as possible, without using fragile hacks like custom element
+names that break between releases. The downside of this is that we cannot represent
+all possible trees; specifically the following are known to cause problems:
+
+Text or comments as siblings of the root element
+Docypes with no name
+
+When any of these things occur, we emit a DataLossWarning
+"""
+
+from __future__ import absolute_import, division, unicode_literals
+
+import warnings
+import re
+import sys
+
+from . import _base
+from ..constants import DataLossWarning
+from .. import constants
+from . import etree as etree_builders
+from .. import ihatexml
+
+import lxml.etree as etree
+
+
+fullTree = True
+tag_regexp = re.compile("{([^}]*)}(.*)")
+
+comment_type = etree.Comment("asd").tag
+
+
+class DocumentType(object):
+    def __init__(self, name, publicId, systemId):
+        self.name = name
+        self.publicId = publicId
+        self.systemId = systemId
+
+
+class Document(object):
+    def __init__(self):
+        self._elementTree = None
+        self._childNodes = []
+
+    def appendChild(self, element):
+        self._elementTree.getroot().addnext(element._element)
+
+    def _getChildNodes(self):
+        return self._childNodes
+
+    childNodes = property(_getChildNodes)
+
+
+def testSerializer(element):
+    rv = []
+    finalText = None
+    infosetFilter = ihatexml.InfosetFilter()
+
+    def serializeElement(element, indent=0):
+        if not hasattr(element, "tag"):
+            if hasattr(element, "getroot"):
+                # Full tree case
+                rv.append("#document")
+                if element.docinfo.internalDTD:
+                    if not (element.docinfo.public_id or
+                            element.docinfo.system_url):
+                        dtd_str = "<!DOCTYPE %s>" % element.docinfo.root_name
+                    else:
+                        dtd_str = """<!DOCTYPE %s "%s" "%s">""" % (
+                            element.docinfo.root_name,
+                            element.docinfo.public_id,
+                            element.docinfo.system_url)
+                    rv.append("|%s%s" % (' ' * (indent + 2), dtd_str))
+                next_element = element.getroot()
+                while next_element.getprevious() is not None:
+                    next_element = next_element.getprevious()
+                while next_element is not None:
+                    serializeElement(next_element, indent + 2)
+                    next_element = next_element.getnext()
+            elif isinstance(element, str) or isinstance(element, bytes):
+                # Text in a fragment
+                assert isinstance(element, str) or sys.version_info.major == 2
+                rv.append("|%s\"%s\"" % (' ' * indent, element))
+            else:
+                # Fragment case
+                rv.append("#document-fragment")
+                for next_element in element:
+                    serializeElement(next_element, indent + 2)
+        elif element.tag == comment_type:
+            rv.append("|%s<!-- %s -->" % (' ' * indent, element.text))
+            if hasattr(element, "tail") and element.tail:
+                rv.append("|%s\"%s\"" % (' ' * indent, element.tail))
+        else:
+            assert isinstance(element, etree._Element)
+            nsmatch = etree_builders.tag_regexp.match(element.tag)
+            if nsmatch is not None:
+                ns = nsmatch.group(1)
+                tag = nsmatch.group(2)
+                prefix = constants.prefixes[ns]
+                rv.append("|%s<%s %s>" % (' ' * indent, prefix,
+                                          infosetFilter.fromXmlName(tag)))
+            else:
+                rv.append("|%s<%s>" % (' ' * indent,
+                                       infosetFilter.fromXmlName(element.tag)))
+
+            if hasattr(element, "attrib"):
+                attributes = []
+                for name, value in element.attrib.items():
+                    nsmatch = tag_regexp.match(name)
+                    if nsmatch is not None:
+                        ns, name = nsmatch.groups()
+                        name = infosetFilter.fromXmlName(name)
+                        prefix = constants.prefixes[ns]
+                        attr_string = "%s %s" % (prefix, name)
+                    else:
+                        attr_string = infosetFilter.fromXmlName(name)
+                    attributes.append((attr_string, value))
+
+                for name, value in sorted(attributes):
+                    rv.append('|%s%s="%s"' % (' ' * (indent + 2), name, value))
+
+            if element.text:
+                rv.append("|%s\"%s\"" % (' ' * (indent + 2), element.text))
+            indent += 2
+            for child in element:
+                serializeElement(child, indent)
+            if hasattr(element, "tail") and element.tail:
+                rv.append("|%s\"%s\"" % (' ' * (indent - 2), element.tail))
+    serializeElement(element, 0)
+
+    if finalText is not None:
+        rv.append("|%s\"%s\"" % (' ' * 2, finalText))
+
+    return "\n".join(rv)
+
+
+def tostring(element):
+    """Serialize an element and its child nodes to a string"""
+    rv = []
+    finalText = None
+
+    def serializeElement(element):
+        if not hasattr(element, "tag"):
+            if element.docinfo.internalDTD:
+                if element.docinfo.doctype:
+                    dtd_str = element.docinfo.doctype
+                else:
+                    dtd_str = "<!DOCTYPE %s>" % element.docinfo.root_name
+                rv.append(dtd_str)
+            serializeElement(element.getroot())
+
+        elif element.tag == comment_type:
+            rv.append("<!--%s-->" % (element.text,))
+
+        else:
+            # This is assumed to be an ordinary element
+            if not element.attrib:
+                rv.append("<%s>" % (element.tag,))
+            else:
+                attr = " ".join(["%s=\"%s\"" % (name, value)
+                                 for name, value in element.attrib.items()])
+                rv.append("<%s %s>" % (element.tag, attr))
+            if element.text:
+                rv.append(element.text)
+
+            for child in element:
+                serializeElement(child)
+
+            rv.append("</%s>" % (element.tag,))
+
+        if hasattr(element, "tail") and element.tail:
+            rv.append(element.tail)
+
+    serializeElement(element)
+
+    if finalText is not None:
+        rv.append("%s\"" % (' ' * 2, finalText))
+
+    return "".join(rv)
+
+
+class TreeBuilder(_base.TreeBuilder):
+    documentClass = Document
+    doctypeClass = DocumentType
+    elementClass = None
+    commentClass = None
+    fragmentClass = Document
+    implementation = etree
+
+    def __init__(self, namespaceHTMLElements, fullTree=False):
+        builder = etree_builders.getETreeModule(etree, fullTree=fullTree)
+        infosetFilter = self.infosetFilter = ihatexml.InfosetFilter()
+        self.namespaceHTMLElements = namespaceHTMLElements
+
+        class Attributes(dict):
+            def __init__(self, element, value={}):
+                self._element = element
+                dict.__init__(self, value)
+                for key, value in self.items():
+                    if isinstance(key, tuple):
+                        name = "{%s}%s" % (key[2], infosetFilter.coerceAttribute(key[1]))
+                    else:
+                        name = infosetFilter.coerceAttribute(key)
+                    self._element._element.attrib[name] = value
+
+            def __setitem__(self, key, value):
+                dict.__setitem__(self, key, value)
+                if isinstance(key, tuple):
+                    name = "{%s}%s" % (key[2], infosetFilter.coerceAttribute(key[1]))
+                else:
+                    name = infosetFilter.coerceAttribute(key)
+                self._element._element.attrib[name] = value
+
+        class Element(builder.Element):
+            def __init__(self, name, namespace):
+                name = infosetFilter.coerceElement(name)
+                builder.Element.__init__(self, name, namespace=namespace)
+                self._attributes = Attributes(self)
+
+            def _setName(self, name):
+                self._name = infosetFilter.coerceElement(name)
+                self._element.tag = self._getETreeTag(
+                    self._name, self._namespace)
+
+            def _getName(self):
+                return infosetFilter.fromXmlName(self._name)
+
+            name = property(_getName, _setName)
+
+            def _getAttributes(self):
+                return self._attributes
+
+            def _setAttributes(self, attributes):
+                self._attributes = Attributes(self, attributes)
+
+            attributes = property(_getAttributes, _setAttributes)
+
+            def insertText(self, data, insertBefore=None):
+                data = infosetFilter.coerceCharacters(data)
+                builder.Element.insertText(self, data, insertBefore)
+
+            def appendChild(self, child):
+                builder.Element.appendChild(self, child)
+
+        class Comment(builder.Comment):
+            def __init__(self, data):
+                data = infosetFilter.coerceComment(data)
+                builder.Comment.__init__(self, data)
+
+            def _setData(self, data):
+                data = infosetFilter.coerceComment(data)
+                self._element.text = data
+
+            def _getData(self):
+                return self._element.text
+
+            data = property(_getData, _setData)
+
+        self.elementClass = Element
+        self.commentClass = builder.Comment
+        # self.fragmentClass = builder.DocumentFragment
+        _base.TreeBuilder.__init__(self, namespaceHTMLElements)
+
+    def reset(self):
+        _base.TreeBuilder.reset(self)
+        self.insertComment = self.insertCommentInitial
+        self.initial_comments = []
+        self.doctype = None
+
+    def testSerializer(self, element):
+        return testSerializer(element)
+
+    def getDocument(self):
+        if fullTree:
+            return self.document._elementTree
+        else:
+            return self.document._elementTree.getroot()
+
+    def getFragment(self):
+        fragment = []
+        element = self.openElements[0]._element
+        if element.text:
+            fragment.append(element.text)
+        fragment.extend(list(element))
+        if element.tail:
+            fragment.append(element.tail)
+        return fragment
+
+    def insertDoctype(self, token):
+        name = token["name"]
+        publicId = token["publicId"]
+        systemId = token["systemId"]
+
+        if not name:
+            warnings.warn("lxml cannot represent empty doctype", DataLossWarning)
+            self.doctype = None
+        else:
+            coercedName = self.infosetFilter.coerceElement(name)
+            if coercedName != name:
+                warnings.warn("lxml cannot represent non-xml doctype", DataLossWarning)
+
+            doctype = self.doctypeClass(coercedName, publicId, systemId)
+            self.doctype = doctype
+
+    def insertCommentInitial(self, data, parent=None):
+        self.initial_comments.append(data)
+
+    def insertCommentMain(self, data, parent=None):
+        if (parent == self.document and
+                self.document._elementTree.getroot()[-1].tag == comment_type):
+                warnings.warn("lxml cannot represent adjacent comments beyond the root elements", DataLossWarning)
+        super(TreeBuilder, self).insertComment(data, parent)
+
+    def insertRoot(self, token):
+        """Create the document root"""
+        # Because of the way libxml2 works, it doesn't seem to be possible to
+        # alter information like the doctype after the tree has been parsed.
+        # Therefore we need to use the built-in parser to create our iniial
+        # tree, after which we can add elements like normal
+        docStr = ""
+        if self.doctype:
+            assert self.doctype.name
+            docStr += "<!DOCTYPE %s" % self.doctype.name
+            if (self.doctype.publicId is not None or
+                    self.doctype.systemId is not None):
+                docStr += (' PUBLIC "%s" ' %
+                           (self.infosetFilter.coercePubid(self.doctype.publicId or "")))
+                if self.doctype.systemId:
+                    sysid = self.doctype.systemId
+                    if sysid.find("'") >= 0 and sysid.find('"') >= 0:
+                        warnings.warn("DOCTYPE system cannot contain single and double quotes", DataLossWarning)
+                        sysid = sysid.replace("'", 'U00027')
+                    if sysid.find("'") >= 0:
+                        docStr += '"%s"' % sysid
+                    else:
+                        docStr += "'%s'" % sysid
+                else:
+                    docStr += "''"
+            docStr += ">"
+            if self.doctype.name != token["name"]:
+                warnings.warn("lxml cannot represent doctype with a different name to the root element", DataLossWarning)
+        docStr += "<THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>"
+        root = etree.fromstring(docStr)
+
+        # Append the initial comments:
+        for comment_token in self.initial_comments:
+            root.addprevious(etree.Comment(comment_token["data"]))
+
+        # Create the root document and add the ElementTree to it
+        self.document = self.documentClass()
+        self.document._elementTree = root.getroottree()
+
+        # Give the root element the right name
+        name = token["name"]
+        namespace = token.get("namespace", self.defaultNamespace)
+        if namespace is None:
+            etree_tag = name
+        else:
+            etree_tag = "{%s}%s" % (namespace, name)
+        root.tag = etree_tag
+
+        # Add the root element to the internal child/open data structures
+        root_element = self.elementClass(name, namespace)
+        root_element._element = root
+        self.document._childNodes.append(root_element)
+        self.openElements.append(root_element)
+
+        # Reset to the default insert comment function
+        self.insertComment = self.insertCommentMain
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/__init__.py
new file mode 100644
index 0000000..18124e7
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/__init__.py
@@ -0,0 +1,57 @@
+"""A collection of modules for iterating through different kinds of
+tree, generating tokens identical to those produced by the tokenizer
+module.
+
+To create a tree walker for a new type of tree, you need to do
+implement a tree walker object (called TreeWalker by convention) that
+implements a 'serialize' method taking a tree as sole argument and
+returning an iterator generating tokens.
+"""
+
+from __future__ import absolute_import, division, unicode_literals
+
+import sys
+
+from ..utils import default_etree
+
+treeWalkerCache = {}
+
+
+def getTreeWalker(treeType, implementation=None, **kwargs):
+    """Get a TreeWalker class for various types of tree with built-in support
+
+    treeType - the name of the tree type required (case-insensitive). Supported
+               values are:
+
+                "dom" - The xml.dom.minidom DOM implementation
+                "pulldom" - The xml.dom.pulldom event stream
+                "etree" - A generic walker for tree implementations exposing an
+                          elementtree-like interface (known to work with
+                          ElementTree, cElementTree and lxml.etree).
+                "lxml" - Optimized walker for lxml.etree
+                "genshi" - a Genshi stream
+
+    implementation - (Currently applies to the "etree" tree type only). A module
+                      implementing the tree type e.g. xml.etree.ElementTree or
+                      cElementTree."""
+
+    treeType = treeType.lower()
+    if treeType not in treeWalkerCache:
+        if treeType in ("dom", "pulldom"):
+            name = "%s.%s" % (__name__, treeType)
+            __import__(name)
+            mod = sys.modules[name]
+            treeWalkerCache[treeType] = mod.TreeWalker
+        elif treeType == "genshi":
+            from . import genshistream
+            treeWalkerCache[treeType] = genshistream.TreeWalker
+        elif treeType == "lxml":
+            from . import lxmletree
+            treeWalkerCache[treeType] = lxmletree.TreeWalker
+        elif treeType == "etree":
+            from . import etree
+            if implementation is None:
+                implementation = default_etree
+            # XXX: NEVER cache here, caching is done in the etree submodule
+            return etree.getETreeModule(implementation, **kwargs).TreeWalker
+    return treeWalkerCache.get(treeType)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/_base.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/_base.py
new file mode 100644
index 0000000..34252e5
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/_base.py
@@ -0,0 +1,200 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type, string_types
+
+import gettext
+_ = gettext.gettext
+
+from xml.dom import Node
+
+DOCUMENT = Node.DOCUMENT_NODE
+DOCTYPE = Node.DOCUMENT_TYPE_NODE
+TEXT = Node.TEXT_NODE
+ELEMENT = Node.ELEMENT_NODE
+COMMENT = Node.COMMENT_NODE
+ENTITY = Node.ENTITY_NODE
+UNKNOWN = "<#UNKNOWN#>"
+
+from ..constants import voidElements, spaceCharacters
+spaceCharacters = "".join(spaceCharacters)
+
+
+def to_text(s, blank_if_none=True):
+    """Wrapper around six.text_type to convert None to empty string"""
+    if s is None:
+        if blank_if_none:
+            return ""
+        else:
+            return None
+    elif isinstance(s, text_type):
+        return s
+    else:
+        return text_type(s)
+
+
+def is_text_or_none(string):
+    """Wrapper around isinstance(string_types) or is None"""
+    return string is None or isinstance(string, string_types)
+
+
+class TreeWalker(object):
+    def __init__(self, tree):
+        self.tree = tree
+
+    def __iter__(self):
+        raise NotImplementedError
+
+    def error(self, msg):
+        return {"type": "SerializeError", "data": msg}
+
+    def emptyTag(self, namespace, name, attrs, hasChildren=False):
+        assert namespace is None or isinstance(namespace, string_types), type(namespace)
+        assert isinstance(name, string_types), type(name)
+        assert all((namespace is None or isinstance(namespace, string_types)) and
+                   isinstance(name, string_types) and
+                   isinstance(value, string_types)
+                   for (namespace, name), value in attrs.items())
+
+        yield {"type": "EmptyTag", "name": to_text(name, False),
+               "namespace": to_text(namespace),
+               "data": attrs}
+        if hasChildren:
+            yield self.error(_("Void element has children"))
+
+    def startTag(self, namespace, name, attrs):
+        assert namespace is None or isinstance(namespace, string_types), type(namespace)
+        assert isinstance(name, string_types), type(name)
+        assert all((namespace is None or isinstance(namespace, string_types)) and
+                   isinstance(name, string_types) and
+                   isinstance(value, string_types)
+                   for (namespace, name), value in attrs.items())
+
+        return {"type": "StartTag",
+                "name": text_type(name),
+                "namespace": to_text(namespace),
+                "data": dict(((to_text(namespace, False), to_text(name)),
+                              to_text(value, False))
+                             for (namespace, name), value in attrs.items())}
+
+    def endTag(self, namespace, name):
+        assert namespace is None or isinstance(namespace, string_types), type(namespace)
+        assert isinstance(name, string_types), type(namespace)
+
+        return {"type": "EndTag",
+                "name": to_text(name, False),
+                "namespace": to_text(namespace),
+                "data": {}}
+
+    def text(self, data):
+        assert isinstance(data, string_types), type(data)
+
+        data = to_text(data)
+        middle = data.lstrip(spaceCharacters)
+        left = data[:len(data) - len(middle)]
+        if left:
+            yield {"type": "SpaceCharacters", "data": left}
+        data = middle
+        middle = data.rstrip(spaceCharacters)
+        right = data[len(middle):]
+        if middle:
+            yield {"type": "Characters", "data": middle}
+        if right:
+            yield {"type": "SpaceCharacters", "data": right}
+
+    def comment(self, data):
+        assert isinstance(data, string_types), type(data)
+
+        return {"type": "Comment", "data": text_type(data)}
+
+    def doctype(self, name, publicId=None, systemId=None, correct=True):
+        assert is_text_or_none(name), type(name)
+        assert is_text_or_none(publicId), type(publicId)
+        assert is_text_or_none(systemId), type(systemId)
+
+        return {"type": "Doctype",
+                "name": to_text(name),
+                "publicId": to_text(publicId),
+                "systemId": to_text(systemId),
+                "correct": to_text(correct)}
+
+    def entity(self, name):
+        assert isinstance(name, string_types), type(name)
+
+        return {"type": "Entity", "name": text_type(name)}
+
+    def unknown(self, nodeType):
+        return self.error(_("Unknown node type: ") + nodeType)
+
+
+class NonRecursiveTreeWalker(TreeWalker):
+    def getNodeDetails(self, node):
+        raise NotImplementedError
+
+    def getFirstChild(self, node):
+        raise NotImplementedError
+
+    def getNextSibling(self, node):
+        raise NotImplementedError
+
+    def getParentNode(self, node):
+        raise NotImplementedError
+
+    def __iter__(self):
+        currentNode = self.tree
+        while currentNode is not None:
+            details = self.getNodeDetails(currentNode)
+            type, details = details[0], details[1:]
+            hasChildren = False
+
+            if type == DOCTYPE:
+                yield self.doctype(*details)
+
+            elif type == TEXT:
+                for token in self.text(*details):
+                    yield token
+
+            elif type == ELEMENT:
+                namespace, name, attributes, hasChildren = details
+                if name in voidElements:
+                    for token in self.emptyTag(namespace, name, attributes,
+                                               hasChildren):
+                        yield token
+                    hasChildren = False
+                else:
+                    yield self.startTag(namespace, name, attributes)
+
+            elif type == COMMENT:
+                yield self.comment(details[0])
+
+            elif type == ENTITY:
+                yield self.entity(details[0])
+
+            elif type == DOCUMENT:
+                hasChildren = True
+
+            else:
+                yield self.unknown(details[0])
+
+            if hasChildren:
+                firstChild = self.getFirstChild(currentNode)
+            else:
+                firstChild = None
+
+            if firstChild is not None:
+                currentNode = firstChild
+            else:
+                while currentNode is not None:
+                    details = self.getNodeDetails(currentNode)
+                    type, details = details[0], details[1:]
+                    if type == ELEMENT:
+                        namespace, name, attributes, hasChildren = details
+                        if name not in voidElements:
+                            yield self.endTag(namespace, name)
+                    if self.tree is currentNode:
+                        currentNode = None
+                        break
+                    nextSibling = self.getNextSibling(currentNode)
+                    if nextSibling is not None:
+                        currentNode = nextSibling
+                        break
+                    else:
+                        currentNode = self.getParentNode(currentNode)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/dom.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/dom.py
new file mode 100644
index 0000000..a01287a9
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/dom.py
@@ -0,0 +1,46 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from xml.dom import Node
+
+import gettext
+_ = gettext.gettext
+
+from . import _base
+
+
+class TreeWalker(_base.NonRecursiveTreeWalker):
+    def getNodeDetails(self, node):
+        if node.nodeType == Node.DOCUMENT_TYPE_NODE:
+            return _base.DOCTYPE, node.name, node.publicId, node.systemId
+
+        elif node.nodeType in (Node.TEXT_NODE, Node.CDATA_SECTION_NODE):
+            return _base.TEXT, node.nodeValue
+
+        elif node.nodeType == Node.ELEMENT_NODE:
+            attrs = {}
+            for attr in list(node.attributes.keys()):
+                attr = node.getAttributeNode(attr)
+                if attr.namespaceURI:
+                    attrs[(attr.namespaceURI, attr.localName)] = attr.value
+                else:
+                    attrs[(None, attr.name)] = attr.value
+            return (_base.ELEMENT, node.namespaceURI, node.nodeName,
+                    attrs, node.hasChildNodes())
+
+        elif node.nodeType == Node.COMMENT_NODE:
+            return _base.COMMENT, node.nodeValue
+
+        elif node.nodeType in (Node.DOCUMENT_NODE, Node.DOCUMENT_FRAGMENT_NODE):
+            return (_base.DOCUMENT,)
+
+        else:
+            return _base.UNKNOWN, node.nodeType
+
+    def getFirstChild(self, node):
+        return node.firstChild
+
+    def getNextSibling(self, node):
+        return node.nextSibling
+
+    def getParentNode(self, node):
+        return node.parentNode
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/etree.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/etree.py
new file mode 100644
index 0000000..fd8a9cc
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/etree.py
@@ -0,0 +1,138 @@
+from __future__ import absolute_import, division, unicode_literals
+
+try:
+    from collections import OrderedDict
+except ImportError:
+    try:
+        from ordereddict import OrderedDict
+    except ImportError:
+        OrderedDict = dict
+import gettext
+_ = gettext.gettext
+
+import re
+
+from six import text_type
+
+from . import _base
+from ..utils import moduleFactoryFactory
+
+tag_regexp = re.compile("{([^}]*)}(.*)")
+
+
+def getETreeBuilder(ElementTreeImplementation):
+    ElementTree = ElementTreeImplementation
+    ElementTreeCommentType = ElementTree.Comment("asd").tag
+
+    class TreeWalker(_base.NonRecursiveTreeWalker):
+        """Given the particular ElementTree representation, this implementation,
+        to avoid using recursion, returns "nodes" as tuples with the following
+        content:
+
+        1. The current element
+
+        2. The index of the element relative to its parent
+
+        3. A stack of ancestor elements
+
+        4. A flag "text", "tail" or None to indicate if the current node is a
+           text node; either the text or tail of the current element (1)
+        """
+        def getNodeDetails(self, node):
+            if isinstance(node, tuple):  # It might be the root Element
+                elt, key, parents, flag = node
+                if flag in ("text", "tail"):
+                    return _base.TEXT, getattr(elt, flag)
+                else:
+                    node = elt
+
+            if not(hasattr(node, "tag")):
+                node = node.getroot()
+
+            if node.tag in ("DOCUMENT_ROOT", "DOCUMENT_FRAGMENT"):
+                return (_base.DOCUMENT,)
+
+            elif node.tag == "<!DOCTYPE>":
+                return (_base.DOCTYPE, node.text,
+                        node.get("publicId"), node.get("systemId"))
+
+            elif node.tag == ElementTreeCommentType:
+                return _base.COMMENT, node.text
+
+            else:
+                assert type(node.tag) == text_type, type(node.tag)
+                # This is assumed to be an ordinary element
+                match = tag_regexp.match(node.tag)
+                if match:
+                    namespace, tag = match.groups()
+                else:
+                    namespace = None
+                    tag = node.tag
+                attrs = OrderedDict()
+                for name, value in list(node.attrib.items()):
+                    match = tag_regexp.match(name)
+                    if match:
+                        attrs[(match.group(1), match.group(2))] = value
+                    else:
+                        attrs[(None, name)] = value
+                return (_base.ELEMENT, namespace, tag,
+                        attrs, len(node) or node.text)
+
+        def getFirstChild(self, node):
+            if isinstance(node, tuple):
+                element, key, parents, flag = node
+            else:
+                element, key, parents, flag = node, None, [], None
+
+            if flag in ("text", "tail"):
+                return None
+            else:
+                if element.text:
+                    return element, key, parents, "text"
+                elif len(element):
+                    parents.append(element)
+                    return element[0], 0, parents, None
+                else:
+                    return None
+
+        def getNextSibling(self, node):
+            if isinstance(node, tuple):
+                element, key, parents, flag = node
+            else:
+                return None
+
+            if flag == "text":
+                if len(element):
+                    parents.append(element)
+                    return element[0], 0, parents, None
+                else:
+                    return None
+            else:
+                if element.tail and flag != "tail":
+                    return element, key, parents, "tail"
+                elif key < len(parents[-1]) - 1:
+                    return parents[-1][key + 1], key + 1, parents, None
+                else:
+                    return None
+
+        def getParentNode(self, node):
+            if isinstance(node, tuple):
+                element, key, parents, flag = node
+            else:
+                return None
+
+            if flag == "text":
+                if not parents:
+                    return element
+                else:
+                    return element, key, parents, None
+            else:
+                parent = parents.pop()
+                if not parents:
+                    return parent
+                else:
+                    return parent, list(parents[-1]).index(parent), parents, None
+
+    return locals()
+
+getETreeModule = moduleFactoryFactory(getETreeBuilder)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/genshistream.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/genshistream.py
new file mode 100644
index 0000000..f559c45d
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/genshistream.py
@@ -0,0 +1,69 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from genshi.core import QName
+from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
+from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
+
+from . import _base
+
+from ..constants import voidElements, namespaces
+
+
+class TreeWalker(_base.TreeWalker):
+    def __iter__(self):
+        # Buffer the events so we can pass in the following one
+        previous = None
+        for event in self.tree:
+            if previous is not None:
+                for token in self.tokens(previous, event):
+                    yield token
+            previous = event
+
+        # Don't forget the final event!
+        if previous is not None:
+            for token in self.tokens(previous, None):
+                yield token
+
+    def tokens(self, event, next):
+        kind, data, pos = event
+        if kind == START:
+            tag, attribs = data
+            name = tag.localname
+            namespace = tag.namespace
+            converted_attribs = {}
+            for k, v in attribs:
+                if isinstance(k, QName):
+                    converted_attribs[(k.namespace, k.localname)] = v
+                else:
+                    converted_attribs[(None, k)] = v
+
+            if namespace == namespaces["html"] and name in voidElements:
+                for token in self.emptyTag(namespace, name, converted_attribs,
+                                           not next or next[0] != END
+                                           or next[1] != tag):
+                    yield token
+            else:
+                yield self.startTag(namespace, name, converted_attribs)
+
+        elif kind == END:
+            name = data.localname
+            namespace = data.namespace
+            if name not in voidElements:
+                yield self.endTag(namespace, name)
+
+        elif kind == COMMENT:
+            yield self.comment(data)
+
+        elif kind == TEXT:
+            for token in self.text(data):
+                yield token
+
+        elif kind == DOCTYPE:
+            yield self.doctype(*data)
+
+        elif kind in (XML_NAMESPACE, DOCTYPE, START_NS, END_NS,
+                      START_CDATA, END_CDATA, PI):
+            pass
+
+        else:
+            yield self.unknown(kind)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/lxmletree.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/lxmletree.py
new file mode 100644
index 0000000..bc934ac0
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/lxmletree.py
@@ -0,0 +1,204 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type
+
+from lxml import etree
+from ..treebuilders.etree import tag_regexp
+
+from gettext import gettext
+_ = gettext
+
+from . import _base
+
+from .. import ihatexml
+
+
+def ensure_str(s):
+    if s is None:
+        return None
+    elif isinstance(s, text_type):
+        return s
+    else:
+        return s.decode("utf-8", "strict")
+
+
+class Root(object):
+    def __init__(self, et):
+        self.elementtree = et
+        self.children = []
+        if et.docinfo.internalDTD:
+            self.children.append(Doctype(self,
+                                         ensure_str(et.docinfo.root_name),
+                                         ensure_str(et.docinfo.public_id),
+                                         ensure_str(et.docinfo.system_url)))
+        root = et.getroot()
+        node = root
+
+        while node.getprevious() is not None:
+            node = node.getprevious()
+        while node is not None:
+            self.children.append(node)
+            node = node.getnext()
+
+        self.text = None
+        self.tail = None
+
+    def __getitem__(self, key):
+        return self.children[key]
+
+    def getnext(self):
+        return None
+
+    def __len__(self):
+        return 1
+
+
+class Doctype(object):
+    def __init__(self, root_node, name, public_id, system_id):
+        self.root_node = root_node
+        self.name = name
+        self.public_id = public_id
+        self.system_id = system_id
+
+        self.text = None
+        self.tail = None
+
+    def getnext(self):
+        return self.root_node.children[1]
+
+
+class FragmentRoot(Root):
+    def __init__(self, children):
+        self.children = [FragmentWrapper(self, child) for child in children]
+        self.text = self.tail = None
+
+    def getnext(self):
+        return None
+
+
+class FragmentWrapper(object):
+    def __init__(self, fragment_root, obj):
+        self.root_node = fragment_root
+        self.obj = obj
+        if hasattr(self.obj, 'text'):
+            self.text = ensure_str(self.obj.text)
+        else:
+            self.text = None
+        if hasattr(self.obj, 'tail'):
+            self.tail = ensure_str(self.obj.tail)
+        else:
+            self.tail = None
+
+    def __getattr__(self, name):
+        return getattr(self.obj, name)
+
+    def getnext(self):
+        siblings = self.root_node.children
+        idx = siblings.index(self)
+        if idx < len(siblings) - 1:
+            return siblings[idx + 1]
+        else:
+            return None
+
+    def __getitem__(self, key):
+        return self.obj[key]
+
+    def __bool__(self):
+        return bool(self.obj)
+
+    def getparent(self):
+        return None
+
+    def __str__(self):
+        return str(self.obj)
+
+    def __unicode__(self):
+        return str(self.obj)
+
+    def __len__(self):
+        return len(self.obj)
+
+
+class TreeWalker(_base.NonRecursiveTreeWalker):
+    def __init__(self, tree):
+        if hasattr(tree, "getroot"):
+            tree = Root(tree)
+        elif isinstance(tree, list):
+            tree = FragmentRoot(tree)
+        _base.NonRecursiveTreeWalker.__init__(self, tree)
+        self.filter = ihatexml.InfosetFilter()
+
+    def getNodeDetails(self, node):
+        if isinstance(node, tuple):  # Text node
+            node, key = node
+            assert key in ("text", "tail"), _("Text nodes are text or tail, found %s") % key
+            return _base.TEXT, ensure_str(getattr(node, key))
+
+        elif isinstance(node, Root):
+            return (_base.DOCUMENT,)
+
+        elif isinstance(node, Doctype):
+            return _base.DOCTYPE, node.name, node.public_id, node.system_id
+
+        elif isinstance(node, FragmentWrapper) and not hasattr(node, "tag"):
+            return _base.TEXT, node.obj
+
+        elif node.tag == etree.Comment:
+            return _base.COMMENT, ensure_str(node.text)
+
+        elif node.tag == etree.Entity:
+            return _base.ENTITY, ensure_str(node.text)[1:-1]  # strip &;
+
+        else:
+            # This is assumed to be an ordinary element
+            match = tag_regexp.match(ensure_str(node.tag))
+            if match:
+                namespace, tag = match.groups()
+            else:
+                namespace = None
+                tag = ensure_str(node.tag)
+            attrs = {}
+            for name, value in list(node.attrib.items()):
+                name = ensure_str(name)
+                value = ensure_str(value)
+                match = tag_regexp.match(name)
+                if match:
+                    attrs[(match.group(1), match.group(2))] = value
+                else:
+                    attrs[(None, name)] = value
+            return (_base.ELEMENT, namespace, self.filter.fromXmlName(tag),
+                    attrs, len(node) > 0 or node.text)
+
+    def getFirstChild(self, node):
+        assert not isinstance(node, tuple), _("Text nodes have no children")
+
+        assert len(node) or node.text, "Node has no children"
+        if node.text:
+            return (node, "text")
+        else:
+            return node[0]
+
+    def getNextSibling(self, node):
+        if isinstance(node, tuple):  # Text node
+            node, key = node
+            assert key in ("text", "tail"), _("Text nodes are text or tail, found %s") % key
+            if key == "text":
+                # XXX: we cannot use a "bool(node) and node[0] or None" construct here
+                # because node[0] might evaluate to False if it has no child element
+                if len(node):
+                    return node[0]
+                else:
+                    return None
+            else:  # tail
+                return node.getnext()
+
+        return (node, "tail") if node.tail else node.getnext()
+
+    def getParentNode(self, node):
+        if isinstance(node, tuple):  # Text node
+            node, key = node
+            assert key in ("text", "tail"), _("Text nodes are text or tail, found %s") % key
+            if key == "text":
+                return node
+            # else: fallback to "normal" processing
+
+        return node.getparent()
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/pulldom.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/pulldom.py
new file mode 100644
index 0000000..0b0f515f
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/treewalkers/pulldom.py
@@ -0,0 +1,63 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, \
+    COMMENT, IGNORABLE_WHITESPACE, CHARACTERS
+
+from . import _base
+
+from ..constants import voidElements
+
+
+class TreeWalker(_base.TreeWalker):
+    def __iter__(self):
+        ignore_until = None
+        previous = None
+        for event in self.tree:
+            if previous is not None and \
+                    (ignore_until is None or previous[1] is ignore_until):
+                if previous[1] is ignore_until:
+                    ignore_until = None
+                for token in self.tokens(previous, event):
+                    yield token
+                    if token["type"] == "EmptyTag":
+                        ignore_until = previous[1]
+            previous = event
+        if ignore_until is None or previous[1] is ignore_until:
+            for token in self.tokens(previous, None):
+                yield token
+        elif ignore_until is not None:
+            raise ValueError("Illformed DOM event stream: void element without END_ELEMENT")
+
+    def tokens(self, event, next):
+        type, node = event
+        if type == START_ELEMENT:
+            name = node.nodeName
+            namespace = node.namespaceURI
+            attrs = {}
+            for attr in list(node.attributes.keys()):
+                attr = node.getAttributeNode(attr)
+                attrs[(attr.namespaceURI, attr.localName)] = attr.value
+            if name in voidElements:
+                for token in self.emptyTag(namespace,
+                                           name,
+                                           attrs,
+                                           not next or next[1] is not node):
+                    yield token
+            else:
+                yield self.startTag(namespace, name, attrs)
+
+        elif type == END_ELEMENT:
+            name = node.nodeName
+            namespace = node.namespaceURI
+            if name not in voidElements:
+                yield self.endTag(namespace, name)
+
+        elif type == COMMENT:
+            yield self.comment(node.nodeValue)
+
+        elif type in (IGNORABLE_WHITESPACE, CHARACTERS):
+            for token in self.text(node.nodeValue):
+                yield token
+
+        else:
+            yield self.unknown(type)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/__init__.py
new file mode 100644
index 0000000..a8cca8a9
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/__init__.py
@@ -0,0 +1,12 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from .py import Trie as PyTrie
+
+Trie = PyTrie
+
+try:
+    from .datrie import Trie as DATrie
+except ImportError:
+    pass
+else:
+    Trie = DATrie
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/_base.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/_base.py
new file mode 100644
index 0000000..724486b1
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/_base.py
@@ -0,0 +1,37 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from collections import Mapping
+
+
+class Trie(Mapping):
+    """Abstract base class for tries"""
+
+    def keys(self, prefix=None):
+        keys = super().keys()
+
+        if prefix is None:
+            return set(keys)
+
+        # Python 2.6: no set comprehensions
+        return set([x for x in keys if x.startswith(prefix)])
+
+    def has_keys_with_prefix(self, prefix):
+        for key in self.keys():
+            if key.startswith(prefix):
+                return True
+
+        return False
+
+    def longest_prefix(self, prefix):
+        if prefix in self:
+            return prefix
+
+        for i in range(1, len(prefix) + 1):
+            if prefix[:-i] in self:
+                return prefix[:-i]
+
+        raise KeyError(prefix)
+
+    def longest_prefix_item(self, prefix):
+        lprefix = self.longest_prefix(prefix)
+        return (lprefix, self[lprefix])
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/datrie.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/datrie.py
new file mode 100644
index 0000000..51f3d04
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/datrie.py
@@ -0,0 +1,44 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from datrie import Trie as DATrie
+from six import text_type
+
+from ._base import Trie as ABCTrie
+
+
+class Trie(ABCTrie):
+    def __init__(self, data):
+        chars = set()
+        for key in data.keys():
+            if not isinstance(key, text_type):
+                raise TypeError("All keys must be strings")
+            for char in key:
+                chars.add(char)
+
+        self._data = DATrie("".join(chars))
+        for key, value in data.items():
+            self._data[key] = value
+
+    def __contains__(self, key):
+        return key in self._data
+
+    def __len__(self):
+        return len(self._data)
+
+    def __iter__(self):
+        raise NotImplementedError()
+
+    def __getitem__(self, key):
+        return self._data[key]
+
+    def keys(self, prefix=None):
+        return self._data.keys(prefix)
+
+    def has_keys_with_prefix(self, prefix):
+        return self._data.has_keys_with_prefix(prefix)
+
+    def longest_prefix(self, prefix):
+        return self._data.longest_prefix(prefix)
+
+    def longest_prefix_item(self, prefix):
+        return self._data.longest_prefix_item(prefix)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/py.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/py.py
new file mode 100644
index 0000000..c2ba3da7
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/trie/py.py
@@ -0,0 +1,67 @@
+from __future__ import absolute_import, division, unicode_literals
+from six import text_type
+
+from bisect import bisect_left
+
+from ._base import Trie as ABCTrie
+
+
+class Trie(ABCTrie):
+    def __init__(self, data):
+        if not all(isinstance(x, text_type) for x in data.keys()):
+            raise TypeError("All keys must be strings")
+
+        self._data = data
+        self._keys = sorted(data.keys())
+        self._cachestr = ""
+        self._cachepoints = (0, len(data))
+
+    def __contains__(self, key):
+        return key in self._data
+
+    def __len__(self):
+        return len(self._data)
+
+    def __iter__(self):
+        return iter(self._data)
+
+    def __getitem__(self, key):
+        return self._data[key]
+
+    def keys(self, prefix=None):
+        if prefix is None or prefix == "" or not self._keys:
+            return set(self._keys)
+
+        if prefix.startswith(self._cachestr):
+            lo, hi = self._cachepoints
+            start = i = bisect_left(self._keys, prefix, lo, hi)
+        else:
+            start = i = bisect_left(self._keys, prefix)
+
+        keys = set()
+        if start == len(self._keys):
+            return keys
+
+        while self._keys[i].startswith(prefix):
+            keys.add(self._keys[i])
+            i += 1
+
+        self._cachestr = prefix
+        self._cachepoints = (start, i)
+
+        return keys
+
+    def has_keys_with_prefix(self, prefix):
+        if prefix in self._data:
+            return True
+
+        if prefix.startswith(self._cachestr):
+            lo, hi = self._cachepoints
+            i = bisect_left(self._keys, prefix, lo, hi)
+        else:
+            i = bisect_left(self._keys, prefix)
+
+        if i == len(self._keys):
+            return False
+
+        return self._keys[i].startswith(prefix)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/utils.py b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/utils.py
new file mode 100644
index 0000000..2f41f4d
--- /dev/null
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/html5lib/html5lib/utils.py
@@ -0,0 +1,82 @@
+from __future__ import absolute_import, division, unicode_literals
+
+from types import ModuleType
+
+try:
+    import xml.etree.cElementTree as default_etree
+except ImportError:
+    import xml.etree.ElementTree as default_etree
+
+
+__all__ = ["default_etree", "MethodDispatcher", "isSurrogatePair",
+           "surrogatePairToCodepoint", "moduleFactoryFactory"]
+
+
+class MethodDispatcher(dict):
+    """Dict with 2 special properties:
+
+    On initiation, keys that are lists, sets or tuples are converted to
+    multiple keys so accessing any one of the items in the original
+    list-like object returns the matching value
+
+    md = MethodDispatcher({("foo", "bar"):"baz"})
+    md["foo"] == "baz"
+
+    A default value which can be set through the default attribute.
+    """
+
+    def __init__(self, items=()):
+        # Using _dictEntries instead of directly assigning to self is about
+        # twice as fast. Please do careful performance testing before changing
+        # anything here.
+        _dictEntries = []
+        for name, value in items:
+            if type(name) in (list, tuple, frozenset, set):
+                for item in name:
+                    _dictEntries.append((item, value))
+            else:
+                _dictEntries.append((name, value))
+        dict.__init__(self, _dictEntries)
+        self.default = None
+
+    def __getitem__(self, key):
+        return dict.get(self, key, self.default)
+
+
+# Some utility functions to dal with weirdness around UCS2 vs UCS4
+# python builds
+
+def isSurrogatePair(data):
+    return (len(data) == 2 and
+            ord(data[0]) >= 0xD800 and ord(data[0]) <= 0xDBFF and
+            ord(data[1]) >= 0xDC00 and ord(data[1]) <= 0xDFFF)
+
+
+def surrogatePairToCodepoint(data):
+    char_val = (0x10000 + (ord(data[0]) - 0xD800) * 0x400 +
+                (ord(data[1]) - 0xDC00))
+    return char_val
+
+# Module Factory Factory (no, this isn't Java, I know)
+# Here to stop this being duplicated all over the place.
+
+
+def moduleFactoryFactory(factory):
+    moduleCache = {}
+
+    def moduleFactory(baseModule, *args, **kwargs):
+        if isinstance(ModuleType.__name__, type("")):
+            name = "_%s_factory" % baseModule.__name__
+        else:
+            name = b"_%s_factory" % baseModule.__name__
+
+        if name in moduleCache:
+            return moduleCache[name]
+        else:
+            mod = ModuleType(name)
+            objs = factory(baseModule, *args, **kwargs)
+            mod.__dict__.update(objs)
+            moduleCache[name] = mod
+            return mod
+
+    return moduleFactory
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
index 944ed8f..3943fe8 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -96,7 +96,7 @@
 
         for root, dirs, files in self.filesystem.walk(self.source_repo_path):
             cur_dir = root.replace(self.dir_above_repo + '/', '') + '/'
-            _log.info('  scanning ' + cur_dir + '...')
+            _log.debug('  scanning ' + cur_dir + '...')
             total_tests = 0
             reftests = 0
             jstests = 0
@@ -121,10 +121,10 @@
                     if path_base in dirs:
                         dirs.remove(path_base)
                         if self.import_in_place:
-                            _log.info("  pruning %s", path_base)
+                            _log.debug('  pruning %s', path_base)
                             self.filesystem.rmtree(path_full)
                         else:
-                            _log.info("  skipping %s", path_base)
+                            _log.debug('  skipping %s', path_base)
 
             copy_list = []
 
@@ -134,7 +134,7 @@
                 path_base = self.destination_directory.replace(self.layout_tests_dir + '/', '') + '/' + path_base
                 if path_base in paths_to_skip:
                     if self.import_in_place:
-                        _log.info("  pruning %s", path_base)
+                        _log.debug('  pruning %s', path_base)
                         self.filesystem.remove(path_full)
                         continue
                     else:
@@ -308,7 +308,7 @@
         # FIXME: Maybe doing a file diff is in order here for existing files?
         # In other words, there's no sense in overwriting identical files, but
         # there's no harm in copying the identical thing.
-        _log.info('  %s', relpath)
+        _log.debug('  copying %s', relpath)
 
         if self.should_try_to_convert(file_to_copy, source_path, dest_dir):
             converted_file = convert_for_webkit(
diff --git a/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap b/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap
index c11dd123..80ceda0 100644
--- a/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap
+++ b/third_party/WebKit/public/platform/modules/bluetooth/Bluetooth.typemap
@@ -12,5 +12,5 @@
 ]
 type_mappings = [
   "blink.mojom.WebBluetoothDeviceId=WTF::String",
-  "bluetooth.mojom.UUID=WTF::String",
+  "bluetooth.mojom.UUID=WTF::String[nullable_is_same_type]",
 ]
diff --git a/third_party/WebKit/public/platform/modules/bluetooth/OWNERS b/third_party/WebKit/public/platform/modules/bluetooth/OWNERS
index 56c53f7..029cce6 100644
--- a/third_party/WebKit/public/platform/modules/bluetooth/OWNERS
+++ b/third_party/WebKit/public/platform/modules/bluetooth/OWNERS
@@ -4,3 +4,6 @@
 
 per-file *.mojom=set noparent
 per-file *.mojom=file://ipc/SECURITY_OWNERS
+
+per-file *.typemap=set noparent
+per-file *.typemap=file://ipc/SECURITY_OWNERS
diff --git a/third_party/WebKit/public/web/WebFrameClient.h b/third_party/WebKit/public/web/WebFrameClient.h
index 5349ba3..ef4f788 100644
--- a/third_party/WebKit/public/web/WebFrameClient.h
+++ b/third_party/WebKit/public/web/WebFrameClient.h
@@ -68,8 +68,6 @@
 namespace blink {
 
 enum class WebTreeScopeType;
-class InterfaceProvider;
-class InterfaceRegistry;
 class WebApplicationCacheHost;
 class WebApplicationCacheHostClient;
 class WebColorChooser;
@@ -744,10 +742,6 @@
     }
   }
 
-  // Mojo ----------------------------------------------------------------
-  virtual InterfaceProvider* interfaceProvider() { return nullptr; }
-  virtual InterfaceRegistry* interfaceRegistry() { return nullptr; }
-
   // Visibility ----------------------------------------------------------
 
   // Returns the current visibility of the WebFrame.
diff --git a/third_party/WebKit/public/web/WebLocalFrame.h b/third_party/WebKit/public/web/WebLocalFrame.h
index f050d49..54816f8 100644
--- a/third_party/WebKit/public/web/WebLocalFrame.h
+++ b/third_party/WebKit/public/web/WebLocalFrame.h
@@ -19,6 +19,8 @@
 
 namespace blink {
 
+class InterfaceProvider;
+class InterfaceRegistry;
 class WebAutofillClient;
 class WebContentSettingsClient;
 class WebDevToolsAgent;
@@ -46,6 +48,8 @@
   // WebFrameClient may not be null.
   BLINK_EXPORT static WebLocalFrame* create(WebTreeScopeType,
                                             WebFrameClient*,
+                                            blink::InterfaceProvider*,
+                                            blink::InterfaceRegistry*,
                                             WebFrame* opener = nullptr);
 
   // Used to create a provisional local frame. Currently, it's possible for a
@@ -65,9 +69,12 @@
   //
   // Otherwise, if the load should not commit, call detach() to discard the
   // frame.
-  BLINK_EXPORT static WebLocalFrame* createProvisional(WebFrameClient*,
-                                                       WebRemoteFrame*,
-                                                       WebSandboxFlags);
+  BLINK_EXPORT static WebLocalFrame* createProvisional(
+      WebFrameClient*,
+      blink::InterfaceProvider*,
+      blink::InterfaceRegistry*,
+      WebRemoteFrame*,
+      WebSandboxFlags);
 
   // Returns the WebFrame associated with the current V8 context. This
   // function can return 0 if the context is associated with a Document that
diff --git a/third_party/WebKit/public/web/WebRemoteFrame.h b/third_party/WebKit/public/web/WebRemoteFrame.h
index 385f2bd..c8a18f2 100644
--- a/third_party/WebKit/public/web/WebRemoteFrame.h
+++ b/third_party/WebKit/public/web/WebRemoteFrame.h
@@ -14,6 +14,8 @@
 namespace blink {
 
 enum class WebTreeScopeType;
+class InterfaceProvider;
+class InterfaceRegistry;
 class WebFrameClient;
 class WebLayer;
 class WebRemoteFrameClient;
@@ -35,6 +37,8 @@
                                           const WebString& uniqueName,
                                           WebSandboxFlags,
                                           WebFrameClient*,
+                                          blink::InterfaceProvider*,
+                                          blink::InterfaceRegistry*,
                                           WebFrame* previousSibling,
                                           const WebFrameOwnerProperties&,
                                           WebFrame* opener) = 0;
diff --git a/third_party/WebKit/public/web/WebViewClient.h b/third_party/WebKit/public/web/WebViewClient.h
index 0cafd7d..22a7dd0 100644
--- a/third_party/WebKit/public/web/WebViewClient.h
+++ b/third_party/WebKit/public/web/WebViewClient.h
@@ -276,7 +276,7 @@
   void resetInputMethod() override {}
   WebScreenInfo screenInfo() override { return WebScreenInfo(); }
   void setTouchAction(WebTouchAction touchAction) override {}
-  void showVirtualKeyboard() override {}
+  void showVirtualKeyboardOnElementFocus() override {}
   void showUnhandledTapUIIfNeeded(const WebPoint& tappedPosition,
                                   const WebNode& tappedNode,
                                   bool pageChanged) override {}
diff --git a/third_party/WebKit/public/web/WebWidgetClient.h b/third_party/WebKit/public/web/WebWidgetClient.h
index c4e2b44b..1cc46a4 100644
--- a/third_party/WebKit/public/web/WebWidgetClient.h
+++ b/third_party/WebKit/public/web/WebWidgetClient.h
@@ -144,7 +144,7 @@
   virtual void setTouchAction(WebTouchAction touchAction) {}
 
   // Request the browser to show virtual keyboard for current input type.
-  virtual void showVirtualKeyboard() {}
+  virtual void showVirtualKeyboardOnElementFocus() {}
 
   // Request that the browser show a UI for an unhandled tap, if needed.
   // Invoked during the handling of a GestureTap input event whenever the
diff --git a/third_party/boringssl/BUILD.generated_tests.gni b/third_party/boringssl/BUILD.generated_tests.gni
index 49ef385..c249ca8 100644
--- a/third_party/boringssl/BUILD.generated_tests.gni
+++ b/third_party/boringssl/BUILD.generated_tests.gni
@@ -4,7 +4,7 @@
 
 # This file is created by generate_build_files.py. Do not edit manually.
 
-_test_support_sources = [
+test_support_sources = [
   "src/crypto/test/file_test.cc",
   "src/crypto/test/file_test.h",
   "src/crypto/test/malloc.cc",
@@ -15,12 +15,23 @@
   "src/ssl/test/test_config.h",
 ]
 
+crypto_test_sources = [
+  "src/crypto/dh/dh_test.cc",
+  "src/crypto/dsa/dsa_test.cc",
+  "src/crypto/test/gtest_main.cc",
+]
+
+ssl_test_sources = [
+  "src/crypto/test/gtest_main.cc",
+  "src/ssl/ssl_test.cc",
+]
+
 template("create_tests") {
   executable("boringssl_aes_test") {
     sources = [
       "src/crypto/aes/aes_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -32,7 +43,7 @@
     sources = [
       "src/crypto/asn1/asn1_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -44,7 +55,7 @@
     sources = [
       "src/crypto/base64/base64_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -56,7 +67,7 @@
     sources = [
       "src/crypto/bio/bio_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -68,7 +79,7 @@
     sources = [
       "src/crypto/bn/bn_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -80,7 +91,7 @@
     sources = [
       "src/crypto/bytestring/bytestring_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -92,7 +103,7 @@
     sources = [
       "src/crypto/chacha/chacha_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -104,7 +115,7 @@
     sources = [
       "src/crypto/cipher/aead_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -116,7 +127,7 @@
     sources = [
       "src/crypto/cipher/cipher_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -128,7 +139,7 @@
     sources = [
       "src/crypto/cmac/cmac_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -140,7 +151,7 @@
     sources = [
       "src/crypto/constant_time_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -152,7 +163,7 @@
     sources = [
       "src/crypto/curve25519/ed25519_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -164,7 +175,7 @@
     sources = [
       "src/crypto/curve25519/spake25519_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -176,19 +187,7 @@
     sources = [
       "src/crypto/curve25519/x25519_test.cc",
     ]
-    sources += _test_support_sources
-    if (defined(invoker.configs_exclude)) {
-      configs -= invoker.configs_exclude
-    }
-    configs += invoker.configs
-    deps = invoker.deps
-  }
-
-  executable("boringssl_dh_test") {
-    sources = [
-      "src/crypto/dh/dh_test.cc",
-    ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -200,19 +199,7 @@
     sources = [
       "src/crypto/digest/digest_test.cc",
     ]
-    sources += _test_support_sources
-    if (defined(invoker.configs_exclude)) {
-      configs -= invoker.configs_exclude
-    }
-    configs += invoker.configs
-    deps = invoker.deps
-  }
-
-  executable("boringssl_dsa_test") {
-    sources = [
-      "src/crypto/dsa/dsa_test.cc",
-    ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -224,7 +211,7 @@
     sources = [
       "src/crypto/ec/ec_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -236,7 +223,7 @@
     sources = [
       "src/crypto/ec/example_mul.c",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -248,7 +235,7 @@
     sources = [
       "src/crypto/ec/p256-x86_64_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -260,7 +247,7 @@
     sources = [
       "src/crypto/ecdh/ecdh_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -272,7 +259,7 @@
     sources = [
       "src/crypto/ecdsa/ecdsa_sign_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -284,7 +271,7 @@
     sources = [
       "src/crypto/ecdsa/ecdsa_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -296,7 +283,7 @@
     sources = [
       "src/crypto/ecdsa/ecdsa_verify_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -308,7 +295,7 @@
     sources = [
       "src/crypto/err/err_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -320,7 +307,7 @@
     sources = [
       "src/crypto/evp/evp_extra_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -332,7 +319,7 @@
     sources = [
       "src/crypto/evp/evp_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -344,7 +331,7 @@
     sources = [
       "src/crypto/evp/pbkdf_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -356,7 +343,7 @@
     sources = [
       "src/crypto/hkdf/hkdf_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -368,7 +355,7 @@
     sources = [
       "src/crypto/hmac/hmac_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -380,7 +367,7 @@
     sources = [
       "src/crypto/lhash/lhash_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -392,7 +379,7 @@
     sources = [
       "src/crypto/modes/gcm_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -404,7 +391,7 @@
     sources = [
       "src/crypto/obj/obj_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -416,7 +403,7 @@
     sources = [
       "src/crypto/pkcs8/pkcs12_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -428,7 +415,7 @@
     sources = [
       "src/crypto/pkcs8/pkcs8_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -440,7 +427,7 @@
     sources = [
       "src/crypto/poly1305/poly1305_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -452,7 +439,7 @@
     sources = [
       "src/crypto/pool/pool_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -464,7 +451,7 @@
     sources = [
       "src/crypto/refcount_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -476,7 +463,7 @@
     sources = [
       "src/crypto/rsa/rsa_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -488,7 +475,7 @@
     sources = [
       "src/crypto/thread_test.c",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -500,7 +487,7 @@
     sources = [
       "src/crypto/x509/pkcs7_test.c",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -512,7 +499,7 @@
     sources = [
       "src/crypto/x509/x509_test.cc",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -524,7 +511,7 @@
     sources = [
       "src/crypto/x509v3/tab_test.c",
     ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -536,19 +523,7 @@
     sources = [
       "src/crypto/x509v3/v3name_test.c",
     ]
-    sources += _test_support_sources
-    if (defined(invoker.configs_exclude)) {
-      configs -= invoker.configs_exclude
-    }
-    configs += invoker.configs
-    deps = invoker.deps
-  }
-
-  executable("boringssl_ssl_test") {
-    sources = [
-      "src/ssl/ssl_test.cc",
-    ]
-    sources += _test_support_sources
+    sources += test_support_sources
     if (defined(invoker.configs_exclude)) {
       configs -= invoker.configs_exclude
     }
@@ -569,9 +544,7 @@
       ":boringssl_cipher_test",
       ":boringssl_cmac_test",
       ":boringssl_constant_time_test",
-      ":boringssl_dh_test",
       ":boringssl_digest_test",
-      ":boringssl_dsa_test",
       ":boringssl_ec_test",
       ":boringssl_ecdh_test",
       ":boringssl_ecdsa_sign_test",
@@ -597,7 +570,6 @@
       ":boringssl_refcount_test",
       ":boringssl_rsa_test",
       ":boringssl_spake25519_test",
-      ":boringssl_ssl_test",
       ":boringssl_tab_test",
       ":boringssl_thread_test",
       ":boringssl_v3name_test",
diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
index f23085c..abe39b2 100644
--- a/third_party/boringssl/BUILD.gn
+++ b/third_party/boringssl/BUILD.gn
@@ -27,7 +27,7 @@
   ]
   configs = [
     # TODO(davidben): Fix size_t truncations in BoringSSL.
-    # https://crbug.com/429039
+    # https://crbug.com/boringssl/22
     "//build/config/compiler:no_size_t_to_int_warning",
   ]
   if (is_posix) {
@@ -123,6 +123,38 @@
   }
 }
 
+# These targets are named "_tests" rather than "_test" to avoid colliding with a
+# historical "boringssl_ssl_test" target. This works around a bug with the iOS
+# build rules.
+
+test("boringssl_crypto_tests") {
+  sources = crypto_test_sources + test_support_sources
+  deps = [
+    ":boringssl",
+    "//testing/gtest",
+  ]
+
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [
+    ":internal_config",
+    "//build/config/compiler:no_chromium_code",
+  ]
+}
+
+test("boringssl_ssl_tests") {
+  sources = ssl_test_sources + test_support_sources
+  deps = [
+    ":boringssl",
+    "//testing/gtest",
+  ]
+
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [
+    ":internal_config",
+    "//build/config/compiler:no_chromium_code",
+  ]
+}
+
 if (build_with_chromium) {
   create_tests("boringssl_tests") {
     configs_exclude = [ "//build/config/compiler:chromium_code" ]
diff --git a/third_party/boringssl/boringssl_unittest.cc b/third_party/boringssl/boringssl_unittest.cc
index 9747713..934ef73 100644
--- a/third_party/boringssl/boringssl_unittest.cc
+++ b/third_party/boringssl/boringssl_unittest.cc
@@ -85,6 +85,13 @@
     if (base::StartsWith(name, "decrepit/", base::CompareCase::SENSITIVE))
       continue;
 
+    // Skip the GTest tests. This wrapper will be removed once all the tests are
+    // converted to GTest. See https://crbug.com/boringssl/129
+    if (base::EndsWith(name, "crypto_test", base::CompareCase::SENSITIVE) ||
+        base::EndsWith(name, "ssl_test", base::CompareCase::SENSITIVE)) {
+      continue;
+    }
+
     name = name.substr(name.find_last_of('/') + 1);
     SCOPED_TRACE(name);
 
diff --git a/tools/gn/misc/vim/autoload/gn.vim b/tools/gn/misc/vim/autoload/gn.vim
new file mode 100644
index 0000000..c1df012
--- /dev/null
+++ b/tools/gn/misc/vim/autoload/gn.vim
@@ -0,0 +1,17 @@
+" 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.
+
+function! gn#TranslateToBuildFile(name) abort
+  " Strip '//' prefix
+  let l:new_path = substitute(a:name, '\v^//', '', '')
+
+  " Strip the build target name (necessary if 'isfname' contains ':')
+  let l:new_path = substitute(l:new_path, '\v:.*$', '', '')
+
+  " Append 'BUILD.gn', only if this is a directory and not a file
+  if isdirectory(l:new_path)
+    let l:new_path = substitute(l:new_path, '\v/?$', '/BUILD.gn', '')
+  endif
+  return l:new_path
+endfunction
diff --git a/tools/gn/misc/vim/ftplugin/gn.vim b/tools/gn/misc/vim/ftplugin/gn.vim
new file mode 100644
index 0000000..ede251d
--- /dev/null
+++ b/tools/gn/misc/vim/ftplugin/gn.vim
@@ -0,0 +1,12 @@
+" 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.
+
+if exists('b:did_ftplugin')
+  finish
+endif
+let b:did_ftplugin = 1
+
+setlocal includeexpr=gn#TranslateToBuildFile(v:fname)
+
+setlocal commentstring=#\ %s
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml
index e52e5b4..1531ad5 100644
--- a/tools/metrics/actions/actions.xml
+++ b/tools/metrics/actions/actions.xml
@@ -13362,6 +13362,7 @@
   <description>
     A high priority Physical Web opt-in notification was displayed.
   </description>
+  <obsolete>Deprecated 01/2017, no longer used</obsolete>
 </action>
 
 <action name="PhysicalWeb.OptIn.MinPriorityNotificationShown">
@@ -13371,6 +13372,7 @@
   <description>
     A min priority Physical Web opt-in notification was displayed.
   </description>
+  <obsolete>Deprecated 01/2017, no longer used</obsolete>
 </action>
 
 <action name="PhysicalWeb.OptIn.NotificationPressed">
@@ -13380,6 +13382,7 @@
   <description>
     The user pressed the Physical Web opt-in notification.
   </description>
+  <obsolete>Deprecated 01/2017, no longer used</obsolete>
 </action>
 
 <action name="PhysicalWeb.Prefs.FeatureDisabled">
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 55bd86af..9604846 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -45953,6 +45953,9 @@
 </histogram>
 
 <histogram name="PhysicalWeb.ReferralDelay.OptInNotification" units="ms">
+  <obsolete>
+    Deprecated 01/2017, no longer used
+  </obsolete>
   <owner>cco3@chromium.org</owner>
   <owner>mattreynolds@chromium.org</owner>
   <owner>mmocny@chromium.org</owner>
@@ -45963,6 +45966,9 @@
 </histogram>
 
 <histogram name="PhysicalWeb.ReferralDelay.StandardNotification" units="ms">
+  <obsolete>
+    Deprecated 01/2017, no longer used
+  </obsolete>
   <owner>cco3@chromium.org</owner>
   <owner>mattreynolds@chromium.org</owner>
   <owner>mmocny@chromium.org</owner>
@@ -53417,6 +53423,17 @@
   </summary>
 </histogram>
 
+<histogram name="Renderer4.GestureScrollingThreadStatus"
+    enum="ScrollingThreadStatus">
+  <owner>tdresser@chromium.org</owner>
+  <summary>
+    For every gesture, we record whether the scroll occurred on the main thread,
+    on the compositor thread, or on the compositor thread but blocked on the
+    main thread. The last case will happen when there is a blocking event
+    listener.
+  </summary>
+</histogram>
+
 <histogram name="Renderer4.GpuImageDecodeState" enum="GpuImageDecodeState">
   <owner>vmpstr@chromium.org</owner>
   <summary>
@@ -53815,6 +53832,17 @@
   </summary>
 </histogram>
 
+<histogram name="Renderer4.WheelScrollingThreadStatus"
+    enum="ScrollingThreadStatus">
+  <owner>tdresser@chromium.org</owner>
+  <summary>
+    For every wheel tick, we record whether the scroll occurred on the main
+    thread, on the compositor thread, or on the compositor thread but blocked on
+    the main thread. The last case will happen when there is a blocking event
+    listener.
+  </summary>
+</histogram>
+
 <histogram name="RendererScheduler.BackgroundRendererMainThreadLoad" units="%">
   <owner>altimin@chromium.org</owner>
   <summary>
@@ -70265,6 +70293,15 @@
   </summary>
 </histogram>
 
+<histogram name="UMA.Debug.EnableCrashUpload.DeferredStartUpAsyncTaskDuration"
+    units="ms">
+  <owner>wnwen@chromium.org</owner>
+  <summary>
+    Measures how much time it took to complete all async deferred startup tasks
+    on the background thread. Only logged on Android.
+  </summary>
+</histogram>
+
 <histogram name="UMA.Debug.EnableCrashUpload.DeferredStartUpCompleteTime"
     units="ms">
   <owner>wnwen@chromium.org</owner>
@@ -70276,6 +70313,10 @@
 
 <histogram name="UMA.Debug.EnableCrashUpload.DeferredStartUpDuration"
     units="ms">
+  <obsolete>
+    Deprecated 01/2017 for
+    UMA.Debug.EnableCrashUploadDeferredStartupAsyncTaskDuration.
+  </obsolete>
   <owner>wnwen@chromium.org</owner>
   <owner>asvitkine@chromium.org</owner>
   <summary>
@@ -83344,6 +83385,9 @@
   <int value="29" label="Supervised User"/>
   <int value="30" label="Image Fetcher Untagged"/>
   <int value="31" label="GAIA"/>
+  <int value="32" label="Captive Portal"/>
+  <int value="33" label="Web Resource Service"/>
+  <int value="34" label="Signin"/>
 </enum>
 
 <enum name="DecodedImageOrientation" type="int">
@@ -104476,6 +104520,12 @@
   <int value="9" label="Rollback: SBER2 absent so SBER1 must be cleared"/>
 </enum>
 
+<enum name="ScrollingThreadStatus" type="int">
+  <int value="0" label="SCROLLING_ON_COMPOSITOR"/>
+  <int value="1" label="SCROLLING_ON_COMPOSITOR_BLOCKED_ON_MAIN"/>
+  <int value="2" label="SCROLLING_ON_MAIN"/>
+</enum>
+
 <enum name="ScrollThread" type="int">
   <int value="0" label="Scroll on impl-thread"/>
   <int value="1" label="Scroll on main-thread"/>
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 7d9c07b..be6b6e52 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -692,23 +692,21 @@
 }
 
 void Layer::UpdateNinePatchLayerImage(const gfx::ImageSkia& image) {
-  DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
+  DCHECK_EQ(type_, LAYER_NINE_PATCH);
+  DCHECK(nine_patch_layer_.get());
+
   nine_patch_layer_image_ = image;
-  SkBitmap bitmap = nine_patch_layer_image_.GetRepresentation(
-      device_scale_factor_).sk_bitmap();
-  SkBitmap bitmap_copy;
-  if (bitmap.isImmutable()) {
-    bitmap_copy = bitmap;
-  } else {
-    // UIResourceBitmap requires an immutable copy of the input |bitmap|.
-    bitmap.copyTo(&bitmap_copy);
-    bitmap_copy.setImmutable();
-  }
-  nine_patch_layer_->SetBitmap(bitmap_copy);
+  // TODO(estade): we don't clean up old bitmaps in the UIResourceManager when
+  // the scale factor changes. Currently for the way NinePatchLayers are used,
+  // we don't need/want to, but we should address this in the future if it
+  // becomes an issue.
+  nine_patch_layer_->SetBitmap(
+      image.GetRepresentation(device_scale_factor_).sk_bitmap());
 }
 
 void Layer::UpdateNinePatchLayerAperture(const gfx::Rect& aperture_in_dip) {
-  DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
+  DCHECK_EQ(type_, LAYER_NINE_PATCH);
+  DCHECK(nine_patch_layer_.get());
   nine_patch_layer_aperture_ = aperture_in_dip;
   gfx::Rect aperture_in_pixel = ConvertRectToPixel(this, aperture_in_dip);
   nine_patch_layer_->SetAperture(aperture_in_pixel);
@@ -721,7 +719,8 @@
 }
 
 void Layer::UpdateNinePatchOcclusion(const gfx::Rect& occlusion) {
-  DCHECK(type_ == LAYER_NINE_PATCH && nine_patch_layer_.get());
+  DCHECK_EQ(type_, LAYER_NINE_PATCH);
+  DCHECK(nine_patch_layer_.get());
   nine_patch_layer_->SetLayerOcclusion(occlusion);
 }
 
@@ -803,7 +802,8 @@
   RecomputeDrawsContentAndUVRect();
   RecomputePosition();
   if (nine_patch_layer_) {
-    UpdateNinePatchLayerImage(nine_patch_layer_image_);
+    if (!nine_patch_layer_image_.isNull())
+      UpdateNinePatchLayerImage(nine_patch_layer_image_);
     UpdateNinePatchLayerAperture(nine_patch_layer_aperture_);
   }
   SchedulePaint(gfx::Rect(bounds_.size()));
diff --git a/ui/display/manager/display_manager.cc b/ui/display/manager/display_manager.cc
index 24c74f0c..dc9160e 100644
--- a/ui/display/manager/display_manager.cc
+++ b/ui/display/manager/display_manager.cc
@@ -636,7 +636,7 @@
 #if defined(OS_WIN)
   DCHECK_EQ(1u, updated_display_info_list.size())
       << ": Multiple display test does not work on Windows bots. Please "
-         "skip (don't disable) the test using SupportsMultipleDisplays()";
+         "skip (don't disable) the test.";
 #endif
 
   DisplayInfoList new_display_info_list = updated_display_info_list;
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index 5094466..f90ffcf 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -233,6 +233,13 @@
              : cc::InputHandler::TOUCHSCREEN;
 }
 
+enum ScrollingThreadStatus {
+  SCROLLING_ON_COMPOSITOR,
+  SCROLLING_ON_COMPOSITOR_BLOCKED_ON_MAIN,
+  SCROLLING_ON_MAIN,
+  LAST_SCROLLING_THREAD_STATUS_VALUE = SCROLLING_ON_MAIN,
+};
+
 }  // namespace
 
 namespace ui {
@@ -257,6 +264,7 @@
       uma_latency_reporting_enabled_(base::TimeTicks::IsHighResolution()),
       touchpad_and_wheel_scroll_latching_enabled_(false),
       touch_start_result_(kEventDispositionUndefined),
+      mouse_wheel_result_(kEventDispositionUndefined),
       current_overscroll_params_(nullptr),
       has_ongoing_compositor_scroll_pinch_(false),
       tick_clock_(base::MakeUnique<base::DefaultTickClock>()) {
@@ -586,6 +594,54 @@
   }
 }
 
+void InputHandlerProxy::RecordScrollingThreadStatus(
+    blink::WebGestureDevice device,
+    uint32_t reasons) {
+  DCHECK(device == blink::WebGestureDeviceTouchpad ||
+         device == blink::WebGestureDeviceTouchscreen);
+
+  if (device != blink::WebGestureDeviceTouchpad &&
+      device != blink::WebGestureDeviceTouchscreen) {
+    return;
+  }
+
+  ScrollingThreadStatus scrolling_thread_status = SCROLLING_ON_MAIN;
+  if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) {
+    int32_t event_disposition_result =
+        (device == blink::WebGestureDeviceTouchpad ? mouse_wheel_result_
+                                                   : touch_start_result_);
+    switch (event_disposition_result) {
+      case kEventDispositionUndefined:
+      case DID_NOT_HANDLE_NON_BLOCKING_DUE_TO_FLING:
+      case DID_HANDLE_NON_BLOCKING:
+      case DROP_EVENT:
+        scrolling_thread_status = SCROLLING_ON_COMPOSITOR;
+        break;
+      case DID_NOT_HANDLE:
+        scrolling_thread_status = SCROLLING_ON_COMPOSITOR_BLOCKED_ON_MAIN;
+        break;
+      default:
+        NOTREACHED();
+        scrolling_thread_status = SCROLLING_ON_COMPOSITOR;
+    }
+  }
+
+  // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly
+  // greater than the sample value.
+  const uint32_t kScrolingThreadStatusEnumMax =
+      ScrollingThreadStatus::LAST_SCROLLING_THREAD_STATUS_VALUE + 1;
+
+  if (device == blink::WebGestureDeviceTouchscreen) {
+    UMA_HISTOGRAM_ENUMERATION("Renderer4.GestureScrollingThreadStatus",
+                              scrolling_thread_status,
+                              kScrolingThreadStatusEnumMax);
+  } else {
+    UMA_HISTOGRAM_ENUMERATION("Renderer4.WheelScrollingThreadStatus",
+                              scrolling_thread_status,
+                              kScrolingThreadStatusEnumMax);
+  }
+}
+
 bool InputHandlerProxy::ShouldAnimate(bool has_precise_scroll_deltas) const {
 #if defined(OS_MACOSX)
   // Mac does not smooth scroll wheel events (crbug.com/574283).
@@ -602,21 +658,28 @@
   if (!wheel_event.hasPreciseScrollingDeltas && fling_curve_)
     CancelCurrentFling();
 
+  InputHandlerProxy::EventDisposition result = DROP_EVENT;
   cc::EventListenerProperties properties =
       input_handler_->GetEventListenerProperties(
           cc::EventListenerClass::kMouseWheel);
   switch (properties) {
     case cc::EventListenerProperties::kPassive:
-      return DID_HANDLE_NON_BLOCKING;
+      result = DID_HANDLE_NON_BLOCKING;
+      break;
     case cc::EventListenerProperties::kBlockingAndPassive:
     case cc::EventListenerProperties::kBlocking:
-      return DID_NOT_HANDLE;
+      result = DID_NOT_HANDLE;
+      break;
     case cc::EventListenerProperties::kNone:
-      return DROP_EVENT;
+      result = DROP_EVENT;
+      break;
     default:
       NOTREACHED();
-      return DROP_EVENT;
+      result = DROP_EVENT;
   }
+
+  mouse_wheel_result_ = result;
+  return result;
 }
 
 InputHandlerProxy::EventDisposition InputHandlerProxy::FlingScrollByMouseWheel(
@@ -671,6 +734,13 @@
         blink::WebGestureDeviceTouchpad,
         scroll_status.main_thread_scrolling_reasons);
 
+    mouse_wheel_result_ =
+        (listener_properties == cc::EventListenerProperties::kPassive)
+            ? DID_HANDLE_NON_BLOCKING
+            : DROP_EVENT;
+    RecordScrollingThreadStatus(blink::WebGestureDeviceTouchpad,
+                                scroll_status.main_thread_scrolling_reasons);
+
     switch (scroll_status.thread) {
       case cc::InputHandler::SCROLL_ON_IMPL_THREAD: {
         TRACE_EVENT_INSTANT2("input",
@@ -753,6 +823,9 @@
   RecordMainThreadScrollingReasons(gesture_event.sourceDevice,
                                    scroll_status.main_thread_scrolling_reasons);
 
+  RecordScrollingThreadStatus(gesture_event.sourceDevice,
+                              scroll_status.main_thread_scrolling_reasons);
+
   InputHandlerProxy::EventDisposition result = DID_NOT_HANDLE;
   switch (scroll_status.thread) {
     case cc::InputHandler::SCROLL_ON_IMPL_THREAD:
diff --git a/ui/events/blink/input_handler_proxy.h b/ui/events/blink/input_handler_proxy.h
index 09b44d0c..0d3f9c1 100644
--- a/ui/events/blink/input_handler_proxy.h
+++ b/ui/events/blink/input_handler_proxy.h
@@ -118,6 +118,8 @@
  protected:
   void RecordMainThreadScrollingReasons(blink::WebGestureDevice device,
                                         uint32_t reasons);
+  void RecordScrollingThreadStatus(blink::WebGestureDevice device,
+                                   uint32_t reasons);
 
  private:
   friend class test::InputHandlerProxyTest;
@@ -245,6 +247,10 @@
   // passive events not to block scrolling.
   int32_t touch_start_result_;
 
+  // The result of the last mouse wheel event. This value is used to determine
+  // whether the next wheel scroll is blocked on the Main thread or not.
+  int32_t mouse_wheel_result_;
+
   base::TimeTicks last_fling_animate_time_;
 
   // Used to record overscroll notifications while an event is being
diff --git a/ui/events/blink/input_handler_proxy_unittest.cc b/ui/events/blink/input_handler_proxy_unittest.cc
index 6e5ffbb2..85e9b46 100644
--- a/ui/events/blink/input_handler_proxy_unittest.cc
+++ b/ui/events/blink/input_handler_proxy_unittest.cc
@@ -327,7 +327,7 @@
 
 const cc::InputHandler::ScrollStatus kMainThreadScrollState(
     cc::InputHandler::SCROLL_ON_MAIN_THREAD,
-    cc::MainThreadScrollingReason::kNotScrollingOnMain);
+    cc::MainThreadScrollingReason::kHandlingScrollFromMainThread);
 
 const cc::InputHandler::ScrollStatus kScrollIgnoredScrollState(
     cc::InputHandler::SCROLL_IGNORED,
@@ -3011,6 +3011,186 @@
                            base::Bucket(5, 1), base::Bucket(14, 1)));
 }
 
+TEST_P(InputHandlerProxyTest, GestureScrollingThreadStatusHistogram) {
+  VERIFY_AND_RESET_MOCKS();
+
+  WebTouchEvent touch_start(WebInputEvent::TouchStart,
+                            WebInputEvent::NoModifiers,
+                            WebInputEvent::TimeStampForTesting);
+  touch_start.touchesLength = 1;
+  touch_start.touches[0] =
+      CreateWebTouchPoint(WebTouchPoint::StatePressed, 10, 10);
+
+  WebGestureEvent gesture_scroll_begin;
+  gesture_scroll_begin.setType(WebInputEvent::GestureScrollBegin);
+  gesture_scroll_begin.sourceDevice = blink::WebGestureDeviceTouchscreen;
+
+  WebGestureEvent gesture_scroll_end;
+  gesture_scroll_end.setType(WebInputEvent::GestureScrollEnd);
+  gesture_scroll_end.sourceDevice = blink::WebGestureDeviceTouchscreen;
+
+  // Touch start with passive event listener.
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartAt(
+                  testing::Property(&gfx::Point::x, testing::Gt(0))))
+      .WillOnce(testing::Return(
+          cc::InputHandler::TouchStartEventListenerType::NO_HANDLER));
+  EXPECT_CALL(
+      mock_input_handler_,
+      GetEventListenerProperties(cc::EventListenerClass::kTouchStartOrMove))
+      .WillOnce(testing::Return(cc::EventListenerProperties::kPassive));
+
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE_NON_BLOCKING;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(touch_start));
+
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(kImplThreadScrollState));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_begin));
+
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Renderer4.GestureScrollingThreadStatus"),
+              testing::ElementsAre(base::Bucket(0, 1)));
+
+  EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_end));
+
+  VERIFY_AND_RESET_MOCKS();
+
+  // Touch event with HANDLER_ON_SCROLLING_LAYER event listener.
+  EXPECT_CALL(mock_input_handler_,
+              EventListenerTypeForTouchStartAt(
+                  testing::Property(&gfx::Point::x, testing::Gt(0))))
+      .WillOnce(testing::Return(cc::InputHandler::TouchStartEventListenerType::
+                                    HANDLER_ON_SCROLLING_LAYER));
+
+  expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(touch_start));
+
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(kImplThreadScrollState));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_begin));
+
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Renderer4.GestureScrollingThreadStatus"),
+              testing::ElementsAre(base::Bucket(0, 1), base::Bucket(1, 1)));
+
+  EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_end));
+
+  VERIFY_AND_RESET_MOCKS();
+
+  // Gesture scrolling on main thread.
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(kMainThreadScrollState));
+  expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_begin));
+
+  EXPECT_THAT(histogram_tester().GetAllSamples(
+                  "Renderer4.GestureScrollingThreadStatus"),
+              testing::ElementsAre(base::Bucket(0, 1), base::Bucket(1, 1),
+                                   base::Bucket(2, 1)));
+
+  EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
+  expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_end));
+
+  VERIFY_AND_RESET_MOCKS();
+}
+
+TEST_P(InputHandlerProxyTest, WheelScrollingThreadStatusHistogram) {
+  VERIFY_AND_RESET_MOCKS();
+
+  WebMouseWheelEvent wheel(WebInputEvent::MouseWheel, WebInputEvent::ControlKey,
+                           WebInputEvent::TimeStampForTesting);
+
+  WebGestureEvent gesture_scroll_begin;
+  gesture_scroll_begin.setType(WebInputEvent::GestureScrollBegin);
+  gesture_scroll_begin.sourceDevice = blink::WebGestureDeviceTouchpad;
+
+  WebGestureEvent gesture_scroll_end;
+  gesture_scroll_end.setType(WebInputEvent::GestureScrollEnd);
+  gesture_scroll_end.sourceDevice = blink::WebGestureDeviceTouchpad;
+
+  // Wheel event with passive event listener.
+  EXPECT_CALL(mock_input_handler_,
+              GetEventListenerProperties(cc::EventListenerClass::kMouseWheel))
+      .WillOnce(testing::Return(cc::EventListenerProperties::kPassive));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE_NON_BLOCKING;
+  EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel));
+
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(kImplThreadScrollState));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_begin));
+
+  EXPECT_THAT(
+      histogram_tester().GetAllSamples("Renderer4.WheelScrollingThreadStatus"),
+      testing::ElementsAre(base::Bucket(0, 1)));
+
+  EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_end));
+
+  VERIFY_AND_RESET_MOCKS();
+
+  // Wheel event with blocking event listener.
+  EXPECT_CALL(mock_input_handler_,
+              GetEventListenerProperties(cc::EventListenerClass::kMouseWheel))
+      .WillOnce(testing::Return(cc::EventListenerProperties::kBlocking));
+  expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
+  EXPECT_EQ(expected_disposition_, input_handler_->HandleInputEvent(wheel));
+
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(kImplThreadScrollState));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_begin));
+
+  EXPECT_THAT(
+      histogram_tester().GetAllSamples("Renderer4.WheelScrollingThreadStatus"),
+      testing::ElementsAre(base::Bucket(0, 1), base::Bucket(1, 1)));
+
+  EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
+  expected_disposition_ = InputHandlerProxy::DID_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_end));
+
+  VERIFY_AND_RESET_MOCKS();
+
+  // Wheel scrolling on main thread.
+  EXPECT_CALL(mock_input_handler_, ScrollBegin(testing::_, testing::_))
+      .WillOnce(testing::Return(kMainThreadScrollState));
+  expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_begin));
+
+  EXPECT_THAT(
+      histogram_tester().GetAllSamples("Renderer4.WheelScrollingThreadStatus"),
+      testing::ElementsAre(base::Bucket(0, 1), base::Bucket(1, 1),
+                           base::Bucket(2, 1)));
+
+  EXPECT_CALL(mock_input_handler_, ScrollEnd(testing::_));
+  expected_disposition_ = InputHandlerProxy::DID_NOT_HANDLE;
+  EXPECT_EQ(expected_disposition_,
+            input_handler_->HandleInputEvent(gesture_scroll_end));
+
+  VERIFY_AND_RESET_MOCKS();
+}
+
 TEST_F(InputHandlerProxyEventQueueTest, VSyncAlignedGestureScroll) {
   base::HistogramTester histogram_tester;
 
diff --git a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
index b72f6f2..c6da6de 100644
--- a/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
+++ b/ui/events/ozone/layout/xkb/xkb_keyboard_layout_engine.cc
@@ -821,7 +821,7 @@
                {ui::EF_MOD3_DOWN, "Mod3"},
                {ui::EF_CAPS_LOCK_ON, XKB_MOD_NAME_CAPS}};
   xkb_flag_map_.clear();
-  xkb_flag_map_.resize(arraysize(flags));
+  xkb_flag_map_.reserve(arraysize(flags));
   for (size_t i = 0; i < arraysize(flags); ++i) {
     xkb_mod_index_t index = xkb_keymap_mod_get_index(keymap, flags[i].xkb_name);
     if (index == XKB_MOD_INVALID) {
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index a0dbb0b..3b36ea0 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -1340,7 +1340,7 @@
 }
 
 void RenderText::ApplyTextShadows(internal::SkiaTextRenderer* renderer) {
-  renderer->SetDrawLooper(CreateShadowDrawLooper(shadows_));
+  renderer->SetDrawLooper(CreateShadowDrawLooperCorrectBlur(shadows_));
 }
 
 base::i18n::TextDirection RenderText::GetTextDirection(
diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
index 0e83a8d..2242fa8 100644
--- a/ui/native_theme/native_theme.h
+++ b/ui/native_theme/native_theme.h
@@ -45,6 +45,9 @@
   // The part to be painted / sized.
   enum Part {
     kCheckbox,
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+    kFrameTopArea,
+#endif
     kInnerSpinButton,
     kMenuList,
     kMenuPopupBackground,
@@ -109,6 +112,19 @@
     SkColor background_color;
   };
 
+  struct FrameTopAreaExtraParams {
+    // Distinguishes between active (foreground) and inactive
+    // (background) window frame styles.
+    bool is_active;
+    bool incognito;
+    // True when Chromium renders the titlebar.  False when the window
+    // manager renders the titlebar.
+    bool use_custom_frame;
+    // If the NativeTheme will paint a solid color, it should use
+    // |default_background_color|.
+    SkColor default_background_color;
+  };
+
   struct InnerSpinButtonExtraParams {
     bool spin_up;
     bool read_only;
@@ -207,6 +223,7 @@
     ExtraParams(const ExtraParams& other);
 
     ButtonExtraParams button;
+    FrameTopAreaExtraParams frame_top_area;
     InnerSpinButtonExtraParams inner_spin;
     MenuArrowExtraParams menu_arrow;
     MenuCheckExtraParams menu_check;
diff --git a/ui/native_theme/native_theme_base.cc b/ui/native_theme/native_theme_base.cc
index b9d2827d..ec5b30a 100644
--- a/ui/native_theme/native_theme_base.cc
+++ b/ui/native_theme/native_theme_base.cc
@@ -172,6 +172,11 @@
     case kCheckbox:
       PaintCheckbox(canvas, state, rect, extra.button);
       break;
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+    case kFrameTopArea:
+      PaintFrameTopArea(canvas, state, rect, extra.frame_top_area);
+      break;
+#endif
     case kInnerSpinButton:
       PaintInnerSpinButton(canvas, state, rect, extra.inner_spin);
       break;
@@ -898,6 +903,16 @@
   canvas->drawRect(gfx::RectFToSkRect(border_rect), stroke_paint);
 }
 
+void NativeThemeBase::PaintFrameTopArea(
+    SkCanvas* canvas,
+    State state,
+    const gfx::Rect& rect,
+    const FrameTopAreaExtraParams& frame_top_area) const {
+  SkPaint paint;
+  paint.setColor(frame_top_area.default_background_color);
+  canvas->drawRect(gfx::RectToSkRect(rect), paint);
+}
+
 void NativeThemeBase::AdjustCheckboxRadioRectForPadding(SkRect* rect) const {
   // By default we only take 1px from right and bottom for the drop shadow.
   rect->iset(rect->x(), rect->y(), rect->right() - 1, rect->bottom() - 1);
diff --git a/ui/native_theme/native_theme_base.h b/ui/native_theme/native_theme_base.h
index f471293..fa06cfbc 100644
--- a/ui/native_theme/native_theme_base.h
+++ b/ui/native_theme/native_theme_base.h
@@ -128,6 +128,12 @@
       const gfx::Rect& rect,
       const ProgressBarExtraParams& progress_bar) const;
 
+  virtual void PaintFrameTopArea(
+      SkCanvas* canvas,
+      State state,
+      const gfx::Rect& rect,
+      const FrameTopAreaExtraParams& frame_top_area) const;
+
   // Shrinks checkbox/radio button rect, if necessary, to make room for padding
   // and drop shadow.
   // TODO(mohsen): This is needed because checkboxes/radio buttons on Android
diff --git a/ui/views/button_drag_utils.cc b/ui/views/button_drag_utils.cc
index 70ecf3a..084ed5b8 100644
--- a/ui/views/button_drag_utils.cc
+++ b/ui/views/button_drag_utils.cc
@@ -58,7 +58,7 @@
       ui::NativeTheme::kColorId_TextfieldDefaultBackground);
   if (widget->IsTranslucentWindowOpacitySupported()) {
     button.SetTextShadows(gfx::ShadowValues(
-        10, gfx::ShadowValue(gfx::Vector2d(0, 0), 1.0f, bg_color)));
+        10, gfx::ShadowValue(gfx::Vector2d(0, 0), 2.0f, bg_color)));
   } else {
     button.set_background(views::Background::CreateSolidBackground(bg_color));
     button.SetBorder(button.CreateDefaultBorder());
diff --git a/ui/views/window/custom_frame_view.cc b/ui/views/window/custom_frame_view.cc
index bac98a41..14d4630 100644
--- a/ui/views/window/custom_frame_view.cc
+++ b/ui/views/window/custom_frame_view.cc
@@ -221,6 +221,14 @@
   if (!ShouldShowTitleBarAndBorder())
     return;
 
+  frame_background_->set_frame_color(GetFrameColor());
+  frame_background_->set_use_custom_frame(true);
+  frame_background_->set_is_active(ShouldPaintAsActive());
+  frame_background_->set_incognito(false);
+  const gfx::ImageSkia frame_image = GetFrameImage();
+  frame_background_->set_theme_image(frame_image);
+  frame_background_->set_top_area_height(frame_image.height());
+
   if (frame_->IsMaximized())
     PaintMaximizedFrameBorder(canvas);
   else
@@ -359,11 +367,6 @@
 }
 
 void CustomFrameView::PaintRestoredFrameBorder(gfx::Canvas* canvas) {
-  frame_background_->set_frame_color(GetFrameColor());
-  const gfx::ImageSkia frame_image = GetFrameImage();
-  frame_background_->set_theme_image(frame_image);
-  frame_background_->set_top_area_height(frame_image.height());
-
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
 
   frame_background_->SetCornerImages(
@@ -381,9 +384,6 @@
 }
 
 void CustomFrameView::PaintMaximizedFrameBorder(gfx::Canvas* canvas) {
-  const gfx::ImageSkia frame_image = GetFrameImage();
-  frame_background_->set_theme_image(frame_image);
-  frame_background_->set_top_area_height(frame_image.height());
   frame_background_->PaintMaximized(canvas, this);
 
   ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
diff --git a/ui/views/window/frame_background.cc b/ui/views/window/frame_background.cc
index 3e0e4ff..7bbbb8d 100644
--- a/ui/views/window/frame_background.cc
+++ b/ui/views/window/frame_background.cc
@@ -8,12 +8,16 @@
 #include "third_party/skia/include/core/SkColor.h"
 #include "ui/base/theme_provider.h"
 #include "ui/gfx/canvas.h"
+#include "ui/native_theme/native_theme.h"
 #include "ui/views/view.h"
 
 namespace views {
 
 FrameBackground::FrameBackground()
     : frame_color_(0),
+      use_custom_frame_(true),
+      is_active_(true),
+      incognito_(false),
       top_area_height_(0),
       left_edge_(nullptr),
       top_edge_(nullptr),
@@ -125,10 +129,8 @@
   // beneath the image.
   int theme_frame_bottom = -maximized_top_inset_ +
                            (theme_image_.isNull() ? 0 : theme_image_.height());
-  if (top_area_height_ > theme_frame_bottom) {
-    canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_),
-                     frame_color_);
-  }
+  if (top_area_height_ > theme_frame_bottom)
+    PaintFrameTopArea(canvas, view);
 
   // Draw the theme frame.
   if (!theme_image_.isNull()) {
@@ -142,9 +144,7 @@
 
 void FrameBackground::PaintFrameColor(gfx::Canvas* canvas,
                                       const View* view) const {
-  // Fill the top area.
-  canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_),
-                   frame_color_);
+  PaintFrameTopArea(canvas, view);
 
   // If the window is very short, we're done.
   int remaining_height = view->height() - top_area_height_;
@@ -171,4 +171,22 @@
                              frame_color_);
 }
 
+void FrameBackground::PaintFrameTopArea(gfx::Canvas* canvas,
+                                        const View* view) const {
+#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
+  auto* native_theme = view->GetNativeTheme();
+  ui::NativeTheme::ExtraParams params;
+  params.frame_top_area.use_custom_frame = use_custom_frame_;
+  params.frame_top_area.is_active = is_active_;
+  params.frame_top_area.incognito = incognito_;
+  params.frame_top_area.default_background_color = frame_color_;
+  native_theme->Paint(canvas->sk_canvas(), ui::NativeTheme::kFrameTopArea,
+                      ui::NativeTheme::kNormal,
+                      gfx::Rect(0, 0, view->width(), top_area_height_), params);
+#else
+  canvas->FillRect(gfx::Rect(0, 0, view->width(), top_area_height_),
+                   frame_color_);
+#endif
+}
+
 }  // namespace views
diff --git a/ui/views/window/frame_background.h b/ui/views/window/frame_background.h
index a420de5..191e5209d 100644
--- a/ui/views/window/frame_background.h
+++ b/ui/views/window/frame_background.h
@@ -29,6 +29,16 @@
   // Sets the color to draw under the frame images.
   void set_frame_color(SkColor color) { frame_color_ = color; }
 
+  void set_use_custom_frame(bool use_custom_frame) {
+    use_custom_frame_ = use_custom_frame;
+  }
+
+  // Sets whether the frame to be drawn should have focus.
+  void set_is_active(bool is_active) { is_active_ = is_active; }
+
+  // Sets whether the frame to be drawn is in incognito mode.
+  void set_incognito(bool incognito) { incognito_ = incognito; }
+
   // Sets the theme image for the top of the window.  May be null (empty).
   // Memory is owned by the caller.
   void set_theme_image(const gfx::ImageSkia& image) { theme_image_ = image; }
@@ -74,7 +84,13 @@
   // Fills the frame area with the frame color.
   void PaintFrameColor(gfx::Canvas* canvas, const View* view) const;
 
+  // Paints the background of the tab strip.
+  void PaintFrameTopArea(gfx::Canvas* canvas, const View* view) const;
+
   SkColor frame_color_;
+  bool use_custom_frame_;
+  bool is_active_;
+  bool incognito_;
   gfx::ImageSkia theme_image_;
   gfx::ImageSkia theme_overlay_image_;
   int top_area_height_;