diff --git a/DEPS b/DEPS
index d5404f835..8adc2307 100644
--- a/DEPS
+++ b/DEPS
@@ -111,11 +111,11 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling Skia
   # and whatever else without interference from each other.
-  'skia_revision': '70bd0b72f3f837fcc663fb0728f3e69ba26bd93a',
+  'skia_revision': '472639d9f12f7e4034f7aedeb22f44405d0d5d23',
   # 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': '130258cf6273bec7d44aeea4f0cb85f4b1dbfd30',
+  'v8_revision': '8bc0f79a45048636adca4b808041722813647884',
   # 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.
@@ -171,7 +171,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling catapult
   # and whatever else without interference from each other.
-  'catapult_revision': '685b5de1133a99e317a7e17ecc9f7155313a3f76',
+  'catapult_revision': '00455e0148682bff1f1f9ccf377ee8923a6f1364',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling libFuzzer
   # and whatever else without interference from each other.
@@ -219,7 +219,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
-  'spv_tools_revision': '07d0f9dff3d22d5dfc0175586dd529649b165a7f',
+  'spv_tools_revision': '18fe6d59e5e8dd8c5ccf8baa40f57bda838e7dfa',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling feed
   # and whatever else without interference from each other.
@@ -342,7 +342,7 @@
   },
 
   'src/ios/third_party/material_components_ios/src': {
-      'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + 'd57bd2777a261d3503c745fa5a7e080f9523a676',
+      'url': Var('chromium_git') + '/external/github.com/material-components/material-components-ios.git' + '@' + '3543693ca80a183aab49f5fe89e0c93888fb50a8',
       'condition': 'checkout_ios',
   },
 
@@ -650,7 +650,7 @@
 
   # Build tools for Chrome OS. Note: This depends on third_party/pyelftools.
   'src/third_party/chromite': {
-      'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '962ec4e02afcec265590b78fc4c5963db9e425df',
+      'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + 'b6c3804254e9edc8cfe39e5eea03e2892b50dbf7',
       'condition': 'checkout_linux',
   },
 
@@ -1004,7 +1004,7 @@
   },
 
   'src/third_party/perfetto':
-    Var('android_git') + '/platform/external/perfetto.git' + '@' +  'ea62998cdf18529969c2ce0fac89f5642e5b2e7f',
+    Var('android_git') + '/platform/external/perfetto.git' + '@' +  '78f4835a7135f700c092f7f66d26780b4f7e484a',
 
   'src/third_party/perl': {
       'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + 'ac0d98b5cee6c024b0cffeb4f8f45b6fc5ccdb78',
@@ -1153,10 +1153,10 @@
     Var('chromium_git') + '/external/selenium/py.git' + '@' + '5fd78261a75fe08d27ca4835fb6c5ce4b42275bd',
 
   'src/third_party/webgl/src':
-    Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '6d2f3f4cb8bac1f7c4a945c73d07a33df74f22f9',
+    Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + '0d55c887e92b645f6effe753528323ab2ffd94c2',
 
   'src/third_party/webrtc':
-    Var('webrtc_git') + '/src.git' + '@' + '41ed3e083ed5750e4a133db82ef4c30956df77dd',
+    Var('webrtc_git') + '/src.git' + '@' + '62ae178357b76b844e28b20fc704bfd11f5bd194',
 
   'src/third_party/xdg-utils': {
       'url': Var('chromium_git') + '/chromium/deps/xdg-utils.git' + '@' + 'd80274d5869b17b8c9067a1022e4416ee7ed5e0d',
@@ -1187,7 +1187,7 @@
     Var('chromium_git') + '/v8/v8.git' + '@' +  Var('v8_revision'),
 
   'src-internal': {
-    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@f426f506dc36258a0a53db39fdda99fda659cdc8',
+    'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@cebaec8758504d8002703e3996fd68017b30edb3',
     'condition': 'checkout_src_internal',
   },
 
diff --git a/ash/keyboard/virtual_keyboard_controller_unittest.cc b/ash/keyboard/virtual_keyboard_controller_unittest.cc
index 921d6da..62a56913 100644
--- a/ash/keyboard/virtual_keyboard_controller_unittest.cc
+++ b/ash/keyboard/virtual_keyboard_controller_unittest.cc
@@ -367,7 +367,7 @@
   TabletModeControllerTestApi().EnterTabletMode();
   ASSERT_TRUE(keyboard_controller_->IsKeyboardEnableRequested());
   // Toggle tablet mode off.
-  TabletModeControllerTestApi().LeaveTabletMode(false);
+  TabletModeControllerTestApi().LeaveTabletMode();
   ASSERT_FALSE(keyboard_controller_->IsKeyboardEnableRequested());
 }
 
@@ -410,7 +410,7 @@
   ASSERT_TRUE(notified());
   ASSERT_FALSE(IsVirtualKeyboardSuppressed());
   // Toggle tablet mode oFF.
-  TabletModeControllerTestApi().LeaveTabletMode(false);
+  TabletModeControllerTestApi().LeaveTabletMode();
   ASSERT_FALSE(keyboard_controller_->IsKeyboardEnableRequested());
 }
 
diff --git a/ash/system/message_center/arc/arc_notification_view.cc b/ash/system/message_center/arc/arc_notification_view.cc
index 7e69abea..3a0181e 100644
--- a/ash/system/message_center/arc/arc_notification_view.cc
+++ b/ash/system/message_center/arc/arc_notification_view.cc
@@ -149,15 +149,10 @@
 }
 
 void ArcNotificationView::OnSettingsButtonPressed(const ui::Event& event) {
-  // TODO(yamaguchi): remove this line and call CloseSwipeControl() from parent
-  // view of this view. The parent view should activate the swipe control of
-  // the slider attached to this view. Same for OnShoozeButtonPressed().
-  CloseSwipeControl();
   MessageView::OnSettingsButtonPressed(event);
 }
 
 void ArcNotificationView::OnSnoozeButtonPressed(const ui::Event& event) {
-  CloseSwipeControl();
   if (item_)
     return item_->OpenSnooze();
 }
diff --git a/ash/system/message_center/notification_swipe_control_view.cc b/ash/system/message_center/notification_swipe_control_view.cc
index 19ef56e..0e800237 100644
--- a/ash/system/message_center/notification_swipe_control_view.cc
+++ b/ash/system/message_center/notification_swipe_control_view.cc
@@ -155,12 +155,15 @@
 void NotificationSwipeControlView::ButtonPressed(views::Button* sender,
                                                  const ui::Event& event) {
   DCHECK(sender);
-  message_view_->CloseSwipeControl();
   if (sender == settings_button_)
     message_view_->OnSettingsButtonPressed(event);
   else if (sender == snooze_button_)
     message_view_->OnSnoozeButtonPressed(event);
   HideButtons();
+
+  // Closing the swipe control is done in these button pressed handlers.
+  // Otherwise, handlers might not work.
+  message_view_->CloseSwipeControl();
 }
 
 }  // namespace ash
diff --git a/ash/system/overview/overview_button_tray_unittest.cc b/ash/system/overview/overview_button_tray_unittest.cc
index 63194d6..7a2f2af8 100644
--- a/ash/system/overview/overview_button_tray_unittest.cc
+++ b/ash/system/overview/overview_button_tray_unittest.cc
@@ -113,7 +113,7 @@
   TabletModeControllerTestApi().EnterTabletMode();
   EXPECT_TRUE(GetTray()->visible());
 
-  TabletModeControllerTestApi().LeaveTabletMode(false);
+  TabletModeControllerTestApi().LeaveTabletMode();
   EXPECT_FALSE(GetTray()->visible());
 }
 
@@ -303,7 +303,7 @@
   ASSERT_TRUE(Shell::IsSystemModalWindowOpen());
   TabletModeControllerTestApi().EnterTabletMode();
   EXPECT_TRUE(GetTray()->visible());
-  TabletModeControllerTestApi().LeaveTabletMode(false);
+  TabletModeControllerTestApi().LeaveTabletMode();
   EXPECT_FALSE(GetTray()->visible());
 }
 
diff --git a/ash/wm/splitview/split_view_controller.cc b/ash/wm/splitview/split_view_controller.cc
index e8005a1..28889c3 100644
--- a/ash/wm/splitview/split_view_controller.cc
+++ b/ash/wm/splitview/split_view_controller.cc
@@ -594,6 +594,7 @@
   black_scrim_layer_.reset();
   default_snap_position_ = NONE;
   divider_position_ = -1;
+  divider_closest_ratio_ = 0.f;
   snapping_window_transformed_bounds_map_.clear();
 
   UpdateSplitViewStateAndNotifyObservers();
@@ -830,18 +831,24 @@
     return;
   }
 
-  // Update |divider_position_| if the top/left window changes.
-  if ((metrics & (display::DisplayObserver::DISPLAY_METRIC_ROTATION)) &&
-      (IsPrimaryOrientation(previous_screen_orientation) !=
-       IsCurrentScreenOrientationPrimary())) {
-    const int work_area_long_length = GetDividerEndPosition();
+  if ((metrics & display::DisplayObserver::DISPLAY_METRIC_ROTATION) ||
+      (metrics & display::DisplayObserver::DISPLAY_METRIC_WORK_AREA)) {
     const gfx::Size divider_size = SplitViewDivider::GetDividerSize(
-        display.work_area(), GetCurrentScreenOrientation(),
-        false /* is_dragging */);
-    const int divider_short_length =
+        display.work_area(), GetCurrentScreenOrientation(), false);
+    const int divider_thickness =
         std::min(divider_size.width(), divider_size.height());
+    // Set default |divider_closest_ratio_| to kFixedPositionRatios[1].
+    if (!divider_closest_ratio_)
+      divider_closest_ratio_ = kFixedPositionRatios[1];
+
+    // Reverse the position ratio if top/left window changes.
+    if (IsPrimaryOrientation(previous_screen_orientation) !=
+        IsCurrentScreenOrientationPrimary()) {
+      divider_closest_ratio_ = 1.f - divider_closest_ratio_;
+    }
     divider_position_ =
-        work_area_long_length - divider_short_length - divider_position_;
+        std::floor(divider_closest_ratio_ * GetDividerEndPosition()) -
+        std::floor(divider_thickness / 2.f);
   }
 
   // For other display configuration changes, we only move the divider to the
@@ -996,7 +1003,7 @@
     right_window_min_size = right_window_->delegate()->GetMinimumSize();
 
   bool is_primary = IsCurrentScreenOrientationPrimary();
-  int long_length = GetDividerEndPosition();
+  int divider_end_position = GetDividerEndPosition();
   // The distance from the current resizing position to the left or right side
   // of the screen. Note: left or right side here means the side of the
   // |left_window_| or |right_window_|.
@@ -1021,11 +1028,11 @@
     min_right_length = right_window_min_size.height();
   }
 
-  if (left_window_distance < long_length * kOneThirdPositionRatio ||
+  if (left_window_distance < divider_end_position * kOneThirdPositionRatio ||
       left_window_distance < min_left_length) {
     return LEFT;
   }
-  if (right_window_distance < long_length * kOneThirdPositionRatio ||
+  if (right_window_distance < divider_end_position * kOneThirdPositionRatio ||
       right_window_distance < min_right_length) {
     return RIGHT;
   }
@@ -1105,12 +1112,12 @@
   // extract the center from |divider_position_|. The result will also be the
   // center of the divider, so extract the origin, unless the result is on of
   // the endpoints.
-  int work_area_long_length = GetDividerEndPosition();
-  float closest_ratio = FindClosestPositionRatio(
+  int divider_end_position = GetDividerEndPosition();
+  divider_closest_ratio_ = FindClosestPositionRatio(
       divider_position_ + std::floor(divider_thickness / 2.f),
-      work_area_long_length);
-  divider_position_ = std::floor(work_area_long_length * closest_ratio);
-  if (closest_ratio > 0.f && closest_ratio < 1.f)
+      divider_end_position);
+  divider_position_ = std::floor(divider_end_position * divider_closest_ratio_);
+  if (divider_closest_ratio_ > 0.f && divider_closest_ratio_ < 1.f)
     divider_position_ -= std::floor(divider_thickness / 2.f);
 }
 
@@ -1136,7 +1143,8 @@
 int SplitViewController::GetDividerEndPosition() {
   const gfx::Rect work_area_bounds =
       GetDisplayWorkAreaBoundsInScreen(GetDefaultSnappedWindow());
-  return std::max(work_area_bounds.width(), work_area_bounds.height());
+  return IsCurrentScreenOrientationLandscape() ? work_area_bounds.width()
+                                               : work_area_bounds.height();
 }
 
 void SplitViewController::OnWindowSnapped(aura::Window* window) {
@@ -1235,7 +1243,6 @@
       is_left_or_top ? right_window_ : left_window_;
   bool is_landscape = IsCurrentScreenOrientationLandscape();
 
-  int long_length = GetDividerEndPosition();
   float min_size_left_ratio = 0.f, min_size_right_ratio = 0.f;
   int min_left_size = 0, min_right_size = 0;
   if (left_or_top_window && left_or_top_window->delegate()) {
@@ -1247,8 +1254,11 @@
     min_right_size = is_landscape ? min_size.width() : min_size.height();
   }
 
-  min_size_left_ratio = static_cast<float>(min_left_size) / long_length;
-  min_size_right_ratio = static_cast<float>(min_right_size) / long_length;
+  int divider_end_position = GetDividerEndPosition();
+  min_size_left_ratio =
+      static_cast<float>(min_left_size) / divider_end_position;
+  min_size_right_ratio =
+      static_cast<float>(min_right_size) / divider_end_position;
   if (min_size_left_ratio <= kOneThirdPositionRatio)
     position_ratios->push_back(kOneThirdPositionRatio);
 
diff --git a/ash/wm/splitview/split_view_controller.h b/ash/wm/splitview/split_view_controller.h
index 6922ab8..7c4cd4c 100644
--- a/ash/wm/splitview/split_view_controller.h
+++ b/ash/wm/splitview/split_view_controller.h
@@ -264,8 +264,9 @@
   // needs to be activated. Returns nullptr if there is no such window.
   aura::Window* GetActiveWindowAfterResizingUponExit();
 
-  // Returns the maximum value of the |divider_position_|. It should always be
-  // the length of the longer side of the current display's work area bounds.
+  // Returns the maximum value of the |divider_position_|. It is the width of
+  // the current display's work area bounds in landscape orientation, or height
+  // of the current display's work area bounds in portrait orientation.
   int GetDividerEndPosition();
 
   // Called after a to-be-snapped window |window| got snapped. It updates the
@@ -384,8 +385,8 @@
   // The window observer that obseves the tab-dragged window.
   std::unique_ptr<TabDraggedWindowObserver> dragged_window_observer_;
 
-  // The distance between the origin of the divider and the origin of the screen
-  // in screen coordinates.
+  // The distance between the origin of the divider and the origin of the
+  // current display's work area in screen coordinates.
   //     |<---     divider_position_    --->|
   //     ----------------------------------------------------------
   //     |                                  | |                    |
@@ -394,6 +395,12 @@
   //     ----------------------------------------------------------
   int divider_position_ = -1;
 
+  // The closest position ratio of divider among kFixedPositionRatios,
+  // kOneThirdPositionRatio and kTwoThirdPositionRatio based on current
+  // |divider_position_|. Used to update |divider_position_| on work area
+  // changes.
+  float divider_closest_ratio_ = 0.f;
+
   // The location of the previous mouse/gesture event in screen coordinates.
   gfx::Point previous_event_location_;
 
diff --git a/ash/wm/splitview/split_view_controller_unittest.cc b/ash/wm/splitview/split_view_controller_unittest.cc
index 28a24887..add0205 100644
--- a/ash/wm/splitview/split_view_controller_unittest.cc
+++ b/ash/wm/splitview/split_view_controller_unittest.cc
@@ -167,6 +167,10 @@
 
   int divider_position() { return split_view_controller()->divider_position(); }
 
+  float divider_closest_ratio() {
+    return split_view_controller()->divider_closest_ratio_;
+  }
+
  protected:
   class SplitViewTestWindowDelegate : public aura::test::TestWindowDelegate {
    public:
@@ -1656,6 +1660,65 @@
   EndSplitView();
 }
 
+// Tests the divider closest position ratio if work area is not starts from the
+// top of the display.
+TEST_F(SplitViewControllerTest, DividerClosestRatioOnWorkArea) {
+  UpdateDisplay("1200x800");
+  // Docked magnifier will put a view port window on the top of the display.
+  Shell::Get()->docked_magnifier_controller()->SetEnabled(true);
+
+  int64_t display_id = display::Screen::GetScreen()->GetPrimaryDisplay().id();
+  display::DisplayManager* display_manager = Shell::Get()->display_manager();
+  display::test::ScopedSetInternalDisplayId set_internal(display_manager,
+                                                         display_id);
+  ScreenOrientationControllerTestApi test_api(
+      Shell::Get()->screen_orientation_controller());
+  ui::test::EventGenerator* generator = GetEventGenerator();
+  ASSERT_EQ(OrientationLockType::kLandscapePrimary,
+            test_api.GetCurrentOrientation());
+
+  const gfx::Rect bounds(0, 0, 200, 200);
+  std::unique_ptr<aura::Window> window(CreateWindow(bounds));
+  split_view_controller()->SnapWindow(window.get(), SplitViewController::LEFT);
+
+  test_api.SetDisplayRotation(display::Display::ROTATE_90,
+                              display::Display::RotationSource::ACTIVE);
+  EXPECT_EQ(OrientationLockType::kPortraitSecondary,
+            test_api.GetCurrentOrientation());
+  EXPECT_EQ(divider_closest_ratio(), 0.5f);
+
+  test_api.SetDisplayRotation(display::Display::ROTATE_0,
+                              display::Display::RotationSource::ACTIVE);
+  EXPECT_EQ(OrientationLockType::kLandscapePrimary,
+            test_api.GetCurrentOrientation());
+  EXPECT_EQ(divider_closest_ratio(), 0.5f);
+  gfx::Rect divider_bounds =
+      split_view_divider()->GetDividerBoundsInScreen(false);
+  gfx::Rect workarea_bounds =
+      split_view_controller()->GetDisplayWorkAreaBoundsInScreen(window.get());
+  generator->set_current_location(divider_bounds.CenterPoint());
+  // Drag the divider to one third position of the work area's width.
+  generator->DragMouseTo(
+      gfx::Point(workarea_bounds.width() * 0.33f, workarea_bounds.y()));
+  EXPECT_EQ(divider_closest_ratio(), 0.33f);
+
+  // Divider closest position ratio changed from one third to two thirds if
+  // left/top window changes.
+  test_api.SetDisplayRotation(display::Display::ROTATE_90,
+                              display::Display::RotationSource::ACTIVE);
+  EXPECT_EQ(OrientationLockType::kPortraitSecondary,
+            test_api.GetCurrentOrientation());
+  EXPECT_EQ(divider_closest_ratio(), 0.67f);
+
+  // Divider closest position ratio is kept as one third if left/top window
+  // doesn't changes.
+  test_api.SetDisplayRotation(display::Display::ROTATE_270,
+                              display::Display::RotationSource::ACTIVE);
+  EXPECT_EQ(OrientationLockType::kPortraitPrimary,
+            test_api.GetCurrentOrientation());
+  EXPECT_EQ(divider_closest_ratio(), 0.33f);
+}
+
 // Test the tab-dragging related functionalities in tablet mode. Tab(s) can be
 // dragged out of a window and then put in split view mode or merge into another
 // window.
diff --git a/ash/wm/splitview/split_view_drag_indicators.cc b/ash/wm/splitview/split_view_drag_indicators.cc
index f42737a..d893db42 100644
--- a/ash/wm/splitview/split_view_drag_indicators.cc
+++ b/ash/wm/splitview/split_view_drag_indicators.cc
@@ -356,6 +356,11 @@
               GetWidget()->GetNativeWindow(), preview_left
                                                   ? SplitViewController::LEFT
                                                   : SplitViewController::RIGHT);
+      gfx::Rect work_area_bounds = Shell::Get()
+                                       ->split_view_controller()
+                                       ->GetDisplayWorkAreaBoundsInScreen(
+                                           GetWidget()->GetNativeWindow());
+      preview_area_bounds.set_y(preview_area_bounds.y() - work_area_bounds.y());
       preview_area_bounds.Inset(kHighlightScreenEdgePaddingDp,
                                 kHighlightScreenEdgePaddingDp);
 
diff --git a/ash/wm/tablet_mode/tablet_mode_controller.cc b/ash/wm/tablet_mode/tablet_mode_controller.cc
index 1f2b25987..e52f1ac 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller.cc
+++ b/ash/wm/tablet_mode/tablet_mode_controller.cc
@@ -204,6 +204,8 @@
     if (client_)  // Null at startup and in tests.
       client_->OnTabletModeToggled(false);
   }
+
+  UpdateInternalMouseAndKeyboardEventBlocker();
 }
 
 bool TabletModeController::IsTabletModeWindowManagerEnabled() const {
@@ -265,7 +267,7 @@
   if (!display::Display::HasInternalDisplay() ||
       !Shell::Get()->display_manager()->IsActiveDisplayId(
           display::Display::InternalDisplayId())) {
-    AttemptLeaveTabletMode(false);
+    AttemptLeaveTabletMode();
   } else if (tablet_mode_switch_is_on_ && !IsTabletModeWindowManagerEnabled()) {
     // The internal display has returned, as we are exiting docked mode.
     // The device is still in tablet mode, so trigger tablet mode, as this
@@ -345,7 +347,7 @@
   lid_is_closed_ = !open;
 
   if (!tablet_mode_switch_is_on_)
-    AttemptLeaveTabletMode(false);
+    AttemptLeaveTabletMode();
 }
 
 void TabletModeController::TabletModeEventReceived(
@@ -369,8 +371,13 @@
     AttemptEnterTabletMode();
   } else if (!on && IsTabletModeWindowManagerEnabled() &&
              !can_detect_lid_angle_) {
-    AttemptLeaveTabletMode(false);
+    AttemptLeaveTabletMode();
   }
+
+  // Even if we do not change its ui mode, we should update its input device
+  // blocker as tablet mode events may come in because of the lid angle/or folio
+  // keyboard state changes but ui mode might still stay the same.
+  UpdateInternalMouseAndKeyboardEventBlocker();
 }
 
 void TabletModeController::SuspendImminent(
@@ -454,7 +461,7 @@
 
   // Toggle tablet mode on or off when corresponding thresholds are passed.
   if (is_angle_stable && lid_angle_ <= kExitTabletModeAngle) {
-    AttemptLeaveTabletMode(false);
+    AttemptLeaveTabletMode();
   } else if (!lid_is_closed_ && lid_angle_ >= kEnterTabletModeAngle &&
              (is_angle_stable || CanUseUnstableLidAngle())) {
     AttemptEnterTabletMode();
@@ -494,37 +501,19 @@
 }
 
 void TabletModeController::AttemptEnterTabletMode() {
-  event_blocker_.reset();
-  event_blocker_ = CreateScopedDisableInternalMouseAndKeyboard();
-  for (auto& observer : tablet_mode_observers_)
-    observer.OnTabletModeEventsBlockingChanged();
-
-  if (IsTabletModeWindowManagerEnabled())
+  if (IsTabletModeWindowManagerEnabled() || has_external_mouse_) {
+    UpdateInternalMouseAndKeyboardEventBlocker();
     return;
-
-  should_enter_tablet_mode_ = true;
-
-  if (has_external_mouse_)
-    return;
+  }
 
   EnableTabletModeWindowManager(true);
 }
 
-void TabletModeController::AttemptLeaveTabletMode(
-    bool called_by_device_update) {
-  // Do not unlock internal keyboard if we enter clamshell by plugging in an
-  // external mouse.
-  if (!called_by_device_update) {
-    event_blocker_.reset();
-    for (auto& observer : tablet_mode_observers_)
-      observer.OnTabletModeEventsBlockingChanged();
-  }
-
-  if (!IsTabletModeWindowManagerEnabled())
+void TabletModeController::AttemptLeaveTabletMode() {
+  if (!IsTabletModeWindowManagerEnabled()) {
+    UpdateInternalMouseAndKeyboardEventBlocker();
     return;
-
-  if (!called_by_device_update)
-    should_enter_tablet_mode_ = false;
+  }
 
   EnableTabletModeWindowManager(false);
 }
@@ -594,17 +583,18 @@
 
   has_external_mouse_ = has_external_mouse;
 
-  // Try to tablet mode if we are already in tablet mode and
-  // |has_external_mouse| is true.
+  // Enter clamshell mode whenever an external mouse is attached.
   if (has_external_mouse) {
-    AttemptLeaveTabletMode(true);
-    return;
-  }
-
-  // Try to enter tablet mode if |has_external_mouse| is false and we
-  // are in an orientation that should be tablet mode.
-  if (should_enter_tablet_mode_)
+    AttemptLeaveTabletMode();
+  } else if (LidAngleIsInTabletModeRange() || tablet_mode_switch_is_on_) {
+    // If there is no external mouse, only enter tablet mode if 1) the lid angle
+    // can be detected and is in tablet mode angle range. or 2) if the lid angle
+    // can't be detected (e.g., tablet device or clamshell device) and
+    // |tablet_mode_switch_is_on_| is true (it can only happen for tablet device
+    // as |tablet_mode_switch_is_on_| should never be true for a clamshell
+    // device).
     AttemptEnterTabletMode();
+  }
 }
 
 void TabletModeController::UpdateBluetoothDevice(
@@ -622,4 +612,34 @@
   HandleMouseAddedOrRemoved();
 }
 
+void TabletModeController::UpdateInternalMouseAndKeyboardEventBlocker() {
+  bool should_block_internal_events = false;
+  if (IsTabletModeWindowManagerEnabled()) {
+    // If we are currently in tablet mode, the internal input events should
+    // always be blocked.
+    should_block_internal_events = true;
+  } else if (LidAngleIsInTabletModeRange() || tablet_mode_switch_is_on_) {
+    // If we are currently in clamshell mode, the intenral input events should
+    // only be blocked if the current lid angle belongs to tablet mode angle
+    // or |tablet_mode_switch_is_on_| is true.
+    should_block_internal_events = true;
+  }
+
+  if (should_block_internal_events == AreInternalInputDeviceEventsBlocked())
+    return;
+
+  if (should_block_internal_events)
+    event_blocker_ = CreateScopedDisableInternalMouseAndKeyboard();
+  else
+    event_blocker_.reset();
+
+  for (auto& observer : tablet_mode_observers_)
+    observer.OnTabletModeEventsBlockingChanged();
+}
+
+bool TabletModeController::LidAngleIsInTabletModeRange() {
+  return can_detect_lid_angle_ && !lid_is_closed_ &&
+         lid_angle_ >= kEnterTabletModeAngle;
+}
+
 }  // namespace ash
diff --git a/ash/wm/tablet_mode/tablet_mode_controller.h b/ash/wm/tablet_mode/tablet_mode_controller.h
index 134466d..70fc5d1 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller.h
+++ b/ash/wm/tablet_mode/tablet_mode_controller.h
@@ -169,12 +169,13 @@
   // tablet mode becomes enabled.
   bool CanEnterTabletMode();
 
-  // Attempts to enter tablet mode and locks the internal keyboard and touchpad.
+  // Attempts to enter tablet mode and updates the internal keyboard and
+  // touchpad.
   void AttemptEnterTabletMode();
 
-  // Attempts to exit tablet mode and unlocks the internal keyboard and touchpad
-  // if |called_by_device_update| is false.
-  void AttemptLeaveTabletMode(bool called_by_device_update);
+  // Attempts to exit tablet mode and updates the internal keyboard and
+  // touchpad.
+  void AttemptLeaveTabletMode();
 
   // Record UMA stats tracking TabletMode usage. If |type| is
   // TABLET_MODE_INTERVAL_INACTIVE, then record that TabletMode has been
@@ -207,6 +208,17 @@
   // changes.
   void UpdateBluetoothDevice(device::BluetoothDevice* device);
 
+  // Update the internal mouse and keyboard event blocker |event_blocker_|
+  // according to current configuration. The internal input events should be
+  // blocked if 1) we are currently in tablet mode or 2) we are currently in
+  // laptop mode but the lid is flipped over (i.e., we are in laptop mode
+  // because of an external attached mouse).
+  void UpdateInternalMouseAndKeyboardEventBlocker();
+
+  // Returns true if the current lid angle can be detected and is in tablet mode
+  // angle range.
+  bool LidAngleIsInTabletModeRange();
+
   // The maximized window manager (if enabled).
   std::unique_ptr<TabletModeWindowManager> tablet_mode_window_manager_;
 
@@ -253,11 +265,6 @@
   // not enter tablet mode if this is true.
   bool has_external_mouse_ = false;
 
-  // Tracks if the device would enter tablet mode, but does not because of a
-  // attached external mouse. If the external mouse is detached and this is
-  // true, we will enter tablet mode.
-  bool should_enter_tablet_mode_ = false;
-
   // Tracks smoothed accelerometer data over time. This is done when the hinge
   // is approaching vertical to remove abrupt acceleration that can lead to
   // incorrect calculations of hinge angles.
diff --git a/ash/wm/tablet_mode/tablet_mode_controller_test_api.cc b/ash/wm/tablet_mode/tablet_mode_controller_test_api.cc
index bd2a7836..ef0d7439 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller_test_api.cc
+++ b/ash/wm/tablet_mode/tablet_mode_controller_test_api.cc
@@ -21,9 +21,8 @@
   tablet_mode_controller_->AttemptEnterTabletMode();
 }
 
-void TabletModeControllerTestApi::LeaveTabletMode(
-    bool called_by_device_update) {
-  tablet_mode_controller_->AttemptLeaveTabletMode(called_by_device_update);
+void TabletModeControllerTestApi::LeaveTabletMode() {
+  tablet_mode_controller_->AttemptLeaveTabletMode();
 }
 
 void TabletModeControllerTestApi::AttachExternalMouse() {
diff --git a/ash/wm/tablet_mode/tablet_mode_controller_test_api.h b/ash/wm/tablet_mode/tablet_mode_controller_test_api.h
index 407ed197..c6c7c975 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller_test_api.h
+++ b/ash/wm/tablet_mode/tablet_mode_controller_test_api.h
@@ -29,7 +29,7 @@
   // Enters or exits tablet mode. Use these instead when stuff such as tray
   // visibilty depends on the event blocker instead of the actual tablet mode.
   void EnterTabletMode();
-  void LeaveTabletMode(bool called_by_device_update);
+  void LeaveTabletMode();
 
   // Called to attach an external mouse. If we're currently in tablet mode,
   // tablet mode will be ended because of this.
diff --git a/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc b/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc
index 8cea74ca..406374b 100644
--- a/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc
+++ b/ash/wm/tablet_mode/tablet_mode_controller_unittest.cc
@@ -783,6 +783,119 @@
   EXPECT_FALSE(AreEventsBlocked());
 }
 
+// Test that the ui mode and input event blocker should be both correctly
+// updated when there is a change in external mouse and lid angle.
+TEST_F(TabletModeControllerTest, ExternalMouseWithLidAngleTest) {
+  // Set the current list of devices to empty so that they don't interfere
+  // with the test.
+  base::RunLoop().RunUntilIdle();
+  ws::InputDeviceClientTestApi().SetMouseDevices({});
+  base::RunLoop().RunUntilIdle();
+
+  // Start in laptop mode.
+  OpenLidToAngle(30.0f);
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+
+  // Attach external mouse doesn't change the mode.
+  ws::InputDeviceClientTestApi().SetMouseDevices(
+      {ui::InputDevice(3, ui::InputDeviceType::INPUT_DEVICE_USB, "mouse")});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+
+  // Now flip the device to tablet mode angle. The device should stay in
+  // clamshell mode because of the external mouse. But the internal input events
+  // should be blocked.
+  OpenLidToAngle(300.0f);
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_TRUE(AreEventsBlocked());
+
+  // Remove the external mouse should enter tablet mode now. The internal input
+  // events should still be blocked.
+  ws::InputDeviceClientTestApi().SetMouseDevices({});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(IsTabletModeStarted());
+  EXPECT_TRUE(AreEventsBlocked());
+
+  // Attach the mouse again should enter clamshell mode again.
+  ws::InputDeviceClientTestApi().SetMouseDevices(
+      {ui::InputDevice(3, ui::InputDeviceType::INPUT_DEVICE_USB, "mouse")});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_TRUE(AreEventsBlocked());
+
+  // Flip the device back to clamshell angle. The device should stay in
+  // clamshell mode and the internal input events should not be blocked.
+  OpenLidToAngle(30.0f);
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+
+  // Now remove the mouse. The device should stay in clamshell mode and the
+  // internal events should not be blocked.
+  ws::InputDeviceClientTestApi().SetMouseDevices({});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+}
+
+// Test that the ui mode and input event blocker should be both correctly
+// updated when there is a change in external mouse and tablet mode switch
+// value.
+TEST_F(TabletModeControllerTest, ExternalMouseWithTabletModeSwithTest) {
+  // Set the current list of devices to empty so that they don't interfere
+  // with the test.
+  base::RunLoop().RunUntilIdle();
+  ws::InputDeviceClientTestApi().SetMouseDevices({});
+  base::RunLoop().RunUntilIdle();
+
+  // Start in laptop mode.
+  SetTabletMode(false);
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+
+  // Attach external mouse doesn't change the mode.
+  ws::InputDeviceClientTestApi().SetMouseDevices(
+      {ui::InputDevice(3, ui::InputDeviceType::INPUT_DEVICE_USB, "mouse")});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+
+  // Now set tablet mode switch value to true. The device should stay in
+  // clamshell mode because of the external mouse. But the internal input events
+  // should be blocked.
+  SetTabletMode(true);
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_TRUE(AreEventsBlocked());
+
+  // Remove the external mouse should enter tablet mode now. The internal input
+  // events should still be blocked.
+  ws::InputDeviceClientTestApi().SetMouseDevices({});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_TRUE(IsTabletModeStarted());
+  EXPECT_TRUE(AreEventsBlocked());
+
+  // Attach the mouse again should enter clamshell mode again.
+  ws::InputDeviceClientTestApi().SetMouseDevices(
+      {ui::InputDevice(3, ui::InputDeviceType::INPUT_DEVICE_USB, "mouse")});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_TRUE(AreEventsBlocked());
+
+  // Set tablet mode switch value to false. The device should stay in
+  // clamshell mode and the internal input events should not be blocked.
+  SetTabletMode(false);
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+
+  // Now remove the mouse. The device should stay in clamshell mode and the
+  // internal events should not be blocked.
+  ws::InputDeviceClientTestApi().SetMouseDevices({});
+  base::RunLoop().RunUntilIdle();
+  EXPECT_FALSE(IsTabletModeStarted());
+  EXPECT_FALSE(AreEventsBlocked());
+}
+
 class TabletModeControllerForceTabletModeTest
     : public TabletModeControllerTest {
  public:
diff --git a/base/BUILD.gn b/base/BUILD.gn
index bd20a62..21371e67 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -1312,6 +1312,12 @@
       "android/statistics_recorder_android.cc",
       "android/sys_utils.cc",
       "android/sys_utils.h",
+      "android/task_scheduler/post_task_android.cc",
+      "android/task_scheduler/post_task_android.h",
+      "android/task_scheduler/sequenced_task_runner_android.cc",
+      "android/task_scheduler/single_thread_task_runner_android.cc",
+      "android/task_scheduler/task_runner_android.cc",
+      "android/task_scheduler/task_runner_android.h",
       "android/time_utils.cc",
       "android/timezone_utils.cc",
       "android/timezone_utils.h",
@@ -2852,6 +2858,10 @@
       "android/java/src/org/chromium/base/metrics/RecordUserAction.java",
       "android/java/src/org/chromium/base/metrics/StatisticsRecorderAndroid.java",
       "android/java/src/org/chromium/base/process_launcher/ChildProcessService.java",
+      "android/java/src/org/chromium/base/task/PostTask.java",
+      "android/java/src/org/chromium/base/task/SequencedTaskRunnerImpl.java",
+      "android/java/src/org/chromium/base/task/SingleThreadTaskRunnerImpl.java",
+      "android/java/src/org/chromium/base/task/TaskRunnerImpl.java",
     ]
 
     public_deps = [
@@ -2863,7 +2873,10 @@
 
   generate_jar_jni("android_runtime_jni_headers") {
     jni_package = "base"
-    classes = [ "java/lang/Runtime.class" ]
+    classes = [
+      "java/lang/Runnable.class",
+      "java/lang/Runtime.class",
+    ]
   }
 
   java_library("jni_processor_annotations_java") {
@@ -2971,11 +2984,19 @@
       "android/java/src/org/chromium/base/memory/MemoryPressureCallback.java",
       "android/java/src/org/chromium/base/memory/MemoryPressureUma.java",
       "android/java/src/org/chromium/base/task/AsyncTask.java",
+      "android/java/src/org/chromium/base/task/DefaultTaskExecutor.java",
       "android/java/src/org/chromium/base/task/ChromeThreadPoolExecutor.java",
+      "android/java/src/org/chromium/base/task/PostTask.java",
+      "android/java/src/org/chromium/base/task/PreNativeSequence.java",
       "android/java/src/org/chromium/base/task/SequencedTaskRunner.java",
+      "android/java/src/org/chromium/base/task/SequencedTaskRunnerImpl.java",
       "android/java/src/org/chromium/base/task/SerialExecutor.java",
       "android/java/src/org/chromium/base/task/SingleThreadTaskRunner.java",
+      "android/java/src/org/chromium/base/task/SingleThreadTaskRunnerImpl.java",
+      "android/java/src/org/chromium/base/task/TaskExecutor.java",
       "android/java/src/org/chromium/base/task/TaskRunner.java",
+      "android/java/src/org/chromium/base/task/TaskRunnerImpl.java",
+      "android/java/src/org/chromium/base/task/TaskTraits.java",
     ]
 
     # New versions of BuildConfig.java and NativeLibraries.java
@@ -3020,6 +3041,10 @@
       "android/javatests/src/org/chromium/base/StrictModeContextTest.java",
       "android/javatests/src/org/chromium/base/metrics/RecordHistogramTest.java",
       "android/javatests/src/org/chromium/base/task/AsyncTaskTest.java",
+      "android/javatests/src/org/chromium/base/task/PostTaskTest.java",
+      "android/javatests/src/org/chromium/base/task/SequencedTaskRunnerImplTest.java",
+      "android/javatests/src/org/chromium/base/task/SingleThreadTaskRunnerImplTest.java",
+      "android/javatests/src/org/chromium/base/task/TaskRunnerImplTest.java",
     ]
   }
 
@@ -3062,6 +3087,8 @@
       "test/android/javatests/src/org/chromium/base/test/params/ParameterizedRunnerDelegateFactory.java",
       "test/android/javatests/src/org/chromium/base/test/params/ParameterProvider.java",
       "test/android/javatests/src/org/chromium/base/test/params/ParameterSet.java",
+      "test/android/javatests/src/org/chromium/base/test/task/SchedulerTestHelpers.java",
+      "test/android/javatests/src/org/chromium/base/test/task/TaskSchedulerTestHelpers.java",
       "test/android/javatests/src/org/chromium/base/test/util/AdvancedMockContext.java",
       "test/android/javatests/src/org/chromium/base/test/util/AnnotationRule.java",
       "test/android/javatests/src/org/chromium/base/test/util/CallbackHelper.java",
@@ -3165,6 +3192,7 @@
       "android/library_loader/library_loader_hooks.h",
       "memory/memory_pressure_listener.h",
       "metrics/histogram_base.h",
+      "task/task_traits.h",
       "trace_event/trace_config.h",
     ]
   }
diff --git a/base/android/java/src/org/chromium/base/task/DefaultTaskExecutor.java b/base/android/java/src/org/chromium/base/task/DefaultTaskExecutor.java
new file mode 100644
index 0000000..fd8d048
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/DefaultTaskExecutor.java
@@ -0,0 +1,35 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+/**
+ * The default {@link TaskExecutor} which maps directly to base::TaskScheduler.
+ */
+class DefaultTaskExecutor implements TaskExecutor {
+    @Override
+    public TaskRunner createTaskRunner(TaskTraits taskTraits) {
+        return new TaskRunnerImpl(taskTraits);
+    }
+
+    @Override
+    public SequencedTaskRunner createSequencedTaskRunner(TaskTraits taskTraits) {
+        return new SequencedTaskRunnerImpl(taskTraits);
+    }
+
+    /**
+     * This maps to a single thread within the native thread pool. Due to that contract we
+     * can't run tasks posted on it until native has started.
+     */
+    @Override
+    public SingleThreadTaskRunner createSingleThreadTaskRunner(TaskTraits taskTraits) {
+        // Tasks posted via this API will not execute until after native has started.
+        return new SingleThreadTaskRunnerImpl(null, taskTraits);
+    }
+
+    @Override
+    public void postTask(TaskTraits taskTraits, Runnable task) {
+        createTaskRunner(taskTraits).postTask(task);
+    }
+}
diff --git a/base/android/java/src/org/chromium/base/task/PostTask.java b/base/android/java/src/org/chromium/base/task/PostTask.java
new file mode 100644
index 0000000..8834439
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/PostTask.java
@@ -0,0 +1,141 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+
+import java.util.Collections;
+import java.util.Set;
+import java.util.WeakHashMap;
+
+/**
+ * Java interface to the native chromium scheduler.  Note tasks can be posted before native
+ * initialization, but task prioritization is extremely limited. Once the native scheduler
+ * is ready, tasks will be migrated over.
+ */
+@JNINamespace("base")
+public class PostTask {
+    private static final Object sLock = new Object();
+    private static Set<TaskRunner> sPreNativeTaskRunners =
+            Collections.newSetFromMap(new WeakHashMap<TaskRunner, Boolean>());
+
+    private static final TaskExecutor sTaskExecutors[] = getInitialTaskExecutors();
+
+    private static TaskExecutor[] getInitialTaskExecutors() {
+        TaskExecutor taskExecutors[] = new TaskExecutor[TaskTraits.MAX_EXTENSION_ID + 1];
+        taskExecutors[0] = new DefaultTaskExecutor();
+        return taskExecutors;
+    }
+
+    /**
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @return The TaskRunner for the specified TaskTraits.
+     */
+    public static TaskRunner createTaskRunner(TaskTraits taskTraits) {
+        synchronized (sLock) {
+            TaskRunner taskRunner =
+                    getTaskExecutorForTraits(taskTraits).createTaskRunner(taskTraits);
+            if (sPreNativeTaskRunners != null) {
+                sPreNativeTaskRunners.add(taskRunner);
+            } else {
+                taskRunner.initNativeTaskRunner();
+            }
+            return taskRunner;
+        }
+    }
+
+    /**
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @return The TaskRunner for the specified TaskTraits.
+     */
+    public static SequencedTaskRunner createSequencedTaskRunner(TaskTraits taskTraits) {
+        synchronized (sLock) {
+            SequencedTaskRunner taskRunner =
+                    getTaskExecutorForTraits(taskTraits).createSequencedTaskRunner(taskTraits);
+            if (sPreNativeTaskRunners != null) {
+                sPreNativeTaskRunners.add(taskRunner);
+            } else {
+                taskRunner.initNativeTaskRunner();
+            }
+            return taskRunner;
+        }
+    }
+
+    /**
+     *
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @return The TaskRunner for the specified TaskTraits.
+     */
+    public static SingleThreadTaskRunner createSingleThreadTaskRunner(TaskTraits taskTraits) {
+        synchronized (sLock) {
+            SingleThreadTaskRunner taskRunner =
+                    getTaskExecutorForTraits(taskTraits).createSingleThreadTaskRunner(taskTraits);
+            if (sPreNativeTaskRunners != null) {
+                sPreNativeTaskRunners.add(taskRunner);
+            } else {
+                taskRunner.initNativeTaskRunner();
+            }
+            return taskRunner;
+        }
+    }
+
+    /**
+     * @param taskTraits The TaskTraits that describe the desired TaskRunner.
+     * @param task The task to be run with the specified traits.
+     */
+    public static void postTask(TaskTraits taskTraits, Runnable task) {
+        synchronized (sLock) {
+            if (sPreNativeTaskRunners != null) {
+                getTaskExecutorForTraits(taskTraits).postTask(taskTraits, task);
+            } else {
+                nativePostTask(taskTraits.mPrioritySetExplicitly, taskTraits.mPriority,
+                        taskTraits.mMayBlock, taskTraits.mExtensionId, taskTraits.mExtensionData,
+                        task);
+            }
+        }
+    }
+
+    /**
+     * Registers a TaskExecutor, this must be called before any other usages of this API.
+     *
+     * @param extensionId The id associated with the TaskExecutor.
+     * @param taskExecutor The TaskExecutor to be registered. Must not equal zero.
+     */
+    public static void registerTaskExecutor(byte extensionId, TaskExecutor taskExecutor) {
+        synchronized (sLock) {
+            assert extensionId != 0;
+            assert extensionId <= TaskTraits.MAX_EXTENSION_ID;
+            assert sTaskExecutors[extensionId] == null;
+            sTaskExecutors[extensionId] = taskExecutor;
+        }
+    }
+
+    private static TaskExecutor getTaskExecutorForTraits(TaskTraits traits) {
+        return sTaskExecutors[traits.mExtensionId];
+    }
+
+    @CalledByNative
+    private static void onNativeTaskSchedulerReady() {
+        synchronized (sLock) {
+            for (TaskRunner taskRunner : sPreNativeTaskRunners) {
+                taskRunner.initNativeTaskRunner();
+            }
+            sPreNativeTaskRunners = null;
+        }
+    }
+
+    // This is here to make C++ tests work.
+    @CalledByNative
+    private static void onNativeTaskSchedulerShutdown() {
+        synchronized (sLock) {
+            sPreNativeTaskRunners =
+                    Collections.newSetFromMap(new WeakHashMap<TaskRunner, Boolean>());
+        }
+    }
+
+    private static native void nativePostTask(boolean prioritySetExplicitly, int priority,
+            boolean mayBlock, byte extensionId, byte[] extensionData, Runnable task);
+}
diff --git a/base/android/java/src/org/chromium/base/task/PreNativeSequence.java b/base/android/java/src/org/chromium/base/task/PreNativeSequence.java
new file mode 100644
index 0000000..ce159ff
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/PreNativeSequence.java
@@ -0,0 +1,77 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import org.chromium.base.TraceEvent;
+
+import java.util.ArrayDeque;
+
+/**
+ * Common implementation of a pre-native task runner which runs on either a thread pool or
+ * on a Handler, which can migrate posted tasks to native APIs.
+ */
+abstract class PreNativeSequence implements Runnable {
+    protected final ArrayDeque<Runnable> mTasks = new ArrayDeque<Runnable>();
+    private final String mTraceCategory;
+    private boolean mTaskRunning;
+    private boolean mMigrateToNative;
+
+    /**
+     * @param traceCategory The trace category to use when emitting trace events for tasks posted
+     * on this sequence.
+     */
+    PreNativeSequence(String traceCategory) {
+        mTraceCategory = traceCategory;
+    }
+
+    /**
+     * @param task The task to be enqueued and run sequentially.
+     */
+    synchronized void postTask(Runnable task) {
+        boolean wasEmpty = mTasks.isEmpty();
+        mTasks.offer(task);
+
+        if (wasEmpty && !mTaskRunning) scheduleNext();
+    }
+
+    /**
+     * Ensures the next task from this sequence is run via native APIs.
+     */
+    synchronized void requestMigrateToNative() {
+        if (mTaskRunning) {
+            mMigrateToNative = true;
+        } else {
+            migrateToNative();
+        }
+    }
+
+    @Override
+    public void run() {
+        try (TraceEvent te = TraceEvent.scoped(mTraceCategory)) {
+            Runnable activeTask;
+            synchronized (this) {
+                if (mMigrateToNative) {
+                    migrateToNative();
+                    return;
+                }
+
+                activeTask = mTasks.poll();
+                mTaskRunning = true;
+            }
+
+            // Avoid holding the lock for too long, to allow other threads to postTask.
+            if (activeTask != null) activeTask.run();
+
+            synchronized (this) {
+                mTaskRunning = false;
+                if (!mTasks.isEmpty()) scheduleNext();
+            }
+        }
+    }
+
+    protected abstract void scheduleNext();
+
+    protected abstract void migrateToNative();
+}
diff --git a/base/android/java/src/org/chromium/base/task/SequencedTaskRunnerImpl.java b/base/android/java/src/org/chromium/base/task/SequencedTaskRunnerImpl.java
new file mode 100644
index 0000000..f4b7139
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/SequencedTaskRunnerImpl.java
@@ -0,0 +1,85 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import org.chromium.base.annotations.JNINamespace;
+
+import javax.annotation.Nullable;
+
+/**
+ * Implementation of the abstract class {@link SequencedTaskRunner}. Uses AsyncTasks until
+ * native APIs are available.
+ */
+@JNINamespace("base")
+public class SequencedTaskRunnerImpl implements SequencedTaskRunner {
+    private final Object mLock = new Object();
+
+    @Nullable
+    private final TaskTraits mTaskTraits;
+    private long mNativeTaskRunnerAndroid;
+
+    @Nullable
+    private PreNativeSequence mPreNativeSequence;
+
+    /**
+     * @param traits The TaskTraits associated with this SequencedTaskRunnerImpl.
+     */
+    SequencedTaskRunnerImpl(TaskTraits traits) {
+        mTaskTraits = traits;
+    }
+
+    @Override
+    protected void finalize() {
+        if (mNativeTaskRunnerAndroid != 0) nativeFinalize(mNativeTaskRunnerAndroid);
+    }
+
+    @Override
+    public void initNativeTaskRunner() {
+        synchronized (mLock) {
+            mNativeTaskRunnerAndroid = nativeInit(mTaskTraits.mPrioritySetExplicitly,
+                    mTaskTraits.mPriority, mTaskTraits.mMayBlock, mTaskTraits.mExtensionId,
+                    mTaskTraits.mExtensionData);
+
+            if (mPreNativeSequence != null) mPreNativeSequence.migrateToNative();
+        }
+    }
+
+    @Override
+    public void postTask(Runnable task) {
+        synchronized (mLock) {
+            if (mNativeTaskRunnerAndroid != 0) {
+                nativePostTask(mNativeTaskRunnerAndroid, task);
+            } else {
+                if (mPreNativeSequence == null) mPreNativeSequence = new PreNativeImpl();
+                mPreNativeSequence.postTask(task);
+            }
+        }
+    }
+
+    private class PreNativeImpl extends PreNativeSequence {
+        PreNativeImpl() {
+            super("SequencedTaskRunnerImpl.PreNativeImpl.run");
+        }
+
+        @Override
+        protected void scheduleNext() {
+            AsyncTask.THREAD_POOL_EXECUTOR.execute(this);
+        }
+
+        @Override
+        protected void migrateToNative() {
+            while (!mTasks.isEmpty()) {
+                nativePostTask(mNativeTaskRunnerAndroid, mTasks.poll());
+            }
+            mPreNativeSequence = null;
+        }
+    }
+
+    // NB due to Proguard obfuscation it's easiest to pass the traits via arguments.
+    private static native long nativeInit(boolean prioritySetExplicitly, int priority,
+            boolean mayBlock, byte extensionId, byte[] extensionData);
+    private native void nativeFinalize(long nativeTaskRunnerAndroid);
+    private native void nativePostTask(long nativeTaskRunnerAndroid, Runnable task);
+}
diff --git a/base/android/java/src/org/chromium/base/task/SingleThreadTaskRunnerImpl.java b/base/android/java/src/org/chromium/base/task/SingleThreadTaskRunnerImpl.java
new file mode 100644
index 0000000..99b56e2a
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/SingleThreadTaskRunnerImpl.java
@@ -0,0 +1,101 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import android.os.Handler;
+
+import org.chromium.base.annotations.JNINamespace;
+
+import javax.annotation.Nullable;
+
+/**
+ * Implementation of the abstract class {@link SingleThreadTaskRunner}. Before native initialization
+ * tasks are posted to the {@link java android.os.Handler}, after native initialization they're
+ * posted to a base::SingleThreadTaskRunner which runs on the same thread.
+ */
+@JNINamespace("base")
+public class SingleThreadTaskRunnerImpl implements SingleThreadTaskRunner {
+    private final Object mLock = new Object();
+
+    @Nullable
+    private final Handler mHandler;
+
+    @Nullable
+    private final TaskTraits mTaskTraits;
+    private long mNativeTaskRunnerAndroid;
+
+    @Nullable
+    private PreNativeSequence mPreNativeSequence;
+
+    /**
+     * @param handler The backing Handler if any. Note this must run tasks on the same thread that
+     * the native code runs a task with |traits|.  If handler is null then tasks won't run until
+     * native has initialized.
+     * @param traits The TaskTraits associated with this SingleThreadTaskRunnerImpl.
+     */
+    public SingleThreadTaskRunnerImpl(Handler handler, TaskTraits traits) {
+        mHandler = handler;
+        mTaskTraits = traits;
+    }
+
+    @Override
+    protected void finalize() {
+        if (mNativeTaskRunnerAndroid != 0) nativeFinalize(mNativeTaskRunnerAndroid);
+    }
+
+    @Override
+    public void initNativeTaskRunner() {
+        synchronized (mLock) {
+            mNativeTaskRunnerAndroid = nativeInit(mTaskTraits.mPrioritySetExplicitly,
+                    mTaskTraits.mPriority, mTaskTraits.mMayBlock, mTaskTraits.mExtensionId,
+                    mTaskTraits.mExtensionData);
+
+            if (mPreNativeSequence != null) mPreNativeSequence.migrateToNative();
+        }
+    }
+
+    @Override
+    public void postTask(Runnable task) {
+        synchronized (mLock) {
+            if (mNativeTaskRunnerAndroid != 0) {
+                nativePostTask(mNativeTaskRunnerAndroid, task);
+            } else {
+                if (mPreNativeSequence == null) mPreNativeSequence = new PreNativeImpl();
+                mPreNativeSequence.postTask(task);
+            }
+        }
+    }
+
+    private class PreNativeImpl extends PreNativeSequence {
+        PreNativeImpl() {
+            super("SingleThreadTaskRunnerImpl.PreNativeImpl.run");
+        }
+
+        @Override
+        protected void scheduleNext() {
+            // if |mHandler| is null then pre-native task execution is not supported.
+            if (mHandler != null) mHandler.post(this);
+        }
+
+        /**
+         * This is only called in the context of PreNativeSequence.initNativeTaskRunner and
+         * PreNativeSequence.postTask which are synchronized hence this doesn't need additional
+         * synchronization.
+         */
+        @Override
+        protected void migrateToNative() {
+            while (!mTasks.isEmpty()) {
+                nativePostTask(mNativeTaskRunnerAndroid, mTasks.poll());
+            }
+            mPreNativeSequence = null;
+        }
+    }
+
+    // NB due to Proguard obfuscation it's easiest to pass the traits via arguments.
+    private static native long nativeInit(boolean prioritySetExplicitly, int priority,
+            boolean mayBlock, byte extensionId, byte[] extensionData);
+    private native void nativeFinalize(long nativeTaskRunnerAndroid);
+    private native void nativePostTask(long nativeTaskRunnerAndroid, Runnable task);
+}
diff --git a/base/android/java/src/org/chromium/base/task/TaskExecutor.java b/base/android/java/src/org/chromium/base/task/TaskExecutor.java
new file mode 100644
index 0000000..101be682
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/TaskExecutor.java
@@ -0,0 +1,36 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+/**
+ * The Java equivalent of base::TaskExecutor, which can execute Tasks with a specific TaskTraits
+ * id. To handle tasks posted via the PostTask API, the TaskExecutor should be registered by
+ * calling {@link PostTask.registerTaskExecutor}.
+ */
+public interface TaskExecutor {
+    /**
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @param task The task to be run with the specified traits.
+     */
+    public void postTask(TaskTraits traits, Runnable task);
+
+    /**
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @return The TaskRunner for the specified TaskTraits.
+     */
+    public TaskRunner createTaskRunner(TaskTraits traits);
+
+    /**
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @return The TaskRunner for the specified TaskTraits.
+     */
+    public SequencedTaskRunner createSequencedTaskRunner(TaskTraits traits);
+
+    /**
+     * @param traits The TaskTraits that describe the desired TaskRunner.
+     * @return The TaskRunner for the specified TaskTraits.
+     */
+    public SingleThreadTaskRunner createSingleThreadTaskRunner(TaskTraits traits);
+}
diff --git a/base/android/java/src/org/chromium/base/task/TaskRunnerImpl.java b/base/android/java/src/org/chromium/base/task/TaskRunnerImpl.java
new file mode 100644
index 0000000..46b1b102
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/TaskRunnerImpl.java
@@ -0,0 +1,95 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import org.chromium.base.TraceEvent;
+import org.chromium.base.annotations.JNINamespace;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.annotation.Nullable;
+
+/**
+ * Implementation of the abstract class {@link TaskRunnerImpl}. Uses AsyncTasks until
+ * native APIs are available.
+ */
+@JNINamespace("base")
+public class TaskRunnerImpl implements TaskRunner {
+    @Nullable
+    private final TaskTraits mTaskTraits;
+    private final Object mLock = new Object();
+    private long mNativeTaskRunnerAndroid;
+
+    @Nullable
+    private List<PreNativeTask> mPreNativeTasks = new ArrayList<>();
+
+    /**
+     * @param traits The TaskTraits associated with this TaskRunnerImpl.
+     */
+    TaskRunnerImpl(TaskTraits traits) {
+        mTaskTraits = traits;
+    }
+
+    @Override
+    protected void finalize() {
+        if (mNativeTaskRunnerAndroid != 0) nativeFinalize(mNativeTaskRunnerAndroid);
+    }
+
+    @Override
+    public void postTask(Runnable task) {
+        synchronized (mLock) {
+            if (mNativeTaskRunnerAndroid != 0) {
+                nativePostTask(mNativeTaskRunnerAndroid, task);
+                return;
+            }
+
+            // We don't expect a whole lot of these, if that changes consider pooling them.
+            PreNativeTask preNativeTask = new PreNativeTask(task);
+            mPreNativeTasks.add(preNativeTask);
+            AsyncTask.THREAD_POOL_EXECUTOR.execute(preNativeTask);
+        }
+    }
+
+    private class PreNativeTask implements Runnable {
+        PreNativeTask(Runnable task) {
+            this.mTask = task;
+        }
+
+        @Override
+        public void run() {
+            try (TraceEvent te = TraceEvent.scoped("TaskRunnerImpl.PreNativeTask.run")) {
+                synchronized (mLock) {
+                    if (mPreNativeTasks == null) return;
+
+                    mPreNativeTasks.remove(this);
+                }
+
+                mTask.run();
+            }
+        }
+
+        final Runnable mTask;
+    }
+
+    @Override
+    public void initNativeTaskRunner() {
+        synchronized (mLock) {
+            mNativeTaskRunnerAndroid = nativeInit(mTaskTraits.mPrioritySetExplicitly,
+                    mTaskTraits.mPriority, mTaskTraits.mMayBlock, mTaskTraits.mExtensionId,
+                    mTaskTraits.mExtensionData);
+            for (PreNativeTask task : mPreNativeTasks) {
+                nativePostTask(mNativeTaskRunnerAndroid, task.mTask);
+            }
+            mPreNativeTasks = null;
+        }
+    }
+
+    // NB due to Proguard obfuscation it's easiest to pass the traits via arguments.
+    private static native long nativeInit(boolean prioritySetExplicitly, int priority,
+            boolean mayBlock, byte extensionId, byte[] extensionData);
+    private native void nativeFinalize(long nativeTaskRunnerAndroid);
+    private native void nativePostTask(long nativeTaskRunnerAndroid, Runnable task);
+}
diff --git a/base/android/java/src/org/chromium/base/task/TaskTraits.java b/base/android/java/src/org/chromium/base/task/TaskTraits.java
new file mode 100644
index 0000000..940c7d1
--- /dev/null
+++ b/base/android/java/src/org/chromium/base/task/TaskTraits.java
@@ -0,0 +1,84 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import java.util.Arrays;
+
+import javax.annotation.Nullable;
+
+/**
+ * TaskTraits are metadata that influence how the TaskSecheduler deals with that task.
+ * E.g. the trait can directly or indirectly control task prioritization.
+ */
+public class TaskTraits {
+    // Keep in sync with base::TaskTraitsExtensionStorage:: kInvalidExtensionId
+    public static final byte INVALID_EXTENSION_ID = 0;
+
+    // Keep in sync with base::TaskTraitsExtensionStorage::kMaxExtensionId
+    public static final int MAX_EXTENSION_ID = 4;
+
+    // Keep in sync with base::TaskTraitsExtensionStorage::kStorageSize
+    public static final int EXTENSION_STORAGE_SIZE = 8;
+
+    public TaskTraits() {}
+
+    public TaskTraits setTaskPriority(int taskPriority) {
+        mPrioritySetExplicitly = true;
+        mPriority = taskPriority;
+        return this;
+    }
+
+    /**
+     * Tasks with this trait may block. This includes but is not limited to tasks that wait on
+     * synchronous file I/O operations: read or write a file from disk, interact with a pipe or a
+     * socket, rename or delete a file, enumerate files in a directory, etc. This trait isn't
+     * required for the mere use of locks.
+     */
+    public TaskTraits setMayBlock(boolean mayBlock) {
+        mMayBlock = mayBlock;
+        return this;
+    }
+
+    // For convenience of the JNI code, we use primitive types only.
+    // Note shutdown behavior is not supported on android.
+    boolean mPrioritySetExplicitly;
+    int mPriority = TaskPriority.USER_VISIBLE;
+    boolean mMayBlock;
+    byte mExtensionId = INVALID_EXTENSION_ID;
+    byte mExtensionData[];
+
+    protected void setExtensionId(byte extensionId) {
+        mExtensionId = extensionId;
+    }
+
+    protected void setExtensionData(byte[] extensionData) {
+        mExtensionData = extensionData;
+    }
+
+    @Override
+    public boolean equals(@Nullable Object object) {
+        if (object == this) {
+            return true;
+        } else if (object instanceof TaskTraits) {
+            TaskTraits other = (TaskTraits) object;
+            return mPrioritySetExplicitly == other.mPrioritySetExplicitly
+                    && mPriority == other.mPriority && mExtensionId == other.mExtensionId
+                    && Arrays.equals(mExtensionData, other.mExtensionData);
+        } else {
+            return false;
+        }
+    }
+
+    @Override
+    public int hashCode() {
+        int hash = 31;
+        hash = 37 * hash + (mPrioritySetExplicitly ? 0 : 1);
+        hash = 37 * hash + mPriority;
+        hash = 37 * hash + (mMayBlock ? 0 : 1);
+        hash = 37 * hash + (int) mExtensionId;
+        hash = 37 * hash + Arrays.hashCode(mExtensionData);
+        return hash;
+    }
+}
diff --git a/base/android/javatests/src/org/chromium/base/task/PostTaskTest.java b/base/android/javatests/src/org/chromium/base/task/PostTaskTest.java
new file mode 100644
index 0000000..931a069
--- /dev/null
+++ b/base/android/javatests/src/org/chromium/base/task/PostTaskTest.java
@@ -0,0 +1,94 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+import static org.junit.Assert.assertNotNull;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.support.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.task.SchedulerTestHelpers;
+import org.chromium.base.test.util.MinAndroidSdkLevel;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Test class for {@link PostTask}.
+ *
+ * Note due to layering concerns we can't test post native functionality in a
+ * base javatest. Instead see:
+ * content/public/android/javatests/src/org/chromium/content/browser/scheduler/
+ * TaskSchedulerTest.java
+ */
+@RunWith(BaseJUnit4ClassRunner.class)
+@MinAndroidSdkLevel(23)
+@TargetApi(Build.VERSION_CODES.M)
+public class PostTaskTest {
+    @Test
+    @SmallTest
+    public void testPreNativePostTask() {
+        // This test should not timeout.
+        final Object lock = new Object();
+        final AtomicBoolean taskExecuted = new AtomicBoolean();
+        PostTask.postTask(new TaskTraits(), new Runnable() {
+            @Override
+            public void run() {
+                synchronized (lock) {
+                    taskExecuted.set(true);
+                    lock.notify();
+                }
+            }
+        });
+        synchronized (lock) {
+            try {
+                while (!taskExecuted.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+
+    @Test
+    @SmallTest
+    public void testCreateSingleThreadTaskRunner() throws Exception {
+        TaskRunner taskQueue = PostTask.createSingleThreadTaskRunner(new TaskTraits());
+        // A SingleThreadTaskRunner with default traits will run in the native thread pool
+        // and tasks posted won't run until after the native library has loaded.
+        assertNotNull(taskQueue);
+    }
+
+    @Test
+    @SmallTest
+    public void testCreateSequencedTaskRunner() throws Exception {
+        TaskRunner taskQueue = PostTask.createSequencedTaskRunner(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 2);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 3);
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+
+        assertThat(orderList, contains(1, 2, 3));
+    }
+
+    @Test
+    @SmallTest
+    public void testCreateTaskRunner() throws Exception {
+        TaskRunner taskQueue = PostTask.createTaskRunner(new TaskTraits());
+
+        // This should not timeout.
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+    }
+}
diff --git a/base/android/javatests/src/org/chromium/base/task/SequencedTaskRunnerImplTest.java b/base/android/javatests/src/org/chromium/base/task/SequencedTaskRunnerImplTest.java
new file mode 100644
index 0000000..a2d693af
--- /dev/null
+++ b/base/android/javatests/src/org/chromium/base/task/SequencedTaskRunnerImplTest.java
@@ -0,0 +1,43 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+
+import android.support.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.task.SchedulerTestHelpers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Test class for {@link SequencedTaskRunnerImpl}.
+ *
+ * Note due to layering concerns we can't test post native functionality in a
+ * base javatest. Instead see:
+ * content/public/android/javatests/src/org/chromium/content/browser/scheduler/
+ * TaskSchedulerTest.java
+ */
+@RunWith(BaseJUnit4ClassRunner.class)
+public class SequencedTaskRunnerImplTest {
+    @Test
+    @SmallTest
+    public void testPreNativeTasksRunInOrder() {
+        TaskRunner taskQueue = new SequencedTaskRunnerImpl(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 2);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 3);
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+
+        assertThat(orderList, contains(1, 2, 3));
+    }
+}
diff --git a/base/android/javatests/src/org/chromium/base/task/SingleThreadTaskRunnerImplTest.java b/base/android/javatests/src/org/chromium/base/task/SingleThreadTaskRunnerImplTest.java
new file mode 100644
index 0000000..dacc77ed
--- /dev/null
+++ b/base/android/javatests/src/org/chromium/base/task/SingleThreadTaskRunnerImplTest.java
@@ -0,0 +1,73 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Looper;
+import android.support.test.filters.SmallTest;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.task.SchedulerTestHelpers;
+import org.chromium.base.test.util.MinAndroidSdkLevel;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Test class for {@link SingleThreadTaskRunnerImpl}.
+ *
+ * Note due to layering concerns we can't test post native functionality in a
+ * base javatest. Instead see:
+ * content/public/android/javatests/src/org/chromium/content/browser/scheduler/
+ * TaskSchedulerTest.java
+ */
+@RunWith(BaseJUnit4ClassRunner.class)
+@MinAndroidSdkLevel(23)
+@TargetApi(Build.VERSION_CODES.M)
+public class SingleThreadTaskRunnerImplTest {
+    @Before
+    public void setUp() throws Exception {
+        mHandlerThread = new HandlerThread("SingleThreadTaskRunnerImplTest thread");
+        mHandlerThread.start();
+        mHandler = new Handler(mHandlerThread.getLooper());
+    }
+
+    @After
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
+    public void tearDown() throws InterruptedException {
+        Looper looper = mHandlerThread.getLooper();
+        if (looper != null) {
+            looper.quitSafely();
+        }
+        mHandlerThread.join();
+    }
+
+    private HandlerThread mHandlerThread;
+    private Handler mHandler;
+
+    @Test
+    @SmallTest
+    public void testPreNativePostTask() {
+        TaskRunner taskQueue = new SingleThreadTaskRunnerImpl(mHandler, new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 2);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 3);
+
+        SchedulerTestHelpers.preNativeRunUntilIdle(mHandlerThread);
+        assertThat(orderList, contains(1, 2, 3));
+    }
+}
diff --git a/base/android/javatests/src/org/chromium/base/task/TaskRunnerImplTest.java b/base/android/javatests/src/org/chromium/base/task/TaskRunnerImplTest.java
new file mode 100644
index 0000000..3676ace
--- /dev/null
+++ b/base/android/javatests/src/org/chromium/base/task/TaskRunnerImplTest.java
@@ -0,0 +1,33 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.task;
+
+import android.support.test.filters.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.task.SchedulerTestHelpers;
+
+/**
+ * Test class for {@link TaskRunner}.
+ *
+ * Note due to layering concerns we can't test post native functionality in a
+ * base javatest. Instead see:
+ * content/public/android/javatests/src/org/chromium/content/browser/scheduler/
+ * TaskSchedulerTest.java
+ */
+@RunWith(BaseJUnit4ClassRunner.class)
+public class TaskRunnerImplTest {
+    @Test
+    @SmallTest
+    public void testPreNativePostTask() {
+        TaskRunner taskQueue = new TaskRunnerImpl(new TaskTraits());
+
+        // This should not time out.
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+    }
+}
diff --git a/base/android/task_scheduler/post_task_android.cc b/base/android/task_scheduler/post_task_android.cc
new file mode 100644
index 0000000..6de2057c
--- /dev/null
+++ b/base/android/task_scheduler/post_task_android.cc
@@ -0,0 +1,92 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/task_scheduler/post_task_android.h"
+
+#include "base/no_destructor.h"
+#include "base/run_loop.h"
+#include "base/task/post_task.h"
+#include "base/task/task_scheduler/task_scheduler.h"
+#include "jni/PostTask_jni.h"
+#include "jni/Runnable_jni.h"
+
+namespace base {
+
+// static
+void PostTaskAndroid::SignalNativeSchedulerReady() {
+  Java_PostTask_onNativeTaskSchedulerReady(
+      base::android::AttachCurrentThread());
+}
+
+// static
+void PostTaskAndroid::SignalNativeSchedulerShutdown() {
+  Java_PostTask_onNativeTaskSchedulerShutdown(
+      base::android::AttachCurrentThread());
+}
+
+namespace {
+std::array<uint8_t, TaskTraitsExtensionStorage::kStorageSize> GetExtensionData(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jbyteArray>& array_object) {
+  if (env->IsSameObject(array_object, nullptr))
+    return std::array<uint8_t, TaskTraitsExtensionStorage::kStorageSize>();
+
+  jbyteArray array = static_cast<jbyteArray>(array_object);
+  DCHECK_EQ(env->GetArrayLength(array),
+            static_cast<jsize>(TaskTraitsExtensionStorage::kStorageSize));
+
+  std::array<uint8_t, TaskTraitsExtensionStorage::kStorageSize> result;
+  jbyte* src_bytes = env->GetByteArrayElements(array, nullptr);
+  memcpy(&result[0], src_bytes, TaskTraitsExtensionStorage::kStorageSize);
+  env->ReleaseByteArrayElements(array, src_bytes, JNI_ABORT);
+  return result;
+}
+}  // namespace
+
+// static
+TaskTraits PostTaskAndroid::CreateTaskTraits(
+    JNIEnv* env,
+    jboolean priority_set_explicitly,
+    jint priority,
+    jboolean may_block,
+    jbyte extension_id,
+    const base::android::JavaParamRef<jbyteArray>& extension_data) {
+  return TaskTraits(priority_set_explicitly,
+                    static_cast<TaskPriority>(priority),
+                    /* shutdown_behavior_set_explicitly */ false,
+                    TaskShutdownBehavior::SKIP_ON_SHUTDOWN, may_block,
+                    /* with_base_sync_primitives */ false,
+                    TaskTraitsExtensionStorage(
+                        extension_id, GetExtensionData(env, extension_data)));
+}
+
+void JNI_PostTask_PostTask(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    jboolean priority_set_explicitly,
+    jint priority,
+    jboolean may_block,
+    jbyte extension_id,
+    const base::android::JavaParamRef<jbyteArray>& extension_data,
+    const base::android::JavaParamRef<jobject>& task) {
+  // This could be run on any java thread, so we can't cache |env| in the
+  // BindOnce because JNIEnv is thread specific.
+  PostTaskWithTraits(
+      FROM_HERE,
+      PostTaskAndroid::CreateTaskTraits(env, priority_set_explicitly, priority,
+                                        may_block, extension_id,
+                                        extension_data),
+      BindOnce(&PostTaskAndroid::RunJavaTask,
+               base::android::ScopedJavaGlobalRef<jobject>(task)));
+}
+
+// static
+void PostTaskAndroid::RunJavaTask(
+    base::android::ScopedJavaGlobalRef<jobject> task) {
+  // JNIEnv is thread specific, but we don't know which thread we'll be run on
+  // so we must look it up.
+  JNI_Runnable::Java_Runnable_run(base::android::AttachCurrentThread(), task);
+}
+
+}  // namespace base
diff --git a/base/android/task_scheduler/post_task_android.h b/base/android/task_scheduler/post_task_android.h
new file mode 100644
index 0000000..753210f
--- /dev/null
+++ b/base/android/task_scheduler/post_task_android.h
@@ -0,0 +1,42 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ANDROID_TASK_SCHEDULER_POST_TASK_ANDROID_H_
+#define BASE_ANDROID_TASK_SCHEDULER_POST_TASK_ANDROID_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/base_export.h"
+#include "base/task/task_traits.h"
+
+namespace base {
+
+// C++ interface for PostTask.java
+class BASE_EXPORT PostTaskAndroid {
+ public:
+  // Routes Java tasks posted via TaskScheduler APIs through the C++
+  // TaskScheduler.
+  static void SignalNativeSchedulerReady();
+
+  // Signals that the C++ scheduler has shutdown. Needed to make unit tests that
+  // repeatedly create and destroy the scheduler work.
+  static void SignalNativeSchedulerShutdown();
+
+  static TaskTraits CreateTaskTraits(
+      JNIEnv* env,
+      jboolean priority_set_explicitly,
+      jint priority,
+      jboolean may_block,
+      jbyte extension_id,
+      const base::android::JavaParamRef<jbyteArray>& extension_data);
+
+  // We don't know ahead of time which thread this will run on so it looks up
+  // the JNI environment and the bindings dynamically (albeit with caching).
+  static void RunJavaTask(base::android::ScopedJavaGlobalRef<jobject> task);
+
+  DISALLOW_COPY_AND_ASSIGN(PostTaskAndroid);
+};
+
+}  // namespace base
+
+#endif  // BASE_ANDROID_TASK_SCHEDULER_POST_TASK_ANDROID_H_
diff --git a/base/android/task_scheduler/sequenced_task_runner_android.cc b/base/android/task_scheduler/sequenced_task_runner_android.cc
new file mode 100644
index 0000000..227819b
--- /dev/null
+++ b/base/android/task_scheduler/sequenced_task_runner_android.cc
@@ -0,0 +1,26 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/task_scheduler/post_task_android.h"
+#include "base/android/task_scheduler/task_runner_android.h"
+#include "base/task/post_task.h"
+#include "jni/SequencedTaskRunnerImpl_jni.h"
+
+namespace base {
+
+jlong JNI_SequencedTaskRunnerImpl_Init(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    jboolean priority_set_explicitly,
+    jint priority,
+    jboolean may_block,
+    jbyte extension_id,
+    const base::android::JavaParamRef<jbyteArray>& extension_data) {
+  return reinterpret_cast<intptr_t>(new TaskRunnerAndroid(
+      CreateSequencedTaskRunnerWithTraits(PostTaskAndroid::CreateTaskTraits(
+          env, priority_set_explicitly, priority, may_block, extension_id,
+          extension_data))));
+}
+
+}  // namespace base
diff --git a/base/android/task_scheduler/single_thread_task_runner_android.cc b/base/android/task_scheduler/single_thread_task_runner_android.cc
new file mode 100644
index 0000000..f919a49
--- /dev/null
+++ b/base/android/task_scheduler/single_thread_task_runner_android.cc
@@ -0,0 +1,26 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/task_scheduler/post_task_android.h"
+#include "base/android/task_scheduler/task_runner_android.h"
+#include "base/task/post_task.h"
+#include "jni/SingleThreadTaskRunnerImpl_jni.h"
+
+namespace base {
+
+jlong JNI_SingleThreadTaskRunnerImpl_Init(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    jboolean priority_set_explicitly,
+    jint priority,
+    jboolean may_block,
+    jbyte extension_id,
+    const base::android::JavaParamRef<jbyteArray>& extension_data) {
+  return reinterpret_cast<intptr_t>(new TaskRunnerAndroid(
+      CreateSingleThreadTaskRunnerWithTraits(PostTaskAndroid::CreateTaskTraits(
+          env, priority_set_explicitly, priority, may_block, extension_id,
+          extension_data))));
+}
+
+}  // namespace base
diff --git a/base/android/task_scheduler/task_runner_android.cc b/base/android/task_scheduler/task_runner_android.cc
new file mode 100644
index 0000000..dfdad5f9
--- /dev/null
+++ b/base/android/task_scheduler/task_runner_android.cc
@@ -0,0 +1,49 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/android/task_scheduler/task_runner_android.h"
+
+#include "base/android/task_scheduler/post_task_android.h"
+#include "base/run_loop.h"
+#include "base/task/post_task.h"
+#include "jni/TaskRunnerImpl_jni.h"
+
+namespace base {
+
+jlong JNI_TaskRunnerImpl_Init(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller,
+    jboolean priority_set_explicitly,
+    jint priority,
+    jboolean may_block,
+    jbyte extension_id,
+    const base::android::JavaParamRef<jbyteArray>& extension_data) {
+  return reinterpret_cast<intptr_t>(new TaskRunnerAndroid(
+      CreateTaskRunnerWithTraits(PostTaskAndroid::CreateTaskTraits(
+          env, priority_set_explicitly, priority, may_block, extension_id,
+          extension_data))));
+}
+
+TaskRunnerAndroid::TaskRunnerAndroid(scoped_refptr<TaskRunner> task_runner)
+    : task_runner_(std::move(task_runner)) {}
+
+TaskRunnerAndroid::~TaskRunnerAndroid() = default;
+
+void TaskRunnerAndroid::Finalize(
+    JNIEnv* env,
+    const base::android::JavaRef<jobject>& caller) {
+  // This will happen on the Java finalizer thread.
+  delete this;
+}
+
+void TaskRunnerAndroid::PostTask(JNIEnv* env,
+                                 const base::android::JavaRef<jobject>& caller,
+                                 const base::android::JavaRef<jobject>& task) {
+  task_runner_->PostTask(
+      FROM_HERE,
+      base::BindOnce(&PostTaskAndroid::RunJavaTask,
+                     base::android::ScopedJavaGlobalRef<jobject>(task)));
+}
+
+}  // namespace base
diff --git a/base/android/task_scheduler/task_runner_android.h b/base/android/task_scheduler/task_runner_android.h
new file mode 100644
index 0000000..155a253
--- /dev/null
+++ b/base/android/task_scheduler/task_runner_android.h
@@ -0,0 +1,34 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef BASE_ANDROID_TASK_SCHEDULER_TASK_RUNNER_ANDROID_H_
+#define BASE_ANDROID_TASK_SCHEDULER_TASK_RUNNER_ANDROID_H_
+
+#include "base/android/jni_weak_ref.h"
+#include "base/single_thread_task_runner.h"
+
+namespace base {
+
+// Native implementation backing TaskRunnerImpl.java which posts java tasks onto
+// a C++ TaskRunner.
+class TaskRunnerAndroid {
+ public:
+  explicit TaskRunnerAndroid(scoped_refptr<TaskRunner> task_runner);
+  ~TaskRunnerAndroid();
+
+  void Finalize(JNIEnv* env, const base::android::JavaRef<jobject>& caller);
+
+  void PostTask(JNIEnv* env,
+                const base::android::JavaRef<jobject>& caller,
+                const base::android::JavaRef<jobject>& task);
+
+ private:
+  const scoped_refptr<TaskRunner> task_runner_;
+
+  DISALLOW_COPY_AND_ASSIGN(TaskRunnerAndroid);
+};
+
+}  // namespace base
+
+#endif  // BASE_ANDROID_TASK_SCHEDULER_TASK_RUNNER_ANDROID_H_
diff --git a/base/observer_list.h b/base/observer_list.h
index d111adf..dd4c6ad 100644
--- a/base/observer_list.h
+++ b/base/observer_list.h
@@ -241,11 +241,11 @@
 
   const_iterator end() const { return const_iterator(); }
 
-  ObserverList() {
+  explicit ObserverList(ObserverListPolicy policy = ObserverListPolicy::ALL)
+      : policy_(policy) {
     // Sequence checks only apply when iterators are live.
     DETACH_FROM_SEQUENCE(iteration_sequence_checker_);
   }
-  explicit ObserverList(ObserverListPolicy policy) : policy_(policy) {}
 
   ~ObserverList() {
     // If there are live iterators, ensure destruction is thread-safe.
@@ -333,7 +333,7 @@
 
   base::LinkedList<internal::WeakLinkNode<ObserverList>> live_iterators_;
 
-  const ObserverListPolicy policy_ = ObserverListPolicy::ALL;
+  const ObserverListPolicy policy_;
 
   SEQUENCE_CHECKER(iteration_sequence_checker_);
 
diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc
index efeb49f..dfff56c 100644
--- a/base/observer_list_unittest.cc
+++ b/base/observer_list_unittest.cc
@@ -6,6 +6,7 @@
 
 #include "base/strings/string_piece.h"
 #include "base/test/gtest_util.h"
+#include "base/threading/simple_thread.h"
 #include "build/build_config.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -113,6 +114,31 @@
   Foo* to_add_;
 };
 
+template <class ObserverListType>
+class ObserverListCreator : public DelegateSimpleThread::Delegate {
+ public:
+  std::unique_ptr<ObserverListType> Create(
+      base::Optional<base::ObserverListPolicy> policy = nullopt) {
+    policy_ = policy;
+    DelegateSimpleThread thread(this, "ListCreator");
+    thread.Start();
+    thread.Join();
+    return std::move(observer_list_);
+  }
+
+ private:
+  void Run() override {
+    if (policy_) {
+      observer_list_ = std::make_unique<ObserverListType>(*policy_);
+    } else {
+      observer_list_ = std::make_unique<ObserverListType>();
+    }
+  }
+
+  std::unique_ptr<ObserverListType> observer_list_;
+  base::Optional<base::ObserverListPolicy> policy_;
+};
+
 }  // namespace
 
 class ObserverListTestBase {
@@ -293,6 +319,33 @@
   EXPECT_EQ(0, e.total);
 }
 
+TYPED_TEST(ObserverListTest, CreatedAndUsedOnDifferentThreads) {
+  DECLARE_TYPES;
+
+  ObserverListCreator<ObserverListFoo> list_creator;
+  Adder a(1);
+  // Check with default constructor
+  {
+    std::unique_ptr<ObserverListFoo> observer_list = list_creator.Create();
+    observer_list->AddObserver(&a);
+    for (auto& observer : *observer_list) {
+      observer.Observe(1);
+    }
+    EXPECT_EQ(1, a.GetValue());
+  }
+
+  // Check with constructor taking explicit policy
+  {
+    std::unique_ptr<ObserverListFoo> observer_list =
+        list_creator.Create(base::ObserverListPolicy::EXISTING_ONLY);
+    observer_list->AddObserver(&a);
+    for (auto& observer : *observer_list) {
+      observer.Observe(1);
+    }
+    EXPECT_EQ(2, a.GetValue());
+  }
+}
+
 TYPED_TEST(ObserverListTest, CompactsWhenNoActiveIterator) {
   DECLARE_TYPES;
   using ObserverListConstFoo =
diff --git a/base/task/sequence_manager/sequence_manager_impl.cc b/base/task/sequence_manager/sequence_manager_impl.cc
index 8d9b092..7b6309f5 100644
--- a/base/task/sequence_manager/sequence_manager_impl.cc
+++ b/base/task/sequence_manager/sequence_manager_impl.cc
@@ -12,7 +12,6 @@
 #include "base/compiler_specific.h"
 #include "base/debug/crash_logging.h"
 #include "base/memory/ptr_util.h"
-#include "base/metrics/histogram_macros.h"
 #include "base/rand_util.h"
 #include "base/task/sequence_manager/real_time_domain.h"
 #include "base/task/sequence_manager/task_time_observer.h"
@@ -401,9 +400,6 @@
         work_queue->TakeTaskFromWorkQueue(), work_queue->task_queue(),
         InitializeTaskTiming(work_queue->task_queue()));
 
-    UMA_HISTOGRAM_COUNTS_1000("TaskQueueManager.ActiveQueuesCount",
-                              main_thread_only().active_queues.size());
-
     ExecutingTask& executing_task =
         *main_thread_only().task_execution_stack.rbegin();
     NotifyWillProcessTask(&executing_task, &lazy_now);
diff --git a/base/task/sequence_manager/task_queue_selector.cc b/base/task/sequence_manager/task_queue_selector.cc
index 9e0e4700..03b08a9 100644
--- a/base/task/sequence_manager/task_queue_selector.cc
+++ b/base/task/sequence_manager/task_queue_selector.cc
@@ -7,7 +7,6 @@
 #include <utility>
 
 #include "base/logging.h"
-#include "base/metrics/histogram_macros.h"
 #include "base/task/sequence_manager/associated_thread_id.h"
 #include "base/task/sequence_manager/task_queue_impl.h"
 #include "base/task/sequence_manager/work_queue.h"
@@ -18,38 +17,6 @@
 namespace sequence_manager {
 namespace internal {
 
-namespace {
-
-TaskQueueSelectorLogic QueuePriorityToSelectorLogic(
-    TaskQueue::QueuePriority priority) {
-  switch (priority) {
-    case TaskQueue::kControlPriority:
-      return TaskQueueSelectorLogic::kControlPriorityLogic;
-    case TaskQueue::kHighestPriority:
-      return TaskQueueSelectorLogic::kHighestPriorityLogic;
-    case TaskQueue::kHighPriority:
-      return TaskQueueSelectorLogic::kHighPriorityLogic;
-    case TaskQueue::kNormalPriority:
-      return TaskQueueSelectorLogic::kNormalPriorityLogic;
-    case TaskQueue::kLowPriority:
-      return TaskQueueSelectorLogic::kLowPriorityLogic;
-    case TaskQueue::kBestEffortPriority:
-      return TaskQueueSelectorLogic::kBestEffortPriorityLogic;
-    default:
-      NOTREACHED();
-      return TaskQueueSelectorLogic::kCount;
-  }
-}
-
-// Helper function used to report the number of times a selector logic is
-// trigerred. This will create a histogram for the enumerated data.
-void ReportTaskSelectionLogic(TaskQueueSelectorLogic selector_logic) {
-  UMA_HISTOGRAM_ENUMERATION("TaskQueueSelector.TaskServicedPerSelectorLogic",
-                            selector_logic, TaskQueueSelectorLogic::kCount);
-}
-
-}  // namespace
-
 TaskQueueSelector::TaskQueueSelector(
     scoped_refptr<AssociatedThreadId> associated_thread)
     : associated_thread_(std::move(associated_thread)),
@@ -227,7 +194,6 @@
       ChooseOldestWithPriority(TaskQueue::kControlPriority,
                                out_chose_delayed_over_immediate,
                                out_work_queue)) {
-    ReportTaskSelectionLogic(TaskQueueSelectorLogic::kControlPriorityLogic);
     return true;
   }
 
@@ -238,8 +204,6 @@
       ChooseOldestWithPriority(TaskQueue::kLowPriority,
                                out_chose_delayed_over_immediate,
                                out_work_queue)) {
-    ReportTaskSelectionLogic(
-        TaskQueueSelectorLogic::kLowPriorityStarvationLogic);
     return true;
   }
 
@@ -250,8 +214,6 @@
       ChooseOldestWithPriority(TaskQueue::kNormalPriority,
                                out_chose_delayed_over_immediate,
                                out_work_queue)) {
-    ReportTaskSelectionLogic(
-        TaskQueueSelectorLogic::kNormalPriorityStarvationLogic);
     return true;
   }
 
@@ -262,8 +224,6 @@
       ChooseOldestWithPriority(TaskQueue::kHighPriority,
                                out_chose_delayed_over_immediate,
                                out_work_queue)) {
-    ReportTaskSelectionLogic(
-        TaskQueueSelectorLogic::kHighPriorityStarvationLogic);
     return true;
   }
 
@@ -272,7 +232,6 @@
        priority < max_priority; priority = NextPriority(priority)) {
     if (ChooseOldestWithPriority(priority, out_chose_delayed_over_immediate,
                                  out_work_queue)) {
-      ReportTaskSelectionLogic(QueuePriorityToSelectorLogic(priority));
       return true;
     }
   }
diff --git a/base/task/sequence_manager/task_queue_selector_unittest.cc b/base/task/sequence_manager/task_queue_selector_unittest.cc
index e7b0bb56..3e854a2 100644
--- a/base/task/sequence_manager/task_queue_selector_unittest.cc
+++ b/base/task/sequence_manager/task_queue_selector_unittest.cc
@@ -20,7 +20,6 @@
 #include "base/task/sequence_manager/test/mock_time_domain.h"
 #include "base/task/sequence_manager/work_queue.h"
 #include "base/task/sequence_manager/work_queue_sets.h"
-#include "base/test/metrics/histogram_tester.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -164,7 +163,6 @@
           << i;
       queue_to_index_map_.insert(std::make_pair(task_queues_[i].get(), i));
     }
-    histogram_tester_.reset(new HistogramTester());
   }
 
   void TearDown() final {
@@ -189,17 +187,12 @@
   std::unique_ptr<TimeDomain> time_domain_;
   std::vector<std::unique_ptr<TaskQueueImpl>> task_queues_;
   std::map<TaskQueueImpl*, size_t> queue_to_index_map_;
-  std::unique_ptr<HistogramTester> histogram_tester_;
 };
 
 TEST_F(TaskQueueSelectorTest, TestDefaultPriority) {
   size_t queue_order[] = {4, 3, 2, 1, 0};
   PushTasks(queue_order, 5);
   EXPECT_THAT(PopTasks(), testing::ElementsAre(4, 3, 2, 1, 0));
-  EXPECT_EQ(histogram_tester_->GetBucketCount(
-                "TaskQueueSelector.TaskServicedPerSelectorLogic",
-                static_cast<int>(TaskQueueSelectorLogic::kNormalPriorityLogic)),
-            5);
 }
 
 TEST_F(TaskQueueSelectorTest, TestHighestPriority) {
@@ -208,11 +201,6 @@
   selector_.SetQueuePriority(task_queues_[2].get(),
                              TaskQueue::kHighestPriority);
   EXPECT_THAT(PopTasks(), ::testing::ElementsAre(2, 0, 1, 3, 4));
-  EXPECT_EQ(
-      histogram_tester_->GetBucketCount(
-          "TaskQueueSelector.TaskServicedPerSelectorLogic",
-          static_cast<int>(TaskQueueSelectorLogic::kHighestPriorityLogic)),
-      1);
 }
 
 TEST_F(TaskQueueSelectorTest, TestHighPriority) {
@@ -223,10 +211,6 @@
   selector_.SetQueuePriority(task_queues_[1].get(), TaskQueue::kHighPriority);
   selector_.SetQueuePriority(task_queues_[0].get(), TaskQueue::kLowPriority);
   EXPECT_THAT(PopTasks(), ::testing::ElementsAre(2, 1, 3, 4, 0));
-  EXPECT_EQ(histogram_tester_->GetBucketCount(
-                "TaskQueueSelector.TaskServicedPerSelectorLogic",
-                static_cast<int>(TaskQueueSelectorLogic::kHighPriorityLogic)),
-            1);
 }
 
 TEST_F(TaskQueueSelectorTest, TestLowPriority) {
@@ -234,10 +218,6 @@
   PushTasks(queue_order, 5);
   selector_.SetQueuePriority(task_queues_[2].get(), TaskQueue::kLowPriority);
   EXPECT_THAT(PopTasks(), testing::ElementsAre(0, 1, 3, 4, 2));
-  EXPECT_EQ(histogram_tester_->GetBucketCount(
-                "TaskQueueSelector.TaskServicedPerSelectorLogic",
-                static_cast<int>(TaskQueueSelectorLogic::kLowPriorityLogic)),
-            1);
 }
 
 TEST_F(TaskQueueSelectorTest, TestBestEffortPriority) {
@@ -249,11 +229,6 @@
   selector_.SetQueuePriority(task_queues_[3].get(),
                              TaskQueue::kHighestPriority);
   EXPECT_THAT(PopTasks(), ::testing::ElementsAre(3, 1, 4, 2, 0));
-  EXPECT_EQ(
-      histogram_tester_->GetBucketCount(
-          "TaskQueueSelector.TaskServicedPerSelectorLogic",
-          static_cast<int>(TaskQueueSelectorLogic::kBestEffortPriorityLogic)),
-      1);
 }
 
 TEST_F(TaskQueueSelectorTest, TestControlPriority) {
@@ -266,11 +241,6 @@
                              TaskQueue::kHighestPriority);
   EXPECT_EQ(TaskQueue::kHighestPriority, task_queues_[2]->GetQueuePriority());
   EXPECT_THAT(PopTasks(), ::testing::ElementsAre(4, 2, 0, 1, 3));
-  EXPECT_EQ(
-      histogram_tester_->GetBucketCount(
-          "TaskQueueSelector.TaskServicedPerSelectorLogic",
-          static_cast<int>(TaskQueueSelectorLogic::kControlPriorityLogic)),
-      1);
 }
 
 TEST_F(TaskQueueSelectorTest, TestObserverWithEnabledQueue) {
diff --git a/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc b/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc
index a488602..ed729663 100644
--- a/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc
+++ b/base/task/sequence_manager/thread_controller_with_message_pump_impl.cc
@@ -153,8 +153,9 @@
   DCHECK_GE(do_work_delay, TimeDelta());
   // Schedule a continuation.
   if (do_work_delay.is_zero()) {
-    // Need to run new work immediately.
-    pump_->ScheduleWork();
+    // Need to run new work immediately, but due to the contract of DoWork we
+    // only need to return true to ensure that happens.
+    return true;
   } else if (do_work_delay != TimeDelta::Max()) {
     // Cancels any previously scheduled delayed wake-ups.
     pump_->ScheduleDelayedWork(lazy_now.Now() + do_work_delay);
diff --git a/base/task/task_scheduler/task_scheduler.h b/base/task/task_scheduler/task_scheduler.h
index 8b991e2..03cc1d9 100644
--- a/base/task/task_scheduler/task_scheduler.h
+++ b/base/task/task_scheduler/task_scheduler.h
@@ -37,6 +37,7 @@
 
 class HistogramBase;
 class SchedulerWorkerObserver;
+class TaskSchedulerTestHelpers;
 
 // Interface for a task scheduler and static methods to manage the instance used
 // by the post_task.h API.
@@ -201,6 +202,7 @@
   static TaskScheduler* GetInstance();
 
  private:
+  friend class TaskSchedulerTestHelpers;
   friend class gin::V8Platform;
   friend class content::BrowserMainLoopTest_CreateThreadsInSingleProcess_Test;
 
diff --git a/base/task/task_traits.h b/base/task/task_traits.h
index 3b5994f..465fde5 100644
--- a/base/task/task_traits.h
+++ b/base/task/task_traits.h
@@ -20,10 +20,13 @@
 
 namespace base {
 
+class PostTaskAndroid;
+
 // Valid priorities supported by the task scheduler. Note: internal algorithms
 // depend on priorities being expressed as a continuous zero-based list from
 // lowest to highest priority. Users of this API shouldn't otherwise care about
 // nor use the underlying values.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.base.task
 enum class TaskPriority {
   // This will always be equal to the lowest priority available.
   LOWEST = 0,
@@ -246,6 +249,26 @@
   }
 
  private:
+  friend PostTaskAndroid;
+
+  // For use by PostTaskAndroid.
+  TaskTraits(bool priority_set_explicitly,
+             TaskPriority priority,
+             bool shutdown_behavior_set_explicitly,
+             TaskShutdownBehavior shutdown_behavior,
+             bool may_block,
+             bool with_base_sync_primitives,
+             TaskTraitsExtensionStorage extension)
+      : extension_(extension),
+        priority_(priority),
+        shutdown_behavior_(shutdown_behavior),
+        priority_set_explicitly_(priority_set_explicitly),
+        shutdown_behavior_set_explicitly_(shutdown_behavior_set_explicitly),
+        may_block_(may_block),
+        with_base_sync_primitives_(with_base_sync_primitives) {
+    static_assert(sizeof(TaskTraits) == 24, "Keep this constructor up to date");
+  }
+
   constexpr TaskTraits(const TaskTraits& left, const TaskTraits& right)
       : extension_(right.extension_.extension_id !=
                            TaskTraitsExtensionStorage::kInvalidExtensionId
diff --git a/base/task/task_traits_extension.h b/base/task/task_traits_extension.h
index b90625a..f20bf4f 100644
--- a/base/task/task_traits_extension.h
+++ b/base/task/task_traits_extension.h
@@ -128,7 +128,9 @@
 // this data directly (rather than in a separate object on the heap) to support
 // constexpr-compatible TaskTraits construction.
 struct BASE_EXPORT TaskTraitsExtensionStorage {
-  static constexpr size_t kStorageSize = 8;  // bytes
+  // Size in bytes.
+  // Keep in sync with org.chromium.base.task.TaskTraits.EXTENSION_STORAGE_SIZE
+  static constexpr size_t kStorageSize = 8;
 
   inline constexpr TaskTraitsExtensionStorage();
   inline constexpr TaskTraitsExtensionStorage(
@@ -146,11 +148,13 @@
   inline bool operator==(const TaskTraitsExtensionStorage& other) const;
 
   enum ExtensionId : uint8_t {
+    // Keep in sync with org.chromium.base.task.TaskTraits.INVALID_EXTENSION_ID
     kInvalidExtensionId = 0,
     // The embedder is responsible for assigning the remaining values uniquely.
     kFirstEmbedderExtensionId = 1,
     // Maximum number of extension types is artificially limited to support
     // super efficient TaskExecutor lookup in post_task.cc.
+    // Keep in sync with org.chromium.base.TaskTraits.MAX_EXTENSION_ID
     kMaxExtensionId = 4
   };
 
diff --git a/base/test/BUILD.gn b/base/test/BUILD.gn
index 6b71dd9e..c9f05ea 100644
--- a/base/test/BUILD.gn
+++ b/base/test/BUILD.gn
@@ -116,6 +116,7 @@
     "simple_test_tick_clock.h",
     "task_runner_test_template.cc",
     "task_runner_test_template.h",
+    "task_scheduler_test_helpers_android.cc",
     "test_discardable_memory_allocator.cc",
     "test_discardable_memory_allocator.h",
     "test_file_util.cc",
@@ -412,6 +413,7 @@
     sources = [
       "android/java/src/org/chromium/base/MainReturnCodeResult.java",
       "android/java/src/org/chromium/base/MultiprocessTestClientLauncher.java",
+      "android/javatests/src/org/chromium/base/test/task/TaskSchedulerTestHelpers.java",
       "android/javatests/src/org/chromium/base/test/util/UrlUtils.java",
     ]
     jni_package = "base"
diff --git a/base/test/android/javatests/src/org/chromium/base/test/task/SchedulerTestHelpers.java b/base/test/android/javatests/src/org/chromium/base/test/task/SchedulerTestHelpers.java
new file mode 100644
index 0000000..121ea39
--- /dev/null
+++ b/base/test/android/javatests/src/org/chromium/base/test/task/SchedulerTestHelpers.java
@@ -0,0 +1,129 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.test.task;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.MessageQueue;
+
+import org.chromium.base.task.TaskRunner;
+import org.chromium.base.test.util.MinAndroidSdkLevel;
+
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Collection of helpers for testing the java PostTask.
+ */
+@MinAndroidSdkLevel(23)
+@TargetApi(Build.VERSION_CODES.M)
+public class SchedulerTestHelpers {
+    public static void postRecordOrderTask(
+            TaskRunner taskQueue, List<Integer> orderList, int order) {
+        taskQueue.postTask(new Runnable() {
+            @Override
+            public void run() {
+                orderList.add(order);
+            }
+        });
+    }
+
+    public static void postTaskAndBlockUntilRun(TaskRunner taskQueue) {
+        final Object lock = new Object();
+        final AtomicBoolean taskExecuted = new AtomicBoolean();
+        taskQueue.postTask(new Runnable() {
+            @Override
+            public void run() {
+                synchronized (lock) {
+                    taskExecuted.set(true);
+                    lock.notify();
+                }
+            }
+        });
+        synchronized (lock) {
+            try {
+                while (!taskExecuted.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+
+    /**
+     * A helper which posts a task on the handler which when run blocks until unblock() is called.
+     */
+    public static class HandlerBlocker {
+        final Handler mHandler;
+        final Object mLock = new Object();
+        final AtomicBoolean mTaskExecuted = new AtomicBoolean();
+
+        public HandlerBlocker(Handler handler) {
+            mHandler = handler;
+        }
+
+        /**
+         * Posts a task that blocks until unblock() is called.
+         */
+        public void postBlockingTask() {
+            mHandler.post(new Runnable() {
+                @Override
+                public void run() {
+                    synchronized (mLock) {
+                        try {
+                            while (!mTaskExecuted.get()) {
+                                mLock.wait();
+                            }
+                        } catch (InterruptedException ie) {
+                            ie.printStackTrace();
+                        }
+                    }
+                }
+            });
+        }
+
+        public void unblock() {
+            synchronized (mLock) {
+                mTaskExecuted.set(true);
+                mLock.notify();
+            }
+        }
+    };
+
+    /**
+     * Waits until the looper's MessageQueue becomes idle.
+     */
+    public static void preNativeRunUntilIdle(HandlerThread handlerThread) {
+        final MessageQueue messageQueue = handlerThread.getLooper().getQueue();
+        // This API was added in sdk level 23.
+        if (messageQueue.isIdle()) {
+            return;
+        }
+        final Object lock = new Object();
+        final AtomicBoolean taskExecuted = new AtomicBoolean();
+        messageQueue.addIdleHandler(new MessageQueue.IdleHandler() {
+            @Override
+            public boolean queueIdle() {
+                synchronized (lock) {
+                    taskExecuted.set(true);
+                    lock.notify();
+                }
+                return false;
+            }
+        });
+        synchronized (lock) {
+            try {
+                while (!taskExecuted.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+}
diff --git a/base/test/android/javatests/src/org/chromium/base/test/task/TaskSchedulerTestHelpers.java b/base/test/android/javatests/src/org/chromium/base/test/task/TaskSchedulerTestHelpers.java
new file mode 100644
index 0000000..5427cba
--- /dev/null
+++ b/base/test/android/javatests/src/org/chromium/base/test/task/TaskSchedulerTestHelpers.java
@@ -0,0 +1,25 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.base.test.task;
+
+/** Helpers that allow base::TaskScheduler to be initialized or shutdown for testing. */
+public class TaskSchedulerTestHelpers {
+    /**
+     * Initializes base::TaskScheduler with default params.
+     */
+    public static void enableTaskSchedulerExecutionForTesting() {
+        nativeEnableTaskSchedulerExecutionForTesting();
+    }
+
+    /**
+     * Shuts down base::TaskScheduler.
+     */
+    public static void disableTaskSchedulerExecutionForTesting() {
+        nativeDisableTaskSchedulerExecutionForTesting();
+    }
+
+    private static native void nativeEnableTaskSchedulerExecutionForTesting();
+    private static native void nativeDisableTaskSchedulerExecutionForTesting();
+}
diff --git a/base/test/task_scheduler_test_helpers_android.cc b/base/test/task_scheduler_test_helpers_android.cc
new file mode 100644
index 0000000..47d64eb
--- /dev/null
+++ b/base/test/task_scheduler_test_helpers_android.cc
@@ -0,0 +1,40 @@
+// Copyright (c) 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/task/task_scheduler/task_scheduler.h"
+#include "jni/TaskSchedulerTestHelpers_jni.h"
+
+namespace base {
+
+// TaskSchedulerTestHelpers is a friend of TaskScheduler which grants access to
+// SetExecutionFenceEnabled.
+class TaskSchedulerTestHelpers {
+ public:
+  // Enables/disables an execution fence that prevents tasks from running.
+  static void SetTaskSchedulerExecutionFenceEnabledForTesting(
+      bool execution_fence_enabled);
+};
+
+// static
+void TaskSchedulerTestHelpers::SetTaskSchedulerExecutionFenceEnabledForTesting(
+    bool execution_fence_enabled) {
+  TaskScheduler::GetInstance()->SetExecutionFenceEnabled(
+      execution_fence_enabled);
+}
+
+}  // namespace base
+
+void JNI_TaskSchedulerTestHelpers_EnableTaskSchedulerExecutionForTesting(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller) {
+  base::TaskSchedulerTestHelpers::
+      SetTaskSchedulerExecutionFenceEnabledForTesting(false);
+}
+
+void JNI_TaskSchedulerTestHelpers_DisableTaskSchedulerExecutionForTesting(
+    JNIEnv* env,
+    const base::android::JavaParamRef<jclass>& jcaller) {
+  base::TaskSchedulerTestHelpers::
+      SetTaskSchedulerExecutionFenceEnabledForTesting(true);
+}
diff --git a/build/config/OWNERS b/build/config/OWNERS
index f1592d3..925b505 100644
--- a/build/config/OWNERS
+++ b/build/config/OWNERS
@@ -1,5 +1,7 @@
 dpranke@chromium.org
 scottmg@chromium.org
 
+per-file *jumbo*=bratell@opera.com
+
 per-file BUILDCONFIG.gn=dpranke@chromium.org
 per-file BUILDCONFIG.gn=set noparent
diff --git a/build/config/fuchsia/fidl_library.gni b/build/config/fuchsia/fidl_library.gni
index dc67a4b4..8243317 100644
--- a/build/config/fuchsia/fidl_library.gni
+++ b/build/config/fuchsia/fidl_library.gni
@@ -45,6 +45,17 @@
     languages = [ "cpp" ]
   }
 
+  _define_cpp_action = false
+  _define_js_action = false
+
+  foreach(language, languages) {
+    if (language == "cpp") {
+      _define_cpp_action = true
+    } else if (language == "js") {
+      _define_js_action = true
+    }
+  }
+
   _response_file = "$target_gen_dir/$target_name.rsp"
   _json_representation = "$target_gen_dir/${_library_name}.fidl.json"
   _output_gen_dir = "$target_gen_dir/fidl"
@@ -139,71 +150,75 @@
     ]
   }
 
-  action("${target_name}_cpp_gen") {
-    visibility = [ ":${invoker.target_name}" ]
-    forward_variables_from(invoker, [ "testonly" ])
+  if (_define_cpp_action) {
+    action("${target_name}_cpp_gen") {
+      visibility = [ ":${invoker.target_name}" ]
+      forward_variables_from(invoker, [ "testonly" ])
 
-    deps = [
-      ":${invoker.target_name}_compile",
-    ]
+      deps = [
+        ":${invoker.target_name}_compile",
+      ]
 
-    inputs = [
-      # Depend on the SDK hash, to ensure rebuild if the SDK tools change.
-      rebase_path("$fuchsia_sdk/.hash"),
-      _json_representation,
-    ]
+      inputs = [
+        # Depend on the SDK hash, to ensure rebuild if the SDK tools change.
+        rebase_path("$fuchsia_sdk/.hash"),
+        _json_representation,
+      ]
 
-    outputs = [
-      "${_output_base}.h",
-      "${_output_base}.cc",
-    ]
+      outputs = [
+        "${_output_base}.h",
+        "${_output_base}.cc",
+      ]
 
-    script = "//build/gn_run_binary.py"
-    args = [
-      rebase_path("//third_party/fuchsia-sdk/sdk/tools/fidlgen",
-                  root_build_dir),
-      "-generators",
-      "cpp",
-      "-json",
-      rebase_path(_json_representation),
-      "-include-base",
-      rebase_path(_output_gen_dir),
-      "-output-base",
-      rebase_path("${_output_base}"),
-    ]
+      script = "//build/gn_run_binary.py"
+      args = [
+        rebase_path("//third_party/fuchsia-sdk/sdk/tools/fidlgen",
+                    root_build_dir),
+        "-generators",
+        "cpp",
+        "-json",
+        rebase_path(_json_representation),
+        "-include-base",
+        rebase_path(_output_gen_dir),
+        "-output-base",
+        rebase_path("${_output_base}"),
+      ]
+    }
   }
 
-  _output_js_path = "$_output_gen_dir/${_library_path}/js/fidl.js"
-  action("${target_name}_js_gen") {
-    visibility = [ ":${invoker.target_name}" ]
-    forward_variables_from(invoker, [ "testonly" ])
+  if (_define_js_action) {
+    _output_js_path = "$_output_gen_dir/${_library_path}/js/fidl.js"
+    action("${target_name}_js_gen") {
+      visibility = [ ":${invoker.target_name}" ]
+      forward_variables_from(invoker, [ "testonly" ])
 
-    deps = [
-      ":${invoker.target_name}_compile",
-    ]
+      deps = [
+        ":${invoker.target_name}_compile",
+      ]
 
-    inputs = [
-      # Depend on the SDK hash, to ensure rebuild if the SDK tools change.
-      rebase_path("$fuchsia_sdk/.hash"),
-      _json_representation,
-      "//build/fuchsia/fidlgen_js/fidl.py",  # The schema helper file.
-    ]
+      inputs = [
+        # Depend on the SDK hash, to ensure rebuild if the SDK tools change.
+        rebase_path("$fuchsia_sdk/.hash"),
+        _json_representation,
+        "//build/fuchsia/fidlgen_js/fidl.py",  # The schema helper file.
+      ]
 
-    outputs = [
-      _output_js_path,
-    ]
+      outputs = [
+        _output_js_path,
+      ]
 
-    script = "//build/fuchsia/fidlgen_js/gen.py"
+      script = "//build/fuchsia/fidlgen_js/gen.py"
 
-    args = [
-      rebase_path(_json_representation),
-      "--output",
-      rebase_path("${_output_js_path}"),
-    ]
+      args = [
+        rebase_path(_json_representation),
+        "--output",
+        rebase_path("${_output_js_path}"),
+      ]
 
-    data = []
-    foreach(o, outputs) {
-      data += [ rebase_path(o) ]
+      data = []
+      foreach(o, outputs) {
+        data += [ rebase_path(o) ]
+      }
     }
   }
 
diff --git a/build/config/jumbo.gni b/build/config/jumbo.gni
index 2d4c1d5..77c131a 100644
--- a/build/config/jumbo.gni
+++ b/build/config/jumbo.gni
@@ -75,7 +75,7 @@
 
   excluded_sources = []
   if (defined(invoker.jumbo_excluded_sources)) {
-    excluded_sources += invoker.jumbo_excluded_sources
+    excluded_sources = invoker.jumbo_excluded_sources
   }
 
   if (defined(invoker.sources)) {
@@ -106,9 +106,11 @@
     has_c_file = false
     has_objective_c_file = false
     has_S_file = false
+    sources_in_jumbo_files = []
     assert(merge_limit > 0)
     foreach(source_file, invoker_sources) {
       source_ext = get_path_info(source_file, "extension")
+      is_source_file = true
       if (source_ext == "c") {
         has_c_file = true
       } else if (source_ext == "mm") {
@@ -123,6 +125,11 @@
           next_chunk_start += merge_limit
         }
         current_file_index += 1
+      } else {
+        is_source_file = false
+      }
+      if (is_source_file) {
+        sources_in_jumbo_files += [ source_file ]
       }
     }
 
@@ -130,9 +137,12 @@
       # Empty sources list or a sources list with only header files or
       # at most one non-header file.
       use_jumbo_build_for_target = false
-      assert(current_file_index <= 1)  # Prevent "unused variable"
-      assert(next_chunk_start >= 0)  # Prevent "unused variable"
-      assert(next_chunk_number <= 2)  # Prevent "unused variable"
+      not_needed([
+                   "sources_in_jumbo_files",
+                   "current_file_index",
+                   "next_chunk_start",
+                   "next_chunk_number",
+                 ])
     }
 
     if (has_c_file) {
@@ -148,12 +158,13 @@
 
   if (use_jumbo_build_for_target) {
     merge_action_name = target_name + "__jumbo_merge"
+    sources_in_jumbo_files -= excluded_sources
 
     # Create an action that calls a script that merges all the source files.
     action(merge_action_name) {
       script = "//build/config/merge_for_jumbo.py"
       response_file_contents =
-          rebase_path(invoker_sources - excluded_sources, root_build_dir)
+          rebase_path(sources_in_jumbo_files, root_build_dir)
       outputs = jumbo_files
       args = [ "--outputs" ] + rebase_path(outputs, root_build_dir) +
              [ "--file-list={{response_file_name}}" ]
@@ -189,15 +200,7 @@
       variables_to_not_forward += [ "sources" ]
       assert(jumbo_files != [])
       set_sources_assignment_filter([])  # Prefiltered.
-      sources = jumbo_files + excluded_sources
-
-      # Need to keep the headers in sources so that dependency checks
-      # work.
-      foreach(source_file, invoker_sources) {
-        if (get_path_info(source_file, "extension") == "h") {
-          sources += [ source_file ]
-        }
-      }
+      sources = invoker_sources - sources_in_jumbo_files + jumbo_files
 
       # Change include_dirs to make sure that the jumbo file can find its
       # #included files.
diff --git a/build/config/merge_for_jumbo.py b/build/config/merge_for_jumbo.py
index 2ee23d9..1b6a6c0 100755
--- a/build/config/merge_for_jumbo.py
+++ b/build/config/merge_for_jumbo.py
@@ -135,6 +135,7 @@
     write_jumbo_files(inputs, outputs, written_input_set, written_output_set)
 
   assert set(args.outputs) == written_output_set, "Did not fill all outputs"
+  assert set(all_inputs) == written_input_set, "Did not use all inputs"
   if args.verbose:
     print("Generated %s (%d files) based on %s" % (
       str(args.outputs), len(written_input_set), args.file_list))
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeKeyboardVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeKeyboardVisibilityDelegate.java
new file mode 100644
index 0000000..807e70b
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeKeyboardVisibilityDelegate.java
@@ -0,0 +1,55 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.view.View;
+
+import org.chromium.chrome.browser.init.SingleWindowKeyboardVisibilityDelegate;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * A {@link SingleWindowKeyboardVisibilityDelegate} that considers UI elements of a
+ * {@link ChromeActivity} which amend or replace the keyboard.
+ */
+public class ChromeKeyboardVisibilityDelegate extends SingleWindowKeyboardVisibilityDelegate {
+    /**
+     * Creates a new visibility delegate.
+     * @param activity A {@link WeakReference} to a {@link ChromeActivity}.
+     */
+    public ChromeKeyboardVisibilityDelegate(WeakReference<Activity> activity) {
+        super(activity);
+        assert activity.get() instanceof ChromeActivity;
+    }
+
+    @Override
+    public @Nullable ChromeActivity getActivity() {
+        return (ChromeActivity) super.getActivity();
+    }
+
+    /**
+     * Hide only Android's soft keyboard. Keeps eventual keyboard replacements and extensions
+     * untouched. Usually, you will want to call {@link #hideKeyboard(View)}.
+     * @param view A focused {@link View}.
+     * @return True if the keyboard was visible before this call.
+     */
+    public boolean hideSoftKeyboardOnly(View view) {
+        return hideAndroidSoftKeyboard(view);
+    }
+
+    /**
+     * Returns whether Android soft keyboard is showing and ignores all extensions/replacements.
+     * Usually, you will want to call {@link #isKeyboardShowing(Context, View)}.
+     * @param context A {@link Context} instance.
+     * @param view    A {@link View}.
+     * @return Returns true if Android's soft keyboard is visible. Ignores extensions/replacements.
+     */
+    public boolean isSoftKeyboardShowing(Context context, View view) {
+        return isAndroidSoftKeyboardShowing(context, view);
+    }
+}
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java
index 2f82f30..d9b574b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeWindow.java
@@ -7,20 +7,34 @@
 import android.app.Activity;
 import android.view.View;
 
+import org.chromium.base.VisibleForTesting;
 import org.chromium.chrome.browser.infobar.InfoBarIdentifier;
 import org.chromium.chrome.browser.infobar.SimpleConfirmInfoBarBuilder;
 import org.chromium.chrome.browser.metrics.WebApkUma;
 import org.chromium.chrome.browser.tab.Tab;
 import org.chromium.chrome.browser.webapps.WebApkActivity;
 import org.chromium.ui.base.ActivityAndroidPermissionDelegate;
+import org.chromium.ui.base.ActivityKeyboardVisibilityDelegate;
 import org.chromium.ui.base.ActivityWindowAndroid;
 
+import java.lang.ref.WeakReference;
+
 /**
  * The window that has access to the main activity and is able to create and receive intents,
  * and show error messages.
  */
 public class ChromeWindow extends ActivityWindowAndroid {
     /**
+     * Interface allowing to inject a different keyboard delegate for testing.
+     */
+    @VisibleForTesting
+    public interface KeyboardVisibilityDelegateFactory {
+        ActivityKeyboardVisibilityDelegate create(WeakReference<Activity> activity);
+    }
+    private static KeyboardVisibilityDelegateFactory sKeyboardVisibilityDelegateFactory =
+            ChromeKeyboardVisibilityDelegate::new;
+
+    /**
      * Creates Chrome specific ActivityWindowAndroid.
      * @param activity The activity that owns the ChromeWindow.
      */
@@ -53,6 +67,11 @@
         };
     }
 
+    @Override
+    protected ActivityKeyboardVisibilityDelegate createKeyboardVisibilityDelegate() {
+        return sKeyboardVisibilityDelegateFactory.create(getActivity());
+    }
+
     /**
      * Shows an infobar error message overriding the WindowAndroid implementation.
      */
@@ -71,4 +90,15 @@
             super.showCallbackNonExistentError(error);
         }
     }
+
+    @VisibleForTesting
+    public static void setKeyboardVisibilityDelegateFactory(
+            KeyboardVisibilityDelegateFactory factory) {
+        sKeyboardVisibilityDelegateFactory = factory;
+    }
+
+    @VisibleForTesting
+    public static void resetKeyboardVisibilityDelegateFactory() {
+        setKeyboardVisibilityDelegateFactory(ChromeKeyboardVisibilityDelegate::new);
+    }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java
index 1e6daa4..c79ad45 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingMediator.java
@@ -13,6 +13,7 @@
 import org.chromium.base.VisibleForTesting;
 import org.chromium.chrome.browser.ChromeActivity;
 import org.chromium.chrome.browser.ChromeFeatureList;
+import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
 import org.chromium.chrome.browser.InsetObserverView;
 import org.chromium.chrome.browser.autofill.keyboard_accessory.KeyboardAccessoryData.Action;
 import org.chromium.chrome.browser.autofill.keyboard_accessory.KeyboardAccessoryData.Provider;
@@ -31,6 +32,7 @@
 import org.chromium.chrome.browser.tabmodel.TabModelObserver;
 import org.chromium.chrome.browser.tabmodel.TabModelSelectorTabModelObserver;
 import org.chromium.ui.DropdownPopupWindow;
+import org.chromium.ui.KeyboardVisibilityDelegate;
 import org.chromium.ui.base.WindowAndroid;
 
 import java.util.HashMap;
@@ -43,7 +45,7 @@
 class ManualFillingMediator
         extends EmptyTabObserver implements KeyboardAccessoryCoordinator.VisibilityDelegate {
     private WindowAndroid mWindowAndroid;
-    private final WindowAndroid.KeyboardVisibilityListener mVisibilityListener =
+    private final KeyboardVisibilityDelegate.KeyboardVisibilityListener mVisibilityListener =
             this::onKeyboardVisibilityChanged;
     private Supplier<InsetObserverView> mInsetObserverViewSupplier;
     private boolean mShouldShow = false;
@@ -155,7 +157,7 @@
         setInsetObserverViewSupplier(mActivity::getInsetObserverView);
         LayoutManager manager = getLayoutManager();
         if (manager != null) manager.addSceneChangeObserver(mTabSwitcherObserver);
-        windowAndroid.addKeyboardVisibilityListener(mVisibilityListener);
+        windowAndroid.getKeyboardDelegate().addKeyboardVisibilityListener(mVisibilityListener);
         mTabModelObserver = new TabModelSelectorTabModelObserver(mActivity.getTabModelSelector()) {
             @Override
             public void didSelectTab(Tab tab, @TabModel.TabSelectionType int type, int lastId) {
@@ -224,7 +226,7 @@
     void destroy() {
         if (!isInitialized()) return;
         pause();
-        mWindowAndroid.removeKeyboardVisibilityListener(mVisibilityListener);
+        getKeyboard().removeKeyboardVisibilityListener(mVisibilityListener);
         LayoutManager manager = getLayoutManager();
         if (manager != null) manager.removeSceneChangeObserver(mTabSwitcherObserver);
         mWindowAndroid = null;
@@ -245,7 +247,7 @@
         pause();
         ViewGroup contentView = getContentView();
         if (contentView != null) {
-            mWindowAndroid.getKeyboardDelegate().hideKeyboard(getContentView());
+            getKeyboard().hideSoftKeyboardOnly(getContentView());
         }
     }
 
@@ -257,7 +259,7 @@
         if (!isInitialized() || !mKeyboardAccessory.hasContents() || mShouldShow) return;
         mShouldShow = true;
         ViewGroup contentView = getContentView();
-        if (mWindowAndroid.getKeyboardDelegate().isKeyboardShowing(mActivity, contentView)) {
+        if (getKeyboard().isSoftKeyboardShowing(mActivity, contentView)) {
             displayKeyboardAccessory();
         }
     }
@@ -309,14 +311,14 @@
         View rootView = contentView.getRootView();
         if (rootView == null) return;
         mAccessorySheet.setHeight(calculateAccessorySheetHeight(rootView));
-        mWindowAndroid.getKeyboardDelegate().hideKeyboard(contentView);
+        getKeyboard().hideSoftKeyboardOnly(contentView);
     }
 
     @Override
     public void onCloseAccessorySheet() {
         ViewGroup contentView = getContentView();
         if (contentView == null || mActivity == null) return; // The tab was cleaned up already.
-        if (mWindowAndroid.getKeyboardDelegate().isKeyboardShowing(mActivity, contentView)) {
+        if (getKeyboard().isSoftKeyboardShowing(mActivity, contentView)) {
             return; // If the keyboard is showing or is starting to show, the sheet closes gently.
         }
         mActivity.getFullscreenManager().setBottomControlsHeight(mPreviousControlHeight);
@@ -339,7 +341,7 @@
         assert mActivity != null : "ManualFillingMediator needs initialization.";
         mKeyboardExtensionSizeManager.setKeyboardExtensionHeight(calculateAccessoryBarHeight());
         if (mActivity.getCurrentFocus() != null) {
-            mWindowAndroid.getKeyboardDelegate().showKeyboard(mActivity.getCurrentFocus());
+            getKeyboard().showKeyboard(mActivity.getCurrentFocus());
         }
     }
 
@@ -386,6 +388,11 @@
         return compositorViewHolder.getLayoutManager();
     }
 
+    private ChromeKeyboardVisibilityDelegate getKeyboard() {
+        KeyboardVisibilityDelegate delegate = mWindowAndroid.getKeyboardDelegate();
+        return (ChromeKeyboardVisibilityDelegate) delegate;
+    }
+
     private AccessoryState getOrCreateAccessoryState(Tab tab) {
         assert tab != null : "Accessory state was requested without providing a non-null tab!";
         AccessoryState state = mModel.get(tab);
@@ -418,7 +425,7 @@
         // Without known inset (which is keyboard + bottom soft keys), use the keyboard height.
         return Math.max(mActivity.getResources().getDimensionPixelSize(
                                 org.chromium.chrome.R.dimen.keyboard_accessory_suggestion_height),
-                mWindowAndroid.getKeyboardDelegate().calculateKeyboardHeight(mActivity, rootView));
+                getKeyboard().calculateKeyboardHeight(rootView));
     }
 
     private @Px int calculateAccessoryBarHeight() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java
index 19648f3..bc4837c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill_assistant/AutofillAssistantUiController.java
@@ -23,6 +23,7 @@
 import org.chromium.payments.mojom.PaymentOptions;
 
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
@@ -235,8 +236,10 @@
             int day, int hour, int minute, int second) {
         Date date = null;
         if (year > 0 && month > 0 && day > 0 && hour >= 0 && minute >= 0 && second >= 0) {
+            Calendar calendar = Calendar.getInstance();
             // Month in Java Date is 0-based, but the one we receive from the server is 1-based.
-            date = new Date(year, month - 1, day, hour, minute, second);
+            calendar.set(year, month - 1, day, hour, minute, second);
+            date = calendar.getTime();
         }
 
         mUiDelegate.showDetails(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
index 5e1c53f..532c41b1 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java
@@ -5,13 +5,11 @@
 package org.chromium.chrome.browser.init;
 
 import android.annotation.TargetApi;
-import android.app.Activity;
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.os.Build;
 import android.os.SystemClock;
 import android.support.annotation.WorkerThread;
-import android.view.View;
 import android.view.inputmethod.InputMethodInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.view.inputmethod.InputMethodSubtype;
@@ -55,7 +53,6 @@
 import org.chromium.chrome.browser.media.MediaViewerUtils;
 import org.chromium.chrome.browser.metrics.LaunchMetrics;
 import org.chromium.chrome.browser.metrics.PackageMetrics;
-import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
 import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
 import org.chromium.chrome.browser.notifications.channels.ChannelsUpdater;
 import org.chromium.chrome.browser.ntp.NewTabPage;
@@ -77,12 +74,12 @@
 import org.chromium.components.minidump_uploader.CrashFileManager;
 import org.chromium.components.signin.AccountManagerFacade;
 import org.chromium.components.signin.AccountsChangeObserver;
+import org.chromium.content_public.browser.BrowserTaskExecutor;
 import org.chromium.content_public.browser.ChildProcessLauncherHelper;
 import org.chromium.content_public.common.ContentSwitches;
 import org.chromium.printing.PrintDocumentAdapterWrapper;
 import org.chromium.printing.PrintingControllerImpl;
 import org.chromium.ui.ContactsPickerListener;
-import org.chromium.ui.KeyboardVisibilityDelegate;
 import org.chromium.ui.PhotoPickerListener;
 import org.chromium.ui.UiUtils;
 import org.chromium.ui.base.SelectFileDialog;
@@ -150,26 +147,10 @@
      * Performs the shared class initialization.
      */
     protected void handlePreNativeInitialization() {
+        BrowserTaskExecutor.register();
+
         Context application = ContextUtils.getApplicationContext();
 
-        KeyboardVisibilityDelegate.setInstance(new KeyboardVisibilityDelegate() {
-            @Override
-            public boolean isKeyboardShowing(Context context, View view) {
-                Activity activity = null;
-                if (context instanceof Activity) {
-                    activity = (Activity) context;
-                } else if (view != null && view.getContext() instanceof Activity) {
-                    activity = (Activity) view.getContext();
-                }
-
-                if (activity != null
-                        && MultiWindowUtils.getInstance().isLegacyMultiWindow(activity)) {
-                    return false; // For multi-window mode we do not track keyboard visibility.
-                }
-                return super.isKeyboardShowing(context, view);
-            }
-        });
-
         // Initialize the AccountManagerFacade with the correct AccountManagerDelegate. Must be done
         // only once and before AccountMangerHelper.get(...) is called to avoid using the
         // default AccountManagerDelegate.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/init/SingleWindowKeyboardVisibilityDelegate.java b/chrome/android/java/src/org/chromium/chrome/browser/init/SingleWindowKeyboardVisibilityDelegate.java
new file mode 100644
index 0000000..a66b75a3
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/init/SingleWindowKeyboardVisibilityDelegate.java
@@ -0,0 +1,38 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.init;
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.View;
+
+import org.chromium.chrome.browser.multiwindow.MultiWindowUtils;
+import org.chromium.ui.base.ActivityKeyboardVisibilityDelegate;
+import org.chromium.ui.base.WindowAndroid;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * A {@link ActivityKeyboardVisibilityDelegate} that prevents the multi-window functionality from
+ * triggering the layout-based keyboard detection.
+ */
+public class SingleWindowKeyboardVisibilityDelegate extends ActivityKeyboardVisibilityDelegate {
+    public SingleWindowKeyboardVisibilityDelegate(WeakReference<Activity> activity) {
+        super(activity);
+    }
+
+    @Override
+    public boolean isKeyboardShowing(Context context, View view) {
+        Activity activity = WindowAndroid.activityFromContext(context);
+        if (activity == null && view != null && view.getContext() instanceof Activity) {
+            activity = (Activity) view.getContext();
+        }
+
+        if (activity != null && MultiWindowUtils.getInstance().isLegacyMultiWindow(activity)) {
+            return false; // For multi-window mode we do not track keyboard visibility.
+        }
+        return super.isKeyboardShowing(context, view);
+    }
+}
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
index 3c69d3d..95b79c5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/searchwidget/SearchActivity.java
@@ -25,6 +25,7 @@
 import org.chromium.chrome.browser.customtabs.CustomTabsConnection;
 import org.chromium.chrome.browser.document.ChromeLauncherActivity;
 import org.chromium.chrome.browser.init.AsyncInitializationActivity;
+import org.chromium.chrome.browser.init.SingleWindowKeyboardVisibilityDelegate;
 import org.chromium.chrome.browser.locale.LocaleManager;
 import org.chromium.chrome.browser.omnibox.suggestions.AutocompleteController;
 import org.chromium.chrome.browser.snackbar.SnackbarManager;
@@ -37,6 +38,7 @@
 import org.chromium.components.url_formatter.UrlFormatter;
 import org.chromium.content_public.browser.LoadUrlParams;
 import org.chromium.content_public.common.ContentUrlConstants;
+import org.chromium.ui.base.ActivityKeyboardVisibilityDelegate;
 import org.chromium.ui.base.ActivityWindowAndroid;
 
 /** Queries the user's default search engine and shows autocomplete suggestions. */
@@ -115,7 +117,12 @@
 
     @Override
     protected ActivityWindowAndroid createWindowAndroid() {
-        return new ActivityWindowAndroid(this);
+        return new ActivityWindowAndroid(this) {
+            @Override
+            protected ActivityKeyboardVisibilityDelegate createKeyboardVisibilityDelegate() {
+                return new SingleWindowKeyboardVisibilityDelegate(getActivity());
+            }
+        };
     }
 
     @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarMediator.java
index 7965a56..8321c3d 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarMediator.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/BottomToolbarMediator.java
@@ -22,8 +22,8 @@
 import org.chromium.chrome.browser.widget.textbubble.TextBubble;
 import org.chromium.components.feature_engagement.FeatureConstants;
 import org.chromium.components.feature_engagement.Tracker;
+import org.chromium.ui.KeyboardVisibilityDelegate;
 import org.chromium.ui.base.WindowAndroid;
-import org.chromium.ui.base.WindowAndroid.KeyboardVisibilityListener;
 import org.chromium.ui.resources.ResourceManager;
 import org.chromium.ui.widget.ViewRectProvider;
 
@@ -32,9 +32,9 @@
  * coordinators, running most of the business logic associated with the bottom toolbar, and updating
  * the model accordingly.
  */
-class BottomToolbarMediator implements FullscreenListener, KeyboardVisibilityListener,
-                                       OverlayPanelManagerObserver, OverviewModeObserver,
-                                       SceneChangeObserver {
+class BottomToolbarMediator
+        implements FullscreenListener, KeyboardVisibilityDelegate.KeyboardVisibilityListener,
+                   OverlayPanelManagerObserver, OverviewModeObserver, SceneChangeObserver {
     /** The amount of time to show the Duet help bubble for. */
     private static final int DUET_IPH_BUBBLE_SHOW_DURATION_MS = 6000;
 
@@ -106,7 +106,9 @@
     void destroy() {
         mFullscreenManager.removeListener(this);
         if (mOverviewModeBehavior != null) mOverviewModeBehavior.removeOverviewModeObserver(this);
-        if (mWindowAndroid != null) mWindowAndroid.removeKeyboardVisibilityListener(this);
+        if (mWindowAndroid != null) {
+            mWindowAndroid.getKeyboardDelegate().removeKeyboardVisibilityListener(this);
+        }
         if (mModel.get(BottomToolbarModel.LAYOUT_MANAGER) != null) {
             LayoutManager manager = mModel.get(BottomToolbarModel.LAYOUT_MANAGER);
             manager.getOverlayPanelManager().removeObserver(this);
@@ -229,7 +231,7 @@
         assert mWindowAndroid == null : "#setWindowAndroid should only be called once per toolbar.";
         // Watch for keyboard events so we can hide the bottom toolbar when the keyboard is showing.
         mWindowAndroid = windowAndroid;
-        mWindowAndroid.addKeyboardVisibilityListener(this);
+        mWindowAndroid.getKeyboardDelegate().addKeyboardVisibilityListener(this);
     }
 
     void setTabSwitcherButtonData(
diff --git a/chrome/android/java_sources.gni b/chrome/android/java_sources.gni
index df21d3c..ccafb8d9 100644
--- a/chrome/android/java_sources.gni
+++ b/chrome/android/java_sources.gni
@@ -31,6 +31,7 @@
   "java/src/org/chromium/chrome/browser/ChromeBackupWatcher.java",
   "java/src/org/chromium/chrome/browser/ChromeFeatureList.java",
   "java/src/org/chromium/chrome/browser/ChromeHttpAuthHandler.java",
+  "java/src/org/chromium/chrome/browser/ChromeKeyboardVisibilityDelegate.java",
   "java/src/org/chromium/chrome/browser/ChromeStrictMode.java",
   "java/src/org/chromium/chrome/browser/ChromeStringConstants.java",
   "java/src/org/chromium/chrome/browser/ChromeSwitches.java",
@@ -770,6 +771,7 @@
   "java/src/org/chromium/chrome/browser/init/NativeInitializationController.java",
   "java/src/org/chromium/chrome/browser/init/ProcessInitializationHandler.java",
   "java/src/org/chromium/chrome/browser/init/ServiceManagerStartupUtils.java",
+  "java/src/org/chromium/chrome/browser/init/SingleWindowKeyboardVisibilityDelegate.java",
   "java/src/org/chromium/chrome/browser/installedapp/InstalledAppProviderFactory.java",
   "java/src/org/chromium/chrome/browser/installedapp/InstalledAppProviderImpl.java",
   "java/src/org/chromium/chrome/browser/installedapp/PackageHash.java",
@@ -1793,6 +1795,7 @@
   "javatests/src/org/chromium/chrome/browser/autofill/AutofillTestHelper.java",
   "javatests/src/org/chromium/chrome/browser/autofill/PersonalDataManagerTest.java",
   "javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/AccessorySheetViewTest.java",
+  "javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/FakeKeyboard.java",
   "javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/KeyboardAccessoryViewTest.java",
   "javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingIntegrationTest.java",
   "javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingTestHelper.java",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/FakeKeyboard.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/FakeKeyboard.java
new file mode 100644
index 0000000..7066c2e
--- /dev/null
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/FakeKeyboard.java
@@ -0,0 +1,103 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.autofill.keyboard_accessory;
+
+import static org.chromium.base.ThreadUtils.runOnUiThreadBlocking;
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.View;
+import android.view.ViewGroup;
+
+import org.chromium.chrome.browser.ChromeKeyboardVisibilityDelegate;
+import org.chromium.chrome.browser.ChromeWindow;
+import org.chromium.chrome.browser.InsetObserverView;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * This class allows to mock the {@link org.chromium.ui.KeyboardVisibilityDelegate} in any given
+ * {@link org.chromium.chrome.test.ChromeActivityTestRule} which allows to write tests relying on
+ * keyboard without having to deal with the soft keyboard. To use it, inject its constructor as
+ * factory into the {@link org.chromium.chrome.browser.ChromeWindow} before launching an activity.
+ * To reset, call {@link ChromeWindow#resetKeyboardVisibilityDelegateFactory()}.
+ * <pre>E.g.{@code
+ *    // To force a keyboard open.
+ *    ChromeWindow.setKeyboardVisibilityDelegateFactory(FakeKeyboard::new);
+ *    aTestRule.startMainActivityOnBlankPage();
+ *    ChromeWindow.resetKeyboardVisibilityDelegateFactory();
+ *    aTestRule.getKeyboardDelegate().showKeyboard();  // No delay/waiting necessary.
+ *  }</pre>
+ */
+public class FakeKeyboard extends ChromeKeyboardVisibilityDelegate {
+    private static final int KEYBOARD_HEIGHT_DP = 234;
+    private boolean mIsShowing;
+
+    public FakeKeyboard(WeakReference<Activity> activity) {
+        super(activity);
+    }
+
+    private int getStaticKeyboardHeight() {
+        return (int) getActivity().getResources().getDisplayMetrics().density * KEYBOARD_HEIGHT_DP;
+    }
+
+    @Override
+    protected boolean isAndroidSoftKeyboardShowing(Context context, View view) {
+        return mIsShowing;
+    }
+
+    @Override
+    public void showKeyboard(View view) {
+        boolean keyboardWasVisible = isKeyboardShowing(getActivity(), view);
+        mIsShowing = true;
+        runOnUiThreadBlocking(() -> {
+            if (!keyboardWasVisible) notifyListeners(mIsShowing);
+            // Pretend a layout change for components listening to the activity directly:
+            View contentView = getActivity().findViewById(android.R.id.content);
+            ViewGroup.LayoutParams p = contentView.getLayoutParams();
+            p.height = p.height - getStaticKeyboardHeight();
+            contentView.setLayoutParams(p);
+        });
+    }
+
+    @Override
+    protected boolean hideAndroidSoftKeyboard(View view) {
+        boolean keyboardWasVisible = isKeyboardShowing(getActivity(), view);
+        mIsShowing = false;
+        runOnUiThreadBlocking(() -> {
+            if (keyboardWasVisible) notifyListeners(mIsShowing);
+            // Pretend a layout change for components listening to the activity directly:
+            View contentView = getActivity().findViewById(android.R.id.content);
+            ViewGroup.LayoutParams p = contentView.getLayoutParams();
+            p.height = p.height + getStaticKeyboardHeight();
+            contentView.setLayoutParams(p);
+        });
+        return keyboardWasVisible;
+    }
+
+    @Override
+    public int calculateKeyboardHeight(View rootView) {
+        return mIsShowing ? getStaticKeyboardHeight() : 0;
+    }
+
+    @Override
+    public int calculateKeyboardDetectionThreshold(Context context, View rootView) {
+        return 0;
+    }
+
+    /**
+     * Creates an inset observer view calculating the bottom inset based on the fake keyboard.
+     * @param context Context used to instantiate this view.
+     * @return a {@link InsetObserverView}
+     */
+    InsetObserverView createInsetObserver(Context context) {
+        return new InsetObserverView(context) {
+            @Override
+            public int getSystemWindowInsetsBottom() {
+                return mIsShowing ? getStaticKeyboardHeight() : 0;
+            }
+        };
+    }
+}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingIntegrationTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingIntegrationTest.java
index 295de00d..2f79679 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingIntegrationTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingIntegrationTest.java
@@ -383,7 +383,7 @@
     @Test
     @SmallTest
     public void testInfobarStaysHiddenWhenOpeningSheet()
-            throws InterruptedException, TimeoutException {
+            throws InterruptedException, TimeoutException, ExecutionException {
         mHelper.loadTestPage(false);
 
         InfoBarTestAnimationListener listener = new InfoBarTestAnimationListener();
@@ -413,7 +413,11 @@
         // Reopen the keyboard, then close it.
         whenDisplayed(withId(R.id.tabs)).perform(selectTabAtPosition(0));
         mHelper.waitForKeyboard();
-        mActivityTestRule.getKeyboardDelegate().hideKeyboard(null);
+        ThreadUtils.runOnUiThreadBlocking(() -> {
+            mActivityTestRule.getKeyboardDelegate().hideKeyboard(
+                    mActivityTestRule.getActivity().getCurrentFocus());
+            mActivityTestRule.getInfoBarContainer().requestLayout();
+        });
 
         mHelper.waitToBeHidden(withId(R.id.keyboard_accessory_sheet));
         mHelper.waitToBeHidden(withId(R.id.keyboard_accessory));
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingTestHelper.java b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingTestHelper.java
index b2b1ec7..d2f9ff7 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingTestHelper.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingTestHelper.java
@@ -17,9 +17,8 @@
 import static org.chromium.chrome.test.util.ViewUtils.waitForView;
 import static org.chromium.ui.base.LocalizationUtils.setRtlForTesting;
 
-import android.content.Context;
+import android.app.Activity;
 import android.support.design.widget.TabLayout;
-import android.support.test.InstrumentationRegistry;
 import android.support.test.espresso.PerformException;
 import android.support.test.espresso.UiController;
 import android.support.test.espresso.ViewAction;
@@ -34,7 +33,7 @@
 import org.chromium.base.test.util.UrlUtils;
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.ChromeTabbedActivity;
-import org.chromium.chrome.browser.InsetObserverView;
+import org.chromium.chrome.browser.ChromeWindow;
 import org.chromium.chrome.test.ChromeTabbedActivityTestRule;
 import org.chromium.content_public.browser.ImeAdapter;
 import org.chromium.content_public.browser.WebContents;
@@ -43,7 +42,6 @@
 import org.chromium.content_public.browser.test.util.DOMUtils;
 import org.chromium.content_public.browser.test.util.TestInputMethodManagerWrapper;
 import org.chromium.ui.DropdownPopupWindowInterface;
-import org.chromium.ui.KeyboardVisibilityDelegate;
 
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeoutException;
@@ -57,66 +55,16 @@
     private final AtomicReference<WebContents> mWebContentsRef = new AtomicReference<>();
     private TestInputMethodManagerWrapper mInputMethodManagerWrapper;
 
-    private class FakeKeyboard extends KeyboardVisibilityDelegate {
-        static final int KEYBOARD_HEIGHT = 234;
-
-        private boolean mIsShowing;
-
-        @Override
-        public void showKeyboard(View view) {
-            mIsShowing = true;
-            ThreadUtils.runOnUiThreadBlocking(() -> {
-                mActivityTestRule.getActivity()
-                        .getManualFillingController()
-                        .getMediatorForTesting()
-                        .onKeyboardVisibilityChanged(mIsShowing);
-            });
-        }
-
-        @Override
-        public boolean hideKeyboard(View view) {
-            boolean keyboardWasVisible = mIsShowing;
-            mIsShowing = false;
-            ThreadUtils.runOnUiThreadBlocking(() -> {
-                mActivityTestRule.getActivity()
-                        .getManualFillingController()
-                        .getMediatorForTesting()
-                        .onKeyboardVisibilityChanged(mIsShowing);
-            });
-            return keyboardWasVisible;
-        }
-
-        @Override
-        public int calculateKeyboardHeight(Context context, View rootView) {
-            return mIsShowing ? KEYBOARD_HEIGHT : 0;
-        }
-
-        @Override
-        protected int calculateKeyboardDetectionThreshold(Context context, View rootView) {
-            return 0;
-        }
-
-        /**
-         * Creates an inset observer view calculating the bottom inset based on the fake keyboard.
-         * @param context Context used to instantiate this view.
-         * @return a {@link InsetObserverView}
-         */
-        InsetObserverView createInsetObserver(Context context) {
-            return new InsetObserverView(context) {
-                @Override
-                public int getSystemWindowInsetsBottom() {
-                    return mIsShowing ? KEYBOARD_HEIGHT : 0;
-                }
-            };
-        }
+    public FakeKeyboard getKeyboard() {
+        return (FakeKeyboard) mActivityTestRule.getKeyboardDelegate();
     }
-    private final FakeKeyboard mKeyboard = new FakeKeyboard();
 
     ManualFillingTestHelper(ChromeTabbedActivityTestRule activityTestRule) {
         mActivityTestRule = activityTestRule;
     }
 
     public void loadTestPage(boolean isRtl) throws InterruptedException {
+        ChromeWindow.setKeyboardVisibilityDelegateFactory(FakeKeyboard::new);
         mActivityTestRule.startMainActivityWithURL(UrlUtils.encodeHtmlDataUri("<html"
                 + (isRtl ? " dir=\"rtl\"" : "") + "><head>"
                 + "<meta name=\"viewport\""
@@ -128,14 +76,14 @@
                 + "</form></body></html>"));
         setRtlForTesting(isRtl);
         ThreadUtils.runOnUiThreadBlocking(() -> {
-            ChromeTabbedActivity activity = mActivityTestRule.getActivity();
+            ChromeTabbedActivity activity = (ChromeTabbedActivity) mActivityTestRule.getActivity();
             mWebContentsRef.set(activity.getActivityTab().getWebContents());
             activity.getManualFillingController()
                     .getMediatorForTesting()
-                    .setInsetObserverViewSupplier(() -> {
-                        return mKeyboard.createInsetObserver(
-                                activity.getInsetObserverView().getContext());
-                    });
+                    .setInsetObserverViewSupplier(
+                            ()
+                                    -> getKeyboard().createInsetObserver(
+                                            activity.getInsetObserverView().getContext()));
             // The TestInputMethodManagerWrapper intercepts showSoftInput so that a keyboard is
             // never brought up.
             final ImeAdapter imeAdapter = ImeAdapter.fromWebContents(mWebContentsRef.get());
@@ -143,32 +91,31 @@
             imeAdapter.setInputMethodManagerWrapper(mInputMethodManagerWrapper);
         });
         DOMUtils.waitForNonZeroNodeBounds(mWebContentsRef.get(), "password");
-        KeyboardVisibilityDelegate.setDelegateForTesting(mKeyboard); // Use a fake keyboard.
     }
+
     public void clear() {
-        KeyboardVisibilityDelegate.clearDelegateForTesting();
+        ChromeWindow.resetKeyboardVisibilityDelegateFactory();
     }
 
     public void waitForKeyboard() {
         CriteriaHelper.pollUiThread(() -> {
-            return mActivityTestRule.getKeyboardDelegate().isKeyboardShowing(
-                    InstrumentationRegistry.getContext(),
-                    mActivityTestRule.getActivity().getCurrentFocus());
+            Activity activity = mActivityTestRule.getActivity();
+            return getKeyboard().isAndroidSoftKeyboardShowing(activity, activity.getCurrentFocus());
         });
     }
 
     public void waitForKeyboardToDisappear() {
-        CriteriaHelper.pollUiThread(
-                ()
-                        -> !KeyboardVisibilityDelegate.getInstance().isKeyboardShowing(
-                                InstrumentationRegistry.getContext(),
-                                mActivityTestRule.getActivity().getCurrentFocus()));
+        CriteriaHelper.pollUiThread(() -> {
+            Activity activity = mActivityTestRule.getActivity();
+            return !getKeyboard().isAndroidSoftKeyboardShowing(
+                    activity, activity.getCurrentFocus());
+        });
     }
 
     public void clickPasswordField() throws TimeoutException, InterruptedException {
         DOMUtils.clickNode(mWebContentsRef.get(), "password");
         requestShowKeyboardAccessory();
-        mKeyboard.showKeyboard(null);
+        getKeyboard().showKeyboard(mActivityTestRule.getActivity().getCurrentFocus());
     }
 
     public void clickEmailField(boolean forceAccessory)
@@ -179,7 +126,7 @@
         } else {
             requestHideKeyboardAccessory();
         }
-        mKeyboard.showKeyboard(null);
+        getKeyboard().showKeyboard(mActivityTestRule.getActivity().getCurrentFocus());
     }
 
     public DropdownPopupWindowInterface waitForAutofillPopup(String filterInput)
@@ -222,7 +169,7 @@
      */
     public void clickSubmit() throws TimeoutException, InterruptedException {
         DOMUtils.clickNode(mWebContentsRef.get(), "submit");
-        mKeyboard.hideKeyboard(null);
+        getKeyboard().hideAndroidSoftKeyboard(null);
     }
 
     /**
@@ -264,7 +211,7 @@
                             .withCause(new Throwable("No tab at index " + tabIndex))
                             .build();
                 }
-                tabLayout.getTabAt(tabIndex).select();
+                ThreadUtils.runOnUiThread(() -> tabLayout.getTabAt(tabIndex).select());
             }
         };
     }
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingControllerTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingControllerTest.java
index 513169c..c77c8af 100644
--- a/chrome/android/junit/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingControllerTest.java
+++ b/chrome/android/junit/src/org/chromium/chrome/browser/autofill/keyboard_accessory/ManualFillingControllerTest.java
@@ -55,6 +55,7 @@
 import org.chromium.chrome.test.util.browser.Features.DisableFeatures;
 import org.chromium.chrome.test.util.browser.Features.EnableFeatures;
 import org.chromium.chrome.test.util.browser.modelutil.FakeViewProvider;
+import org.chromium.ui.KeyboardVisibilityDelegate;
 import org.chromium.ui.base.WindowAndroid;
 
 import java.lang.ref.WeakReference;
@@ -71,6 +72,8 @@
     @Mock
     private WindowAndroid mMockWindow;
     @Mock
+    private KeyboardVisibilityDelegate mMockKeyboard;
+    @Mock
     private ChromeActivity mMockActivity;
     @Mock
     private KeyboardAccessoryView mMockKeyboardAccessoryView;
@@ -99,6 +102,7 @@
         ShadowRecordHistogram.reset();
         MockitoAnnotations.initMocks(this);
         when(mMockWindow.getActivity()).thenReturn(new WeakReference<>(mMockActivity));
+        when(mMockWindow.getKeyboardDelegate()).thenReturn(mMockKeyboard);
         when(mMockActivity.getTabModelSelector()).thenReturn(mMockTabModelSelector);
         ChromeFullscreenManager fullscreenManager = new ChromeFullscreenManager(mMockActivity, 0);
         when(mMockActivity.getFullscreenManager()).thenReturn(fullscreenManager);
diff --git a/chrome/browser/android/autofill_assistant/ui_controller_android.cc b/chrome/browser/android/autofill_assistant/ui_controller_android.cc
index 13ca2e8..8f189c9 100644
--- a/chrome/browser/android/autofill_assistant/ui_controller_android.cc
+++ b/chrome/browser/android/autofill_assistant/ui_controller_android.cc
@@ -14,7 +14,9 @@
 #include "base/command_line.h"
 #include "chrome/browser/android/chrome_feature_list.h"
 #include "chrome/browser/autofill/personal_data_manager_factory.h"
+#include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/common/channel_info.h"
 #include "components/autofill_assistant/browser/controller.h"
 #include "components/variations/variations_associated_data.h"
@@ -279,6 +281,24 @@
   return api_key;
 }
 
+identity::IdentityManager*
+UiControllerAndroid::GetIdentityManagerForPrimaryAccount() {
+  Profile* profile = ProfileManager::GetActiveUserProfile();
+  if (!profile) {
+    DLOG(ERROR) << "No active user profile. Cannot authenticate.";
+    return nullptr;
+  }
+  // TODO(crbug.com/806868): Log in as a specific account, instead of always the
+  // primary.
+  identity::IdentityManager* identity_manager =
+      profile ? IdentityManagerFactory::GetForProfile(profile) : nullptr;
+  if (!identity_manager || !identity_manager->HasPrimaryAccount()) {
+    DLOG(ERROR) << "No primary account. Cannot authenticate.";
+    return nullptr;
+  }
+  return identity_manager;
+}
+
 autofill::PersonalDataManager* UiControllerAndroid::GetPersonalDataManager() {
   return autofill::PersonalDataManagerFactory::GetForProfile(
       ProfileManager::GetLastUsedProfile());
diff --git a/chrome/browser/android/autofill_assistant/ui_controller_android.h b/chrome/browser/android/autofill_assistant/ui_controller_android.h
index 40978f3..225cc02 100644
--- a/chrome/browser/android/autofill_assistant/ui_controller_android.h
+++ b/chrome/browser/android/autofill_assistant/ui_controller_android.h
@@ -47,6 +47,7 @@
 
   // Overrides Client:
   std::string GetApiKey() override;
+  identity::IdentityManager* GetIdentityManagerForPrimaryAccount() override;
   autofill::PersonalDataManager* GetPersonalDataManager() override;
   std::string GetServerUrl() override;
   UiController* GetUiController() override;
diff --git a/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc b/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc
index 1b8bb76..aa33412 100644
--- a/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc
+++ b/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_linux.cc
@@ -21,7 +21,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/task/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/threading/scoped_blocking_call.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
 
@@ -48,7 +48,7 @@
 typedef std::map<base::FilePath, base::FilePath> DiskEntries;
 
 std::string GetDiskUuid() {
-  base::AssertBlockingAllowedDeprecated();
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
 
   DiskEntries disk_uuids;
   base::FileEnumerator files(base::FilePath(kDiskByUuidDirectoryName),
@@ -71,7 +71,7 @@
   // Look for first device name matching an entry of |kDeviceNames|.
   std::string result;
   for (size_t i = 0; i < arraysize(kDeviceNames); i++) {
-    auto it = disk_uuids.find(base::FilePath(kDeviceNames[i]));
+    DiskEntries::iterator it = disk_uuids.find(base::FilePath(kDeviceNames[i]));
     if (it != disk_uuids.end()) {
       DVLOG(1) << "Returning uuid: \"" << it->second.value()
                << "\" for device \"" << it->first.value() << "\"";
@@ -85,7 +85,8 @@
   if (result.empty() && !error_logged) {
     error_logged = true;
     LOG(ERROR) << "Could not find appropriate disk uuid.";
-    for (auto it = disk_uuids.begin(); it != disk_uuids.end(); ++it) {
+    for (DiskEntries::iterator it = disk_uuids.begin(); it != disk_uuids.end();
+         ++it) {
       LOG(ERROR) << "  DeviceID=" << it->first.value()
                  << ", uuid=" << it->second.value();
     }
@@ -149,7 +150,7 @@
 
 std::string GetMacAddress(
     const IsValidMacAddressCallback& is_valid_mac_address) {
-  base::AssertBlockingAllowedDeprecated();
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
 
   struct ifaddrs* ifaddrs;
   int rv = getifaddrs(&ifaddrs);
@@ -171,8 +172,6 @@
 
 void GetRawDeviceIdImpl(const IsValidMacAddressCallback& is_valid_mac_address,
                         const DeviceId::IdCallback& callback) {
-  base::AssertBlockingAllowedDeprecated();
-
   std::string disk_id = GetDiskUuid();
   std::string mac_address = GetMacAddress(is_valid_mac_address);
 
diff --git a/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_mac.cc b/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_mac.cc
index 74373c39..107ac47 100644
--- a/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_mac.cc
+++ b/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_mac.cc
@@ -22,7 +22,7 @@
 #include "base/strings/string_util.h"
 #include "base/strings/sys_string_conversions.h"
 #include "base/task/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/threading/scoped_blocking_call.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
 
@@ -40,6 +40,8 @@
 // through the mounted volumes .
 // Return "" if an error occured.
 std::string FindBSDNameOfSystemDisk() {
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
+
   struct statfs* mounted_volumes;
   int num_volumes = getmntinfo(&mounted_volumes, 0);
   if (num_volumes == 0) {
@@ -61,6 +63,8 @@
 // Return the Volume UUID property of a BSD disk name (e.g. '/dev/disk1').
 // Return "" if an error occured.
 std::string GetVolumeUUIDFromBSDName(const std::string& bsd_name) {
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
+
   const CFAllocatorRef allocator = NULL;
 
   base::ScopedCFTypeRef<DASessionRef> session(DASessionCreate(allocator));
@@ -102,8 +106,6 @@
 
 // Return Volume UUID property of disk mounted as "/".
 std::string GetVolumeUUID() {
-  base::AssertBlockingAllowedDeprecated();
-
   std::string result;
   std::string bsd_name = FindBSDNameOfSystemDisk();
   if (!bsd_name.empty()) {
@@ -163,7 +165,7 @@
 
 std::string GetMacAddress(
     const IsValidMacAddressCallback& is_valid_mac_address) {
-  base::AssertBlockingAllowedDeprecated();
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
 
   mach_port_t master_port;
   kern_return_t kr = IOMasterPort(MACH_PORT_NULL, &master_port);
@@ -213,8 +215,6 @@
 
 void GetRawDeviceIdImpl(const IsValidMacAddressCallback& is_valid_mac_address,
                         const DeviceId::IdCallback& callback) {
-  base::AssertBlockingAllowedDeprecated();
-
   std::string raw_device_id;
   std::string mac_address = GetMacAddress(is_valid_mac_address);
   std::string disk_id = GetVolumeUUID();
diff --git a/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_win.cc b/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_win.cc
index 9845d1e9..006e019 100644
--- a/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_win.cc
+++ b/chrome/browser/apps/platform_apps/api/music_manager_private/device_id_win.cc
@@ -23,7 +23,7 @@
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/string_util.h"
 #include "base/task/post_task.h"
-#include "base/threading/thread_restrictions.h"
+#include "base/threading/scoped_blocking_call.h"
 #include "base/win/windows_version.h"
 #include "content/public/browser/browser_task_traits.h"
 #include "content/public/browser/browser_thread.h"
@@ -89,7 +89,7 @@
 
 std::string GetMacAddressFromGetAdaptersAddresses(
     const IsValidMacAddressCallback& is_valid_mac_address) {
-  base::AssertBlockingAllowedDeprecated();
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
 
   // MS recommends a default size of 15k.
   ULONG bufferSize = 15 * 1024;
@@ -124,7 +124,7 @@
 
 std::string GetMacAddressFromGetIfTable2(
     const IsValidMacAddressCallback& is_valid_mac_address) {
-  base::AssertBlockingAllowedDeprecated();
+  base::ScopedBlockingCall scoped_blocking_call(base::BlockingType::MAY_BLOCK);
 
   // This is available on Vista+ only.
   base::ScopedNativeLibrary library(base::FilePath(L"Iphlpapi.dll"));
@@ -162,8 +162,6 @@
 
 void GetMacAddress(const IsValidMacAddressCallback& is_valid_mac_address,
                    const DeviceId::IdCallback& callback) {
-  base::AssertBlockingAllowedDeprecated();
-
   std::string mac_address =
       GetMacAddressFromGetAdaptersAddresses(is_valid_mac_address);
   if (mac_address.empty())
diff --git a/chrome/browser/apps/platform_apps/api/sync_file_system/sync_file_system_browsertest.cc b/chrome/browser/apps/platform_apps/api/sync_file_system/sync_file_system_browsertest.cc
index ab14eb1..8076d041 100644
--- a/chrome/browser/apps/platform_apps/api/sync_file_system/sync_file_system_browsertest.cc
+++ b/chrome/browser/apps/platform_apps/api/sync_file_system/sync_file_system_browsertest.cc
@@ -20,6 +20,7 @@
 #include "components/drive/service/fake_drive_service.h"
 #include "extensions/test/extension_test_message_listener.h"
 #include "extensions/test/result_catcher.h"
+#include "services/identity/public/cpp/identity_manager.h"
 #include "storage/browser/quota/quota_manager.h"
 #include "third_party/leveldatabase/leveldb_chrome.h"
 
@@ -36,7 +37,7 @@
   ~FakeDriveServiceFactory() override {}
 
   std::unique_ptr<drive::DriveServiceInterface> CreateDriveService(
-      OAuth2TokenService* oauth2_token_service,
+      identity::IdentityManager* identity_manager,
       scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
       base::SequencedTaskRunner* blocking_task_runner) override {
     std::unique_ptr<drive::FakeDriveService> drive_service(
@@ -89,7 +90,7 @@
         nullptr,  // notification_manager
         extension_service,
         fake_signin_manager_.get(),  // signin_manager
-        nullptr,                     // token_service
+        nullptr,                     // identity_manager
         nullptr,                     // url_loader_factory
         std::move(drive_service_factory), in_memory_env_.get());
     remote_service_->SetSyncEnabled(true);
diff --git a/chrome/browser/browsing_data/browsing_data_cache_storage_helper.cc b/chrome/browser/browsing_data/browsing_data_cache_storage_helper.cc
index 16601ac..804ec2d 100644
--- a/chrome/browser/browsing_data/browsing_data_cache_storage_helper.cc
+++ b/chrome/browser/browsing_data/browsing_data_cache_storage_helper.cc
@@ -21,7 +21,7 @@
 namespace {
 
 void GetAllOriginsInfoForCacheStorageCallback(
-    const BrowsingDataCacheStorageHelper::FetchCallback& callback,
+    BrowsingDataCacheStorageHelper::FetchCallback callback,
     const std::vector<CacheStorageUsageInfo>& origins) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(!callback.is_null());
@@ -34,7 +34,7 @@
   }
 
   base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
-                           base::BindOnce(callback, result));
+                           base::BindOnce(std::move(callback), result));
 }
 
 }  // namespace
@@ -47,15 +47,14 @@
 
 BrowsingDataCacheStorageHelper::~BrowsingDataCacheStorageHelper() {}
 
-void BrowsingDataCacheStorageHelper::StartFetching(
-    const FetchCallback& callback) {
+void BrowsingDataCacheStorageHelper::StartFetching(FetchCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
   DCHECK(!callback.is_null());
   base::PostTaskWithTraits(
       FROM_HERE, {BrowserThread::IO},
       base::BindOnce(
           &BrowsingDataCacheStorageHelper::FetchCacheStorageUsageInfoOnIOThread,
-          this, callback));
+          this, std::move(callback)));
 }
 
 void BrowsingDataCacheStorageHelper::DeleteCacheStorage(const GURL& origin) {
@@ -68,11 +67,11 @@
 }
 
 void BrowsingDataCacheStorageHelper::FetchCacheStorageUsageInfoOnIOThread(
-    const FetchCallback& callback) {
+    FetchCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
   DCHECK(!callback.is_null());
-  cache_storage_context_->GetAllOriginsInfo(
-      base::Bind(&GetAllOriginsInfoForCacheStorageCallback, callback));
+  cache_storage_context_->GetAllOriginsInfo(base::BindOnce(
+      &GetAllOriginsInfoForCacheStorageCallback, std::move(callback)));
 }
 
 void BrowsingDataCacheStorageHelper::DeleteCacheStorageOnIOThread(
@@ -130,7 +129,7 @@
 }
 
 void CannedBrowsingDataCacheStorageHelper::StartFetching(
-    const FetchCallback& callback) {
+    FetchCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
   DCHECK(!callback.is_null());
 
@@ -144,7 +143,7 @@
   }
 
   base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
-                           base::BindOnce(callback, result));
+                           base::BindOnce(std::move(callback), result));
 }
 
 void CannedBrowsingDataCacheStorageHelper::DeleteCacheStorage(
diff --git a/chrome/browser/browsing_data/browsing_data_cache_storage_helper.h b/chrome/browser/browsing_data/browsing_data_cache_storage_helper.h
index 66c91866..054ec8a 100644
--- a/chrome/browser/browsing_data/browsing_data_cache_storage_helper.h
+++ b/chrome/browser/browsing_data/browsing_data_cache_storage_helper.h
@@ -27,8 +27,8 @@
 class BrowsingDataCacheStorageHelper
     : public base::RefCountedThreadSafe<BrowsingDataCacheStorageHelper> {
  public:
-  using FetchCallback =
-      base::Callback<void(const std::list<content::CacheStorageUsageInfo>&)>;
+  using FetchCallback = base::OnceCallback<void(
+      const std::list<content::CacheStorageUsageInfo>&)>;
 
   // Create a BrowsingDataCacheStorageHelper instance for the Cache Storage
   // stored in |context|'s associated profile's user data directory.
@@ -37,7 +37,7 @@
 
   // Starts the fetching process, which will notify its completion via
   // |callback|. This must be called only in the UI thread.
-  virtual void StartFetching(const FetchCallback& callback);
+  virtual void StartFetching(FetchCallback callback);
   // Requests the Cache Storage data for an origin be deleted.
   virtual void DeleteCacheStorage(const GURL& origin);
 
@@ -54,7 +54,7 @@
   void DeleteCacheStorageOnIOThread(const GURL& origin);
 
   // Enumerates all Cache Storage instances on the IO thread.
-  void FetchCacheStorageUsageInfoOnIOThread(const FetchCallback& callback);
+  void FetchCacheStorageUsageInfoOnIOThread(FetchCallback callback);
 
   DISALLOW_COPY_AND_ASSIGN(BrowsingDataCacheStorageHelper);
 };
@@ -101,9 +101,7 @@
   GetCacheStorageUsageInfo() const;
 
   // BrowsingDataCacheStorageHelper methods.
-  void StartFetching(const base::Callback<
-                     void(const std::list<content::CacheStorageUsageInfo>&)>&
-                         callback) override;
+  void StartFetching(FetchCallback callback) override;
   void DeleteCacheStorage(const GURL& origin) override;
 
  private:
diff --git a/chrome/browser/browsing_data/counters/site_data_counter.cc b/chrome/browser/browsing_data/counters/site_data_counter.cc
index ebec6b33d..999e001 100644
--- a/chrome/browser/browsing_data/counters/site_data_counter.cc
+++ b/chrome/browser/browsing_data/counters/site_data_counter.cc
@@ -4,17 +4,33 @@
 
 #include "chrome/browser/browsing_data/counters/site_data_counter.h"
 
+#include "chrome/browser/browsing_data/counters/browsing_data_counter_utils.h"
 #include "chrome/browser/browsing_data/counters/site_data_counting_helper.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
+#include "components/browser_sync/profile_sync_service.h"
 #include "components/browsing_data/core/pref_names.h"
 #include "content/public/browser/browser_thread.h"
 
 using content::BrowserThread;
 
+namespace {
+bool CheckSyncState(Profile* profile, const syncer::SyncService* sync_service) {
+  return ShouldShowCookieException(profile);
+}
+}  // namespace
+
 SiteDataCounter::SiteDataCounter(Profile* profile)
-    : profile_(profile), weak_ptr_factory_(this) {}
+    : profile_(profile),
+      sync_tracker_(this, ProfileSyncServiceFactory::GetForProfile(profile)),
+      weak_ptr_factory_(this) {}
 
 SiteDataCounter::~SiteDataCounter() {}
 
+void SiteDataCounter::OnInitialized() {
+  sync_tracker_.OnInitialized(
+      base::BindRepeating(&CheckSyncState, base::Unretained(profile_)));
+}
+
 const char* SiteDataCounter::GetPrefName() const {
   return browsing_data::prefs::kDeleteCookies;
 }
diff --git a/chrome/browser/browsing_data/counters/site_data_counter.h b/chrome/browser/browsing_data/counters/site_data_counter.h
index 017dfb6e..d2c1e2de 100644
--- a/chrome/browser/browsing_data/counters/site_data_counter.h
+++ b/chrome/browser/browsing_data/counters/site_data_counter.h
@@ -7,6 +7,7 @@
 
 #include "base/memory/weak_ptr.h"
 #include "components/browsing_data/core/counters/browsing_data_counter.h"
+#include "components/browsing_data/core/counters/sync_tracker.h"
 
 class Profile;
 
@@ -18,10 +19,12 @@
   const char* GetPrefName() const override;
 
  private:
+  void OnInitialized() override;
   void Count() override;
   void Done(int origin_count);
 
   Profile* profile_;
+  browsing_data::SyncTracker sync_tracker_;
   base::WeakPtrFactory<SiteDataCounter> weak_ptr_factory_;
 };
 
diff --git a/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.cc b/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.cc
index d954c57..4e6b761f 100644
--- a/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.cc
+++ b/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.cc
@@ -19,16 +19,16 @@
 
 MockBrowsingDataCacheStorageHelper::~MockBrowsingDataCacheStorageHelper() {}
 
-void MockBrowsingDataCacheStorageHelper::StartFetching(
-    const FetchCallback& callback) {
+void MockBrowsingDataCacheStorageHelper::StartFetching(FetchCallback callback) {
   ASSERT_FALSE(callback.is_null());
   ASSERT_TRUE(callback_.is_null());
-  callback_ = callback;
+  callback_ = std::move(callback);
+  fetched_ = true;
 }
 
 void MockBrowsingDataCacheStorageHelper::DeleteCacheStorage(
     const GURL& origin) {
-  ASSERT_FALSE(callback_.is_null());
+  ASSERT_TRUE(fetched_);
   ASSERT_TRUE(origins_.find(origin) != origins_.end());
   origins_[origin] = false;
 }
@@ -45,7 +45,8 @@
 }
 
 void MockBrowsingDataCacheStorageHelper::Notify() {
-  callback_.Run(response_);
+  ASSERT_FALSE(callback_.is_null());
+  std::move(callback_).Run(response_);
 }
 
 void MockBrowsingDataCacheStorageHelper::Reset() {
diff --git a/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.h b/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.h
index 465322b6..2bb28710 100644
--- a/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.h
+++ b/chrome/browser/browsing_data/mock_browsing_data_cache_storage_helper.h
@@ -36,15 +36,14 @@
   bool AllDeleted();
 
   // BrowsingDataCacheStorageHelper.
-  void StartFetching(const base::Callback<
-                     void(const std::list<content::CacheStorageUsageInfo>&)>&
-                         callback) override;
+  void StartFetching(FetchCallback callback) override;
   void DeleteCacheStorage(const GURL& origin) override;
 
  private:
   ~MockBrowsingDataCacheStorageHelper() override;
 
   FetchCallback callback_;
+  bool fetched_ = false;
   std::map<GURL, bool> origins_;
   std::list<content::CacheStorageUsageInfo> response_;
 
diff --git a/chrome/browser/chrome_browser_field_trials.cc b/chrome/browser/chrome_browser_field_trials.cc
index deb0f896..9a7ea1d 100644
--- a/chrome/browser/chrome_browser_field_trials.cc
+++ b/chrome/browser/chrome_browser_field_trials.cc
@@ -87,17 +87,6 @@
       metrics_dir, upload_dir, ChromeMetricsServiceClient::kBrowserMetricsName,
       &upload_file, &active_file, &spare_file);
 
-  // The "active" file isn't used any longer. Metics are stored directly into
-  // the "upload" file and a run-time filter prevents its upload as long as the
-  // process that created it still lives.
-  // TODO(bcwhite): Remove this in M65 or later.
-  base::PostTaskWithTraits(
-      FROM_HERE,
-      {base::MayBlock(), base::TaskPriority::BEST_EFFORT,
-       base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN},
-      base::BindOnce(base::IgnoreResult(&base::DeleteFile),
-                     std::move(active_file), /*recursive=*/false));
-
   // This is used to report results to an UMA histogram.
   enum InitResult {
     LOCAL_MEMORY_SUCCESS,
@@ -113,9 +102,9 @@
 
   // Create persistent/shared memory and allow histograms to be stored in
   // it. Memory that is not actualy used won't be physically mapped by the
-  // system. BrowserMetrics usage, as reported in UMA, has the 99.9 percentile
-  // around 4MiB as of 2017-02-16.
-  const size_t kAllocSize = 8 << 20;     // 8 MiB
+  // system. BrowserMetrics usage, as reported in UMA, has the 99.99
+  // percentile around 3MiB as of 2018-10-22.
+  const size_t kAllocSize = 4 << 20;     // 4 MiB
   const uint32_t kAllocId = 0x935DDD43;  // SHA1(BrowserMetrics)
   std::string storage = variations::GetVariationParamValueByFeature(
       base::kPersistentHistogramsFeature, "storage");
@@ -135,6 +124,12 @@
   }
 #endif
 
+  // Don't use mapped-file memory by default on low-end devices, especially
+  // on Android. The extra disk consumption and/or extra disk access could
+  // have a significant performance impact. https://crbug.com/896394
+  if (storage.empty() && base::SysInfo::IsLowEndDevice())
+    storage = kLocalMemory;
+
   if (storage.empty() || storage == kMappedFile) {
     if (!base::PathExists(upload_dir)) {
       // Handle failure to create the directory.
diff --git a/chrome/browser/chromeos/crostini/crostini_manager.cc b/chrome/browser/chromeos/crostini/crostini_manager.cc
index 945f225..2c917f4 100644
--- a/chrome/browser/chromeos/crostini/crostini_manager.cc
+++ b/chrome/browser/chromeos/crostini/crostini_manager.cc
@@ -363,6 +363,9 @@
       return;
 
     // Share folders from Downloads, etc with container.
+    // TODO(joelhockey): SharePersistedPaths is getting called on every Restart,
+    // even if the VM is already running.  Only call SharePersistedPaths when
+    // VM starts for the first time.
     SharePersistedPaths(
         profile_,
         base::BindOnce(&CrostiniRestarter::OnPersistedPathsShared, this));
diff --git a/chrome/browser/chromeos/crostini/crostini_share_path.cc b/chrome/browser/chromeos/crostini/crostini_share_path.cc
index 9dc984d..a9868ba1 100644
--- a/chrome/browser/chromeos/crostini/crostini_share_path.cc
+++ b/chrome/browser/chromeos/crostini/crostini_share_path.cc
@@ -11,8 +11,10 @@
 #include "chrome/browser/chromeos/crostini/crostini_manager.h"
 #include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
 #include "chrome/browser/chromeos/crostini/crostini_util.h"
+#include "chrome/browser/chromeos/drive/drive_integration_service.h"
 #include "chrome/browser/chromeos/file_manager/path_util.h"
 #include "chrome/browser/profiles/profile.h"
+#include "chromeos/chromeos_features.h"
 #include "chromeos/chromeos_switches.h"
 #include "chromeos/dbus/concierge/service.pb.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
@@ -43,17 +45,70 @@
     base::OnceCallback<void(bool, std::string)> callback) {
   // Verify path is in one of the allowable mount points.
   // This logic is similar to DownloadPrefs::SanitizeDownloadTargetPath().
-  // TODO(joelhockey):  Seneschal currently only support sharing directories
-  // under Downloads.
-  if (!path.IsAbsolute()) {
+  if (!path.IsAbsolute() || path.ReferencesParent()) {
     std::move(callback).Run(false, "Path must be absolute");
     return;
   }
+
+  vm_tools::seneschal::SharePathRequest request;
+  base::FilePath drivefs_path;
+  base::FilePath relative_path;
+  drive::DriveIntegrationService* integration_service =
+      drive::DriveIntegrationServiceFactory::GetForProfile(profile);
+  base::FilePath drivefs_mount_point_path;
+  base::FilePath drivefs_mount_name;
+
+  // Allow download directory and subdirs.
+  bool allowed_path = false;
   base::FilePath downloads =
       file_manager::util::GetDownloadsFolderForProfile(profile);
-  base::FilePath relative_path;
-  if (!downloads.AppendRelativePath(path, &relative_path)) {
-    std::move(callback).Run(false, "Path must be under Downloads");
+  if (downloads == path || downloads.AppendRelativePath(path, &relative_path)) {
+    allowed_path = true;
+    request.set_storage_location(
+        vm_tools::seneschal::SharePathRequest::DOWNLOADS);
+    request.set_owner_id(crostini::CryptohomeIdForProfile(profile));
+  } else if (base::FeatureList::IsEnabled(chromeos::features::kDriveFs) &&
+             integration_service &&
+             (drivefs_mount_point_path =
+                  integration_service->GetMountPointPath())
+                 .AppendRelativePath(path, &drivefs_path) &&
+             base::FilePath("/media/fuse")
+                 .AppendRelativePath(drivefs_mount_point_path,
+                                     &drivefs_mount_name)) {
+    // Allow subdirs of DriveFS.
+    request.set_drivefs_mount_name(drivefs_mount_name.value());
+    base::FilePath root("root");
+    base::FilePath team_drives("team_drives");
+    base::FilePath computers("Computers");
+    if (root == drivefs_path ||
+        root.AppendRelativePath(drivefs_path, &relative_path)) {
+      // My Drive and subdirs.
+      allowed_path = true;
+      request.set_storage_location(
+          vm_tools::seneschal::SharePathRequest::DRIVEFS_MY_DRIVE);
+    } else if (team_drives == drivefs_path ||
+               team_drives.AppendRelativePath(drivefs_path, &relative_path)) {
+      // Team Drives and subdirs.
+      allowed_path = true;
+      request.set_storage_location(
+          vm_tools::seneschal::SharePathRequest::DRIVEFS_TEAM_DRIVES);
+    } else if (computers == drivefs_path ||
+               computers.AppendRelativePath(drivefs_path, &relative_path)) {
+      // Computers and subdirs.
+      allowed_path = true;
+      request.set_storage_location(
+          vm_tools::seneschal::SharePathRequest::DRIVEFS_COMPUTERS);
+    }
+  } else if (base::FilePath("/media/removable")
+                 .AppendRelativePath(path, &relative_path)) {
+    // Allow subdirs of /media/removable.
+    allowed_path = true;
+    request.set_storage_location(
+        vm_tools::seneschal::SharePathRequest::REMOVABLE);
+  }
+
+  if (!allowed_path) {
+    std::move(callback).Run(false, "Path is not allowed");
     return;
   }
 
@@ -78,13 +133,9 @@
     return;
   }
 
-  vm_tools::seneschal::SharePathRequest request;
   request.set_handle(vm_info->seneschal_server_handle());
   request.mutable_shared_path()->set_path(relative_path.value());
   request.mutable_shared_path()->set_writable(true);
-  request.set_storage_location(
-      vm_tools::seneschal::SharePathRequest::DOWNLOADS);
-  request.set_owner_id(crostini::CryptohomeIdForProfile(profile));
   chromeos::DBusThreadManager::Get()->GetSeneschalClient()->SharePath(
       request, base::BindOnce(&OnSeneschalSharePathResponse, std::move(path),
                               std::move(callback)));
diff --git a/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc b/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc
index e9dcf69..37bc7b3 100644
--- a/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc
+++ b/chrome/browser/chromeos/crostini/crostini_share_path_unittest.cc
@@ -8,17 +8,22 @@
 #include "base/files/file_util.h"
 #include "base/run_loop.h"
 #include "base/sys_info.h"
+#include "base/test/scoped_feature_list.h"
 #include "base/test/scoped_task_environment.h"
 #include "chrome/browser/chromeos/crostini/crostini_manager.h"
 #include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
 #include "chrome/browser/chromeos/crostini/crostini_util.h"
 #include "chrome/browser/chromeos/file_manager/path_util.h"
+#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
 #include "chrome/test/base/testing_profile.h"
+#include "chromeos/chromeos_features.h"
 #include "chromeos/chromeos_switches.h"
 #include "chromeos/dbus/dbus_thread_manager.h"
 #include "chromeos/dbus/fake_cicerone_client.h"
 #include "chromeos/dbus/fake_concierge_client.h"
 #include "chromeos/dbus/fake_seneschal_client.h"
+#include "chromeos/dbus/seneschal/seneschal_service.pb.h"
+#include "components/drive/drive_pref_names.h"
 #include "components/prefs/pref_service.h"
 #include "content/public/test/test_browser_thread_bundle.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -37,8 +42,9 @@
 
     SharePath(profile(), "success", share_path_, true,
               base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
-                             base::Unretained(this), true, true, true, "",
-                             run_loop()->QuitClosure()));
+                             base::Unretained(this), true, true,
+                             &vm_tools::seneschal::SharePathRequest::DOWNLOADS,
+                             "path", true, "", run_loop()->QuitClosure()));
   }
 
   void SharePathErrorSeneschalStartTerminaVmCallback(CrostiniResult result) {
@@ -47,17 +53,23 @@
 
     SharePath(profile(), "error-seneschal", share_path_, true,
               base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
-                             base::Unretained(this), true, true, false,
-                             "test failure", run_loop()->QuitClosure()));
+                             base::Unretained(this), true, true,
+                             &vm_tools::seneschal::SharePathRequest::DOWNLOADS,
+                             "path", false, "test failure",
+                             run_loop()->QuitClosure()));
   }
 
-  void SharePathCallback(bool expected_persist,
-                         bool expected_seneschal_client_called,
-                         bool expected_success,
-                         std::string expected_failure_reason,
-                         base::OnceClosure closure,
-                         bool success,
-                         std::string failure_reason) {
+  void SharePathCallback(
+      bool expected_persist,
+      bool expected_seneschal_client_called,
+      const vm_tools::seneschal::SharePathRequest::StorageLocation*
+          expected_seneschal_storage_location,
+      std::string expected_seneschal_path,
+      bool expected_success,
+      std::string expected_failure_reason,
+      base::OnceClosure closure,
+      bool success,
+      std::string failure_reason) {
     const base::ListValue* prefs =
         profile()->GetPrefs()->GetList(prefs::kCrostiniSharedPaths);
     if (expected_persist) {
@@ -70,6 +82,12 @@
     }
     EXPECT_EQ(fake_seneschal_client_->share_path_called(),
               expected_seneschal_client_called);
+    if (expected_seneschal_client_called) {
+      EXPECT_EQ(fake_seneschal_client_->last_request().storage_location(),
+                *expected_seneschal_storage_location);
+      EXPECT_EQ(fake_seneschal_client_->last_request().shared_path().path(),
+                expected_seneschal_path);
+    }
     EXPECT_EQ(success, expected_success);
     EXPECT_EQ(failure_reason, expected_failure_reason);
     std::move(closure).Run();
@@ -120,9 +138,18 @@
     // before D-Bus is re-initialized for the next test.
     base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
 
+    // Setup for DriveFS.
+    features_.InitAndEnableFeature(chromeos::features::kDriveFs);
+    user_manager.AddUser(AccountId::FromUserEmailGaiaId(
+        profile()->GetProfileUserName(), "12345"));
+    profile()->GetPrefs()->SetString(drive::prefs::kDriveFsProfileSalt, "a");
+    drivefs_ =
+        base::FilePath("/media/fuse/drivefs-84675c855b63e12f384d45f033826980");
+
     // Setup Downloads and path to share.
     downloads_ = file_manager::util::GetDownloadsFolderForProfile(profile());
-    share_path_ = downloads_.AppendASCII("path");
+    share_path_ = downloads_.Append("path");
+
     ASSERT_TRUE(base::CreateDirectory(share_path_));
 
     // Create 'vm-running' VM instance which is running.
@@ -144,6 +171,7 @@
   Profile* profile() { return profile_.get(); }
   base::FilePath downloads_;
   base::FilePath share_path_;
+  base::FilePath drivefs_;
 
   // Owned by chromeos::DBusThreadManager
   chromeos::FakeSeneschalClient* fake_seneschal_client_;
@@ -152,6 +180,9 @@
   std::unique_ptr<base::RunLoop>
       run_loop_;  // run_loop_ must be created on the UI thread.
   std::unique_ptr<TestingProfile> profile_;
+  base::test::ScopedFeatureList features_;
+  chromeos::FakeChromeUserManager user_manager;
+
  private:
   base::test::ScopedTaskEnvironment scoped_task_environment_;
   content::TestBrowserThreadBundle test_browser_thread_bundle_;
@@ -172,11 +203,90 @@
   run_loop()->Run();
 }
 
+TEST_F(CrostiniSharePathTest, SuccessDownloadsRoot) {
+  SharePath(profile(), "vm-running", downloads_, false,
+            base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                           base::Unretained(this), false, true,
+                           &vm_tools::seneschal::SharePathRequest::DOWNLOADS,
+                           "", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
 TEST_F(CrostiniSharePathTest, SuccessNoPersist) {
   SharePath(profile(), "vm-running", share_path_, false,
             base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
-                           base::Unretained(this), false, true, true, "",
-                           run_loop()->QuitClosure()));
+                           base::Unretained(this), false, true,
+                           &vm_tools::seneschal::SharePathRequest::DOWNLOADS,
+                           "path", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, SuccessDriveFsMyDrive) {
+  SharePath(
+      profile(), "vm-running", drivefs_.Append("root").Append("my"), false,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, true,
+                     &vm_tools::seneschal::SharePathRequest::DRIVEFS_MY_DRIVE,
+                     "my", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, SuccessDriveFsMyDriveRoot) {
+  SharePath(
+      profile(), "vm-running", drivefs_.Append("root"), false,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, true,
+                     &vm_tools::seneschal::SharePathRequest::DRIVEFS_MY_DRIVE,
+                     "", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, FailDriveFsRoot) {
+  SharePath(
+      profile(), "vm-running", drivefs_, false,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, false, nullptr, "", false,
+                     "Path is not allowed", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, SuccessDriveFsTeamDrives) {
+  SharePath(profile(), "vm-running",
+            drivefs_.Append("team_drives").Append("team"), false,
+            base::BindOnce(
+                &CrostiniSharePathTest::SharePathCallback,
+                base::Unretained(this), false, true,
+                &vm_tools::seneschal::SharePathRequest::DRIVEFS_TEAM_DRIVES,
+                "team", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, SuccessDriveFsComputers) {
+  SharePath(
+      profile(), "vm-running", drivefs_.Append("Computers").Append("pc"), false,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, true,
+                     &vm_tools::seneschal::SharePathRequest::DRIVEFS_COMPUTERS,
+                     "pc", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, SuccessRemovable) {
+  SharePath(profile(), "vm-running", base::FilePath("/media/removable/MyUSB"),
+            false,
+            base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                           base::Unretained(this), false, true,
+                           &vm_tools::seneschal::SharePathRequest::REMOVABLE,
+                           "MyUSB", true, "", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, FailRemovableRoot) {
+  SharePath(
+      profile(), "vm-running", base::FilePath("/media/removable"), false,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, false, nullptr, "", false,
+                     "Path is not allowed", run_loop()->QuitClosure()));
   run_loop()->Run();
 }
 
@@ -201,28 +311,39 @@
 
 TEST_F(CrostiniSharePathTest, SharePathErrorPathNotAbsolute) {
   const base::FilePath path("not/absolute/dir");
-  SharePath(profile(), "vm-running", path, true,
-            base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
-                           base::Unretained(this), false, false, false,
-                           "Path must be absolute", run_loop()->QuitClosure()));
+  SharePath(
+      profile(), "vm-running", path, true,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, false, nullptr, "", false,
+                     "Path must be absolute", run_loop()->QuitClosure()));
+  run_loop()->Run();
+}
+
+TEST_F(CrostiniSharePathTest, SharePathErrorReferencesParent) {
+  const base::FilePath path("/path/../references/parent");
+  SharePath(
+      profile(), "vm-running", path, false,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, false, nullptr, "", false,
+                     "Path must be absolute", run_loop()->QuitClosure()));
   run_loop()->Run();
 }
 
 TEST_F(CrostiniSharePathTest, SharePathErrorNotUnderDownloads) {
   const base::FilePath path("/not/under/downloads");
-  SharePath(profile(), "vm-running", path, true,
-            base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
-                           base::Unretained(this), false, false, false,
-                           "Path must be under Downloads",
-                           run_loop()->QuitClosure()));
+  SharePath(
+      profile(), "vm-running", path, true,
+      base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
+                     base::Unretained(this), false, false, nullptr, "", false,
+                     "Path is not allowed", run_loop()->QuitClosure()));
   run_loop()->Run();
 }
 
 TEST_F(CrostiniSharePathTest, SharePathErrorVmNotRunning) {
   SharePath(profile(), "error-vm-not-running", share_path_, true,
             base::BindOnce(&CrostiniSharePathTest::SharePathCallback,
-                           base::Unretained(this), true, false, false,
-                           "VM not running", run_loop()->QuitClosure()));
+                           base::Unretained(this), true, false, nullptr, "",
+                           false, "VM not running", run_loop()->QuitClosure()));
   run_loop()->Run();
 }
 
diff --git a/chrome/browser/chromeos/drive/drive_integration_service.cc b/chrome/browser/chromeos/drive/drive_integration_service.cc
index 8c0e66e..487e518 100644
--- a/chrome/browser/chromeos/drive/drive_integration_service.cc
+++ b/chrome/browser/chromeos/drive/drive_integration_service.cc
@@ -36,8 +36,7 @@
 #include "chrome/browser/net/system_network_context_manager.h"
 #include "chrome/browser/profiles/incognito_helpers.h"
 #include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/common/pref_names.h"
 #include "chrome/grit/generated_resources.h"
 #include "chromeos/chromeos_features.h"
@@ -55,8 +54,6 @@
 #include "components/keyed_service/content/browser_context_dependency_manager.h"
 #include "components/prefs/pref_change_registrar.h"
 #include "components/prefs/pref_service.h"
-#include "components/signin/core/browser/profile_oauth2_token_service.h"
-#include "components/signin/core/browser/signin_manager.h"
 #include "components/version_info/version_info.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/browser_thread.h"
@@ -619,8 +616,8 @@
     return;
   }
 
-  ProfileOAuth2TokenService* oauth_service =
-      ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+  identity::IdentityManager* identity_manager =
+      IdentityManagerFactory::GetForProfile(profile);
 
   if (test_drive_service) {
     drive_service_.reset(test_drive_service);
@@ -632,7 +629,7 @@
                                ->GetSharedURLLoaderFactory();
     }
     drive_service_ = std::make_unique<DriveAPIService>(
-        oauth_service, url_loader_factory, blocking_task_runner_.get(),
+        identity_manager, url_loader_factory, blocking_task_runner_.get(),
         GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction),
         GURL(google_apis::DriveApiUrlGenerator::kBaseThumbnailUrlForProduction),
         GetDriveUserAgent(), NO_TRAFFIC_ANNOTATION_YET);
@@ -1065,9 +1062,9 @@
     return;
   }
 
-  SigninManagerBase* signin_manager =
-      SigninManagerFactory::GetForProfile(profile_);
-  drive_service_->Initialize(signin_manager->GetAuthenticatedAccountId());
+  identity::IdentityManager* identity_manager =
+      IdentityManagerFactory::GetForProfile(profile_);
+  drive_service_->Initialize(identity_manager->GetPrimaryAccountId());
 
   if (error != FILE_ERROR_OK) {
     LOG(WARNING) << "Failed to initialize: " << FileErrorToString(error);
@@ -1212,9 +1209,9 @@
 
 DriveIntegrationServiceFactory::DriveIntegrationServiceFactory()
     : BrowserContextKeyedServiceFactory(
-        "DriveIntegrationService",
-        BrowserContextDependencyManager::GetInstance()) {
-  DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance());
+          "DriveIntegrationService",
+          BrowserContextDependencyManager::GetInstance()) {
+  DependsOn(IdentityManagerFactory::GetInstance());
   DependsOn(DriveNotificationManagerFactory::GetInstance());
   DependsOn(DownloadCoreServiceFactory::GetInstance());
 }
diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
index 418d7fc9..44df503f 100644
--- a/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_private_apitest.cc
@@ -14,6 +14,7 @@
 #include "chrome/browser/chromeos/crostini/crostini_manager.h"
 #include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
 #include "chrome/browser/chromeos/crostini/crostini_util.h"
+#include "chrome/browser/chromeos/drive/drivefs_test_support.h"
 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h"
 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h"
 #include "chrome/browser/chromeos/file_manager/file_watcher.h"
@@ -193,6 +194,10 @@
     DCHECK(!event_router_);
   }
 
+  bool SetUpUserDataDirectory() override {
+    return drive::SetUpUserDataDirectoryForDriveFsTest();
+  }
+
   void SetUpOnMainThread() override {
     extensions::ExtensionApiTest::SetUpOnMainThread();
 
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
index c7f75c3..2e520dd0d 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_drive.cc
@@ -34,22 +34,20 @@
 #include "chrome/browser/net/system_network_context_manager.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/common/extensions/api/file_manager_private_internal.h"
 #include "chromeos/chromeos_switches.h"
 #include "chromeos/network/network_handler.h"
 #include "chromeos/network/network_state_handler.h"
 #include "components/drive/chromeos/search_metadata.h"
 #include "components/drive/event_logger.h"
-#include "components/signin/core/browser/profile_oauth2_token_service.h"
-#include "components/signin/core/browser/signin_manager.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/storage_partition.h"
 #include "google_apis/drive/auth_service.h"
 #include "google_apis/drive/drive_api_url_generator.h"
 #include "mojo/public/cpp/bindings/callback_helpers.h"
 #include "net/base/network_change_notifier.h"
+#include "services/identity/public/cpp/identity_manager.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "storage/common/fileapi/file_system_info.h"
 #include "storage/common/fileapi/file_system_util.h"
@@ -1657,11 +1655,9 @@
     return;
   }
   download_url_ = std::move(download_url);
-  ProfileOAuth2TokenService* oauth2_token_service =
-      ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile());
-  SigninManagerBase* signin_manager =
-      SigninManagerFactory::GetForProfile(GetProfile());
-  const std::string& account_id = signin_manager->GetAuthenticatedAccountId();
+  identity::IdentityManager* identity_manager =
+      IdentityManagerFactory::GetForProfile(GetProfile());
+  const std::string& account_id = identity_manager->GetPrimaryAccountId();
   std::vector<std::string> scopes;
   scopes.emplace_back("https://www.googleapis.com/auth/drive.readonly");
 
@@ -1669,7 +1665,7 @@
       content::BrowserContext::GetDefaultStoragePartition(GetProfile())
           ->GetURLLoaderFactoryForBrowserProcess();
   auth_service_ = std::make_unique<google_apis::AuthService>(
-      oauth2_token_service, account_id, url_loader_factory, scopes);
+      identity_manager, account_id, url_loader_factory, scopes);
   auth_service_->StartAuthentication(base::Bind(
       &FileManagerPrivateInternalGetDownloadUrlFunction::OnTokenFetched, this));
 }
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
index e24ca3f..09cc8b7c 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_misc.cc
@@ -41,8 +41,7 @@
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
 #include "chrome/browser/profiles/profiles_state.h"
-#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
 #include "chrome/browser/ui/chrome_pages.h"
@@ -55,8 +54,6 @@
 #include "components/drive/drive_pref_names.h"
 #include "components/drive/event_logger.h"
 #include "components/prefs/pref_service.h"
-#include "components/signin/core/browser/profile_oauth2_token_service.h"
-#include "components/signin/core/browser/signin_manager.h"
 #include "components/user_manager/user_manager.h"
 #include "components/zoom/page_zoom.h"
 #include "content/public/browser/web_contents.h"
@@ -67,6 +64,7 @@
 #include "extensions/browser/app_window/app_window_registry.h"
 #include "google_apis/drive/auth_service.h"
 #include "net/base/hex_utils.h"
+#include "services/identity/public/cpp/identity_manager.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 #include "storage/common/fileapi/file_system_types.h"
 #include "ui/base/webui/web_ui_util.h"
@@ -358,24 +356,22 @@
   std::vector<std::string> scopes;
   scopes.emplace_back(kCWSScope);
 
-  ProfileOAuth2TokenService* oauth_service =
-      ProfileOAuth2TokenServiceFactory::GetForProfile(GetProfile());
+  identity::IdentityManager* identity_manager =
+      IdentityManagerFactory::GetForProfile(GetProfile());
 
-  if (!oauth_service) {
+  if (!identity_manager) {
     drive::EventLogger* logger = file_manager::util::GetLogger(GetProfile());
     if (logger) {
       logger->Log(logging::LOG_ERROR,
-                  "CWS OAuth token fetch failed. OAuth2TokenService can't "
+                  "CWS Access token fetch failed. IdentityManager can't "
                   "be retrieved.");
     }
     SetResult(std::make_unique<base::Value>());
     return false;
   }
 
-  SigninManagerBase* signin_manager =
-      SigninManagerFactory::GetForProfile(GetProfile());
   auth_service_ = std::make_unique<google_apis::AuthService>(
-      oauth_service, signin_manager->GetAuthenticatedAccountId(),
+      identity_manager, identity_manager->GetPrimaryAccountId(),
       g_browser_process->system_network_context_manager()
           ->GetSharedURLLoaderFactory(),
       scopes);
diff --git a/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc b/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc
index 52400242..96739ed 100644
--- a/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc
+++ b/chrome/browser/chromeos/extensions/file_manager/private_api_strings.cc
@@ -14,6 +14,7 @@
 #include "chrome/browser/chromeos/login/demo_mode/demo_session.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/grit/generated_resources.h"
+#include "chromeos/chromeos_features.h"
 #include "chromeos/system/statistics_provider.h"
 #include "components/strings/grit/components_strings.h"
 #include "extensions/common/extension_l10n_util.h"
@@ -836,6 +837,8 @@
   // TODO(crbug.com/868747): Find a better solution for demo mode.
   dict->SetBoolean("HIDE_SPACE_INFO",
                    chromeos::DemoSession::IsDeviceInDemoMode());
+  dict->SetBoolean("DRIVE_FS_ENABLED",
+                   base::FeatureList::IsEnabled(chromeos::features::kDriveFs));
   dict->SetString("CHROMEOS_RELEASE_BOARD",
                   base::SysInfo::GetLsbReleaseBoard());
   dict->SetString(
diff --git a/chrome/browser/chromeos/file_manager/path_util.cc b/chrome/browser/chromeos/file_manager/path_util.cc
index a5cfd82..ebf2b6d 100644
--- a/chrome/browser/chromeos/file_manager/path_util.cc
+++ b/chrome/browser/chromeos/file_manager/path_util.cc
@@ -23,6 +23,7 @@
 #include "chrome/browser/download/download_prefs.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/grit/generated_resources.h"
+#include "chromeos/chromeos_features.h"
 #include "components/drive/file_system_core_util.h"
 #include "components/user_manager/user.h"
 #include "components/user_manager/user_manager.h"
@@ -40,6 +41,8 @@
 
 constexpr char kDownloadsFolderName[] = "Downloads";
 constexpr char kGoogleDriveDisplayName[] = "Google Drive";
+constexpr char kMyDriveDisplayName[] = "My Drive";
+constexpr char kTeamDrivesDisplayName[] = "Team Drives";
 constexpr char kRootRelativeToDriveMount[] = "root";
 constexpr char kTeamDrivesRelativeToDriveMount[] = "team_drives";
 constexpr char kComputersRelativeToDriveMount[] = "Computers";
@@ -184,26 +187,50 @@
     const storage::FileSystemURL& file_system_url,
     base::FilePath* inside) {
   const std::string& id(file_system_url.mount_filesystem_id());
+  base::FilePath path(file_system_url.virtual_path());
   std::string mount_point_name_crostini = GetCrostiniMountPointName(profile);
   std::string mount_point_name_downloads = GetDownloadsMountPointName(profile);
+  // Include drive if using DriveFS.
+  std::string mount_point_name_drive;
+  auto* integration_service =
+      drive::DriveIntegrationServiceFactory::FindForProfile(profile);
+  if (base::FeatureList::IsEnabled(chromeos::features::kDriveFs) &&
+      integration_service) {
+    mount_point_name_drive =
+        integration_service->GetMountPointPath().BaseName().value();
+  }
 
   // Reformat virtual_path() from:
   //   <mount_label>/path/to/file
   // To either:
-  //   /<home-directory>/path/to/file     (path is already in crostini volume)
-  //   /ChromeOS/<volume_id>/path/to/file (path is shared with crostini)
-  base::FilePath folder;
+  //   /<home-directory>/path/to/file   (path is already in crostini volume)
+  //   /ChromeOS/<mapping>/path/to/file (path is shared with crostini)
+  base::FilePath base_to_exclude(id);
   if (id == mount_point_name_crostini) {
-    folder = base::FilePath(mount_point_name_crostini);
     *inside = crostini::ContainerHomeDirectoryForProfile(profile);
   } else if (id == mount_point_name_downloads) {
-    folder = base::FilePath(mount_point_name_downloads);
     *inside =
         crostini::ContainerChromeOSBaseDirectory().Append(kDownloadsFolderName);
+  } else if (id == mount_point_name_drive) {
+    // DriveFS has some more complicated mappings.
+    std::vector<base::FilePath::StringType> components;
+    path.GetComponents(&components);
+    *inside = crostini::ContainerChromeOSBaseDirectory().Append(
+        kGoogleDriveDisplayName);
+    if (components.size() >= 2 && components[1] == kRootRelativeToDriveMount) {
+      // root -> My Drive.
+      base_to_exclude = base_to_exclude.Append(kRootRelativeToDriveMount);
+      *inside = inside->Append(kMyDriveDisplayName);
+    } else if (components.size() >= 2 &&
+               components[1] == kTeamDrivesRelativeToDriveMount) {
+      // team_drives -> Team Drives.
+      base_to_exclude = base_to_exclude.Append(kTeamDrivesRelativeToDriveMount);
+      *inside = inside->Append(kTeamDrivesDisplayName);
+    }
   } else {
     return false;
   }
-  return folder.AppendRelativePath(file_system_url.virtual_path(), inside);
+  return base_to_exclude.AppendRelativePath(path, inside);
 }
 
 bool ConvertPathToArcUrl(const base::FilePath& path, GURL* arc_url_out) {
diff --git a/chrome/browser/chromeos/file_manager/path_util_unittest.cc b/chrome/browser/chromeos/file_manager/path_util_unittest.cc
index ced5939f..a87e9ab4 100644
--- a/chrome/browser/chromeos/file_manager/path_util_unittest.cc
+++ b/chrome/browser/chromeos/file_manager/path_util_unittest.cc
@@ -92,13 +92,8 @@
         new FakeDiskMountManager);
     TestingProfile profile2(base::FilePath("/home/chronos/u-0123456789abcdef"));
     chromeos::FakeChromeUserManager user_manager;
-    AccountId account_id =
-        AccountId::FromUserEmailGaiaId(profile2.GetProfileUserName(), "12345");
-    const auto* user = user_manager.AddUser(account_id);
-    chromeos::ProfileHelper::Get()->SetUserToProfileMappingForTesting(
-        user, &profile2);
-    chromeos::ProfileHelper::Get()->SetProfileToUserMappingForTesting(
-        const_cast<user_manager::User*>(user));
+    user_manager.AddUser(
+        AccountId::FromUserEmailGaiaId(profile2.GetProfileUserName(), "12345"));
     PrefService* prefs = profile2.GetPrefs();
     prefs->SetString(drive::prefs::kDriveFsProfileSalt, "a");
 
@@ -162,24 +157,38 @@
 
 TEST(FileManagerPathUtilTest, ConvertFileSystemURLToPathInsideCrostini) {
   content::TestBrowserThreadBundle thread_bundle;
+  content::TestServiceManagerContext service_manager_context;
 
-  TestingProfile profile;
+  // Setup for DriveFS.
+  base::test::ScopedFeatureList features;
+  features.InitAndEnableFeature(chromeos::features::kDriveFs);
+  TestingProfile profile(base::FilePath("/home/chronos/u-0123456789abcdef"));
+  chromeos::FakeChromeUserManager user_manager;
+  user_manager.AddUser(
+      AccountId::FromUserEmailGaiaId(profile.GetProfileUserName(), "12345"));
+  profile.GetPrefs()->SetString(drive::prefs::kDriveFsProfileSalt, "a");
+
+  // Register crostini, downloads, drive.
   storage::ExternalMountPoints* mount_points =
       storage::ExternalMountPoints::GetSystemInstance();
-
-  // Register crostini and downloads.
   mount_points->RegisterFileSystem(
       GetCrostiniMountPointName(&profile), storage::kFileSystemTypeNativeLocal,
       storage::FileSystemMountOption(), GetCrostiniMountDirectory(&profile));
   mount_points->RegisterFileSystem(
       GetDownloadsMountPointName(&profile), storage::kFileSystemTypeNativeLocal,
       storage::FileSystemMountOption(), GetDownloadsFolderForProfile(&profile));
+  drive::DriveIntegrationService* integration_service =
+      drive::DriveIntegrationServiceFactory::GetForProfile(&profile);
+  base::FilePath mount_point_drive = integration_service->GetMountPointPath();
+  mount_points->RegisterFileSystem(
+      mount_point_drive.BaseName().value(), storage::kFileSystemTypeNativeLocal,
+      storage::FileSystemMountOption(), mount_point_drive);
 
   base::FilePath inside;
   EXPECT_TRUE(ConvertFileSystemURLToPathInsideCrostini(
       &profile,
       mount_points->CreateExternalFileSystemURL(
-          GURL(), "crostini_test_termina_penguin",
+          GURL(), "crostini_0123456789abcdef_termina_penguin",
           base::FilePath("path/in/crostini")),
       &inside));
   EXPECT_EQ("/home/testing_profile/path/in/crostini", inside.value());
@@ -187,7 +196,8 @@
   EXPECT_TRUE(ConvertFileSystemURLToPathInsideCrostini(
       &profile,
       mount_points->CreateExternalFileSystemURL(
-          GURL(), "Downloads", base::FilePath("path/in/downloads")),
+          GURL(), "Downloads-testing_profile-hash",
+          base::FilePath("path/in/downloads")),
       &inside));
   EXPECT_EQ("/ChromeOS/Downloads/path/in/downloads", inside.value());
 
@@ -196,6 +206,32 @@
       mount_points->CreateExternalFileSystemURL(
           GURL(), "unknown", base::FilePath("path/in/unknown")),
       &inside));
+
+  EXPECT_TRUE(ConvertFileSystemURLToPathInsideCrostini(
+      &profile,
+      mount_points->CreateExternalFileSystemURL(
+          GURL(), "drivefs-84675c855b63e12f384d45f033826980",
+          base::FilePath("root/path/in/mydrive")),
+      &inside));
+  EXPECT_EQ("/ChromeOS/Google Drive/My Drive/path/in/mydrive", inside.value());
+
+  EXPECT_TRUE(ConvertFileSystemURLToPathInsideCrostini(
+      &profile,
+      mount_points->CreateExternalFileSystemURL(
+          GURL(), "drivefs-84675c855b63e12f384d45f033826980",
+          base::FilePath("team_drives/path/in/teamdrives")),
+      &inside));
+  EXPECT_EQ("/ChromeOS/Google Drive/Team Drives/path/in/teamdrives",
+            inside.value());
+
+  EXPECT_TRUE(ConvertFileSystemURLToPathInsideCrostini(
+      &profile,
+      mount_points->CreateExternalFileSystemURL(
+          GURL(), "drivefs-84675c855b63e12f384d45f033826980",
+          base::FilePath("Computers/path/in/computers")),
+      &inside));
+  EXPECT_EQ("/ChromeOS/Google Drive/Computers/path/in/computers",
+            inside.value());
 }
 
 std::unique_ptr<KeyedService> CreateFileSystemOperationRunnerForTesting(
diff --git a/chrome/browser/devtools/device/tcp_device_provider.cc b/chrome/browser/devtools/device/tcp_device_provider.cc
index 0545af2..70bf55e3 100644
--- a/chrome/browser/devtools/device/tcp_device_provider.cc
+++ b/chrome/browser/devtools/device/tcp_device_provider.cc
@@ -166,5 +166,5 @@
     network::mojom::HostResolverRequest request) {
   g_browser_process->system_network_context_manager()
       ->GetContext()
-      ->CreateHostResolver(std::move(request));
+      ->CreateHostResolver(base::nullopt, std::move(request));
 }
diff --git a/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h b/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
index 34765edc..5461d856 100644
--- a/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
+++ b/chrome/browser/page_load_metrics/page_load_metrics_update_dispatcher.h
@@ -62,7 +62,6 @@
   INVALID_ORDER_FIRST_PAINT_FIRST_CONTENTFUL_PAINT,
   INVALID_ORDER_FIRST_PAINT_FIRST_MEANINGFUL_PAINT,
   INVALID_ORDER_FIRST_MEANINGFUL_PAINT_PAGE_INTERACTIVE,
-  INVALID_ORDER_FIRST_CONTENTFUL_PAINT_LARGEST_IMAGE_PAINT,
 
   // We received a first input delay without a first input timestamp.
   INVALID_NULL_FIRST_INPUT_TIMESTAMP,
diff --git a/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc
index e64bc00..fe306a2 100644
--- a/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc
+++ b/chrome/browser/safe_browsing/download_protection/download_protection_service_unittest.cc
@@ -266,7 +266,9 @@
     // |test_event_router_| is owned by KeyedServiceFactory.
     test_event_router_ = extensions::CreateAndUseTestEventRouter(profile());
     extensions::SafeBrowsingPrivateEventRouterFactory::GetInstance()
-        ->SetTestingFactory(profile(), BuildSafeBrowsingPrivateEventRouter);
+        ->SetTestingFactory(
+            profile(),
+            base::BindRepeating(&BuildSafeBrowsingPrivateEventRouter));
   }
 
   void TearDown() override {
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service_unittest.cc b/chrome/browser/supervised_user/child_accounts/child_account_service_unittest.cc
index 1b1ce0a..1e7353b 100644
--- a/chrome/browser/supervised_user/child_accounts/child_account_service_unittest.cc
+++ b/chrome/browser/supervised_user/child_accounts/child_account_service_unittest.cc
@@ -31,9 +31,10 @@
   void SetUp() override {
     TestingProfile::Builder builder;
     builder.AddTestingFactory(ChromeSigninClientFactory::GetInstance(),
-                              BuildTestSigninClient);
-    builder.AddTestingFactory(GaiaCookieManagerServiceFactory::GetInstance(),
-                              BuildFakeGaiaCookieManagerService);
+                              base::BindRepeating(&BuildTestSigninClient));
+    builder.AddTestingFactory(
+        GaiaCookieManagerServiceFactory::GetInstance(),
+        base::BindRepeating(&BuildFakeGaiaCookieManagerService));
     profile_ = builder.Build();
     gaia_cookie_manager_service_ = static_cast<FakeGaiaCookieManagerService*>(
         GaiaCookieManagerServiceFactory::GetForProfile(profile_.get()));
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
index 7794de9..dd77cf7 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.cc
@@ -17,7 +17,7 @@
 #include "chrome/browser/drive/drive_notification_manager_factory.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/signin/profile_oauth2_token_service_factory.h"
+#include "chrome/browser/signin/identity_manager_factory.h"
 #include "chrome/browser/signin/signin_manager_factory.h"
 #include "chrome/browser/sync_file_system/drive_backend/callback_helper.h"
 #include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h"
@@ -46,7 +46,6 @@
 #include "components/drive/drive_uploader.h"
 #include "components/drive/service/drive_api_service.h"
 #include "components/drive/service/drive_service_interface.h"
-#include "components/signin/core/browser/profile_oauth2_token_service.h"
 #include "components/signin/core/browser/signin_manager.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/network_service_instance.h"
@@ -61,6 +60,7 @@
 #include "net/traffic_annotation/network_traffic_annotation.h"
 #include "services/device/public/mojom/constants.mojom.h"
 #include "services/device/public/mojom/wake_lock_provider.mojom.h"
+#include "services/identity/public/cpp/identity_manager.h"
 #include "services/service_manager/public/cpp/connector.h"
 #include "storage/browser/blob/scoped_file.h"
 #include "storage/common/fileapi/file_system_util.h"
@@ -96,12 +96,12 @@
 
 std::unique_ptr<drive::DriveServiceInterface>
 SyncEngine::DriveServiceFactory::CreateDriveService(
-    OAuth2TokenService* oauth2_token_service,
+    identity::IdentityManager* identity_manager,
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
     base::SequencedTaskRunner* blocking_task_runner) {
   return std::unique_ptr<
       drive::DriveServiceInterface>(new drive::DriveAPIService(
-      oauth2_token_service, url_loader_factory, blocking_task_runner,
+      identity_manager, url_loader_factory, blocking_task_runner,
       GURL(google_apis::DriveApiUrlGenerator::kBaseUrlForProduction),
       GURL(google_apis::DriveApiUrlGenerator::kBaseThumbnailUrlForProduction),
       std::string(), /* custom_user_agent */
@@ -213,8 +213,8 @@
       extensions::ExtensionSystem::Get(context)->extension_service();
   SigninManagerBase* signin_manager =
       SigninManagerFactory::GetForProfile(profile);
-  OAuth2TokenService* token_service =
-      ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+  identity::IdentityManager* identity_manager =
+      IdentityManagerFactory::GetForProfile(profile);
   scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory =
       content::BrowserContext::GetDefaultStoragePartition(context)
           ->GetURLLoaderFactoryForBrowserProcess();
@@ -222,7 +222,7 @@
   std::unique_ptr<drive_backend::SyncEngine> sync_engine(new SyncEngine(
       ui_task_runner.get(), worker_task_runner.get(), drive_task_runner.get(),
       GetSyncFileSystemDir(context->GetPath()), task_logger,
-      notification_manager, extension_service, signin_manager, token_service,
+      notification_manager, extension_service, signin_manager, identity_manager,
       url_loader_factory, std::make_unique<DriveServiceFactory>(),
       nullptr /* env_override */));
 
@@ -237,7 +237,7 @@
   factories->insert(SigninManagerFactory::GetInstance());
   factories->insert(
       extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
-  factories->insert(ProfileOAuth2TokenServiceFactory::GetInstance());
+  factories->insert(IdentityManagerFactory::GetInstance());
 }
 
 SyncEngine::~SyncEngine() {
@@ -277,7 +277,7 @@
   DCHECK(drive_service_factory_);
   std::unique_ptr<drive::DriveServiceInterface> drive_service =
       drive_service_factory_->CreateDriveService(
-          token_service_, url_loader_factory_, drive_task_runner_.get());
+          identity_manager_, url_loader_factory_, drive_task_runner_.get());
 
   device::mojom::WakeLockProviderPtr wake_lock_provider(nullptr);
   DCHECK(content::ServiceManagerConnection::GetForProcess());
@@ -733,7 +733,7 @@
     drive::DriveNotificationManager* notification_manager,
     extensions::ExtensionServiceInterface* extension_service,
     SigninManagerBase* signin_manager,
-    OAuth2TokenService* token_service,
+    identity::IdentityManager* identity_manager,
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
     std::unique_ptr<DriveServiceFactory> drive_service_factory,
     leveldb::Env* env_override)
@@ -745,7 +745,7 @@
       notification_manager_(notification_manager),
       extension_service_(extension_service),
       signin_manager_(signin_manager),
-      token_service_(token_service),
+      identity_manager_(identity_manager),
       url_loader_factory_(url_loader_factory),
       drive_service_factory_(std::move(drive_service_factory)),
       remote_change_processor_(nullptr),
diff --git a/chrome/browser/sync_file_system/drive_backend/sync_engine.h b/chrome/browser/sync_file_system/drive_backend/sync_engine.h
index eb34829e..a7a4357 100644
--- a/chrome/browser/sync_file_system/drive_backend/sync_engine.h
+++ b/chrome/browser/sync_file_system/drive_backend/sync_engine.h
@@ -24,8 +24,6 @@
 #include "services/network/public/cpp/network_connection_tracker.h"
 #include "services/network/public/cpp/shared_url_loader_factory.h"
 
-class OAuth2TokenService;
-
 namespace base {
 class SequencedTaskRunner;
 }
@@ -40,6 +38,10 @@
 class ExtensionServiceInterface;
 }
 
+namespace identity {
+class IdentityManager;
+}
+
 namespace leveldb {
 class Env;
 }
@@ -76,7 +78,7 @@
     DriveServiceFactory() {}
     virtual ~DriveServiceFactory() {}
     virtual std::unique_ptr<drive::DriveServiceInterface> CreateDriveService(
-        OAuth2TokenService* oauth2_token_service,
+        identity::IdentityManager* identity_manager,
         scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
         base::SequencedTaskRunner* blocking_task_runner);
 
@@ -169,7 +171,7 @@
              drive::DriveNotificationManager* notification_manager,
              extensions::ExtensionServiceInterface* extension_service,
              SigninManagerBase* signin_manager,
-             OAuth2TokenService* token_service,
+             identity::IdentityManager* identity_manager,
              scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
              std::unique_ptr<DriveServiceFactory> drive_service_factory,
              leveldb::Env* env_override);
@@ -200,7 +202,7 @@
   drive::DriveNotificationManager* notification_manager_;
   extensions::ExtensionServiceInterface* extension_service_;
   SigninManagerBase* signin_manager_;
-  OAuth2TokenService* token_service_;
+  identity::IdentityManager* identity_manager_;
 
   scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
 
diff --git a/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc b/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc
index 0fc7db47..c1851e3 100644
--- a/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc
+++ b/chrome/browser/ui/views/frame/top_controls_slide_controller_chromeos_browsertest.cc
@@ -938,8 +938,9 @@
   CheckBrowserLayout(browser_view(), TopChromeShownState::kFullyHidden);
 }
 
+// Flaky: https://crbug.com/898502
 IN_PROC_BROWSER_TEST_F(TopControlsSlideControllerTest,
-                       TestIntermediateSliding) {
+                       DISABLED_TestIntermediateSliding) {
   ToggleTabletMode();
   ASSERT_TRUE(GetTabletModeEnabled());
   EXPECT_TRUE(top_controls_slide_controller()->IsEnabled());
diff --git a/chrome/credential_provider/gaiacp/BUILD.gn b/chrome/credential_provider/gaiacp/BUILD.gn
index 771abce..34bdaa56 100644
--- a/chrome/credential_provider/gaiacp/BUILD.gn
+++ b/chrome/credential_provider/gaiacp/BUILD.gn
@@ -38,7 +38,10 @@
     # Needed in order to include the win32 header security.h.
     "SECURITY_WIN32",
   ]
-  libs = [ "secur32.lib" ]  # For LsaXXX functions
+  libs = [
+    "secur32.lib",  # For LsaXXX functions
+    "wbemuuid.lib",  # For CLSID_WbemLocator
+  ]
 }
 
 # This static library is shared with the test code.
diff --git a/chrome/credential_provider/gaiacp/gcp_utils.cc b/chrome/credential_provider/gaiacp/gcp_utils.cc
index abb0327..3310bdf 100644
--- a/chrome/credential_provider/gaiacp/gcp_utils.cc
+++ b/chrome/credential_provider/gaiacp/gcp_utils.cc
@@ -13,7 +13,11 @@
 #include <ntsecapi.h>         // For LsaLookupAuthenticationPackage()
 #include <sddl.h>             // For ConvertSidToStringSid()
 #include <security.h>         // For NEGOSSP_NAME_A
+#include <wbemidl.h>
 
+#include <atlbase.h>
+#include <atlcom.h>
+#include <atlcomcli.h>
 #include <atlconv.h>
 
 #include <malloc.h>
@@ -23,8 +27,10 @@
 #include <iomanip>
 #include <memory>
 
+#include "base/base64.h"
 #include "base/command_line.h"
 #include "base/files/file_path.h"
+#include "base/json/json_writer.h"
 #include "base/macros.h"
 #include "base/path_service.h"
 #include "base/scoped_native_library.h"
@@ -43,7 +49,7 @@
 
 HRESULT RegisterWithGoogleDeviceManagement(const base::string16& mdm_url,
                                            const base::string16& email,
-                                           const base::string16& token) {
+                                           const std::string& data) {
   base::ScopedNativeLibrary library(
       base::FilePath(FILE_PATH_LITERAL("MDMRegistration.dll")));
   if (!library.is_valid()) {
@@ -62,8 +68,10 @@
     return E_NOTIMPL;
   }
 
+  std::string data_encoded;
+  base::Base64Encode(data, &data_encoded);
   return register_device_with_management_function(
-      email.c_str(), mdm_url.c_str(), token.c_str());
+      email.c_str(), mdm_url.c_str(), base::UTF8ToWide(data_encoded).c_str());
 }
 
 }  // namespace
@@ -442,6 +450,74 @@
   return wcsicmp(wcsrchr(path, L'.'), L".dll") == 0 ? S_OK : S_FALSE;
 }
 
+// Gets the serial number of the machine based on the recipe found at
+// https://docs.microsoft.com/en-us/windows/desktop/WmiSdk/example-creating-a-wmi-application
+HRESULT GetMachineSerialNumber(base::string16* serial_number) {
+  USES_CONVERSION;
+  DCHECK(serial_number);
+
+  serial_number->clear();
+
+  // Make sure COM is initialized.
+  HRESULT hr = ::CoInitializeEx(nullptr, COINIT_MULTITHREADED);
+  if (FAILED(hr)) {
+    LOGFN(ERROR) << "CoInitializeEx hr=" << putHR(hr);
+    return hr;
+  }
+
+  hr = ::CoInitializeSecurity(
+      nullptr, -1, nullptr, nullptr, RPC_C_AUTHN_LEVEL_DEFAULT,
+      RPC_C_IMP_LEVEL_IMPERSONATE, nullptr, EOAC_NONE, nullptr);
+  if (FAILED(hr)) {
+    LOGFN(ERROR) << "CoInitializeSecurity hr=" << putHR(hr);
+    return hr;
+  }
+
+  CComPtr<IWbemLocator> locator;
+  hr = locator.CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER);
+  if (FAILED(hr)) {
+    LOGFN(ERROR) << "CoCreateInstance(CLSID_WbemLocator) hr=" << putHR(hr);
+    return hr;
+  }
+
+  CComPtr<IWbemServices> services;
+  hr = locator->ConnectServer(CComBSTR(W2COLE(L"ROOT\\CIMV2")), nullptr,
+                              nullptr, nullptr, 0, nullptr, nullptr, &services);
+  if (FAILED(hr)) {
+    LOGFN(ERROR) << "locator->ConnectServer hr=" << putHR(hr);
+    return hr;
+  }
+
+  CComPtr<IEnumWbemClassObject> enum_wbem;
+  hr = services->ExecQuery(CComBSTR(W2COLE(L"WQL")),
+                           CComBSTR(W2COLE(L"select * from Win32_Bios")),
+                           WBEM_FLAG_FORWARD_ONLY, nullptr, &enum_wbem);
+  if (FAILED(hr)) {
+    LOGFN(ERROR) << "services->ExecQuery hr=" << putHR(hr);
+    return hr;
+  }
+
+  while (SUCCEEDED(hr) && serial_number->empty()) {
+    CComPtr<IWbemClassObject> class_obj;
+    ULONG count = 1;
+    hr = enum_wbem->Next(WBEM_INFINITE, 1, &class_obj, &count);
+    if (count == 0)
+      break;
+
+    VARIANT var;
+    hr = class_obj->Get(L"SerialNumber", 0, &var, 0, 0);
+    if (SUCCEEDED(hr) && var.vt == VT_BSTR)
+      serial_number->assign(OLE2CW(var.bstrVal));
+
+    VariantClear(&var);
+  }
+
+  LOGFN(INFO) << "GetMachineSerialNumber sn=" << *serial_number
+              << " hr=" << putHR(hr);
+
+  return hr;
+}
+
 HRESULT EnrollToGoogleMdmIfNeeded(const base::DictionaryValue& properties) {
   USES_CONVERSION;
   LOGFN(INFO);
@@ -475,7 +551,25 @@
     LOGFN(INFO) << "MDM_URL=" << mdm_url
                 << " token=" << base::string16(token.c_str(), 10);
 
-    hr = RegisterWithGoogleDeviceManagement(mdm_url, email, token);
+    // Build the json data needed by the server.
+    base::DictionaryValue registration_data;
+    base::string16 serial_number;
+    hr = GetMachineSerialNumber(&serial_number);
+    if (FAILED(hr)) {
+      LOGFN(ERROR) << "GetMachineSerialNumber hr=" << putHR(hr);
+      return hr;
+    }
+
+    registration_data.SetString("serial_number", serial_number);
+    registration_data.SetString("access_token", token);
+    std::string registration_data_str;
+    if (!base::JSONWriter::Write(registration_data, &registration_data_str)) {
+      LOGFN(ERROR) << "JSONWriter::Write(registration_data)";
+      return E_FAIL;
+    }
+
+    hr = RegisterWithGoogleDeviceManagement(mdm_url, email,
+                                            registration_data_str);
     LOGFN(INFO) << "RegisterWithGoogleDeviceManagement hr=" << putHR(hr);
   }
 
diff --git a/chrome/test/data/extensions/api_test/file_browser/crostini_test/test.js b/chrome/test/data/extensions/api_test/file_browser/crostini_test/test.js
index 49a845f..4ea596c5 100644
--- a/chrome/test/data/extensions/api_test/file_browser/crostini_test/test.js
+++ b/chrome/test/data/extensions/api_test/file_browser/crostini_test/test.js
@@ -48,7 +48,7 @@
     getEntry('testing', 'test_dir').then((entry) => {
       chrome.fileManagerPrivate.sharePathsWithCrostini(
           [entry], true,
-          chrome.test.callbackFail('Path must be under Downloads'));
+          chrome.test.callbackFail('Path is not allowed'));
     });
   },
   function testGetCrostiniSharedPaths() {
diff --git a/chromeos/dbus/fake_seneschal_client.cc b/chromeos/dbus/fake_seneschal_client.cc
index a73cca48..897c753 100644
--- a/chromeos/dbus/fake_seneschal_client.cc
+++ b/chromeos/dbus/fake_seneschal_client.cc
@@ -21,6 +21,7 @@
     const vm_tools::seneschal::SharePathRequest& request,
     DBusMethodCallback<vm_tools::seneschal::SharePathResponse> callback) {
   share_path_called_ = true;
+  last_request_ = request;
   base::ThreadTaskRunnerHandle::Get()->PostTask(
       FROM_HERE, base::BindOnce(std::move(callback), share_path_response_));
 }
diff --git a/chromeos/dbus/fake_seneschal_client.h b/chromeos/dbus/fake_seneschal_client.h
index d056e41..1276c441 100644
--- a/chromeos/dbus/fake_seneschal_client.h
+++ b/chromeos/dbus/fake_seneschal_client.h
@@ -29,6 +29,10 @@
     share_path_response_ = share_path_response;
   }
 
+  const vm_tools::seneschal::SharePathRequest& last_request() const {
+    return last_request_;
+  }
+
  protected:
   void Init(dbus::Bus* bus) override {}
 
@@ -37,6 +41,7 @@
 
   bool share_path_called_ = false;
 
+  vm_tools::seneschal::SharePathRequest last_request_;
   vm_tools::seneschal::SharePathResponse share_path_response_;
 
   DISALLOW_COPY_AND_ASSIGN(FakeSeneschalClient);
diff --git a/components/autofill/ios/browser/autofill_agent.mm b/components/autofill/ios/browser/autofill_agent.mm
index e90b681..c799aaee 100644
--- a/components/autofill/ios/browser/autofill_agent.mm
+++ b/components/autofill/ios/browser/autofill_agent.mm
@@ -733,8 +733,10 @@
                            inFrame:(web::WebFrame*)frame {
   if (![self isAutofillEnabled])
     return;
-
+  if (!frame || !frame->CanCallJavaScriptFunction())
+    return;
   FormDataVector forms;
+
   bool success = autofill::ExtractFormsData(
       base::SysUTF8ToNSString(formData), true, base::UTF8ToUTF16(formName),
       webState->GetLastCommittedURL(), frame->GetSecurityOrigin(), &forms);
diff --git a/components/autofill_assistant/browser/BUILD.gn b/components/autofill_assistant/browser/BUILD.gn
index 8adcbb3..a629ca7 100644
--- a/components/autofill_assistant/browser/BUILD.gn
+++ b/components/autofill_assistant/browser/BUILD.gn
@@ -88,6 +88,7 @@
     "//content/public/browser",
     "//google_apis",
     "//net",
+    "//services/identity/public/cpp:cpp",
     "//third_party/re2",
   ]
 }
diff --git a/components/autofill_assistant/browser/DEPS b/components/autofill_assistant/browser/DEPS
index 2bc01d0..b6e26e3 100644
--- a/components/autofill_assistant/browser/DEPS
+++ b/components/autofill_assistant/browser/DEPS
@@ -8,6 +8,7 @@
   "+google_apis",
   "+net",
   "+services/network/public/cpp",
+  "+services/identity/public/cpp",
   "+third_party/blink/public/mojom/payments/payment_request.mojom.h",
   "+third_party/re2",
   "+ui/base/l10n/l10n_util.h",
diff --git a/components/autofill_assistant/browser/client.h b/components/autofill_assistant/browser/client.h
index 4b95cfa..a677bc68 100644
--- a/components/autofill_assistant/browser/client.h
+++ b/components/autofill_assistant/browser/client.h
@@ -7,6 +7,10 @@
 
 #include <string>
 
+namespace identity {
+class IdentityManager;
+}  // namespace identity
+
 namespace autofill {
 class PersonalDataManager;
 }  // namespace autofill
@@ -23,6 +27,10 @@
   // Returns the API key to be used for requests to the backend.
   virtual std::string GetApiKey() = 0;
 
+  // Gets the identity manager to use to make authenticated calls or nullptr if
+  // no identity is available.
+  virtual identity::IdentityManager* GetIdentityManagerForPrimaryAccount() = 0;
+
   // Returns the current active personal data manager.
   virtual autofill::PersonalDataManager* GetPersonalDataManager() = 0;
 
diff --git a/components/autofill_assistant/browser/controller.cc b/components/autofill_assistant/browser/controller.cc
index b0a7405a..c3249bf 100644
--- a/components/autofill_assistant/browser/controller.cc
+++ b/components/autofill_assistant/browser/controller.cc
@@ -36,14 +36,14 @@
     std::unique_ptr<Client> client,
     std::unique_ptr<std::map<std::string, std::string>> parameters) {
   // Get the key early since |client| will be invalidated when moved below.
-  const std::string api_key = client->GetApiKey();
   GURL server_url(client->GetServerUrl());
   DCHECK(server_url.is_valid());
+  std::unique_ptr<Service> service = std::make_unique<Service>(
+      client->GetApiKey(), server_url, web_contents->GetBrowserContext(),
+      client->GetIdentityManagerForPrimaryAccount());
   new Controller(web_contents, std::move(client),
                  WebController::CreateForWebContents(web_contents),
-                 std::make_unique<Service>(api_key, server_url,
-                                           web_contents->GetBrowserContext()),
-                 std::move(parameters));
+                 std::move(service), std::move(parameters));
 }
 
 Service* Controller::GetService() {
diff --git a/components/autofill_assistant/browser/controller_unittest.cc b/components/autofill_assistant/browser/controller_unittest.cc
index 08fa107..641ba236a 100644
--- a/components/autofill_assistant/browser/controller_unittest.cc
+++ b/components/autofill_assistant/browser/controller_unittest.cc
@@ -41,6 +41,9 @@
 
   // Implements Client
   std::string GetApiKey() override { return ""; }
+  identity::IdentityManager* GetIdentityManagerForPrimaryAccount() override {
+    return nullptr;
+  }
   autofill::PersonalDataManager* GetPersonalDataManager() override {
     return nullptr;
   }
diff --git a/components/autofill_assistant/browser/mock_service.cc b/components/autofill_assistant/browser/mock_service.cc
index 9684c1b..e6a28dc 100644
--- a/components/autofill_assistant/browser/mock_service.cc
+++ b/components/autofill_assistant/browser/mock_service.cc
@@ -8,7 +8,8 @@
 
 namespace autofill_assistant {
 
-MockService::MockService() : Service("api_key", GURL("http://fake"), nullptr) {}
+MockService::MockService()
+    : Service("api_key", GURL("http://fake"), nullptr, nullptr) {}
 MockService::~MockService() {}
 
 }  // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/mock_service.h b/components/autofill_assistant/browser/mock_service.h
index 58669877..b9754e54 100644
--- a/components/autofill_assistant/browser/mock_service.h
+++ b/components/autofill_assistant/browser/mock_service.h
@@ -34,6 +34,7 @@
   void GetActions(const std::string& script_path,
                   const GURL& ignored_url,
                   const std::map<std::string, std::string>& parameters,
+                  const std::string& server_payload,
                   ResponseCallback callback) override {
     OnGetActions(script_path, parameters, callback);
   }
diff --git a/components/autofill_assistant/browser/protocol_utils.cc b/components/autofill_assistant/browser/protocol_utils.cc
index 89789c73..ac9fd81 100644
--- a/components/autofill_assistant/browser/protocol_utils.cc
+++ b/components/autofill_assistant/browser/protocol_utils.cc
@@ -105,7 +105,8 @@
 std::string ProtocolUtils::CreateInitialScriptActionsRequest(
     const std::string& script_path,
     const GURL& url,
-    const std::map<std::string, std::string>& parameters) {
+    const std::map<std::string, std::string>& parameters,
+    const std::string& server_payload) {
   ScriptActionRequestProto request_proto;
   InitialScriptActionsRequestProto* initial_request_proto =
       request_proto.mutable_initial_request();
@@ -119,6 +120,10 @@
   request_proto.mutable_client_context()->mutable_chrome()->set_chrome_version(
       version_info::GetProductNameAndVersionForUserAgent());
 
+  if (!server_payload.empty()) {
+    request_proto.set_server_payload(server_payload);
+  }
+
   std::string serialized_initial_request_proto;
   bool success =
       request_proto.SerializeToString(&serialized_initial_request_proto);
diff --git a/components/autofill_assistant/browser/protocol_utils.h b/components/autofill_assistant/browser/protocol_utils.h
index ad452724..854e02f 100644
--- a/components/autofill_assistant/browser/protocol_utils.h
+++ b/components/autofill_assistant/browser/protocol_utils.h
@@ -43,7 +43,8 @@
   static std::string CreateInitialScriptActionsRequest(
       const std::string& script_path,
       const GURL& url,
-      const std::map<std::string, std::string>& parameters);
+      const std::map<std::string, std::string>& parameters,
+      const std::string& server_payload);
 
   // Create request to get next sequence of actions for a script.
   static std::string CreateNextScriptActionsRequest(
diff --git a/components/autofill_assistant/browser/protocol_utils_unittest.cc b/components/autofill_assistant/browser/protocol_utils_unittest.cc
index 535cba1..fd005f0 100644
--- a/components/autofill_assistant/browser/protocol_utils_unittest.cc
+++ b/components/autofill_assistant/browser/protocol_utils_unittest.cc
@@ -75,7 +75,8 @@
   ScriptActionRequestProto request;
   EXPECT_TRUE(
       request.ParseFromString(ProtocolUtils::CreateInitialScriptActionsRequest(
-          "script_path", GURL("http://example.com/"), parameters)));
+          "script_path", GURL("http://example.com/"), parameters,
+          "server_payload")));
 
   EXPECT_THAT(request.client_context().chrome().chrome_version(),
               Not(IsEmpty()));
@@ -88,6 +89,7 @@
   EXPECT_EQ("b", initial.script_parameters(0).value());
   EXPECT_EQ("c", initial.script_parameters(1).name());
   EXPECT_EQ("d", initial.script_parameters(1).value());
+  EXPECT_EQ("server_payload", request.server_payload());
 }
 
 TEST(ProtocolUtilsTest, CreateGetScriptsRequest) {
diff --git a/components/autofill_assistant/browser/script_executor.cc b/components/autofill_assistant/browser/script_executor.cc
index 166c4191..eac9609 100644
--- a/components/autofill_assistant/browser/script_executor.cc
+++ b/components/autofill_assistant/browser/script_executor.cc
@@ -14,6 +14,7 @@
 #include "base/time/time.h"
 #include "components/autofill/core/browser/credit_card.h"
 #include "components/autofill_assistant/browser/batch_element_checker.h"
+#include "components/autofill_assistant/browser/client_memory.h"
 #include "components/autofill_assistant/browser/protocol_utils.h"
 #include "components/autofill_assistant/browser/service.h"
 #include "components/autofill_assistant/browser/ui_controller.h"
@@ -29,8 +30,12 @@
 }  // namespace
 
 ScriptExecutor::ScriptExecutor(const std::string& script_path,
+                               const std::string& server_payload,
+                               ScriptExecutor::Listener* listener,
                                ScriptExecutorDelegate* delegate)
     : script_path_(script_path),
+      last_server_payload_(server_payload),
+      listener_(listener),
       delegate_(delegate),
       at_end_(CONTINUE),
       should_stop_script_(false),
@@ -46,7 +51,7 @@
 
   delegate_->GetService()->GetActions(
       script_path_, delegate_->GetWebController()->GetUrl(),
-      delegate_->GetParameters(),
+      delegate_->GetParameters(), last_server_payload_,
       base::BindOnce(&ScriptExecutor::OnGetActions,
                      weak_ptr_factory_.GetWeakPtr()));
 }
@@ -201,6 +206,9 @@
 
   bool parse_result =
       ProtocolUtils::ParseActions(response, &last_server_payload_, &actions_);
+  if (listener_) {
+    listener_->OnServerPayloadChanged(last_server_payload_);
+  }
   if (!parse_result) {
     RunCallback(false);
     return;
diff --git a/components/autofill_assistant/browser/script_executor.h b/components/autofill_assistant/browser/script_executor.h
index 7c867a7..1c7703c 100644
--- a/components/autofill_assistant/browser/script_executor.h
+++ b/components/autofill_assistant/browser/script_executor.h
@@ -22,8 +22,22 @@
 // Class to execute an assistant script.
 class ScriptExecutor : public ActionDelegate {
  public:
-  // |delegate| should outlive this object and should not be nullptr.
+  // Listens to events on ScriptExecutor.
+  // TODO(b/806868): Make server_payload a part of callback instead of the
+  // listener.
+  class Listener {
+   public:
+    virtual ~Listener() = default;
+
+    // Called when new server_payload is available.
+    virtual void OnServerPayloadChanged(const std::string& server_payload) = 0;
+  };
+
+  // |delegate| and |listener| should outlive this object and should not be
+  // nullptr.
   ScriptExecutor(const std::string& script_path,
+                 const std::string& server_payload,
+                 ScriptExecutor::Listener* listener,
                  ScriptExecutorDelegate* delegate);
   ~ScriptExecutor() override;
 
@@ -105,12 +119,13 @@
   void OnProcessedAction(std::unique_ptr<ProcessedActionProto> action);
 
   std::string script_path_;
+  std::string last_server_payload_;
+  ScriptExecutor::Listener* const listener_;
   ScriptExecutorDelegate* delegate_;
   RunScriptCallback callback_;
 
   std::vector<std::unique_ptr<Action>> actions_;
   std::vector<ProcessedActionProto> processed_actions_;
-  std::string last_server_payload_;
   AtEnd at_end_;
   bool should_stop_script_;
   bool should_clean_contextual_ui_on_finish_;
diff --git a/components/autofill_assistant/browser/script_executor_unittest.cc b/components/autofill_assistant/browser/script_executor_unittest.cc
index 155965b..b232a7a 100644
--- a/components/autofill_assistant/browser/script_executor_unittest.cc
+++ b/components/autofill_assistant/browser/script_executor_unittest.cc
@@ -32,10 +32,12 @@
 using ::testing::StrictMock;
 using ::testing::_;
 
-class ScriptExecutorTest : public testing::Test, public ScriptExecutorDelegate {
+class ScriptExecutorTest : public testing::Test,
+                           public ScriptExecutorDelegate,
+                           public ScriptExecutor::Listener {
  public:
   void SetUp() override {
-    executor_ = std::make_unique<ScriptExecutor>("script path", this);
+    executor_ = std::make_unique<ScriptExecutor>("script path", "", this, this);
     url_ = GURL("http://example.com/");
 
     // In this test, "tell" actions always succeed and "click" actions always
@@ -68,6 +70,8 @@
     return nullptr;
   }
 
+  void OnServerPayloadChanged(const std::string& server_payload) override {}
+
   content::WebContents* GetWebContents() override { return nullptr; }
 
   std::string Serialize(const google::protobuf::MessageLite& message) {
diff --git a/components/autofill_assistant/browser/script_tracker.cc b/components/autofill_assistant/browser/script_tracker.cc
index a610531..8e1b4e74 100644
--- a/components/autofill_assistant/browser/script_tracker.cc
+++ b/components/autofill_assistant/browser/script_tracker.cc
@@ -86,7 +86,8 @@
   }
 
   executed_scripts_[script_path] = SCRIPT_STATUS_RUNNING;
-  executor_ = std::make_unique<ScriptExecutor>(script_path, delegate_);
+  executor_ = std::make_unique<ScriptExecutor>(
+      script_path, last_server_payload_, this, delegate_);
   ScriptExecutor::RunScriptCallback run_script_callback = base::BindOnce(
       &ScriptTracker::OnScriptRun, weak_ptr_factory_.GetWeakPtr(), script_path,
       std::move(callback));
@@ -190,4 +191,8 @@
   TerminatePendingChecks();
 }
 
+void ScriptTracker::OnServerPayloadChanged(const std::string& server_payload) {
+  last_server_payload_ = server_payload;
+}
+
 }  // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/script_tracker.h b/components/autofill_assistant/browser/script_tracker.h
index 65de873..2de9d65 100644
--- a/components/autofill_assistant/browser/script_tracker.h
+++ b/components/autofill_assistant/browser/script_tracker.h
@@ -26,7 +26,7 @@
 //
 // User of this class is responsible for retrieving and passing scripts to the
 // tracker and letting the tracker know about changes to the DOM.
-class ScriptTracker {
+class ScriptTracker : public ScriptExecutor::Listener {
  public:
   // Listens to changes on the ScriptTracker state.
   class Listener {
@@ -44,7 +44,7 @@
   ScriptTracker(ScriptExecutorDelegate* delegate,
                 ScriptTracker::Listener* listener);
 
-  ~ScriptTracker();
+  ~ScriptTracker() override;
 
   // Updates the set of available |scripts|. This interrupts any pending checks,
   // but don't start a new one.'
@@ -84,6 +84,9 @@
   void UpdateRunnableScriptsIfNecessary();
   void OnCheckDone();
 
+  // Overrides ScriptExecutor::Listener.
+  void OnServerPayloadChanged(const std::string& server_payload) override;
+
   // Cleans up any state use by pending checks. Stops running pending checks.
   void TerminatePendingChecks();
 
@@ -129,6 +132,8 @@
   // |pending_run_script_callback_| is not nullptr.
   ScriptExecutor::RunScriptCallback pending_run_script_callback_;
 
+  std::string last_server_payload_;
+
   base::WeakPtrFactory<ScriptTracker> weak_ptr_factory_;
 
   DISALLOW_COPY_AND_ASSIGN(ScriptTracker);
diff --git a/components/autofill_assistant/browser/service.cc b/components/autofill_assistant/browser/service.cc
index 1ab43a3..96a5491 100644
--- a/components/autofill_assistant/browser/service.cc
+++ b/components/autofill_assistant/browser/service.cc
@@ -8,19 +8,31 @@
 #include <utility>
 #include <vector>
 
+#include "base/command_line.h"
 #include "base/strings/strcat.h"
+#include "base/strings/stringprintf.h"
 #include "components/autofill_assistant/browser/protocol_utils.h"
 #include "content/public/browser/browser_context.h"
 #include "content/public/browser/storage_partition.h"
 #include "net/base/load_flags.h"
+#include "net/http/http_request_headers.h"
 #include "net/http/http_status_code.h"
 #include "net/traffic_annotation/network_traffic_annotation.h"
 #include "url/url_canon_stdstring.h"
 
 namespace {
+namespace switches {
+// --autofill_assistant-auth=false disables authentication. This is only useful
+// during development, as prod instances require authentication.
+const char* const kAutofillAssistantAuth = "autofill-assistant-auth";
+}  // namespace switches
+
 // TODO(crbug.com/806868): Provide correct server and endpoint.
 const char* const kScriptEndpoint = "/v1/supportsSite2";
 const char* const kActionEndpoint = "/v1/actions2";
+const char* const kTokenFetchId = "autofill_assistant";
+const char* const kOAuthScope =
+    "https://www.googleapis.com/auth/userinfo.profile";
 
 net::NetworkTrafficAnnotationTag traffic_annotation =
     net::DefineNetworkTrafficAnnotation("autofill_service", R"(
@@ -46,19 +58,25 @@
 
 Service::Service(const std::string& api_key,
                  const GURL& server_url,
-                 content::BrowserContext* context)
-    : context_(context) {
+                 content::BrowserContext* context,
+                 identity::IdentityManager* identity_manager)
+    : context_(context),
+      api_key_(api_key),
+      identity_manager_(identity_manager),
+      auth_enabled_(
+          identity_manager_ &&
+          "false" !=
+              base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+                  switches::kAutofillAssistantAuth)),
+      weak_ptr_factory_(this) {
   DCHECK(server_url.is_valid());
 
-  std::string api_key_query = base::StrCat({"key=", api_key});
   url::StringPieceReplacements<std::string> script_replacements;
   script_replacements.SetPathStr(kScriptEndpoint);
-  script_replacements.SetQueryStr(api_key_query);
   script_server_url_ = server_url.ReplaceComponents(script_replacements);
 
   url::StringPieceReplacements<std::string> action_replacements;
   action_replacements.SetPathStr(kActionEndpoint);
-  action_replacements.SetQueryStr(api_key_query);
   script_action_server_url_ = server_url.ReplaceComponents(action_replacements);
 }
 
@@ -70,28 +88,22 @@
     ResponseCallback callback) {
   DCHECK(url.is_valid());
 
-  std::unique_ptr<Loader> loader = std::make_unique<Loader>();
-  loader->callback = std::move(callback);
-  loader->loader = CreateAndStartLoader(
-      script_server_url_,
-      ProtocolUtils::CreateGetScriptsRequest(url, parameters), loader.get());
-  loaders_[loader.get()] = std::move(loader);
+  SendRequest(AddLoader(script_server_url_,
+                        ProtocolUtils::CreateGetScriptsRequest(url, parameters),
+                        std::move(callback)));
 }
 
 void Service::GetActions(const std::string& script_path,
                          const GURL& url,
                          const std::map<std::string, std::string>& parameters,
+                         const std::string& server_payload,
                          ResponseCallback callback) {
   DCHECK(!script_path.empty());
 
-  std::unique_ptr<Loader> loader = std::make_unique<Loader>();
-  loader->callback = std::move(callback);
-  loader->loader =
-      CreateAndStartLoader(script_action_server_url_,
-                           ProtocolUtils::CreateInitialScriptActionsRequest(
-                               script_path, url, parameters),
-                           loader.get());
-  loaders_[loader.get()] = std::move(loader);
+  SendRequest(AddLoader(script_action_server_url_,
+                        ProtocolUtils::CreateInitialScriptActionsRequest(
+                            script_path, url, parameters, server_payload),
+                        std::move(callback)));
 }
 
 void Service::GetNextActions(
@@ -100,60 +112,103 @@
     ResponseCallback callback) {
   DCHECK(!previous_server_payload.empty());
 
-  std::unique_ptr<Loader> loader = std::make_unique<Loader>();
-  loader->callback = std::move(callback);
-  loader->loader =
-      CreateAndStartLoader(script_action_server_url_,
-                           ProtocolUtils::CreateNextScriptActionsRequest(
-                               previous_server_payload, processed_actions),
-                           loader.get());
-  loaders_[loader.get()] = std::move(loader);
+  SendRequest(AddLoader(script_action_server_url_,
+                        ProtocolUtils::CreateNextScriptActionsRequest(
+                            previous_server_payload, processed_actions),
+                        std::move(callback)));
 }
 
-Service::Loader::Loader() {}
+void Service::SendRequest(Loader* loader) {
+  if (access_token_.empty() && auth_enabled_) {
+    // Trigger a fetch of the access token. All loaders in loaders_ will be
+    // started later on, the access token is available.
+    FetchAccessToken();
+    return;
+  }
+
+  StartLoader(loader);
+}
+
+Service::Loader::Loader() : retried_with_fresh_access_token(false) {}
 Service::Loader::~Loader() {}
 
-std::unique_ptr<::network::SimpleURLLoader> Service::CreateAndStartLoader(
-    const GURL& server_url,
-    const std::string& request,
-    Loader* loader) {
+Service::Loader* Service::AddLoader(const GURL& url,
+                                    const std::string& request_body,
+                                    ResponseCallback callback) {
+  std::unique_ptr<Loader> loader = std::make_unique<Loader>();
+  loader->url = url;
+  loader->request_body = request_body;
+  loader->callback = std::move(callback);
+  Loader* loader_ptr = loader.get();
+  loaders_[loader_ptr] = std::move(loader);
+  return loader_ptr;
+}
+
+void Service::StartLoader(Loader* loader) {
+  if (loader->loader)
+    return;
+
   auto resource_request = std::make_unique<::network::ResourceRequest>();
-  resource_request->url = server_url;
   resource_request->method = "POST";
   resource_request->fetch_redirect_mode =
       ::network::mojom::FetchRedirectMode::kError;
   resource_request->load_flags =
       net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES;
-  std::unique_ptr<::network::SimpleURLLoader> simple_loader =
-      ::network::SimpleURLLoader::Create(std::move(resource_request),
-                                         traffic_annotation);
-  simple_loader->AttachStringForUpload(request, "application/x-protobuffer");
+  if (access_token_.empty()) {
+    url::StringPieceReplacements<std::string> add_key;
+    add_key.SetQueryStr(base::StrCat({"key=", api_key_}));
+    resource_request->url = loader->url.ReplaceComponents(add_key);
+  } else {
+    resource_request->url = loader->url;
+    resource_request->headers.SetHeader(
+        "Authorization", base::StrCat({"Bearer ", access_token_}));
+  }
+
+  loader->loader = ::network::SimpleURLLoader::Create(
+      std::move(resource_request), traffic_annotation);
+  loader->loader->AttachStringForUpload(loader->request_body,
+                                        "application/x-protobuffer");
 #ifdef DEBUG
-  simple_loader->SetAllowHttpErrorResults(true);
+  loader->loader->SetAllowHttpErrorResults(true);
 #endif
-  simple_loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
+  loader->loader->DownloadToStringOfUnboundedSizeUntilCrashAndDie(
       content::BrowserContext::GetDefaultStoragePartition(context_)
           ->GetURLLoaderFactoryForBrowserProcess()
           .get(),
       base::BindOnce(&Service::OnURLLoaderComplete, base::Unretained(this),
                      loader));
-  return simple_loader;
 }
 
 void Service::OnURLLoaderComplete(Loader* loader,
                                   std::unique_ptr<std::string> response_body) {
   auto loader_it = loaders_.find(loader);
   DCHECK(loader_it != loaders_.end());
+
+  int response_code = 0;
+  if (loader->loader->ResponseInfo() &&
+      loader->loader->ResponseInfo()->headers) {
+    response_code = loader->loader->ResponseInfo()->headers->response_code();
+  }
+
+  // When getting a 401, refresh the auth token - but only try this once.
+  if (response_code == 401 && auth_enabled_ && !access_token_.empty() &&
+      !loader->retried_with_fresh_access_token) {
+    loader->retried_with_fresh_access_token = true;
+    loader->loader.reset();
+    // Invalidate access token and load a new one.
+    OAuth2TokenService::ScopeSet scopes{kOAuthScope};
+    identity_manager_->RemoveAccessTokenFromCache(account_id_, scopes,
+                                                  access_token_);
+    access_token_.clear();
+    SendRequest(loader);
+    return;
+  }
+
+  // Take ownership of loader.
   std::unique_ptr<Loader> loader_instance = std::move(loader_it->second);
   loaders_.erase(loader_it);
   DCHECK(loader_instance);
 
-  int response_code = 0;
-  if (loader_instance->loader->ResponseInfo() &&
-      loader_instance->loader->ResponseInfo()->headers) {
-    response_code =
-        loader_instance->loader->ResponseInfo()->headers->response_code();
-  }
   std::string response_body_str;
   if (loader_instance->loader->NetError() != net::OK || response_code != 200) {
     LOG(ERROR) << "Communicating with autofill assistant server error NetError="
@@ -169,4 +224,37 @@
   std::move(loader_instance->callback).Run(true, response_body_str);
 }
 
+void Service::FetchAccessToken() {
+  DCHECK(identity_manager_);
+  if (token_fetcher_)
+    return;
+
+  OAuth2TokenService::ScopeSet scopes{kOAuthScope};
+  account_id_ = identity_manager_->GetPrimaryAccountId();
+  token_fetcher_ = std::make_unique<identity::PrimaryAccountAccessTokenFetcher>(
+      kTokenFetchId, identity_manager_, scopes,
+      base::BindOnce(&Service::OnFetchAccessToken, base::Unretained(this)),
+      identity::PrimaryAccountAccessTokenFetcher::Mode::kWaitUntilAvailable);
+  // Unretained, because token_fetcher_ is owned by this instance.
+}
+
+void Service::OnFetchAccessToken(GoogleServiceAuthError error,
+                                 identity::AccessTokenInfo access_token_info) {
+  token_fetcher_.reset();
+
+  if (error.state() != GoogleServiceAuthError::NONE) {
+    auth_enabled_ = false;
+    // Give up on authentication for this run. Let the pending requests through,
+    // which might be rejected, depending on the server configuration.
+    return;
+  }
+
+  access_token_ = access_token_info.token;
+
+  // Start any pending requests with the access token.
+  for (const auto& entry : loaders_) {
+    StartLoader(entry.first);
+  }
+}
+
 }  // namespace autofill_assistant
diff --git a/components/autofill_assistant/browser/service.h b/components/autofill_assistant/browser/service.h
index 4ff3dec2..371b931 100644
--- a/components/autofill_assistant/browser/service.h
+++ b/components/autofill_assistant/browser/service.h
@@ -11,22 +11,32 @@
 #include <vector>
 
 #include "base/callback.h"
+#include "base/memory/weak_ptr.h"
 #include "components/autofill_assistant/browser/service.pb.h"
+#include "google_apis/gaia/google_service_auth_error.h"
+#include "services/identity/public/cpp/primary_account_access_token_fetcher.h"
 #include "services/network/public/cpp/simple_url_loader.h"
 #include "url/gurl.h"
 
 namespace content {
 class BrowserContext;
-}
+}  // namespace content
+
+namespace identity {
+class IdentityManager;
+}  // namespace identity
 
 namespace autofill_assistant {
 // Autofill assistant service to communicate with the server to get scripts and
 // client actions.
 class Service {
  public:
+  // |context| and |identity_manager| must remain valid for the lifetime of the
+  // service instance. |identity_manager| might be nullptr.
   Service(const std::string& api_key,
           const GURL& server_url,
-          content::BrowserContext* context);
+          content::BrowserContext* context,
+          identity::IdentityManager* identity_manager);
   virtual ~Service();
 
   using ResponseCallback =
@@ -41,6 +51,7 @@
   virtual void GetActions(const std::string& script_path,
                           const GURL& url,
                           const std::map<std::string, std::string>& parameters,
+                          const std::string& server_payload,
                           ResponseCallback callback);
 
   // Get next sequence of actions according to server payload in previous
@@ -56,16 +67,32 @@
     Loader();
     ~Loader();
 
+    GURL url;
+    std::string request_body;
     ResponseCallback callback;
     std::unique_ptr<::network::SimpleURLLoader> loader;
+    bool retried_with_fresh_access_token;
   };
-  std::unique_ptr<::network::SimpleURLLoader> CreateAndStartLoader(
-      const GURL& server_url,
-      const std::string& request,
-      Loader* loader);
+
+  void SendRequest(Loader* loader);
+
+  // Creates a loader and adds it to |loaders_|.
+  Loader* AddLoader(const GURL& url,
+                    const std::string& request_body,
+                    ResponseCallback callback);
+
+  // Sends a request with the given loader, using the current auth token, if one
+  // is available.
+  void StartLoader(Loader* loader);
   void OnURLLoaderComplete(Loader* loader,
                            std::unique_ptr<std::string> response_body);
 
+  // Fetches the access token and, once this is done, starts all pending loaders
+  // in |loaders_|.
+  void FetchAccessToken();
+  void OnFetchAccessToken(GoogleServiceAuthError error,
+                          identity::AccessTokenInfo access_token_info);
+
   content::BrowserContext* context_;
   GURL script_server_url_;
   GURL script_action_server_url_;
@@ -73,6 +100,28 @@
   // Destroying this object will cancel ongoing requests.
   std::map<Loader*, std::unique_ptr<Loader>> loaders_;
 
+  // API key to add to the URL of unauthenticated requests.
+  std::string api_key_;
+
+  // Pointer must remain valid for the lifetime of the Service instance. Might
+  // be nullptr, if auth_enabled_ is false.
+  identity::IdentityManager* const identity_manager_;
+
+  // Whether requests should be authenticated.
+  bool auth_enabled_;
+
+  // An OAuth 2 token. Empty if not fetched yet or if the token has been
+  // invalidated.
+  std::string access_token_;
+
+  // Account id |access_token_| is for.
+  std::string account_id_;
+
+  // Active OAuth2 token fetcher.
+  std::unique_ptr<identity::PrimaryAccountAccessTokenFetcher> token_fetcher_;
+
+  base::WeakPtrFactory<Service> weak_ptr_factory_;
+
   DISALLOW_COPY_AND_ASSIGN(Service);
 };
 
diff --git a/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm b/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm
index f711fc24..dffe0e7 100644
--- a/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm
+++ b/components/bookmarks/browser/bookmark_pasteboard_helper_mac.mm
@@ -66,8 +66,8 @@
   NSMutableDictionary* dictionary = [NSMutableDictionary dictionary];
 
   for (const auto& item : meta_info_map) {
-    [dictionary setObject:base::SysUTF8ToNSString(item.second)
-                   forKey:base::SysUTF8ToNSString(item.first)];
+    dictionary[base::SysUTF8ToNSString(item.first)] =
+        base::SysUTF8ToNSString(item.second);
   }
 
   return dictionary;
@@ -79,22 +79,21 @@
   for (NSDictionary* bookmark_dict in input) {
     auto new_node = std::make_unique<BookmarkNode>(GURL());
 
-    NSNumber* node_id = base::mac::ObjCCast<NSNumber>(
-        [bookmark_dict objectForKey:kChromiumBookmarkIdKey]);
+    NSNumber* node_id =
+        base::mac::ObjCCast<NSNumber>(bookmark_dict[kChromiumBookmarkIdKey]);
     if (node_id)
       new_node->set_id([node_id longLongValue]);
 
     NSDictionary* meta_info = base::mac::ObjCCast<NSDictionary>(
-        [bookmark_dict objectForKey:kChromiumBookmarkMetaInfoKey]);
+        bookmark_dict[kChromiumBookmarkMetaInfoKey]);
     if (meta_info)
       new_node->SetMetaInfoMap(MetaInfoMapFromDictionary(meta_info));
 
-    NSString* title =
-        base::mac::ObjCCast<NSString>([bookmark_dict objectForKey:kTitleKey]);
+    NSString* title = base::mac::ObjCCast<NSString>(bookmark_dict[kTitleKey]);
     new_node->SetTitle(base::SysNSStringToUTF16(title));
 
-    NSString* type = base::mac::ObjCCast<NSString>(
-        [bookmark_dict objectForKey:kWebBookmarkTypeKey]);
+    NSString* type =
+        base::mac::ObjCCast<NSString>(bookmark_dict[kWebBookmarkTypeKey]);
     if (!type)
       continue;
 
@@ -103,8 +102,8 @@
       new_node->set_type(BookmarkNode::FOLDER);
     } else {
       new_node->set_type(BookmarkNode::URL);
-      NSString* url_string = base::mac::ObjCCast<NSString>(
-          [bookmark_dict objectForKey:kURLStringKey]);
+      NSString* url_string =
+          base::mac::ObjCCast<NSString>(bookmark_dict[kURLStringKey]);
       if (!url_string)
         continue;
       new_node->set_url(GURL(base::SysNSStringToUTF8(url_string)));
@@ -119,8 +118,7 @@
     e.date_folder_modified = base::Time();
 
     if (is_folder) {
-      ConvertNSArrayToElements([bookmark_dict objectForKey:kChildrenKey],
-                               &e.children);
+      ConvertNSArrayToElements(bookmark_dict[kChildrenKey], &e.children);
     }
 
     elements->push_back(e);
@@ -151,8 +149,8 @@
 
   NSUInteger len = [titles count];
   for (NSUInteger i = 0; i < len; ++i) {
-    base::string16 title = base::SysNSStringToUTF16([titles objectAtIndex:i]);
-    std::string url = base::SysNSStringToUTF8([urls objectAtIndex:i]);
+    base::string16 title = base::SysNSStringToUTF16(titles[i]);
+    std::string url = base::SysNSStringToUTF8(urls[i]);
     if (!url.empty()) {
       BookmarkNodeData::Element element;
       element.is_url = true;
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index 531445f..66a5d0b 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -270,11 +270,8 @@
 
   sync_prefs_.AddSyncPrefObserver(this);
 
-  int disable_reasons = GetDisableReasons();
-  RecordSyncInitialState(disable_reasons, IsFirstSetupComplete());
-
   // If sync is disallowed by policy, clean up.
-  if (disable_reasons & DISABLE_REASON_ENTERPRISE_POLICY) {
+  if (HasDisableReason(DISABLE_REASON_ENTERPRISE_POLICY)) {
     // Note that this won't actually clear data, since neither |engine_| nor
     // |sync_thread_| exist at this point. Bug or feature?
     StopImpl(CLEAR_DATA);
@@ -293,6 +290,11 @@
     }
   }
 
+  // Note: We need to record the initial state *after* calling
+  // RegisterForAuthNotifications(), because before that the authenticated
+  // account isn't initialized.
+  RecordSyncInitialState(GetDisableReasons(), IsFirstSetupComplete());
+
 #if defined(OS_CHROMEOS)
   std::string bootstrap_token = sync_prefs_.GetEncryptionBootstrapToken();
   if (bootstrap_token.empty()) {
diff --git a/components/crash/core/common/objc_zombie_unittest.mm b/components/crash/core/common/objc_zombie_unittest.mm
index 812cff8..c5fad147 100644
--- a/components/crash/core/common/objc_zombie_unittest.mm
+++ b/components/crash/core/common/objc_zombie_unittest.mm
@@ -15,11 +15,11 @@
 {
   base::scoped_nsobject<id> aRef_;
 }
-- (id)initWith:(id)anObject;
+- (instancetype)initWith:(id)anObject;
 @end
 
 @implementation ZombieCxxDestructTest
-- (id)initWith:(id)anObject {
+- (instancetype)initWith:(id)anObject {
   self = [super init];
   if (self) {
     aRef_.reset([anObject retain]);
@@ -29,12 +29,12 @@
 @end
 
 @interface ZombieAssociatedObjectTest : NSObject
-- (id)initWithAssociatedObject:(id)anObject;
+- (instancetype)initWithAssociatedObject:(id)anObject;
 @end
 
 @implementation ZombieAssociatedObjectTest
 
-- (id)initWithAssociatedObject:(id)anObject {
+- (instancetype)initWithAssociatedObject:(id)anObject {
   if ((self = [super init])) {
     // The address of the variable itself is the unique key, the
     // contents don't matter.
diff --git a/components/download/quarantine/OWNERS b/components/download/quarantine/OWNERS
index 7e28ce6a..d813b03 100644
--- a/components/download/quarantine/OWNERS
+++ b/components/download/quarantine/OWNERS
@@ -1,5 +1,3 @@
-set noparent
-
 asanka@chromium.org
 wfh@chromium.org
 
diff --git a/components/download/quarantine/quarantine_mac.mm b/components/download/quarantine/quarantine_mac.mm
index 7644ab7..b4a3341 100644
--- a/components/download/quarantine/quarantine_mac.mm
+++ b/components/download/quarantine/quarantine_mac.mm
@@ -128,7 +128,7 @@
   if (!md_item_set_attribute_func)
     return false;
 
-  NSString* file_path = [NSString stringWithUTF8String:file.value().c_str()];
+  NSString* file_path = base::mac::FilePathToNSString(file);
   if (!file_path)
     return false;
 
@@ -144,11 +144,10 @@
 
   // Follow Safari's lead: the first item in the list is the source URL of
   // the downloaded file. If the referrer is known, store that, too.
-  NSString* origin_url = [NSString stringWithUTF8String:source.spec().c_str()];
+  NSString* origin_url = base::SysUTF8ToNSString(source.spec());
   if (origin_url)
     [list addObject:origin_url];
-  NSString* referrer_url =
-      [NSString stringWithUTF8String:referrer.spec().c_str()];
+  NSString* referrer_url = base::SysUTF8ToNSString(referrer.spec());
   if (referrer_url)
     [list addObject:referrer_url];
 
@@ -203,16 +202,14 @@
 
   if (![properties valueForKey:(NSString*)kLSQuarantineOriginURLKey] &&
       referrer.is_valid()) {
-    NSString* referrer_url =
-        [NSString stringWithUTF8String:referrer.spec().c_str()];
+    NSString* referrer_url = base::SysUTF8ToNSString(referrer.spec());
     [properties setValue:referrer_url
                   forKey:(NSString*)kLSQuarantineOriginURLKey];
   }
 
   if (![properties valueForKey:(NSString*)kLSQuarantineDataURLKey] &&
       source.is_valid()) {
-    NSString* origin_url =
-        [NSString stringWithUTF8String:source.spec().c_str()];
+    NSString* origin_url = base::SysUTF8ToNSString(source.spec());
     [properties setValue:origin_url forKey:(NSString*)kLSQuarantineDataURLKey];
   }
 
diff --git a/components/drive/service/drive_api_service.cc b/components/drive/service/drive_api_service.cc
index 7d37d95..8cd55ee 100644
--- a/components/drive/service/drive_api_service.cc
+++ b/components/drive/service/drive_api_service.cc
@@ -223,14 +223,14 @@
 }
 
 DriveAPIService::DriveAPIService(
-    OAuth2TokenService* oauth2_token_service,
+    identity::IdentityManager* identity_manager,
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
     base::SequencedTaskRunner* blocking_task_runner,
     const GURL& base_url,
     const GURL& base_thumbnail_url,
     const std::string& custom_user_agent,
     const net::NetworkTrafficAnnotationTag& traffic_annotation)
-    : oauth2_token_service_(oauth2_token_service),
+    : identity_manager_(identity_manager),
       url_loader_factory_(url_loader_factory),
       blocking_task_runner_(blocking_task_runner),
       url_generator_(base_url, base_thumbnail_url),
@@ -252,8 +252,8 @@
   scopes.push_back(kDriveAppsScope);
 
   sender_ = std::make_unique<RequestSender>(
-      std::make_unique<google_apis::AuthService>(
-          oauth2_token_service_, account_id, url_loader_factory_, scopes),
+      std::make_unique<google_apis::AuthService>(identity_manager_, account_id,
+                                                 url_loader_factory_, scopes),
       url_loader_factory_, blocking_task_runner_.get(), custom_user_agent_,
       traffic_annotation_);
   sender_->auth_service()->AddObserver(this);
diff --git a/components/drive/service/drive_api_service.h b/components/drive/service/drive_api_service.h
index 959325b..ac78cf16 100644
--- a/components/drive/service/drive_api_service.h
+++ b/components/drive/service/drive_api_service.h
@@ -23,7 +23,6 @@
 #include "net/traffic_annotation/network_traffic_annotation.h"
 
 class GURL;
-class OAuth2TokenService;
 
 namespace base {
 class FilePath;
@@ -38,6 +37,10 @@
 }  // namespace drive
 }  // namespace google_apis
 
+namespace identity {
+class IdentityManager;
+}
+
 namespace network {
 class SharedURLLoaderFactory;
 }
@@ -93,7 +96,7 @@
 class DriveAPIService : public DriveServiceInterface,
                         public google_apis::AuthServiceObserver {
  public:
-  // |oauth2_token_service| is used for obtaining OAuth2 access tokens.
+  // |identity_manager| is used for interacting with the identity service.
   // |url_request_context_getter| is used to initialize URLFetcher.
   // |url_loader_factory| is used to create SimpleURLLoaders used to create
   // OAuth tokens.
@@ -106,7 +109,7 @@
   // |traffic_annotation| will be used to annotate the network request that will
   // be created to perform this service.
   DriveAPIService(
-      OAuth2TokenService* oauth2_token_service,
+      identity::IdentityManager* identity_manager,
       scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
       base::SequencedTaskRunner* blocking_task_runner,
       const GURL& base_url,
@@ -264,7 +267,7 @@
   // The class is expected to run on UI thread.
   base::ThreadChecker thread_checker_;
 
-  OAuth2TokenService* oauth2_token_service_;
+  identity::IdentityManager* identity_manager_;
   scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
   scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
   std::unique_ptr<google_apis::RequestSender> sender_;
diff --git a/components/storage_monitor/image_capture_device.h b/components/storage_monitor/image_capture_device.h
index 15246efd..0b06f3f 100644
--- a/components/storage_monitor/image_capture_device.h
+++ b/components/storage_monitor/image_capture_device.h
@@ -66,7 +66,7 @@
   bool closing_;
 }
 
-- (id)initWithCameraDevice:(ICCameraDevice*)cameraDevice;
+- (instancetype)initWithCameraDevice:(ICCameraDevice*)cameraDevice;
 - (void)setListener:
         (base::WeakPtr<storage_monitor::ImageCaptureDeviceListener>)listener;
 - (void)open;
diff --git a/components/storage_monitor/image_capture_device.mm b/components/storage_monitor/image_capture_device.mm
index 4cef98bd..e199aa0 100644
--- a/components/storage_monitor/image_capture_device.mm
+++ b/components/storage_monitor/image_capture_device.mm
@@ -57,7 +57,7 @@
 
 @implementation ImageCaptureDevice
 
-- (id)initWithCameraDevice:(ICCameraDevice*)cameraDevice {
+- (instancetype)initWithCameraDevice:(ICCameraDevice*)cameraDevice {
   if ((self = [super init])) {
     camera_.reset([cameraDevice retain]);
     [camera_ setDelegate:self];
@@ -117,10 +117,10 @@
 
       NSMutableDictionary* options =
           [NSMutableDictionary dictionaryWithCapacity:3];
-      [options setObject:[NSURL fileURLWithPath:saveDirectory isDirectory:YES]
-                  forKey:ICDownloadsDirectoryURL];
-      [options setObject:saveFilename forKey:ICSaveAsFilename];
-      [options setObject:[NSNumber numberWithBool:YES] forKey:ICOverwrite];
+      options[ICDownloadsDirectoryURL] =
+          [NSURL fileURLWithPath:saveDirectory isDirectory:YES];
+      options[ICSaveAsFilename] = saveFilename;
+      options[ICOverwrite] = @YES;
 
       [camera_ requestDownloadFile:base::mac::ObjCCastStrict<ICCameraFile>(item)
                            options:options
@@ -200,10 +200,9 @@
     return;
   }
 
-  std::string savedFilename =
-      base::SysNSStringToUTF8([options objectForKey:ICSavedFilename]);
+  std::string savedFilename = base::SysNSStringToUTF8(options[ICSavedFilename]);
   std::string saveAsFilename =
-      base::SysNSStringToUTF8([options objectForKey:ICSaveAsFilename]);
+      base::SysNSStringToUTF8(options[ICSaveAsFilename]);
   if (savedFilename == saveAsFilename) {
     if (listener_)
       listener_->DownloadedFile(name, base::File::FILE_OK);
@@ -213,8 +212,8 @@
   // ImageCapture did not save the file into the name we gave it in the
   // options. It picks a new name according to its best lights, so we need
   // to rename the file.
-  base::FilePath saveDir(base::SysNSStringToUTF8(
-      [[options objectForKey:ICDownloadsDirectoryURL] path]));
+  base::FilePath saveDir(
+      base::SysNSStringToUTF8([options[ICDownloadsDirectoryURL] path]));
   base::FilePath saveAsPath = saveDir.Append(saveAsFilename);
   base::FilePath savedPath = saveDir.Append(savedFilename);
   // Shared result value from file-copy closure to tell-listener closure.
diff --git a/components/storage_monitor/image_capture_device_manager.mm b/components/storage_monitor/image_capture_device_manager.mm
index e9660de..0672771 100644
--- a/components/storage_monitor/image_capture_device_manager.mm
+++ b/components/storage_monitor/image_capture_device_manager.mm
@@ -48,7 +48,7 @@
 
 @implementation ImageCaptureDeviceManagerImpl
 
-- (id)init {
+- (instancetype)init {
   if ((self = [super init])) {
     cameras_.reset([[NSMutableArray alloc] init]);
     notifications_ = NULL;
diff --git a/components/storage_monitor/image_capture_device_manager_unittest.mm b/components/storage_monitor/image_capture_device_manager_unittest.mm
index 9a10311..c21da1c 100644
--- a/components/storage_monitor/image_capture_device_manager_unittest.mm
+++ b/components/storage_monitor/image_capture_device_manager_unittest.mm
@@ -42,8 +42,8 @@
 
 @implementation MockICCameraDevice
 
-- (id)init {
-  if ((self = [super initWithDictionary:[NSDictionary dictionary]])) {
+- (instancetype)init {
+  if ((self = [super initWithDictionary:@{}])) {
   }
   return self;
 }
@@ -89,10 +89,10 @@
            downloadDelegate:(id<ICCameraDeviceDownloadDelegate>)downloadDelegate
         didDownloadSelector:(SEL)selector
                 contextInfo:(void*)contextInfo {
-  base::FilePath saveDir(base::SysNSStringToUTF8(
-      [[options objectForKey:ICDownloadsDirectoryURL] path]));
+  base::FilePath saveDir(
+      base::SysNSStringToUTF8([options[ICDownloadsDirectoryURL] path]));
   std::string saveAsFilename =
-      base::SysNSStringToUTF8([options objectForKey:ICSaveAsFilename]);
+      base::SysNSStringToUTF8(options[ICSaveAsFilename]);
   // It appears that the ImageCapture library adds an extension to the requested
   // filename. Do that here to require a rename.
   saveAsFilename += ".jpg";
@@ -103,8 +103,7 @@
 
   NSMutableDictionary* returnOptions =
       [NSMutableDictionary dictionaryWithDictionary:options];
-  [returnOptions setObject:base::SysUTF8ToNSString(saveAsFilename)
-                    forKey:ICSavedFilename];
+  returnOptions[ICSavedFilename] = base::SysUTF8ToNSString(saveAsFilename);
 
   [static_cast<NSObject<ICCameraDeviceDownloadDelegate>*>(downloadDelegate)
    didDownloadFile:file
@@ -120,13 +119,13 @@
   base::scoped_nsobject<NSString> name_;
 }
 
-- (id)initWithName:(NSString*)name;
+- (instancetype)initWithName:(NSString*)name;
 
 @end
 
 @implementation MockICCameraFolder
 
-- (id)initWithName:(NSString*)name {
+- (instancetype)initWithName:(NSString*)name {
   if ((self = [super init])) {
     name_.reset([name retain]);
   }
@@ -150,14 +149,14 @@
   base::scoped_nsobject<MockICCameraFolder> parent_;
 }
 
-- (id)init:(NSString*)name;
+- (instancetype)init:(NSString*)name;
 - (void)setParent:(NSString*)parent;
 
 @end
 
 @implementation MockICCameraFile
 
-- (id)init:(NSString*)name {
+- (instancetype)init:(NSString*)name {
   if ((self = [super init])) {
     name_.reset([name retain]);
     date_.reset([[NSDate dateWithNaturalLanguageString:@"12/12/12"] retain]);
diff --git a/components/sync/driver/model_type_controller.cc b/components/sync/driver/model_type_controller.cc
index bf1d4a2..c74a642 100644
--- a/components/sync/driver/model_type_controller.cc
+++ b/components/sync/driver/model_type_controller.cc
@@ -246,6 +246,7 @@
       // Nothing to stop. |metadata_fate| might require CLEAR_METADATA,
       // which could lead to leaking sync metadata, but it doesn't seem a
       // realistic scenario (disable sync during shutdown?).
+      std::move(callback).Run();
       return;
 
     case STOPPING:
diff --git a/components/sync/driver/model_type_controller_unittest.cc b/components/sync/driver/model_type_controller_unittest.cc
index c6f8b3a..ce718a4 100644
--- a/components/sync/driver/model_type_controller_unittest.cc
+++ b/components/sync/driver/model_type_controller_unittest.cc
@@ -195,11 +195,17 @@
     controller_.StartAssociating(callback.Get());
   }
 
+  void StopAndWait(ShutdownReason shutdown_reason) {
+    // ModelTypeProcessorProxy does posting of tasks, so we need a runloop. This
+    // also verifies that the completion callback is run.
+    base::RunLoop loop;
+    controller_.Stop(shutdown_reason, loop.QuitClosure());
+    loop.Run();
+  }
+
   void DeactivateDataTypeAndStop(ShutdownReason shutdown_reason) {
     controller_.DeactivateDataType(&configurer_);
-    controller_.Stop(shutdown_reason, base::DoNothing());
-    // ModelTypeProcessorProxy does posting of tasks.
-    base::RunLoop().RunUntilIdle();
+    StopAndWait(shutdown_reason);
   }
 
   MockDelegate* delegate() { return &mock_delegate_; }
@@ -329,11 +335,40 @@
 
   ASSERT_EQ(DataTypeController::NOT_RUNNING, controller()->state());
 
-  controller()->Stop(DISABLE_SYNC, base::DoNothing());
+  StopAndWait(DISABLE_SYNC);
 
   EXPECT_EQ(DataTypeController::NOT_RUNNING, controller()->state());
 }
 
+// Test emulates disabling sync when datatype is in error state. Metadata should
+// not be cleared as the delegate is potentially not ready to handle it.
+TEST_F(ModelTypeControllerTest, StopDuringFailedState) {
+  EXPECT_CALL(*delegate(), OnSyncStopping(CLEAR_METADATA)).Times(0);
+
+  ModelErrorHandler error_handler;
+  EXPECT_CALL(*delegate(), OnSyncStarting(_, _))
+      .WillOnce([&](const DataTypeActivationRequest& request,
+                    ModelTypeControllerDelegate::StartCallback callback) {
+        error_handler = request.error_handler;
+      });
+
+  base::MockCallback<DataTypeController::ModelLoadCallback> load_models_done;
+  controller()->LoadModels(MakeConfigureContext(), load_models_done.Get());
+  ASSERT_EQ(DataTypeController::MODEL_STARTING, controller()->state());
+  ASSERT_TRUE(error_handler);
+  // Mimic completion for OnSyncStarting(), with an error.
+  error_handler.Run(ModelError(FROM_HERE, "Test error"));
+  // TODO(mastiz): We shouldn't need RunUntilIdle() here, but
+  // ModelTypeController currently uses task-posting for errors.
+  base::RunLoop().RunUntilIdle();
+
+  ASSERT_EQ(DataTypeController::FAILED, controller()->state());
+
+  StopAndWait(DISABLE_SYNC);
+
+  EXPECT_EQ(DataTypeController::FAILED, controller()->state());
+}
+
 // Test emulates disabling sync when datatype is loading. The controller should
 // wait for completion of the delegate, before stopping it.
 TEST_F(ModelTypeControllerTest, StopWhileStarting) {
@@ -425,7 +460,7 @@
   // At this point, the UI stops the datatype, but it's possible that the
   // backend has already posted a task to the UI thread, which we'll process
   // later below.
-  controller()->Stop(DISABLE_SYNC, base::DoNothing());
+  StopAndWait(DISABLE_SYNC);
   ASSERT_EQ(DataTypeController::NOT_RUNNING, controller()->state());
 
   base::HistogramTester histogram_tester;
diff --git a/components/sync/engine_impl/loopback_server/loopback_server.cc b/components/sync/engine_impl/loopback_server/loopback_server.cc
index 8f19f02..59af9f6 100644
--- a/components/sync/engine_impl/loopback_server/loopback_server.cc
+++ b/components/sync/engine_impl/loopback_server/loopback_server.cc
@@ -78,12 +78,18 @@
   // part of a GetUpdatesResponse. Update internal tracking of max versions as a
   // side effect which will later be used to set response progress markers.
   bool ClientWantsItem(const LoopbackServerEntity& entity) {
-    int64_t version = entity.GetVersion();
     ModelType type = entity.GetModelType();
+    // Return only requested datatypes, which makes sure we don't add new
+    // entries to |response_version_map_|, which would otherwise send
+    // unnecessary (and unrequested) progress markers in the response.
+    auto it = request_version_map_.find(type);
+    if (it == request_version_map_.end())
+      return false;
+    DCHECK_NE(0U, request_version_map_.count(type));
+    int64_t version = entity.GetVersion();
     response_version_map_[type] =
         std::max(response_version_map_[type], version);
-    auto it = request_version_map_.find(type);
-    return it == request_version_map_.end() ? false : it->second < version;
+    return it->second < version;
   }
 
  private:
diff --git a/components/sync/engine_impl/loopback_server/loopback_server_unittest.cc b/components/sync/engine_impl/loopback_server/loopback_server_unittest.cc
index 298e7da..e6e03598 100644
--- a/components/sync/engine_impl/loopback_server/loopback_server_unittest.cc
+++ b/components/sync/engine_impl/loopback_server/loopback_server_unittest.cc
@@ -159,6 +159,14 @@
   EXPECT_EQ(3, response.get_updates().entries_size());
 }
 
+TEST_F(LoopbackServerTest, GetUpdateCommandShouldFilterByDataType) {
+  ClientToServerResponse response =
+      GetUpdatesForType(EntitySpecifics::kPreferenceFieldNumber);
+  // Expect bookmark nodes to be ignored.
+  EXPECT_EQ(0, response.get_updates().entries_size());
+  EXPECT_EQ(1, response.get_updates().new_progress_marker_size());
+}
+
 TEST_F(LoopbackServerTest, ClearServerDataCommand) {
   ClientToServerMessage msg;
   SyncerProtoUtil::SetProtocolVersion(&msg);
diff --git a/components/url_formatter/idn_spoof_checker.cc b/components/url_formatter/idn_spoof_checker.cc
index d2fba49..d189ba44 100644
--- a/components/url_formatter/idn_spoof_checker.cc
+++ b/components/url_formatter/idn_spoof_checker.cc
@@ -244,7 +244,7 @@
   //   - {U+0968 (२), U+09E8 (২), U+0A68 (੨), U+0A68 (੨), U+0AE8 (૨),
   //      U+0ce9 (೩), U+0ced (೭)} => 2,
   //   - {U+0437 (з), U+0499 (ҙ), U+04E1 (ӡ), U+0909 (उ), U+0993 (ও),
-  //      U+0A69 (੩), U+0AE9 (૩), U+0C69 (౩),
+  //      U+0A24 (ਤ), U+0A69 (੩), U+0AE9 (૩), U+0C69 (౩),
   //      U+1012 (ဒ), U+10D5 (ვ), U+10DE (პ)} => 3
   //   - {U+0A6B (੫)} => 4,
   //   - {U+09EA (৪), U+0A6A (੪), U+0b6b (୫)} => 8,
@@ -262,7 +262,7 @@
           "[৭੧૧] > q;"
           "[บບ] > u;"
           "[२২੨੨૨೩೭] > 2;"
-          "[зҙӡउও੩૩౩ဒვპ] > 3;"
+          "[зҙӡउওਤ੩૩౩ဒვპ] > 3;"
           "[੫] > 4;"
           "[৪੪୫] > 8;"
           "[૭୨౨] > 9;"
diff --git a/components/url_formatter/url_formatter_unittest.cc b/components/url_formatter/url_formatter_unittest.cc
index 23d37a7..06c771353 100644
--- a/components/url_formatter/url_formatter_unittest.cc
+++ b/components/url_formatter/url_formatter_unittest.cc
@@ -594,6 +594,11 @@
      L"12\u0993"
      L"4567890.com",
      false},
+    // 12ਤ4567890.com
+    {"xn--124567890-hfu.com",
+     L"12\u0a24"
+     L"4567890.com",
+     false},
     // 12ဒ4567890.com
     {"xn--124567890-6s6a.com",
      L"12\x1012"
diff --git a/components/viz/service/display/overlay_processor.cc b/components/viz/service/display/overlay_processor.cc
index 85bc490..ba80d44 100644
--- a/components/viz/service/display/overlay_processor.cc
+++ b/components/viz/service/display/overlay_processor.cc
@@ -4,6 +4,8 @@
 
 #include "components/viz/service/display/overlay_processor.h"
 
+#include <vector>
+
 #include "base/metrics/histogram_macros.h"
 #include "base/trace_event/trace_event.h"
 #include "build/build_config.h"
@@ -179,6 +181,9 @@
     break;
   }
 
+  if (!successful_strategy && !previous_frame_underlay_rect.IsEmpty())
+    damage_rect->Union(previous_frame_underlay_rect);
+
   UMA_HISTOGRAM_ENUMERATION("Viz.DisplayCompositor.OverlayStrategy",
                             successful_strategy
                                 ? successful_strategy->GetUMAEnum()
diff --git a/components/viz/service/display/overlay_unittest.cc b/components/viz/service/display/overlay_unittest.cc
index f1cb2281..2dd9c48 100644
--- a/components/viz/service/display/overlay_unittest.cc
+++ b/components/viz/service/display/overlay_unittest.cc
@@ -1964,6 +1964,49 @@
   EXPECT_EQ(kOverlayRect, damage_rect_);
 }
 
+TEST_F(UnderlayTest, UpdateDamageRectWhenNoPromotion) {
+  // In the first pass there is an overlay promotion and the expected damage
+  // size should be unchanged.
+  // In the second pass there is no overlay promotion, but the damage should be
+  // the union of the damage_rect with CreateRenderPass's output_rect which is
+  // {0, 0, 256, 256}.
+  bool has_fullscreen_candidate[] = {true, false};
+  gfx::Rect damages[] = {gfx::Rect(0, 0, 32, 32), gfx::Rect(0, 0, 312, 16)};
+  gfx::Rect expected_damages[] = {gfx::Rect(0, 0, 32, 32),
+                                  gfx::Rect(0, 0, 312, 256)};
+  size_t expected_candidate_size[] = {1, 0};
+
+  for (int i = 0; i < 2; ++i) {
+    std::unique_ptr<RenderPass> pass = CreateRenderPass();
+
+    if (has_fullscreen_candidate[i]) {
+      CreateFullscreenCandidateQuad(
+          resource_provider_.get(), child_resource_provider_.get(),
+          child_provider_.get(), pass->shared_quad_state_list.back(),
+          pass.get());
+    }
+
+    gfx::Rect damage_rect{damages[i]};
+
+    // Add something behind it.
+    CreateFullscreenOpaqueQuad(resource_provider_.get(),
+                               pass->shared_quad_state_list.back(), pass.get());
+
+    OverlayCandidateList candidate_list;
+    OverlayProcessor::FilterOperationsMap render_pass_filters;
+    OverlayProcessor::FilterOperationsMap render_pass_background_filters;
+    RenderPassList pass_list;
+    pass_list.push_back(std::move(pass));
+    overlay_processor_->ProcessForOverlays(
+        resource_provider_.get(), &pass_list, GetIdentityColorMatrix(),
+        render_pass_filters, render_pass_background_filters, &candidate_list,
+        nullptr, nullptr, &damage_rect, &content_bounds_);
+
+    EXPECT_EQ(expected_damages[i], damage_rect);
+    ASSERT_EQ(expected_candidate_size[i], candidate_list.size());
+  }
+}
+
 TEST_F(UnderlayCastTest, NoOverlayContentBounds) {
   std::unique_ptr<RenderPass> pass = CreateRenderPass();
 
diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc
index 43c361d..a1d56afd 100644
--- a/content/browser/browser_thread_impl.cc
+++ b/content/browser/browser_thread_impl.cc
@@ -21,6 +21,10 @@
 #include "build/build_config.h"
 #include "content/public/browser/content_browser_client.h"
 
+#if defined(OS_ANDROID)
+#include "base/android/task_scheduler/post_task_android.h"
+#endif
+
 namespace content {
 
 namespace {
@@ -99,12 +103,24 @@
 
   DCHECK(!globals.task_runners[identifier_]);
   globals.task_runners[identifier_] = std::move(task_runner);
+
+#if defined(OS_ANDROID)
+  // TODO(alexclarke): Move this to the BrowserUIThreadScheduler.
+  if (identifier_ == BrowserThread::ID::UI)
+    base::PostTaskAndroid::SignalNativeSchedulerReady();
+#endif
 }
 
 BrowserThreadImpl::~BrowserThreadImpl() {
   BrowserThreadGlobals& globals = GetBrowserThreadGlobals();
   DCHECK_CALLED_ON_VALID_THREAD(globals.main_thread_checker_);
 
+#if defined(OS_ANDROID)
+  // TODO(alexclarke): Move this to the BrowserUIThreadScheduler.
+  if (identifier_ == BrowserThread::ID::UI)
+    base::PostTaskAndroid::SignalNativeSchedulerShutdown();
+#endif
+
   DCHECK_EQ(base::subtle::NoBarrier_Load(&globals.states[identifier_]),
             BrowserThreadState::RUNNING);
   base::subtle::NoBarrier_Store(&globals.states[identifier_],
diff --git a/content/browser/cache_storage/cache_storage_context_impl.cc b/content/browser/cache_storage/cache_storage_context_impl.cc
index ffc6bc04..9e4ee836 100644
--- a/content/browser/cache_storage/cache_storage_context_impl.cc
+++ b/content/browser/cache_storage/cache_storage_context_impl.cc
@@ -82,17 +82,19 @@
 }
 
 void CacheStorageContextImpl::GetAllOriginsInfo(
-    const CacheStorageContext::GetUsageInfoCallback& callback) {
+    CacheStorageContext::GetUsageInfoCallback callback) {
   DCHECK_CURRENTLY_ON(BrowserThread::IO);
 
   if (!cache_manager_) {
     base::PostTaskWithTraits(
         FROM_HERE, {BrowserThread::IO},
-        base::BindOnce(callback, std::vector<CacheStorageUsageInfo>()));
+        base::BindOnce(std::move(callback),
+                       std::vector<CacheStorageUsageInfo>()));
     return;
   }
 
-  cache_manager_->GetAllOriginsUsage(CacheStorageOwner::kCacheAPI, callback);
+  cache_manager_->GetAllOriginsUsage(CacheStorageOwner::kCacheAPI,
+                                     std::move(callback));
 }
 
 void CacheStorageContextImpl::DeleteForOrigin(const GURL& origin) {
diff --git a/content/browser/cache_storage/cache_storage_context_impl.h b/content/browser/cache_storage/cache_storage_context_impl.h
index cedfd96..8398908b 100644
--- a/content/browser/cache_storage/cache_storage_context_impl.h
+++ b/content/browser/cache_storage/cache_storage_context_impl.h
@@ -77,7 +77,7 @@
       ChromeBlobStorageContext* blob_storage_context);
 
   // CacheStorageContext
-  void GetAllOriginsInfo(const GetUsageInfoCallback& callback) override;
+  void GetAllOriginsInfo(GetUsageInfoCallback callback) override;
   void DeleteForOrigin(const GURL& origin) override;
 
   // Only callable on the IO thread.
diff --git a/content/browser/child_process_launcher_helper.cc b/content/browser/child_process_launcher_helper.cc
index 2f75fff5..108bfed0 100644
--- a/content/browser/child_process_launcher_helper.cc
+++ b/content/browser/child_process_launcher_helper.cc
@@ -88,9 +88,13 @@
 
   BeforeLaunchOnClientThread();
 
+#if defined(OS_FUCHSIA)
+  mojo_channel_.emplace();
+#else   // !defined(OS_FUCHSIA)
   mojo_named_channel_ = CreateNamedPlatformChannelOnClientThread();
   if (!mojo_named_channel_)
     mojo_channel_.emplace();
+#endif  //  !defined(OS_FUCHSIA)
 
   GetProcessLauncherTaskRunner()->PostTask(
       FROM_HERE,
@@ -138,17 +142,21 @@
   // we go out of scope regardless of the outcome below.
   mojo::OutgoingInvitation invitation = std::move(mojo_invitation_);
   if (process.process.IsValid()) {
+#if !defined(OS_FUCHSIA)
+    if (mojo_named_channel_) {
+      DCHECK(!mojo_channel_);
+      mojo::OutgoingInvitation::Send(
+          std::move(invitation), process.process.Handle(),
+          mojo_named_channel_->TakeServerEndpoint(), process_error_callback_);
+    } else
+#endif
     // Set up Mojo IPC to the new process.
-    if (mojo_channel_) {
+    {
+      DCHECK(mojo_channel_);
       DCHECK(mojo_channel_->local_endpoint().is_valid());
       mojo::OutgoingInvitation::Send(
           std::move(invitation), process.process.Handle(),
           mojo_channel_->TakeLocalEndpoint(), process_error_callback_);
-    } else {
-      DCHECK(mojo_named_channel_);
-      mojo::OutgoingInvitation::Send(
-          std::move(invitation), process.process.Handle(),
-          mojo_named_channel_->TakeServerEndpoint(), process_error_callback_);
     }
   }
 
diff --git a/content/browser/child_process_launcher_helper.h b/content/browser/child_process_launcher_helper.h
index da64a5c..3854d3f 100644
--- a/content/browser/child_process_launcher_helper.h
+++ b/content/browser/child_process_launcher_helper.h
@@ -15,12 +15,15 @@
 #include "build/build_config.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/common/result_codes.h"
-#include "mojo/public/cpp/platform/named_platform_channel.h"
 #include "mojo/public/cpp/platform/platform_channel.h"
 #include "mojo/public/cpp/system/invitation.h"
 #include "services/catalog/public/cpp/manifest_parsing_util.h"
 #include "services/service_manager/zygote/common/zygote_buildflags.h"
 
+#if !defined(OS_FUCHSIA)
+#include "mojo/public/cpp/platform/named_platform_channel.h"
+#endif
+
 #if defined(OS_ANDROID)
 #include "base/android/scoped_java_ref.h"
 #endif
@@ -106,11 +109,13 @@
   // Platform specific.
   void BeforeLaunchOnClientThread();
 
+#if !defined(OS_FUCHSIA)
   // Called to give implementors a chance at creating a server pipe. Platform-
   // specific. Returns |base::nullopt| if the helper should initialize
   // a regular PlatformChannel for communication instead.
   base::Optional<mojo::NamedPlatformChannel>
   CreateNamedPlatformChannelOnClientThread();
+#endif
 
   // Returns the list of files that should be mapped in the child process.
   // Platform specific.
@@ -221,10 +226,12 @@
   // |CreateNamedPlatformChannelOnClientThread()|.
   base::Optional<mojo::PlatformChannel> mojo_channel_;
 
+#if !defined(OS_FUCHSIA)
   // May be used in exclusion to the above if the platform helper implementation
   // returns a valid server endpoint from
   // |CreateNamedPlatformChannelOnClientThread()|.
   base::Optional<mojo::NamedPlatformChannel> mojo_named_channel_;
+#endif
 
   bool terminate_on_shutdown_;
   mojo::OutgoingInvitation mojo_invitation_;
diff --git a/content/browser/child_process_launcher_helper_fuchsia.cc b/content/browser/child_process_launcher_helper_fuchsia.cc
index c834ebd2..3d1e5cf 100644
--- a/content/browser/child_process_launcher_helper_fuchsia.cc
+++ b/content/browser/child_process_launcher_helper_fuchsia.cc
@@ -58,12 +58,6 @@
   sandbox_policy_.Initialize(delegate_->GetSandboxType());
 }
 
-base::Optional<mojo::NamedPlatformChannel>
-ChildProcessLauncherHelper::CreateNamedPlatformChannelOnClientThread() {
-  DCHECK_CURRENTLY_ON(client_thread_id_);
-  return base::nullopt;
-}
-
 std::unique_ptr<FileMappedForLaunch>
 ChildProcessLauncherHelper::GetFilesToMap() {
   DCHECK(CurrentlyOnProcessLauncherTaskRunner());
diff --git a/content/browser/devtools/devtools_network_interceptor.h b/content/browser/devtools/devtools_network_interceptor.h
index 9d89ad6..684ec854 100644
--- a/content/browser/devtools/devtools_network_interceptor.h
+++ b/content/browser/devtools/devtools_network_interceptor.h
@@ -14,6 +14,11 @@
 #include "mojo/public/cpp/system/data_pipe.h"
 #include "net/base/net_errors.h"
 
+namespace net {
+class AuthChallengeInfo;
+class HttpResponseHeaders;
+}  // namespace net
+
 namespace content {
 
 struct InterceptedRequestInfo {
@@ -21,18 +26,15 @@
   ~InterceptedRequestInfo();
 
   std::string interception_id;
-  std::unique_ptr<protocol::Network::Request> network_request;
   base::UnguessableToken frame_id;
   ResourceType resource_type;
   bool is_navigation;
-  protocol::Maybe<bool> is_download;
-  protocol::Maybe<protocol::Object> redirect_headers;
-  protocol::Maybe<int> redirect_status_code;
-  protocol::Maybe<protocol::String> redirect_url;
-  protocol::Maybe<protocol::Network::AuthChallenge> auth_challenge;
   int response_error_code;
-  protocol::Maybe<int> http_response_status_code;
-  protocol::Maybe<protocol::Object> response_headers;
+  std::unique_ptr<protocol::Network::Request> network_request;
+  scoped_refptr<net::AuthChallengeInfo> auth_challenge;
+  scoped_refptr<net::HttpResponseHeaders> response_headers;
+  protocol::Maybe<bool> is_download;
+  protocol::Maybe<protocol::String> redirect_url;
 };
 
 class DevToolsNetworkInterceptor {
diff --git a/content/browser/devtools/devtools_url_interceptor_request_job.cc b/content/browser/devtools/devtools_url_interceptor_request_job.cc
index d5682d1..6c66d79 100644
--- a/content/browser/devtools/devtools_url_interceptor_request_job.cc
+++ b/content/browser/devtools/devtools_url_interceptor_request_job.cc
@@ -793,15 +793,7 @@
   waiting_for_user_response_ = WaitingForUserResponse::WAITING_FOR_AUTH_ACK;
 
   std::unique_ptr<InterceptedRequestInfo> request_info = BuildRequestInfo();
-  request_info->auth_challenge =
-      protocol::Network::AuthChallenge::Create()
-          .SetSource(auth_info->is_proxy
-                         ? protocol::Network::AuthChallenge::SourceEnum::Proxy
-                         : protocol::Network::AuthChallenge::SourceEnum::Server)
-          .SetOrigin(auth_info->challenger.Serialize())
-          .SetScheme(auth_info->scheme)
-          .SetRealm(auth_info->realm)
-          .Build();
+  request_info->auth_challenge = auth_info;
   base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
                            base::BindOnce(callback_, std::move(request_info)));
 }
@@ -839,24 +831,12 @@
   // Otherwise we will need to ask what to do via DevTools protocol.
   *defer_redirect = true;
 
-  size_t iter = 0;
-  std::string header_name;
-  std::string header_value;
-  std::unique_ptr<protocol::DictionaryValue> headers_dict(
-      protocol::DictionaryValue::create());
-  while (request.response_headers()->EnumerateHeaderLines(&iter, &header_name,
-                                                          &header_value)) {
-    headers_dict->setString(header_name, header_value);
-  }
-
   redirect_.reset(new net::RedirectInfo(redirectinfo));
 
   waiting_for_user_response_ = WaitingForUserResponse::WAITING_FOR_REQUEST_ACK;
 
   std::unique_ptr<InterceptedRequestInfo> request_info = BuildRequestInfo();
-  request_info->response_headers =
-      protocol::Object::fromValue(headers_dict.get(), nullptr);
-  request_info->http_response_status_code = redirectinfo.status_code;
+  request_info->response_headers = request.response_headers();
   request_info->redirect_url = redirectinfo.new_url.spec();
   base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
                            base::BindOnce(callback_, std::move(request_info)));
@@ -879,19 +859,8 @@
   } else {
     std::unique_ptr<protocol::DictionaryValue> headers_dict(
         protocol::DictionaryValue::create());
-    if (sub_request_->request()->response_headers()) {
-      size_t iter = 0;
-      std::string name;
-      std::string value;
-      while (sub_request_->request()->response_headers()->EnumerateHeaderLines(
-          &iter, &name, &value)) {
-        headers_dict->setString(name, value);
-      }
-    }
-    request_info->http_response_status_code =
-        sub_request_->request()->GetResponseCode();
     request_info->response_headers =
-        protocol::Object::fromValue(headers_dict.get(), nullptr);
+        sub_request_->request()->response_headers();
     request_info->is_download = IsDownload(request(), sub_request_->request());
   }
   base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI},
diff --git a/content/browser/devtools/devtools_url_loader_interceptor.cc b/content/browser/devtools/devtools_url_loader_interceptor.cc
index afc892f..35e4e3b 100644
--- a/content/browser/devtools/devtools_url_loader_interceptor.cc
+++ b/content/browser/devtools/devtools_url_loader_interceptor.cc
@@ -1165,22 +1165,8 @@
   result->is_navigation = resource_type == RESOURCE_TYPE_MAIN_FRAME ||
                           resource_type == RESOURCE_TYPE_SUB_FRAME;
 
-  // TODO(caseq): merge with NetworkHandler::BuildResponse()
-  if (head && head->headers) {
-    result->http_response_status_code = head->headers->response_code();
-    auto headers_dict = protocol::DictionaryValue::create();
-    size_t iter = 0;
-    std::string name;
-    std::string value;
-    while (head->headers->EnumerateHeaderLines(&iter, &name, &value)) {
-      std::string old_value;
-      bool merge_with_another = headers_dict->getString(name, &old_value);
-      headers_dict->setString(
-          name, merge_with_another ? old_value + '\n' + value : value);
-    }
-    result->response_headers =
-        protocol::Object::fromValue(headers_dict.get(), nullptr);
-  }
+  if (head && head->headers)
+    result->response_headers = head->headers;
   return result;
 }
 
@@ -1389,7 +1375,6 @@
 
   std::unique_ptr<InterceptedRequestInfo> request_info =
       BuildRequestInfo(&head);
-  request_info->http_response_status_code = redirect_info.status_code;
   request_info->redirect_url = redirect_info.new_url.spec();
   NotifyClient(std::move(request_info));
 }
@@ -1468,15 +1453,7 @@
   }
   state_ = State::kAuthRequired;
   auto request_info = BuildRequestInfo(nullptr);
-  request_info->auth_challenge =
-      protocol::Network::AuthChallenge::Create()
-          .SetSource(auth_info->is_proxy
-                         ? protocol::Network::AuthChallenge::SourceEnum::Proxy
-                         : protocol::Network::AuthChallenge::SourceEnum::Server)
-          .SetOrigin(auth_info->challenger.Serialize())
-          .SetScheme(auth_info->scheme)
-          .SetRealm(auth_info->realm)
-          .Build();
+  request_info->auth_challenge = auth_info;
   pending_auth_callback_ = std::move(callback);
   NotifyClient(std::move(request_info));
 }
diff --git a/content/browser/devtools/protocol/network_handler.cc b/content/browser/devtools/protocol/network_handler.cc
index 1d3c3137..722e29a1 100644
--- a/content/browser/devtools/protocol/network_handler.cc
+++ b/content/browser/devtools/protocol/network_handler.cc
@@ -1436,22 +1436,29 @@
   return security_details;
 }
 
+std::unique_ptr<protocol::Object> BuildResponseHeaders(
+    scoped_refptr<net::HttpResponseHeaders> headers) {
+  auto headers_dict = DictionaryValue::create();
+  if (!headers)
+    return std::make_unique<protocol::Object>(std::move(headers_dict));
+  size_t iterator = 0;
+  std::string name;
+  std::string value;
+  while (headers->EnumerateHeaderLines(&iterator, &name, &value)) {
+    std::string old_value;
+    bool merge_with_another = headers_dict->getString(name, &old_value);
+    headers_dict->setString(
+        name, merge_with_another ? old_value + '\n' + value : value);
+  }
+  return std::make_unique<protocol::Object>(std::move(headers_dict));
+}
+
 std::unique_ptr<Network::Response> BuildResponse(
     const GURL& url,
     const network::ResourceResponseInfo& info) {
-  std::unique_ptr<DictionaryValue> headers_dict(DictionaryValue::create());
   int status = 0;
   std::string status_text;
   if (info.headers) {
-    size_t iterator = 0;
-    std::string name;
-    std::string value;
-    while (info.headers->EnumerateHeaderLines(&iterator, &name, &value)) {
-      std::string old_value;
-      bool merge_with_another = headers_dict->getString(name, &old_value);
-      headers_dict->setString(
-          name, merge_with_another ? old_value + '\n' + value : value);
-    }
     status = info.headers->response_code();
     status_text = info.headers->GetStatusText();
   } else if (url.SchemeIs(url::kDataScheme)) {
@@ -1465,7 +1472,7 @@
           .SetUrl(NetworkHandler::ExtractFragment(url, &url_fragment))
           .SetStatus(status)
           .SetStatusText(status_text)
-          .SetHeaders(Object::fromValue(headers_dict.get(), nullptr))
+          .SetHeaders(BuildResponseHeaders(info.headers))
           .SetMimeType(info.mime_type)
           .SetConnectionReused(info.load_timing.socket_reused)
           .SetConnectionId(info.load_timing.socket_log_id)
@@ -2114,13 +2121,34 @@
   protocol::Maybe<protocol::Network::ErrorReason> error_reason;
   if (info->response_error_code < 0)
     error_reason = NetErrorToString(info->response_error_code);
+
+  Maybe<int> status_code;
+  Maybe<protocol::Network::Headers> response_headers;
+  if (info->response_headers) {
+    status_code = info->response_headers->response_code();
+    response_headers = BuildResponseHeaders(info->response_headers);
+  }
+
+  std::unique_ptr<protocol::Network::AuthChallenge> auth_challenge;
+  if (info->auth_challenge) {
+    auth_challenge =
+        protocol::Network::AuthChallenge::Create()
+            .SetSource(info->auth_challenge->is_proxy
+                           ? Network::AuthChallenge::SourceEnum::Proxy
+                           : Network::AuthChallenge::SourceEnum::Server)
+            .SetOrigin(info->auth_challenge->challenger.Serialize())
+            .SetScheme(info->auth_challenge->scheme)
+            .SetRealm(info->auth_challenge->realm)
+            .Build();
+  }
+
   frontend_->RequestIntercepted(
       info->interception_id, std::move(info->network_request),
       info->frame_id.ToString(), ResourceTypeToString(info->resource_type),
       info->is_navigation, std::move(info->is_download),
-      std::move(info->redirect_url), std::move(info->auth_challenge),
-      std::move(error_reason), std::move(info->http_response_status_code),
-      std::move(info->response_headers));
+      std::move(info->redirect_url), std::move(auth_challenge),
+      std::move(error_reason), std::move(status_code),
+      std::move(response_headers));
 }
 
 void NetworkHandler::SetNetworkConditions(
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 753566b..ee574ee 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -1239,7 +1239,7 @@
   return *s_data;
 }
 
-void OnNetworkServiceCrash() {
+void OnNetworkServiceCrashForCorb() {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
   network::mojom::NetworkService* network_service = GetNetworkService();
   for (int process_id : GetCurrentCorbPluginExceptions())
@@ -1289,7 +1289,7 @@
     static NetworkServiceCrashHandlerId s_crash_handler_id;
     if (s_crash_handler_id.is_null()) {
       s_crash_handler_id = RegisterNetworkServiceCrashHandler(
-          base::BindRepeating(&OnNetworkServiceCrash));
+          base::BindRepeating(&OnNetworkServiceCrashForCorb));
     }
 
     GetCurrentCorbPluginExceptions().insert(process_id);
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 2890efe..65c16ecd 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -2092,8 +2092,6 @@
   window_->UpdateLocalSurfaceIdFromEmbeddedClient(
       child_allocated_local_surface_id,
       child_local_surface_id_allocation_time.value_or(base::TimeTicks()));
-  if (IsLocalSurfaceIdAllocationSuppressed())
-    return false;
 
   if (delegated_frame_host_) {
     delegated_frame_host_->EmbedSurface(window_->GetLocalSurfaceId(),
@@ -2538,11 +2536,6 @@
   return window_->GetSurfaceIdAllocator(std::move(allocation_task));
 }
 
-bool RenderWidgetHostViewAura::IsLocalSurfaceIdAllocationSuppressed() const {
-  DCHECK(window_);
-  return window_->IsLocalSurfaceIdAllocationSuppressed();
-}
-
 void RenderWidgetHostViewAura::DidNavigate() {
   // The first navigation does not need a new LocalSurfaceID. The renderer can
   // use the ID that was already provided.
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
index 623dcc0..0c603555 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.h
+++ b/content/browser/renderer_host/render_widget_host_view_aura.h
@@ -208,8 +208,6 @@
   viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
       const cc::RenderFrameMetadata& metadata) override;
 
-  bool IsLocalSurfaceIdAllocationSuppressed() const override;
-
   void DidNavigate() override;
   void TakeFallbackContentFrom(RenderWidgetHostView* view) override;
 
diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
index 27936ce3..4163b36 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.cc
+++ b/content/browser/renderer_host/render_widget_host_view_base.cc
@@ -555,10 +555,6 @@
   return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
 }
 
-bool RenderWidgetHostViewBase::IsLocalSurfaceIdAllocationSuppressed() const {
-  return false;
-}
-
 base::WeakPtr<RenderWidgetHostViewBase> RenderWidgetHostViewBase::GetWeakPtr() {
   return weak_factory_.GetWeakPtr();
 }
diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
index 5b3bb17..7163d2b 100644
--- a/content/browser/renderer_host/render_widget_host_view_base.h
+++ b/content/browser/renderer_host/render_widget_host_view_base.h
@@ -203,8 +203,6 @@
   virtual viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
       const cc::RenderFrameMetadata& metadata);
 
-  virtual bool IsLocalSurfaceIdAllocationSuppressed() const;
-
   base::WeakPtr<RenderWidgetHostViewBase> GetWeakPtr();
 
   //----------------------------------------------------------------------------
diff --git a/content/browser/webrtc/webrtc_image_capture_browsertest.cc b/content/browser/webrtc/webrtc_image_capture_browsertest.cc
index a034c7e7..bec1c122 100644
--- a/content/browser/webrtc/webrtc_image_capture_browsertest.cc
+++ b/content/browser/webrtc/webrtc_image_capture_browsertest.cc
@@ -87,10 +87,6 @@
     ASSERT_FALSE(base::CommandLine::ForCurrentProcess()->HasSwitch(
         switches::kUseFakeDeviceForMediaStream));
 
-    // "GetUserMedia": enables navigator.mediaDevices.getUserMedia();
-    // TODO(mcasas): remove GetUserMedia after https://crbug.com/503227.
-    base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-        switches::kEnableBlinkFeatures, "GetUserMedia");
   }
 
   void SetUp() override {
diff --git a/content/child/runtime_features.cc b/content/child/runtime_features.cc
index efe050e5..b1426ad0 100644
--- a/content/child/runtime_features.cc
+++ b/content/child/runtime_features.cc
@@ -400,6 +400,9 @@
   WebRuntimeFeatures::EnableModernMediaControls(
       base::FeatureList::IsEnabled(media::kUseModernMediaControls));
 
+  WebRuntimeFeatures::EnableWorkStealingInScriptRunner(
+      base::FeatureList::IsEnabled(features::kWorkStealingInScriptRunner));
+
   WebRuntimeFeatures::EnableScheduledScriptStreaming(
       base::FeatureList::IsEnabled(features::kScheduledScriptStreaming));
 
diff --git a/content/public/android/BUILD.gn b/content/public/android/BUILD.gn
index 04b83261..f639913 100644
--- a/content/public/android/BUILD.gn
+++ b/content/public/android/BUILD.gn
@@ -228,6 +228,7 @@
     "java/src/org/chromium/content_public/browser/AccessibilitySnapshotNode.java",
     "java/src/org/chromium/content_public/browser/ActionModeCallbackHelper.java",
     "java/src/org/chromium/content_public/browser/BrowserStartupController.java",
+    "java/src/org/chromium/content_public/browser/BrowserTaskExecutor.java",
     "java/src/org/chromium/content_public/browser/ContentViewStatics.java",
     "java/src/org/chromium/content_public/browser/DeviceUtils.java",
     "java/src/org/chromium/content_public/browser/InputMethodManagerWrapper.java",
@@ -259,6 +260,7 @@
     "java/src/org/chromium/content_public/browser/SmartClipProvider.java",
     "java/src/org/chromium/content_public/browser/SpeechRecognition.java",
     "java/src/org/chromium/content_public/browser/RenderCoordinates.java",
+    "java/src/org/chromium/content_public/browser/UiThreadTaskTraits.java",
     "java/src/org/chromium/content_public/browser/ViewEventSink.java",
     "java/src/org/chromium/content_public/browser/WebContents.java",
     "java/src/org/chromium/content_public/browser/WebContentsAccessibility.java",
@@ -500,6 +502,8 @@
     "javatests/src/org/chromium/content/browser/input/TextSuggestionMenuTest.java",
     "javatests/src/org/chromium/content/browser/picker/DateTimePickerDialogTest.java",
     "javatests/src/org/chromium/content/browser/remoteobjects/RemoteObjectHostImplTest.java",
+    "javatests/src/org/chromium/content/browser/scheduler/NativePostTaskTest.java",
+    "javatests/src/org/chromium/content/browser/scheduler/UiThreadSchedulerTest.java",
     "javatests/src/org/chromium/content/browser/webcontents/AccessibilitySnapshotTest.java",
     "javatests/src/org/chromium/content/browser/webcontents/WebContentsTest.java",
     "javatests/src/org/chromium/content/common/ServiceManagerConnectionImplTest.java",
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/BrowserTaskExecutor.java b/content/public/android/java/src/org/chromium/content_public/browser/BrowserTaskExecutor.java
new file mode 100644
index 0000000..ee555e2
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content_public/browser/BrowserTaskExecutor.java
@@ -0,0 +1,71 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content_public.browser;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.task.PostTask;
+import org.chromium.base.task.SequencedTaskRunner;
+import org.chromium.base.task.SingleThreadTaskRunner;
+import org.chromium.base.task.SingleThreadTaskRunnerImpl;
+import org.chromium.base.task.TaskExecutor;
+import org.chromium.base.task.TaskRunner;
+import org.chromium.base.task.TaskTraits;
+
+import java.util.WeakHashMap;
+
+/**
+ * This {@link TaskExecutor} is for tasks posted with {@link UiThreadTaskTraits}. It maps directly
+ * to content::BrowserTaskExecutor except only UI thread posting is supported from java.
+ *
+ * NB if you wish to post to the thread pool then use {@link TaskTraits} instead of {@link
+ * UiThreadTaskTraits}.
+ */
+public class BrowserTaskExecutor implements TaskExecutor {
+    @Override
+    public TaskRunner createTaskRunner(TaskTraits taskTraits) {
+        return createSingleThreadTaskRunner(taskTraits);
+    }
+
+    @Override
+    public SequencedTaskRunner createSequencedTaskRunner(TaskTraits taskTraits) {
+        return createSingleThreadTaskRunner(taskTraits);
+    }
+
+    /**
+     * This maps to a single thread within the native thread pool. Due to that contract we
+     * can't run tasks posted on it until native has started.
+     */
+    @Override
+    public SingleThreadTaskRunner createSingleThreadTaskRunner(TaskTraits taskTraits) {
+        synchronized (mTaskRunners) {
+            SingleThreadTaskRunner taskRunner = mTaskRunners.get(taskTraits);
+            if (taskRunner != null) return taskRunner;
+
+            // TODO(alexclarke): ThreadUtils.getUiThreadHandler shouldn't be in base.
+            taskRunner =
+                    new SingleThreadTaskRunnerImpl(ThreadUtils.getUiThreadHandler(), taskTraits);
+            mTaskRunners.put(taskTraits, taskRunner);
+            return taskRunner;
+        }
+    }
+
+    @Override
+    public void postTask(TaskTraits taskTraits, Runnable task) {
+        createSingleThreadTaskRunner(taskTraits).postTask(task);
+    }
+
+    public static void register() {
+        // In some tests we will get called multiple times.
+        if (sRegistered) return;
+
+        PostTask.registerTaskExecutor(UiThreadTaskTraits.EXTENSION_ID, new BrowserTaskExecutor());
+        sRegistered = true;
+    }
+
+    private final WeakHashMap<TaskTraits, SingleThreadTaskRunner> mTaskRunners =
+            new WeakHashMap<>();
+
+    private static boolean sRegistered;
+}
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/UiThreadTaskTraits.java b/content/public/android/java/src/org/chromium/content_public/browser/UiThreadTaskTraits.java
new file mode 100644
index 0000000..5fb1659
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content_public/browser/UiThreadTaskTraits.java
@@ -0,0 +1,43 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content_public.browser;
+
+import org.chromium.base.task.TaskTraits;
+
+/**
+ * Traits for tasks that need to run on the Browser UI thread. Keep in sync with
+ * content::BrowserTaskTraitsExtension.
+ *
+ * NB if you wish to post to the thread pool then use {@link TaskTraits} instead of {@link
+ * UiThreadTaskTraits}.
+ */
+public class UiThreadTaskTraits extends TaskTraits {
+    // Corresponds to content::BrowserTaskTraitsExtension.
+    static final byte EXTENSION_ID = 1;
+
+    private static final byte UI_THREAD_ID = 0; // Corresponds to content::BrowserThread::ID.
+
+    // Keep in sync with content::BrowserTaskTraitsExtension::Serialize.
+    private static final byte THREAD_INDEX = 0;
+    private static final byte NESTING_INDEX = 1;
+
+    private static final byte[] sDefaultExtensionData = getDefaultExtesionData();
+
+    public UiThreadTaskTraits() {
+        setExtensionId(EXTENSION_ID);
+        setExtensionData(sDefaultExtensionData);
+    }
+
+    private static byte[] getDefaultExtesionData() {
+        byte extensionData[] = new byte[TaskTraits.EXTENSION_STORAGE_SIZE];
+
+        // Note we don't specify the UI thread directly here because it's ID 0 and the array is
+        // initialized to zero.
+
+        // TODO(crbug.com/876272) Remove this if possible.
+        extensionData[NESTING_INDEX] = 1; // Allow the task to run in a nested RunLoop.
+        return extensionData;
+    }
+}
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/scheduler/NativePostTaskTest.java b/content/public/android/javatests/src/org/chromium/content/browser/scheduler/NativePostTaskTest.java
new file mode 100644
index 0000000..ac2f6df
--- /dev/null
+++ b/content/public/android/javatests/src/org/chromium/content/browser/scheduler/NativePostTaskTest.java
@@ -0,0 +1,209 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser.scheduler;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.support.test.filters.MediumTest;
+
+import org.junit.After;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.task.PostTask;
+import org.chromium.base.task.TaskRunner;
+import org.chromium.base.task.TaskTraits;
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.task.SchedulerTestHelpers;
+import org.chromium.base.test.task.TaskSchedulerTestHelpers;
+import org.chromium.base.test.util.MinAndroidSdkLevel;
+import org.chromium.content.app.ContentMain;
+import org.chromium.content_public.browser.test.NativeLibraryTestRule;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Test class for {@link PostTask}.
+ *
+ * Due to layering concerns we can't test native backed task posting in base, so we do it here
+ * instead.
+ */
+@RunWith(BaseJUnit4ClassRunner.class)
+@MinAndroidSdkLevel(23)
+@TargetApi(Build.VERSION_CODES.M)
+public class NativePostTaskTest {
+    @Rule
+    public NativeLibraryTestRule mNativeLibraryTestRule = new NativeLibraryTestRule();
+
+    @After
+    public void tearDown() {
+        TaskSchedulerTestHelpers.disableTaskSchedulerExecutionForTesting();
+    }
+
+    @Test
+    @MediumTest
+    public void testNativePostTask() throws Exception {
+        startNativeScheduler();
+
+        // This should not timeout.
+        final Object lock = new Object();
+        final AtomicBoolean taskExecuted = new AtomicBoolean();
+        PostTask.postTask(new TaskTraits(), new Runnable() {
+            @Override
+            public void run() {
+                synchronized (lock) {
+                    taskExecuted.set(true);
+                    lock.notify();
+                }
+            }
+        });
+        synchronized (lock) {
+            try {
+                while (!taskExecuted.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+
+    @Test
+    @MediumTest
+    public void testCreateTaskRunner() throws Exception {
+        startNativeScheduler();
+        TaskRunner taskQueue = PostTask.createTaskRunner(new TaskTraits());
+        // This should not time out.
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+    }
+
+    @Test
+    @MediumTest
+    public void testCreateSequencedTaskRunner() throws Exception {
+        startNativeScheduler();
+        TaskRunner taskQueue = PostTask.createSequencedTaskRunner(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 2);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 3);
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+
+        assertThat(orderList, contains(1, 2, 3));
+    }
+
+    @Test
+    @MediumTest
+    public void testCreateSingleThreadSequencedTaskRunner() throws Exception {
+        startNativeScheduler();
+        TaskRunner taskQueue = PostTask.createSingleThreadTaskRunner(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 2);
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 3);
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(taskQueue);
+
+        assertThat(orderList, contains(1, 2, 3));
+    }
+
+    @Test
+    @MediumTest
+    public void testCreateTaskRunnerMigrationToNative() throws Exception {
+        TaskRunner taskQueue = PostTask.createTaskRunner(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+
+        postRepeatingTaskAndStartNativeSchedulerThenWaitForTaskToRun(taskQueue, new Runnable() {
+            @Override
+            public void run() {
+                orderList.add(2);
+            }
+        });
+
+        assertThat(orderList, contains(1, 2));
+    }
+
+    @Test
+    @MediumTest
+    public void testCreateSequencedTaskRunnerMigrationToNative() throws Exception {
+        TaskRunner taskQueue = PostTask.createSequencedTaskRunner(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+
+        postRepeatingTaskAndStartNativeSchedulerThenWaitForTaskToRun(taskQueue, new Runnable() {
+            @Override
+            public void run() {
+                orderList.add(2);
+            }
+        });
+
+        assertThat(orderList, contains(1, 2));
+    }
+
+    @Test
+    @MediumTest
+    public void testCreateSingleThreadSequencedTaskRunnerMigrationToNative() throws Exception {
+        TaskRunner taskQueue = PostTask.createSingleThreadTaskRunner(new TaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(taskQueue, orderList, 1);
+
+        postRepeatingTaskAndStartNativeSchedulerThenWaitForTaskToRun(taskQueue, new Runnable() {
+            @Override
+            public void run() {
+                orderList.add(2);
+            }
+        });
+
+        assertThat(orderList, contains(1, 2));
+    }
+
+    private void postRepeatingTaskAndStartNativeSchedulerThenWaitForTaskToRun(
+            TaskRunner taskQueue, Runnable taskToRunAfterNativeSchedulerLoaded) throws Exception {
+        final Object lock = new Object();
+        final AtomicBoolean taskRun = new AtomicBoolean();
+        final AtomicBoolean nativeSchedulerStarted = new AtomicBoolean();
+
+        // Post a task that reposts itself until nativeSchedulerStarted is set to true.  This tests
+        // that tasks posted before the native library is loaded still run afterwards.
+        taskQueue.postTask(new Runnable() {
+            @Override
+            public void run() {
+                if (nativeSchedulerStarted.compareAndSet(true, true)) {
+                    taskToRunAfterNativeSchedulerLoaded.run();
+                    synchronized (lock) {
+                        taskRun.set(true);
+                        lock.notify();
+                    }
+                } else {
+                    taskQueue.postTask(this);
+                }
+            }
+        });
+
+        startNativeScheduler();
+        nativeSchedulerStarted.set(true);
+
+        synchronized (lock) {
+            try {
+                while (!taskRun.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+
+    private void startNativeScheduler() throws Exception {
+        mNativeLibraryTestRule.loadNativeLibraryNoBrowserProcess();
+        ContentMain.start(/* startServiceManagerOnly */ true);
+        TaskSchedulerTestHelpers.enableTaskSchedulerExecutionForTesting();
+    }
+}
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/scheduler/UiThreadSchedulerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/scheduler/UiThreadSchedulerTest.java
new file mode 100644
index 0000000..30ff6d5
--- /dev/null
+++ b/content/public/android/javatests/src/org/chromium/content/browser/scheduler/UiThreadSchedulerTest.java
@@ -0,0 +1,203 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser.scheduler;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+
+import android.annotation.TargetApi;
+import android.os.Build;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.support.test.filters.MediumTest;
+
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.task.PostTask;
+import org.chromium.base.task.TaskRunner;
+import org.chromium.base.task.TaskTraits;
+import org.chromium.base.test.BaseJUnit4ClassRunner;
+import org.chromium.base.test.task.SchedulerTestHelpers;
+import org.chromium.base.test.util.MinAndroidSdkLevel;
+import org.chromium.content.app.ContentMain;
+import org.chromium.content_public.browser.BrowserTaskExecutor;
+import org.chromium.content_public.browser.UiThreadTaskTraits;
+import org.chromium.content_public.browser.test.NativeLibraryTestRule;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * Test class for scheduling on the UI Thread.
+ */
+@RunWith(BaseJUnit4ClassRunner.class)
+@MinAndroidSdkLevel(23)
+@TargetApi(Build.VERSION_CODES.M)
+public class UiThreadSchedulerTest {
+    @Rule
+    public NativeLibraryTestRule mNativeLibraryTestRule = new NativeLibraryTestRule();
+
+    @Before
+    public void setUp() {
+        mNativeLibraryTestRule.loadNativeLibraryNoBrowserProcess();
+        ThreadUtils.setUiThread(null);
+        ThreadUtils.setWillOverrideUiThread();
+        mUiThread = new HandlerThread("UiThreadForTest");
+        mUiThread.start();
+        ThreadUtils.setUiThread(mUiThread.getLooper());
+        BrowserTaskExecutor.register();
+        mHandler = new Handler(mUiThread.getLooper());
+    }
+
+    @After
+    public void tearDown() {
+        mUiThread.quitSafely();
+        ThreadUtils.setUiThread(null);
+    }
+
+    @Test
+    @MediumTest
+    public void testSimpleUiThreadPostingBeforeNativeLoaded() throws Exception {
+        TaskRunner uiThreadTaskRunner =
+                PostTask.createSingleThreadTaskRunner(new UiThreadTaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(uiThreadTaskRunner, orderList, 1);
+        SchedulerTestHelpers.postRecordOrderTask(uiThreadTaskRunner, orderList, 2);
+        SchedulerTestHelpers.postRecordOrderTask(uiThreadTaskRunner, orderList, 3);
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(uiThreadTaskRunner);
+
+        assertThat(orderList, contains(1, 2, 3));
+    }
+
+    @Test
+    @MediumTest
+    public void testUiThreadTaskRunnerMigrationToNative() throws Exception {
+        TaskRunner uiThreadTaskRunner =
+                PostTask.createSingleThreadTaskRunner(new UiThreadTaskTraits());
+        List<Integer> orderList = new ArrayList<>();
+        SchedulerTestHelpers.postRecordOrderTask(uiThreadTaskRunner, orderList, 1);
+
+        postRepeatingTaskAndStartNativeSchedulerThenWaitForTaskToRun(
+                uiThreadTaskRunner, new Runnable() {
+                    @Override
+                    public void run() {
+                        orderList.add(2);
+                    }
+                });
+
+        assertThat(orderList, contains(1, 2));
+    }
+
+    @Test
+    @MediumTest
+    public void testSimpleUiThreadPostingAfterNativeLoaded() throws Exception {
+        TaskRunner uiThreadTaskRunner =
+                PostTask.createSingleThreadTaskRunner(new UiThreadTaskTraits());
+
+        startContentMainOnUiThread();
+
+        uiThreadTaskRunner.postTask(new Runnable() {
+            @Override
+            public void run() {
+                Assert.assertTrue(ThreadUtils.runningOnUiThread());
+            }
+        });
+
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(uiThreadTaskRunner);
+    }
+
+    @Test
+    @MediumTest
+    public void testTaskNotRunOnUiThreadWithoutUiThreadTaskTraits() throws Exception {
+        TaskRunner uiThreadTaskRunner = PostTask.createSingleThreadTaskRunner(new TaskTraits());
+
+        startContentMainOnUiThread();
+
+        uiThreadTaskRunner.postTask(new Runnable() {
+            @Override
+            public void run() {
+                Assert.assertFalse(ThreadUtils.runningOnUiThread());
+            }
+        });
+
+        SchedulerTestHelpers.postTaskAndBlockUntilRun(uiThreadTaskRunner);
+    }
+
+    private void startContentMainOnUiThread() {
+        final Object lock = new Object();
+        final AtomicBoolean uiThreadInitalized = new AtomicBoolean();
+
+        mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                try {
+                    ContentMain.start(/* startServiceManagerOnly */ true);
+                    synchronized (lock) {
+                        uiThreadInitalized.set(true);
+                        lock.notify();
+                    }
+                } catch (Exception e) {
+                }
+            }
+        });
+
+        synchronized (lock) {
+            try {
+                while (!uiThreadInitalized.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+
+    private void postRepeatingTaskAndStartNativeSchedulerThenWaitForTaskToRun(
+            TaskRunner taskQueue, Runnable taskToRunAfterNativeSchedulerLoaded) throws Exception {
+        final Object lock = new Object();
+        final AtomicBoolean taskRun = new AtomicBoolean();
+        final AtomicBoolean nativeSchedulerStarted = new AtomicBoolean();
+
+        // Post a task that reposts itself until nativeSchedulerStarted is set to true.  This tests
+        // that tasks posted before the native library is loaded still run afterwards.
+        taskQueue.postTask(new Runnable() {
+            @Override
+            public void run() {
+                if (nativeSchedulerStarted.compareAndSet(true, true)) {
+                    taskToRunAfterNativeSchedulerLoaded.run();
+                    synchronized (lock) {
+                        taskRun.set(true);
+                        lock.notify();
+                    }
+                } else {
+                    taskQueue.postTask(this);
+                }
+            }
+        });
+
+        startContentMainOnUiThread();
+        nativeSchedulerStarted.set(true);
+
+        synchronized (lock) {
+            try {
+                while (!taskRun.get()) {
+                    lock.wait();
+                }
+            } catch (InterruptedException ie) {
+                ie.printStackTrace();
+            }
+        }
+    }
+
+    private Handler mHandler;
+    private HandlerThread mUiThread;
+}
diff --git a/content/public/browser/browser_task_traits.h b/content/public/browser/browser_task_traits.h
index e5a537cc..64b8608d 100644
--- a/content/public/browser/browser_task_traits.h
+++ b/content/public/browser/browser_task_traits.h
@@ -68,6 +68,7 @@
         nestable_(!base::trait_helpers::GetTraitFromArgList<NonNestableFilter>(
             args...)) {}
 
+  // Keep in sync with UiThreadTaskTraits.java
   constexpr base::TaskTraitsExtensionStorage Serialize() const {
     static_assert(8 == sizeof(BrowserTaskTraitsExtension),
                   "Update Serialize() and Parse() when changing "
diff --git a/content/public/browser/cache_storage_context.h b/content/public/browser/cache_storage_context.h
index 928e762..c415868 100644
--- a/content/public/browser/cache_storage_context.h
+++ b/content/public/browser/cache_storage_context.h
@@ -17,12 +17,12 @@
 class CacheStorageContext
     : public base::RefCountedThreadSafe<CacheStorageContext> {
  public:
-  using GetUsageInfoCallback = base::Callback<void(
+  using GetUsageInfoCallback = base::OnceCallback<void(
       const std::vector<CacheStorageUsageInfo>& usage_info)>;
 
   // Methods used in response to browsing data and quota manager requests.
   // Must be called on the IO thread.
-  virtual void GetAllOriginsInfo(const GetUsageInfoCallback& callback) = 0;
+  virtual void GetAllOriginsInfo(GetUsageInfoCallback callback) = 0;
   virtual void DeleteForOrigin(const GURL& origin_url) = 0;
 
  protected:
diff --git a/content/public/common/content_features.cc b/content/public/common/content_features.cc
index 034d944..de790d1 100644
--- a/content/public/common/content_features.cc
+++ b/content/public/common/content_features.cc
@@ -598,6 +598,10 @@
 const base::Feature kWipeCorruptV2IDBDatabases{
     "WipeCorruptV2IDBDatabases", base::FEATURE_ENABLED_BY_DEFAULT};
 
+// Enabled "work stealing" in the script runner.
+const base::Feature kWorkStealingInScriptRunner{
+    "WorkStealingInScriptRunner", base::FEATURE_DISABLED_BY_DEFAULT};
+
 // Enabled scheduler use for script streaming.
 const base::Feature kScheduledScriptStreaming{
     "ScheduledScriptStreaming", base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/content/public/common/content_features.h b/content/public/common/content_features.h
index 76dcdff6..16d381e 100644
--- a/content/public/common/content_features.h
+++ b/content/public/common/content_features.h
@@ -135,6 +135,7 @@
 CONTENT_EXPORT extern const base::Feature kWebXrHitTest;
 CONTENT_EXPORT extern const base::Feature kWebXrOrientationSensorDevice;
 CONTENT_EXPORT extern const base::Feature kWipeCorruptV2IDBDatabases;
+CONTENT_EXPORT extern const base::Feature kWorkStealingInScriptRunner;
 CONTENT_EXPORT extern const base::Feature kScheduledScriptStreaming;
 
 #if defined(OS_ANDROID)
diff --git a/content/renderer/gpu/layer_tree_view.cc b/content/renderer/gpu/layer_tree_view.cc
index 8db392f..d7cb424 100644
--- a/content/renderer/gpu/layer_tree_view.cc
+++ b/content/renderer/gpu/layer_tree_view.cc
@@ -753,4 +753,8 @@
   layer_tree_host_->SetURLForUkm(url);
 }
 
+void LayerTreeView::ReleaseLayerTreeFrameSink() {
+  layer_tree_host_->ReleaseLayerTreeFrameSink();
+}
+
 }  // namespace content
diff --git a/content/renderer/gpu/layer_tree_view.h b/content/renderer/gpu/layer_tree_view.h
index 585c67e..cd3e343 100644
--- a/content/renderer/gpu/layer_tree_view.h
+++ b/content/renderer/gpu/layer_tree_view.h
@@ -116,6 +116,12 @@
   void RequestNewLocalSurfaceId();
   void SetViewportVisibleRect(const gfx::Rect& visible_rect);
   void SetURLForUkm(const GURL& url);
+  // Call this if the compositor is becoming non-visible in a way that it won't
+  // be used any longer. In this case, becoming visible is longer but this
+  // releases more resources (such as its use of the GpuChannel).
+  // TODO(crbug.com/419087): This is to support a swapped out RenderWidget which
+  // should just be destroyed instead.
+  void ReleaseLayerTreeFrameSink();
 
   // blink::WebLayerTreeView implementation.
   viz::FrameSinkId GetFrameSinkId() override;
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index a0955e0..f7588df 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -1092,6 +1092,12 @@
 
 void RenderViewImpl::OverrideCloseForWidget() {
   DCHECK(frame_widget_);
+  // The RenderWidget isn't actually closed here because we might need to use it
+  // again since it can't be recreated as it is part of |this|. So instead just
+  // stop the compositor.
+  // TODO(crbug.com/419087): The RenderWidget should be destroyed here along
+  // with the WebFrameWidget, then we won't have to do this.
+  GetWidget()->StopCompositor();
   frame_widget_->Close();
   frame_widget_ = nullptr;
 }
@@ -1538,6 +1544,12 @@
   // The previous WebFrameWidget must already be detached by CloseForFrame().
   DCHECK(!frame_widget_);
   frame_widget_ = frame_widget;
+  // In CloseForFrame() the RenderWidget's compositor was stopped instead of
+  // deleting the RenderWidget. So here we can start it again. For the first
+  // main frame, it would already be started by default so this does nothing.
+  // TODO(crbug.com/419087): The RenderWidget should be newly created here along
+  // with the WebFrameWidget, then we won't have to do this.
+  GetWidget()->StartCompositor();
 }
 
 void RenderViewImpl::SetZoomLevel(double zoom_level) {
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 7bfbf979..d1a7178 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -1548,10 +1548,17 @@
   // LayerTreeFrameSink creation.
   bool should_generate_frame_sink =
       !compositor_never_visible_ && RenderThreadImpl::current();
-  if (!should_generate_frame_sink)
+  if (!should_generate_frame_sink) {
+    // Prevents SetVisible() from blink from doing anything.
     layer_tree_view_->SetNeverVisible();
+  } else if (!is_swapped_out_) {
+    // Begins the compositor's scheduler to start producing frames.
+    // Don't do this if the RenderWidget is attached to a RenderViewImpl for a
+    // remote main frame, as this RenderWidget is a zombie then, which won't be
+    // used for compositing until a WebFrameWidget is attached.
+    StartCompositor();
+  }
 
-  StartCompositor();
   DCHECK_NE(MSG_ROUTING_NONE, routing_id_);
   layer_tree_view_->SetFrameSinkId(
       viz::FrameSinkId(RenderThread::Get()->GetClientId(), routing_id_));
@@ -2883,10 +2890,19 @@
 }
 
 void RenderWidget::StartCompositor() {
-  if (!is_hidden())
+  if (!is_hidden_)
     layer_tree_view_->SetVisible(true);
 }
 
+void RenderWidget::StopCompositor() {
+  layer_tree_view_->SetVisible(false);
+  // Drop all gpu resources, this makes SetVisible(true) more expensive/slower
+  // but we don't expect to use this RenderWidget again until some possible
+  // future navigation. This brings us a bit closer to emulating deleting the
+  // RenderWidget instead of just stopping the compositor.
+  layer_tree_view_->ReleaseLayerTreeFrameSink();
+}
+
 void RenderWidget::HasPointerRawMoveEventHandlers(bool has_handlers) {
   if (input_event_queue_)
     input_event_queue_->HasPointerRawMoveEventHandlers(has_handlers);
diff --git a/content/renderer/render_widget.h b/content/renderer/render_widget.h
index 27e1d98..7005d01 100644
--- a/content/renderer/render_widget.h
+++ b/content/renderer/render_widget.h
@@ -343,25 +343,20 @@
   // position.
   ui::TextInputType GetTextInputType();
 
-  // Internal helper that generates the LayerTreeSettings to be given to the
-  // compositor in StartCompositor().
   static cc::LayerTreeSettings GenerateLayerTreeSettings(
       CompositorDependencies* compositor_deps,
       bool is_for_subframe,
       const gfx::Size& initial_screen_size,
       float initial_device_scale_factor);
-  // Internal helper that generates the ManagedMemoryPolicy to be given to the
-  // compositor in StartCompositor().
   static cc::ManagedMemoryPolicy GetGpuMemoryPolicy(
       const cc::ManagedMemoryPolicy& policy,
       const gfx::Size& initial_screen_size,
       float initial_device_scale_factor);
 
-  // Begins the compositor's scheduler to start producing frames.
+  // Initiates the compositor to set up IPC channels and begin its scheduler.
   void StartCompositor();
-
-  // Stop compositing.
-  void WillCloseLayerTreeView();
+  // Pauses the compositor's scheduler and tears down its IPC channels.
+  void StopCompositor();
 
   LayerTreeView* layer_tree_view() const { return layer_tree_view_.get(); }
   WidgetInputHandlerManager* widget_input_handler_manager() {
@@ -571,6 +566,9 @@
   // It is safe to call this multiple times, which happens in the case of
   // frame widgets beings closed, since subsequent calls are ignored.
   void CloseWebWidget();
+  // Informs the WebWidget that compositor is being destroyed, so it can remove
+  // references to it first.
+  void WillCloseLayerTreeView();
 
 #if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
   void SetExternalPopupOriginAdjustmentsForEmulation(
diff --git a/content/shell/browser/shell.cc b/content/shell/browser/shell.cc
index c55bae6..b4898b06 100644
--- a/content/shell/browser/shell.cc
+++ b/content/shell/browser/shell.cc
@@ -606,9 +606,9 @@
 
 gfx::Size Shell::EnterPictureInPicture(const viz::SurfaceId& surface_id,
                                        const gfx::Size& natural_size) {
-  // During tests, returning a fake window size to pretent the window was
-  // created and allow tests to run accordingly.
-  return switches::IsRunWebTestsSwitchPresent() ? gfx::Size(42, 42)
+  // During tests, returning a fake window size (same aspect ratio) to pretend
+  // the window was created and allow tests to run accordingly.
+  return switches::IsRunWebTestsSwitchPresent() ? natural_size
                                                 : gfx::Size(0, 0);
 }
 
diff --git a/content/shell/test_runner/test_interfaces.cc b/content/shell/test_runner/test_interfaces.cc
index 8af4e26..c5fc6e1 100644
--- a/content/shell/test_runner/test_interfaces.cc
+++ b/content/shell/test_runner/test_interfaces.cc
@@ -32,7 +32,7 @@
   // progress here in a per-directory manner.
   // TODO(xiaochengh): Progressively allow more tests to use innerText.
   // Remove this function once rebaseline is complete.
-  return test_path >= "LayoutTests/a" && test_path < "LayoutTests/fast/d";
+  return test_path >= "LayoutTests/a" && test_path < "LayoutTests/fast/e";
 }
 }  // namespace
 
diff --git a/content/test/gpu/gpu_tests/gpu_process_expectations.py b/content/test/gpu/gpu_tests/gpu_process_expectations.py
index be3cb00b..4540c4a5 100644
--- a/content/test/gpu/gpu_tests/gpu_process_expectations.py
+++ b/content/test/gpu/gpu_tests/gpu_process_expectations.py
@@ -12,6 +12,3 @@
 
     # Seems to have become flaky on Windows recently.
     self.Flaky('GpuProcess_one_extra_workaround', ['win'], bug=700522)
-
-    self.Fail('GpuProcess_feature_status_under_swiftshader',
-        ['mac'], bug=897914)
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
index dacacff..a972c0b 100644
--- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
+++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -115,7 +115,7 @@
 
     self.Fail('conformance2/rendering/depth-stencil-feedback-loop.html',
         bug=660844) # WebGL 2.0.1
-    self.Fail('conformance2/rendering/rendering-sampling-feedback-loop.html',
+    self.Fail('conformance/rendering/rendering-sampling-feedback-loop.html',
         bug=660844) # WebGL 2.0.1
     self.Fail('conformance2/textures/misc/' +
         'integer-cubemap-specification-order-bug.html',
@@ -125,6 +125,10 @@
 
     # Need to implement new lifetime/deletion semantics.
     self.Fail('conformance2/vertex_arrays/vertex-array-object.html', bug=739604)
+    self.Fail('deqp/functional/gles3/lifetime.html', bug=898350)
+
+    # Need to forbid generation of mipmaps for zero-sized textures.
+    self.Fail('conformance2/textures/misc/tex-mipmap-levels.html', bug=898351)
 
     # The following actually passes on gl_passthrough and also Mac Intel with
     # command buffer.
@@ -328,8 +332,9 @@
     # Seems to cause the harness to fail immediately afterward
     self.Skip('conformance2/textures/video/tex-2d-rgba16f-rgba-half_float.html',
         ['win', 'intel', 'd3d11'], bug=648337)
-    self.Flaky('deqp/functional/gles3/lifetime.html',
-        ['win', 'intel', 'd3d11'], bug=620379)
+    # TODO(kbr): re-enable after fix for http://crbug.com/898350
+    # self.Flaky('deqp/functional/gles3/lifetime.html',
+    #     ['win', 'intel', 'd3d11'], bug=620379)
     self.Flaky('deqp/functional/gles3/textureformat/unsized_3d.html',
         ['win', 'intel', 'd3d11'], bug=614418)
 
@@ -438,7 +443,10 @@
     self.Fail('conformance/textures/image_bitmap_from_video/' +
         'tex-2d-rgb-rgb-unsigned_short_5_6_5.html',
         ['linux', 'passthrough', 'opengl', 'nvidia'], bug=766918)
-    self.Fail('deqp/functional/gles3/shaderoperator/common_functions.html',
+    self.Flaky('conformance2/textures/image_bitmap_from_video/' +
+        'tex-2d-rgb565-rgb-unsigned_short_5_6_5.html',
+        ['linux', 'passthrough', 'opengl', 'nvidia'], bug=766918)
+    self.Fail('deqp/functional/gles3/shaderoperator/common_functions_*.html',
         ['linux', 'passthrough', 'opengl', 'nvidia'], bug=793055)
 
     # Passthrough command decoder / Linux / OpenGL / Intel
@@ -450,18 +458,21 @@
     self.Fail('conformance2/renderbuffers/' +
         'multisampled-stencil-renderbuffer-initialization.html',
         ['linux', 'passthrough', 'opengl', 'intel'], bug=2760) # ANGLE bug
-    self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
-        ['linux', 'passthrough', 'opengl', 'intel'], bug=2761) # ANGLE bug
+    # TODO(kbr): re-enable after crbug.com/898351 is fixed
+    # self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
+    #     ['linux', 'passthrough', 'opengl', 'intel'], bug=2761) # ANGLE bug
 
     # Regressions in 10.12.4.
     self.Fail('conformance2/textures/misc/tex-base-level-bug.html',
         ['sierra', 'intel'], bug=705865)
-    self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
-        ['sierra', 'intel'], bug=705865)
+    # TODO(kbr): re-enable after crbug.com/898351 is fixed
+    # self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
+    #     ['sierra', 'intel'], bug=705865)
     self.Fail('conformance2/textures/misc/tex-base-level-bug.html',
         ['sierra', 'amd'], bug=870856)
-    self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
-        ['sierra', 'amd'], bug=870856)
+    # TODO(kbr): re-enable after crbug.com/898351 is fixed
+    # self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
+    #     ['sierra', 'amd'], bug=870856)
 
     # Regressions in 10.13
     self.Fail('deqp/functional/gles3/fbocolorbuffer/tex2d_00.html',
@@ -678,11 +689,12 @@
     # OpenGL driver on 10.13.6 specifically. Unfortunately when the
     # tests fail, they fail three times in a row, so we must mark them
     # failing rather than flaky.
-    self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
-        ['highsierra', 'amd'], bug=870856)
+    # TODO(kbr): re-enable after crbug.com/898351 is fixed
+    # self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
+    #     ['highsierra', 'amd'], bug=870856)
     self.Fail('conformance2/textures/misc/tex-base-level-bug.html',
         ['highsierra', 'amd'], bug=870856)
-    self.Fail('deqp/functional/gles3/shaderoperator/common_functions.html',
+    self.Fail('deqp/functional/gles3/shaderoperator/common_functions_*.html',
         ['mac', 'amd'], bug=820225)
     self.Fail('deqp/functional/gles3/transformfeedback/' +
         'array_interleaved_lines.html',
@@ -783,7 +795,7 @@
         ['mac', 'no_passthrough', 'intel'], bug=679692)
     self.Fail('deqp/functional/gles3/fbomultisample*',
         ['mac', 'intel'], bug=641209)
-    self.Fail('deqp/functional/gles3/shaderoperator/common_functions.html',
+    self.Fail('deqp/functional/gles3/shaderoperator/common_functions_*.html',
         ['mac', 'intel'], bug=820225)
     self.Fail('deqp/functional/gles3/texturefiltering/2d_combinations_01.html',
         ['mac', 'intel'], bug=606074)
@@ -1109,8 +1121,9 @@
         ['linux', 'amd'], bug=662644) # WebGL 2.0.1
     self.Fail('conformance2/renderbuffers/framebuffer-texture-layer.html',
         ['linux', 'amd'], bug=295792)
-    self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
-        ['linux', 'amd'], bug=483282)
+    # TODO(kbr): re-enable after crbug.com/898351 is fixed
+    # self.Fail('conformance2/textures/misc/tex-mipmap-levels.html',
+    #     ['linux', 'amd'], bug=483282)
     self.Fail('conformance2/textures/misc/copy-texture-image-luma-format.html',
         ['linux', 'amd'], bug=483282)
 
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
index c18b70e..f193b74 100644
--- a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
+++ b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
@@ -97,8 +97,8 @@
     self.Fail('conformance/extensions/oes-vertex-array-object.html', bug=739604)
 
     # Need to add detection of feedback loops with multiple render targets.
-    self.Fail('conformance/extensions/webgl-draw-buffers-feedback-loop.html',
-        ['no_passthrough'], bug=1619) # angle bug ID
+    self.Fail('conformance/rendering/rendering-sampling-feedback-loop.html',
+        bug=660844)
 
     # Need to implement new error semantics
     # https://github.com/KhronosGroup/WebGL/pull/2607
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_revision.txt b/content/test/gpu/gpu_tests/webgl_conformance_revision.txt
index 50aa6b1..f309a11 100644
--- a/content/test/gpu/gpu_tests/webgl_conformance_revision.txt
+++ b/content/test/gpu/gpu_tests/webgl_conformance_revision.txt
@@ -1,3 +1,3 @@
 # AUTOGENERATED FILE - DO NOT EDIT
 # SEE roll_webgl_conformance.py
-Current webgl revision 6d2f3f4cb8bac1f7c4a945c73d07a33df74f22f9
+Current webgl revision 0d55c887e92b645f6effe753528323ab2ffd94c2
diff --git a/extensions/browser/api/socket/socket_api.cc b/extensions/browser/api/socket/socket_api.cc
index 3db7f37..5b61a08a 100644
--- a/extensions/browser/api/socket/socket_api.cc
+++ b/extensions/browser/api/socket/socket_api.cc
@@ -187,7 +187,8 @@
     return false;
   content::BrowserContext::GetDefaultStoragePartition(browser_context())
       ->GetNetworkContext()
-      ->CreateHostResolver(mojo::MakeRequest(&host_resolver_info_));
+      ->CreateHostResolver(base::nullopt,
+                           mojo::MakeRequest(&host_resolver_info_));
   return true;
 }
 
diff --git a/google_apis/drive/auth_service.cc b/google_apis/drive/auth_service.cc
index e60e010..bf48938 100644
--- a/google_apis/drive/auth_service.cc
+++ b/google_apis/drive/auth_service.cc
@@ -32,15 +32,14 @@
 const int kSuccessRatioHistogramMaxValue = 4;  // The max value is exclusive.
 
 void RecordAuthResultHistogram(int value) {
-  UMA_HISTOGRAM_ENUMERATION("GData.AuthSuccess",
-                            value,
+  UMA_HISTOGRAM_ENUMERATION("GData.AuthSuccess", value,
                             kSuccessRatioHistogramMaxValue);
 }
 
 // OAuth2 authorization token retrieval request.
 class AuthRequest {
  public:
-  AuthRequest(OAuth2TokenService* oauth2_token_service,
+  AuthRequest(identity::IdentityManager* identity_manager,
               const std::string& account_id,
               scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
               const AuthStatusCallback& callback,
@@ -59,16 +58,17 @@
 };
 
 AuthRequest::AuthRequest(
-    OAuth2TokenService* oauth2_token_service,
+    identity::IdentityManager* identity_manager,
     const std::string& account_id,
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
     const AuthStatusCallback& callback,
     const std::vector<std::string>& scopes)
     : callback_(callback) {
+  DCHECK(identity_manager);
   DCHECK(!callback_.is_null());
 
-  access_token_fetcher_ = std::make_unique<identity::AccessTokenFetcher>(
-      account_id, "auth_service", oauth2_token_service, url_loader_factory,
+  access_token_fetcher_ = identity_manager->CreateAccessTokenFetcherForAccount(
+      account_id, "auth_service", url_loader_factory,
       OAuth2TokenService::ScopeSet(scopes.begin(), scopes.end()),
       base::BindOnce(&AuthRequest::OnAccessTokenFetchComplete,
                      base::Unretained(this)),
@@ -111,25 +111,24 @@
 }  // namespace
 
 AuthService::AuthService(
-    OAuth2TokenService* oauth2_token_service,
+    identity::IdentityManager* identity_manager,
     const std::string& account_id,
     scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
     const std::vector<std::string>& scopes)
-    : oauth2_token_service_(oauth2_token_service),
+    : identity_manager_(identity_manager),
       account_id_(account_id),
       url_loader_factory_(url_loader_factory),
       scopes_(scopes),
       weak_ptr_factory_(this) {
-  DCHECK(oauth2_token_service);
+  DCHECK(identity_manager_);
 
-  // Get OAuth2 refresh token (if we have any) and register for its updates.
-  oauth2_token_service_->AddObserver(this);
-  has_refresh_token_ = oauth2_token_service_->RefreshTokenIsAvailable(
-      account_id_);
+  identity_manager_->AddObserver(this);
+  has_refresh_token_ =
+      identity_manager_->HasAccountWithRefreshToken(account_id_);
 }
 
 AuthService::~AuthService() {
-  oauth2_token_service_->RemoveObserver(this);
+  identity_manager_->RemoveObserver(this);
 }
 
 void AuthService::StartAuthentication(const AuthStatusCallback& callback) {
@@ -141,7 +140,7 @@
         FROM_HERE, base::Bind(callback, HTTP_SUCCESS, access_token_));
   } else if (HasRefreshToken()) {
     // We have refresh token, let's get an access token.
-    new AuthRequest(oauth2_token_service_, account_id_, url_loader_factory_,
+    new AuthRequest(identity_manager_, account_id_, url_loader_factory_,
                     base::Bind(&AuthService::OnAuthCompleted,
                                weak_ptr_factory_.GetWeakPtr(), callback),
                     scopes_);
@@ -201,12 +200,15 @@
   observers_.RemoveObserver(observer);
 }
 
-void AuthService::OnRefreshTokenAvailable(const std::string& account_id) {
-  if (account_id == account_id_)
+void AuthService::OnRefreshTokenUpdatedForAccount(
+    const AccountInfo& account_info,
+    bool is_valid) {
+  if (account_info.account_id == account_id_)
     OnHandleRefreshToken(true);
 }
 
-void AuthService::OnRefreshTokenRevoked(const std::string& account_id) {
+void AuthService::OnRefreshTokenRemovedForAccount(
+    const std::string& account_id) {
   if (account_id == account_id_)
     OnHandleRefreshToken(false);
 }
diff --git a/google_apis/drive/auth_service.h b/google_apis/drive/auth_service.h
index 06c0d311..a380304 100644
--- a/google_apis/drive/auth_service.h
+++ b/google_apis/drive/auth_service.h
@@ -14,7 +14,7 @@
 #include "base/observer_list.h"
 #include "base/threading/thread_checker.h"
 #include "google_apis/drive/auth_service_interface.h"
-#include "google_apis/gaia/oauth2_token_service.h"
+#include "services/identity/public/cpp/identity_manager.h"
 
 namespace network {
 class SharedURLLoaderFactory;
@@ -25,17 +25,17 @@
 class AuthServiceObserver;
 
 // This class provides authentication for Google services.
-// It integrates specific service integration with OAuth2 stack
-// (OAuth2TokenService) and provides OAuth2 token refresh infrastructure.
+// It integrates specific service integration with the Identity service
+// (IdentityManager) and provides OAuth2 token refresh infrastructure.
 // All public functions must be called on UI thread.
 class AuthService : public AuthServiceInterface,
-                    public OAuth2TokenService::Observer {
+                    public identity::IdentityManager::Observer {
  public:
   // |url_loader_factory| is used to perform authentication with
   // SimpleURLLoader.
   //
   // |scopes| specifies OAuth2 scopes.
-  AuthService(OAuth2TokenService* oauth2_token_service,
+  AuthService(identity::IdentityManager* identity_manager,
               const std::string& account_id,
               scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory,
               const std::vector<std::string>& scopes);
@@ -51,9 +51,10 @@
   void ClearAccessToken() override;
   void ClearRefreshToken() override;
 
-  // Overridden from OAuth2TokenService::Observer:
-  void OnRefreshTokenAvailable(const std::string& account_id) override;
-  void OnRefreshTokenRevoked(const std::string& account_id) override;
+  // Overridden from IdentityManager::Observer
+  void OnRefreshTokenUpdatedForAccount(const AccountInfo& account_info,
+                                       bool is_valid) override;
+  void OnRefreshTokenRemovedForAccount(const std::string& account_id) override;
 
  private:
   // Called when the state of the refresh token changes.
@@ -65,7 +66,7 @@
                        DriveApiErrorCode error,
                        const std::string& access_token);
 
-  OAuth2TokenService* oauth2_token_service_;
+  identity::IdentityManager* identity_manager_;
   std::string account_id_;
   scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
   bool has_refresh_token_;
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 4efa29c..cc9d0d9 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -724,6 +724,10 @@
     case GL_TEXTURE_BINDING_EXTERNAL_OES:
       *params = texture_units_[active_texture_unit_].bound_texture_external_oes;
       return true;
+    case GL_TEXTURE_BINDING_RECTANGLE_ARB:
+      *params =
+          texture_units_[active_texture_unit_].bound_texture_rectangle_arb;
+      return true;
     case GL_PIXEL_PACK_TRANSFER_BUFFER_BINDING_CHROMIUM:
       *params = bound_pixel_pack_transfer_buffer_id_;
       return true;
@@ -4440,6 +4444,12 @@
         changed = true;
       }
       break;
+    case GL_TEXTURE_RECTANGLE_ARB:
+      if (unit.bound_texture_rectangle_arb != texture) {
+        unit.bound_texture_rectangle_arb = texture;
+        changed = true;
+      }
+      break;
     default:
       changed = true;
       break;
@@ -4615,6 +4625,9 @@
       if (textures[ii] == unit.bound_texture_external_oes) {
         unit.bound_texture_external_oes = 0;
       }
+      if (textures[ii] == unit.bound_texture_rectangle_arb) {
+        unit.bound_texture_rectangle_arb = 0;
+      }
     }
   }
 }
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index 3f83d9e..03b7f65b 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -311,21 +311,22 @@
   };
 
   struct TextureUnit {
-    TextureUnit()
-        : bound_texture_2d(0),
-          bound_texture_cube_map(0),
-          bound_texture_external_oes(0) {}
+    TextureUnit() {}
 
     // texture currently bound to this unit's GL_TEXTURE_2D with glBindTexture
-    GLuint bound_texture_2d;
+    GLuint bound_texture_2d = 0;
 
     // texture currently bound to this unit's GL_TEXTURE_CUBE_MAP with
     // glBindTexture
-    GLuint bound_texture_cube_map;
+    GLuint bound_texture_cube_map = 0;
 
     // texture currently bound to this unit's GL_TEXTURE_EXTERNAL_OES with
     // glBindTexture
-    GLuint bound_texture_external_oes;
+    GLuint bound_texture_external_oes = 0;
+
+    // texture currently bound to this unit's GL_TEXTURE_RECTANGLE_ARB with
+    // glBindTexture
+    GLuint bound_texture_rectangle_arb = 0;
   };
 
   // Prevents problematic reentrancy during error callbacks.
diff --git a/gpu/command_buffer/client/raster_implementation_gles.cc b/gpu/command_buffer/client/raster_implementation_gles.cc
index c8713c9d..ff5e92b 100644
--- a/gpu/command_buffer/client/raster_implementation_gles.cc
+++ b/gpu/command_buffer/client/raster_implementation_gles.cc
@@ -57,10 +57,27 @@
 RasterImplementationGLES::Texture* RasterImplementationGLES::EnsureTextureBound(
     RasterImplementationGLES::Texture* texture) {
   DCHECK(texture);
-  if (bound_texture_ != texture) {
-    bound_texture_ = texture;
-    gl_->BindTexture(texture->target, texture->id);
+  // Reads client side cache of bindings in GLES2Implementation.
+  GLint bound_texture = 0;
+  GLenum pname = 0;
+  switch (texture->target) {
+    case GL_TEXTURE_2D:
+      pname = GL_TEXTURE_BINDING_2D;
+      break;
+    case GL_TEXTURE_RECTANGLE_ARB:
+      pname = GL_TEXTURE_BINDING_RECTANGLE_ARB;
+      break;
+    case GL_TEXTURE_EXTERNAL_OES:
+      pname = GL_TEXTURE_BINDING_EXTERNAL_OES;
+      break;
+    default:
+      NOTREACHED();
   }
+  if (pname != 0)
+    gl_->GetIntegerv(pname, &bound_texture);
+  if (bound_texture != static_cast<GLint>(texture->id))
+    gl_->BindTexture(texture->target, texture->id);
+
   return texture;
 }
 
@@ -171,9 +188,6 @@
     auto texture_iter = texture_info_.find(textures[i]);
     DCHECK(texture_iter != texture_info_.end());
 
-    if (bound_texture_ == &texture_iter->second)
-      bound_texture_ = nullptr;
-
     texture_info_.erase(texture_iter);
   }
 
@@ -334,7 +348,6 @@
   gl_->TraceEndCHROMIUM();
 
   // Reset cached raster state.
-  bound_texture_ = nullptr;
   gl_->ActiveTexture(GL_TEXTURE0);
 }
 
diff --git a/gpu/command_buffer/client/raster_implementation_gles.h b/gpu/command_buffer/client/raster_implementation_gles.h
index 6faf6ff..8d53d3e 100644
--- a/gpu/command_buffer/client/raster_implementation_gles.h
+++ b/gpu/command_buffer/client/raster_implementation_gles.h
@@ -151,7 +151,6 @@
   bool use_texture_storage_image_;
 
   std::unordered_map<GLuint, Texture> texture_info_;
-  Texture* bound_texture_ = nullptr;
 
   DISALLOW_COPY_AND_ASSIGN(RasterImplementationGLES);
 };
diff --git a/infra/config/global/cr-buildbucket.cfg b/infra/config/global/cr-buildbucket.cfg
index def112b..92a2b366 100644
--- a/infra/config/global/cr-buildbucket.cfg
+++ b/infra/config/global/cr-buildbucket.cfg
@@ -1554,6 +1554,12 @@
       dimensions: "cpu:x86-64"
       dimensions: "cores:8"
     }
+    builders {
+      name: "Windows deterministic"
+      dimensions: "os:Windows-10"
+      mixins: "win-ci"
+      mixins: "deterministic"
+    }
 
     # chromium.clang
     builders {
@@ -2434,12 +2440,6 @@
       mixins: "fyi-ci"
     }
     builders {
-      name: "Windows deterministic"
-      dimensions: "os:Windows-10"
-      mixins: "fyi-ci"
-      mixins: "deterministic"
-    }
-    builders {
       name: "Linux ARM"
       dimensions: "os:Ubuntu-14.04"
       mixins: "fyi-ci"
diff --git a/ios/build/bots/chromium.mac/ios-webview.json b/ios/build/bots/chromium.mac/ios-webview.json
index 7cc69f48..6e68acb6 100644
--- a/ios/build/bots/chromium.mac/ios-webview.json
+++ b/ios/build/bots/chromium.mac/ios-webview.json
@@ -11,6 +11,7 @@
     "is_debug=true",
     "symbol_level=1",
     "target_cpu=\"x64\"",
+    "additional_target_cpus=[\"x86\"]",
     "target_os=\"ios\"",
     "use_goma=true"
   ],
@@ -19,46 +20,91 @@
     {
       "app": "ios_web_view_unittests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "ios_web_view_inttests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "ios_components_unittests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "components_unittests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "net_unittests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "ios_net_unittests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "ios_web_unittests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "ios_web_inttests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3"
     },
     {
       "app": "ios_web_shell_egtests",
       "device type": "iPhone 5s",
+      "dimensions": [
+        { "os": "Mac-10.13.4", "pool": "Chrome" },
+        { "os": "Mac-10.13.5", "pool": "Chrome" },
+        { "os": "Mac-10.13.6", "pool": "Chrome" }
+      ],
       "os": "10.3",
       "xctest": true
     }
diff --git a/ios/chrome/browser/about_flags.mm b/ios/chrome/browser/about_flags.mm
index e8f8faf3..bf618c1 100644
--- a/ios/chrome/browser/about_flags.mm
+++ b/ios/chrome/browser/about_flags.mm
@@ -132,6 +132,24 @@
     {"1000", autofill::switches::kAutofillIOSDelayBetweenFields, "1000"},
 };
 
+const FeatureEntry::FeatureParam kIconForSearchButtonGrey[] = {
+    {kIconForSearchButtonFeatureParameterName,
+     kIconForSearchButtonParameterGrey}};
+const FeatureEntry::FeatureParam kIconForSearchButtonColorful[] = {
+    {kIconForSearchButtonFeatureParameterName,
+     kIconForSearchButtonParameterColorful}};
+const FeatureEntry::FeatureParam kIconForSearchButtonMagnifying[] = {
+    {kIconForSearchButtonFeatureParameterName,
+     kIconForSearchButtonParameterMagnifying}};
+
+const FeatureEntry::FeatureVariation kIconForSearchButtonVariations[] = {
+    {"Grey search engine logo", kIconForSearchButtonGrey,
+     base::size(kIconForSearchButtonGrey), nullptr},
+    {"Colorful search engine logo", kIconForSearchButtonColorful,
+     base::size(kIconForSearchButtonColorful), nullptr},
+    {"Magnifying glass", kIconForSearchButtonMagnifying,
+     base::size(kIconForSearchButtonMagnifying), nullptr}};
+
 // To add a new entry, add to the end of kFeatureEntries. There are four
 // distinct types of entries:
 // . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
@@ -391,6 +409,11 @@
      flag_descriptions::kBrowserContainerContainsNTPName,
      flag_descriptions::kBrowserContainerContainsNTPDescription,
      flags_ui::kOsIos, FEATURE_VALUE_TYPE(kBrowserContainerContainsNTP)},
+    {"search-icon-toggle", flag_descriptions::kSearchIconToggleName,
+     flag_descriptions::kSearchIconToggleDescription, flags_ui::kOsIos,
+     FEATURE_WITH_PARAMS_VALUE_TYPE(kIconForSearchButtonFeature,
+                                    kIconForSearchButtonVariations,
+                                    "ToggleSearchButtonIcon")},
 };
 
 // Add all switches from experimental flags to |command_line|.
diff --git a/ios/chrome/browser/infobars/infobar_container_ios.mm b/ios/chrome/browser/infobars/infobar_container_ios.mm
index 4fb25d1a..c2c14d7a 100644
--- a/ios/chrome/browser/infobars/infobar_container_ios.mm
+++ b/ios/chrome/browser/infobars/infobar_container_ios.mm
@@ -48,5 +48,4 @@
 void InfoBarContainerIOS::PlatformSpecificInfoBarStateChanged(
     bool is_animating) {
   [consumer_ setUserInteractionEnabled:!is_animating];
-  [consumer_ updateLayout];
 }
diff --git a/ios/chrome/browser/ios_chrome_flag_descriptions.cc b/ios/chrome/browser/ios_chrome_flag_descriptions.cc
index 89dbfe3..b849042 100644
--- a/ios/chrome/browser/ios_chrome_flag_descriptions.cc
+++ b/ios/chrome/browser/ios_chrome_flag_descriptions.cc
@@ -250,6 +250,10 @@
 const char kIgnoresViewportScaleLimitsDescription[] =
     "When enabled the page can always be scaled, regardless of author intent.";
 
+const char kSearchIconToggleName[] = "Change the icon for the search button";
+const char kSearchIconToggleDescription[] =
+    "Different icons for the search button.";
+
 const char kSlimNavigationManagerName[] = "Use Slim Navigation Manager";
 const char kSlimNavigationManagerDescription[] =
     "When enabled, uses the experimental slim navigation manager that provides "
diff --git a/ios/chrome/browser/ios_chrome_flag_descriptions.h b/ios/chrome/browser/ios_chrome_flag_descriptions.h
index 27c5ebe..6abce5d 100644
--- a/ios/chrome/browser/ios_chrome_flag_descriptions.h
+++ b/ios/chrome/browser/ios_chrome_flag_descriptions.h
@@ -207,6 +207,10 @@
 extern const char kIgnoresViewportScaleLimitsName[];
 extern const char kIgnoresViewportScaleLimitsDescription[];
 
+// Title and description for the flag to toggle the flag of the search button.
+extern const char kSearchIconToggleName[];
+extern const char kSearchIconToggleDescription[];
+
 // Title and description for the flag to enable WKBackForwardList based
 // navigation manager.
 extern const char kSlimNavigationManagerName[];
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 65df0e1..2eb79d4 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -1757,11 +1757,6 @@
                                                 completion:completion];
   }
 
-  // Restore hidden infobars.
-  if (IsIPadIdiom()) {
-    [self.infoBarCoordinator restoreInfobars];
-  }
-
   // If the controller is suspended, or has been paged out due to low memory,
   // updating the view will be handled when it's displayed again.
   if (!self.webUsageEnabled || !self.contentArea)
@@ -1781,9 +1776,6 @@
   if (activeWebState)
     activeWebState->WasHidden();
   [_bookmarkInteractionController dismissSnackbar];
-  if (IsIPadIdiom()) {
-    [self.infoBarCoordinator suspendInfobars];
-  }
   [super viewWillDisappear:animated];
 }
 
diff --git a/ios/chrome/browser/ui/content_suggestions/BUILD.gn b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
index 4b6871e..dadd820 100644
--- a/ios/chrome/browser/ui/content_suggestions/BUILD.gn
+++ b/ios/chrome/browser/ui/content_suggestions/BUILD.gn
@@ -115,6 +115,7 @@
     "//base",
     "//components/strings",
     "//ios/chrome/browser/ui",
+    "//ios/chrome/browser/ui:feature_flags",
     "//ios/chrome/browser/ui/collection_view",
     "//ios/chrome/browser/ui/commands",
     "//ios/chrome/browser/ui/content_suggestions/cells:cells_ui",
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
index b8301ea..5d2b90d 100644
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
+++ b/ios/chrome/browser/ui/content_suggestions/content_suggestions_view_controller.mm
@@ -23,6 +23,7 @@
 #import "ios/chrome/browser/ui/content_suggestions/ntp_home_constant.h"
 #import "ios/chrome/browser/ui/ntp/new_tab_page_header_constants.h"
 #import "ios/chrome/browser/ui/overscroll_actions/overscroll_actions_controller.h"
+#include "ios/chrome/browser/ui/ui_feature_flags.h"
 #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
 #import "ios/chrome/common/ui_util/constraints_ui_util.h"
 #include "ios/web/public/features.h"
@@ -276,6 +277,14 @@
 
 - (void)viewDidLayoutSubviews {
   [super viewDidLayoutSubviews];
+  if (!base::FeatureList::IsEnabled(kBrowserContainerContainsNTP) &&
+      CGSizeEqualToSize(self.collectionView.bounds.size, CGSizeZero) &&
+      !CGSizeEqualToSize(self.view.bounds.size, CGSizeZero)) {
+    // When started after a cold start, the frame of the collection view isn't
+    // set to the bounds of the view. In that case, the constraints for the
+    // cells are broken.
+    self.collectionView.frame = self.view.bounds;
+  }
   [self applyContentOffset];
 }
 
diff --git a/ios/chrome/browser/ui/infobars/BUILD.gn b/ios/chrome/browser/ui/infobars/BUILD.gn
index 66a62ec..27b1856 100644
--- a/ios/chrome/browser/ui/infobars/BUILD.gn
+++ b/ios/chrome/browser/ui/infobars/BUILD.gn
@@ -5,9 +5,9 @@
 source_set("infobars") {
   configs += [ "//build/config/compiler:enable_arc" ]
   sources = [
-    # TODO(crbug.com/892376): Move infobar_container_view to infobars_ui.
-    "infobar_container_view.h",
-    "infobar_container_view.mm",
+    # TODO(crbug.com/892376): Move infobar_container_view_controller to infobars_ui.
+    "infobar_container_view_controller.h",
+    "infobar_container_view_controller.mm",
     "infobar_coordinator.h",
     "infobar_coordinator.mm",
   ]
@@ -25,7 +25,6 @@
     "//ios/chrome/browser/upgrade",
     "//ios/chrome/browser/web:tab_id_tab_helper",
     "//ios/chrome/browser/web_state_list",
-    "//ui/base",
   ]
 }
 
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_consumer.h b/ios/chrome/browser/ui/infobars/infobar_container_consumer.h
index c9b45dd54..8431aa7f 100644
--- a/ios/chrome/browser/ui/infobars/infobar_container_consumer.h
+++ b/ios/chrome/browser/ui/infobars/infobar_container_consumer.h
@@ -15,19 +15,9 @@
 // Add a new infobar to the Infobar container view at position |position|.
 - (void)addInfoBar:(InfoBarIOS*)infoBarIOS position:(NSInteger)position;
 
-// Height of the frontmost infobar contained in Infobar container that is not
-// hidden.
-- (CGFloat)topmostVisibleInfoBarHeight;
-
-// Animates the Infobar container alpha to |alpha|.
-- (void)animateInfoBarContainerToAlpha:(CGFloat)alpha;
-
 // Sets the Infobar container user interaction to |enabled|.
 - (void)setUserInteractionEnabled:(BOOL)enabled;
 
-// Updates Infobar container layout. This should be called when Infobar
-// container needs to re-draw.
-- (void)updateLayout;
 @end
 
 #endif  // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_CONSUMER_H_
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_view.h b/ios/chrome/browser/ui/infobars/infobar_container_view.h
deleted file mode 100644
index 61ab12bd..0000000
--- a/ios/chrome/browser/ui/infobars/infobar_container_view.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_VIEW_H_
-#define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_VIEW_H_
-
-#import <UIKit/UIKit.h>
-
-#import "ios/chrome/browser/ui/infobars/infobar_container_consumer.h"
-
-@interface InfoBarContainerView : UIView<InfobarContainerConsumer>
-@end
-
-#endif  // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_VIEW_H_
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_view.mm b/ios/chrome/browser/ui/infobars/infobar_container_view.mm
deleted file mode 100644
index 2cce323..0000000
--- a/ios/chrome/browser/ui/infobars/infobar_container_view.mm
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/chrome/browser/ui/infobars/infobar_container_view.h"
-
-#include "base/logging.h"
-#include "ios/chrome/browser/infobars/infobar.h"
-#include "ui/base/device_form_factor.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-// Duration for the alpha change animation.
-const CGFloat kAlphaChangeAnimationDuration = 0.35;
-}  // namespace
-
-@implementation InfoBarContainerView
-
-- (void)layoutSubviews {
-  for (UIView<InfoBarViewSizing>* view in self.subviews) {
-    [view sizeToFit];
-    CGRect frame = view.frame;
-    frame.origin.y = CGRectGetHeight(frame) - [view visibleHeight];
-    [view setFrame:frame];
-  }
-}
-
-#pragma mark - InfobarConsumer
-
-- (void)addInfoBar:(InfoBarIOS*)infoBarIOS position:(NSInteger)position {
-  DCHECK_LE((NSUInteger)position, [[self subviews] count]);
-  CGRect containerBounds = [self bounds];
-  infoBarIOS->Layout(containerBounds);
-  UIView<InfoBarViewSizing>* view = infoBarIOS->view();
-  [view setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
-                            UIViewAutoresizingFlexibleHeight];
-  [self insertSubview:view atIndex:position];
-}
-
-- (CGFloat)topmostVisibleInfoBarHeight {
-  for (UIView* view in [self.subviews reverseObjectEnumerator]) {
-    return [view sizeThatFits:self.frame.size].height;
-  }
-  return 0;
-}
-
-- (void)animateInfoBarContainerToAlpha:(CGFloat)alpha {
-  CGFloat oldAlpha = self.alpha;
-  if (oldAlpha > 0 && alpha == 0) {
-    [self setUserInteractionEnabled:NO];
-  }
-
-  [UIView transitionWithView:self
-      duration:kAlphaChangeAnimationDuration
-      options:UIViewAnimationOptionCurveEaseInOut
-      animations:^{
-        [self setAlpha:alpha];
-      }
-      completion:^(BOOL) {
-        if (oldAlpha == 0 && alpha > 0) {
-          [self setUserInteractionEnabled:YES];
-        };
-      }];
-}
-
-- (void)updateLayout {
-  [self setNeedsLayout];
-}
-
-@end
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_view_controller.h b/ios/chrome/browser/ui/infobars/infobar_container_view_controller.h
new file mode 100644
index 0000000..578d934
--- /dev/null
+++ b/ios/chrome/browser/ui/infobars/infobar_container_view_controller.h
@@ -0,0 +1,25 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_VIEW_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_VIEW_CONTROLLER_H_
+
+#import <UIKit/UIKit.h>
+
+#include "ios/chrome/browser/infobars/infobar_container_state_delegate.h"
+#import "ios/chrome/browser/ui/infobars/infobar_container_consumer.h"
+
+@protocol InfobarPositioner;
+
+// ViewController that contains all Infobars. It can contain various at the
+// same time but only the top most one will be visible.
+@interface InfobarContainerViewController
+    : UIViewController<InfobarContainerConsumer, InfobarContainerStateDelegate>
+
+// The delegate used to position the InfoBarContainer in the view.
+@property(nonatomic, weak) id<InfobarPositioner> positioner;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_INFOBARS_INFOBAR_CONTAINER_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/infobars/infobar_container_view_controller.mm b/ios/chrome/browser/ui/infobars/infobar_container_view_controller.mm
new file mode 100644
index 0000000..a517146d
--- /dev/null
+++ b/ios/chrome/browser/ui/infobars/infobar_container_view_controller.mm
@@ -0,0 +1,104 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/infobars/infobar_container_view_controller.h"
+
+#include "base/ios/block_types.h"
+#include "ios/chrome/browser/infobars/infobar.h"
+#import "ios/chrome/browser/ui/infobars/infobar_positioner.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+// Duration for the alpha change animation.
+const CGFloat kAlphaChangeAnimationDuration = 0.35;
+}  // namespace
+
+@implementation InfobarContainerViewController
+
+#pragma mark - InfobarConsumer
+
+- (void)addInfoBar:(InfoBarIOS*)infoBarIOS position:(NSInteger)position {
+  DCHECK_LE(static_cast<NSUInteger>(position), [[self.view subviews] count]);
+  CGRect containerBounds = [self.view bounds];
+  infoBarIOS->Layout(containerBounds);
+  UIView<InfoBarViewSizing>* view = infoBarIOS->view();
+  [self.view insertSubview:view atIndex:position];
+  view.translatesAutoresizingMaskIntoConstraints = NO;
+  [NSLayoutConstraint activateConstraints:@[
+    [view.leadingAnchor constraintEqualToAnchor:self.view.leadingAnchor],
+    [view.trailingAnchor constraintEqualToAnchor:self.view.trailingAnchor],
+    [view.topAnchor constraintEqualToAnchor:self.view.topAnchor],
+    [view.bottomAnchor constraintEqualToAnchor:self.view.bottomAnchor]
+  ]];
+}
+
+- (void)setUserInteractionEnabled:(BOOL)enabled {
+  [self.view setUserInteractionEnabled:enabled];
+}
+
+#pragma mark - InfobarContainerStateDelegate
+
+- (void)infoBarContainerStateDidChangeAnimated:(BOOL)animated {
+  // Update the infobarContainer height.
+  CGRect containerFrame = self.view.frame;
+  CGFloat height = [self topmostVisibleInfoBarHeight];
+  containerFrame.origin.y =
+      CGRectGetMaxY([self.positioner parentView].frame) - height;
+  containerFrame.size.height = height;
+
+  BOOL isViewVisible = [self.positioner isParentViewVisible];
+  auto completion = ^(BOOL finished) {
+    if (!isViewVisible)
+      return;
+    UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
+                                    self.view);
+  };
+
+  ProceduralBlock frameUpdates = ^{
+    [self.view setFrame:containerFrame];
+  };
+  if (animated) {
+    [UIView animateWithDuration:0.1
+                     animations:frameUpdates
+                     completion:completion];
+  } else {
+    frameUpdates();
+    completion(YES);
+  }
+}
+
+#pragma mark - Private Methods
+
+// Animates |self.view| alpha to |alpha|.
+- (void)animateInfoBarContainerToAlpha:(CGFloat)alpha {
+  CGFloat oldAlpha = self.view.alpha;
+  if (oldAlpha > 0 && alpha == 0) {
+    [self.view setUserInteractionEnabled:NO];
+  }
+
+  [UIView transitionWithView:self.view
+      duration:kAlphaChangeAnimationDuration
+      options:UIViewAnimationOptionCurveEaseInOut
+      animations:^{
+        [self.view setAlpha:alpha];
+      }
+      completion:^(BOOL) {
+        if (oldAlpha == 0 && alpha > 0) {
+          [self.view setUserInteractionEnabled:YES];
+        };
+      }];
+}
+
+// Height of the frontmost infobar contained in |self.view| that is not hidden.
+- (CGFloat)topmostVisibleInfoBarHeight {
+  for (UIView* view in [self.view.subviews reverseObjectEnumerator]) {
+    return [view sizeThatFits:self.view.frame.size].height;
+  }
+  return 0;
+}
+
+@end
diff --git a/ios/chrome/browser/ui/infobars/infobar_coordinator.h b/ios/chrome/browser/ui/infobars/infobar_coordinator.h
index 83ad5c23..0c40d59d 100644
--- a/ios/chrome/browser/ui/infobars/infobar_coordinator.h
+++ b/ios/chrome/browser/ui/infobars/infobar_coordinator.h
@@ -42,12 +42,6 @@
 // The InfoBarContainer View.
 - (UIView*)view;
 
-// Displays an Infobar it was previously hidden.
-- (void)restoreInfobars;
-
-// Hides an Infobar if being shown.
-- (void)suspendInfobars;
-
 // Updates the InfobarContainer according to the positioner information.
 - (void)updateInfobarContainer;
 
diff --git a/ios/chrome/browser/ui/infobars/infobar_coordinator.mm b/ios/chrome/browser/ui/infobars/infobar_coordinator.mm
index 3a726e2..69e5089c 100644
--- a/ios/chrome/browser/ui/infobars/infobar_coordinator.mm
+++ b/ios/chrome/browser/ui/infobars/infobar_coordinator.mm
@@ -6,7 +6,6 @@
 
 #include <memory>
 
-#include "base/ios/block_types.h"
 #include "ios/chrome/browser/infobars/infobar_container_delegate_ios.h"
 #include "ios/chrome/browser/infobars/infobar_container_ios.h"
 #include "ios/chrome/browser/infobars/infobar_manager_impl.h"
@@ -15,7 +14,7 @@
 #import "ios/chrome/browser/tabs/tab_model_observer.h"
 #import "ios/chrome/browser/ui/authentication/re_signin_infobar_delegate.h"
 #import "ios/chrome/browser/ui/commands/application_commands.h"
-#include "ios/chrome/browser/ui/infobars/infobar_container_view.h"
+#include "ios/chrome/browser/ui/infobars/infobar_container_view_controller.h"
 #import "ios/chrome/browser/ui/infobars/infobar_positioner.h"
 #import "ios/chrome/browser/ui/settings/sync_utils/sync_util.h"
 #import "ios/chrome/browser/ui/signin_interaction/public/signin_presenter.h"
@@ -27,10 +26,9 @@
 #error "This file requires ARC support."
 #endif
 
-@interface InfobarCoordinator ()<InfobarContainerStateDelegate,
-                                 TabModelObserver,
-                                 SigninPresenter,
-                                 UpgradeCenterClient> {
+@interface InfobarCoordinator ()<TabModelObserver,
+                                 UpgradeCenterClient,
+                                 SigninPresenter> {
   // Bridge class to deliver container change notifications.
   std::unique_ptr<InfoBarContainerDelegateIOS> _infoBarContainerDelegate;
 
@@ -41,8 +39,9 @@
 }
 @property(nonatomic, assign) TabModel* tabModel;
 
-// UIView that contains Infobars.
-@property(nonatomic, strong) InfoBarContainerView* containerView;
+// UIViewController that contains Infobars.
+@property(nonatomic, strong)
+    InfobarContainerViewController* containerViewController;
 
 @end
 
@@ -57,23 +56,27 @@
   if (self) {
     _tabModel = tabModel;
     [_tabModel addObserver:self];
-    _containerView = [[InfoBarContainerView alloc] init];
-    [_containerView setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
-                                        UIViewAutoresizingFlexibleTopMargin];
-    _infoBarContainerDelegate.reset(new InfoBarContainerDelegateIOS(self));
+    _containerViewController = [[InfobarContainerViewController alloc] init];
+    _infoBarContainerDelegate.reset(
+        new InfoBarContainerDelegateIOS(_containerViewController));
     _infoBarContainer.reset(new InfoBarContainerIOS(
-        _infoBarContainerDelegate.get(), _containerView));
+        _infoBarContainerDelegate.get(), _containerViewController));
   }
   return self;
 }
 
 - (void)start {
-  [self.baseViewController.view insertSubview:self.containerView
+  DCHECK(self.positioner);
+  DCHECK(self.dispatcher);
+
+  [self.baseViewController addChildViewController:self.containerViewController];
+  // TODO(crbug.com/892376): We shouldn't modify the BaseVC hierarchy, BVC needs
+  // to handle this.
+  [self.baseViewController.view insertSubview:self.containerViewController.view
                                  aboveSubview:self.positioner.parentView];
-  CGRect infoBarFrame = self.positioner.parentView.frame;
-  infoBarFrame.origin.y = CGRectGetMaxY(infoBarFrame);
-  infoBarFrame.size.height = 0;
-  [self.containerView setFrame:infoBarFrame];
+  [self.containerViewController
+      didMoveToParentViewController:self.baseViewController];
+  self.containerViewController.positioner = self.positioner;
 
   infobars::InfoBarManager* infoBarManager = nullptr;
   if (self.tabModel.currentTab) {
@@ -95,20 +98,11 @@
 #pragma mark - Public Interface
 
 - (UIView*)view {
-  return self.containerView;
+  return self.containerViewController.view;
 }
 
-- (void)restoreInfobars {
-  [self.containerView animateInfoBarContainerToAlpha:1];
-}
-
-- (void)suspendInfobars {
-  [self.containerView animateInfoBarContainerToAlpha:0];
-}
-
-
 - (void)updateInfobarContainer {
-  [self infoBarContainerStateDidChangeAnimated:NO];
+  [self.containerViewController infoBarContainerStateDidChangeAnimated:NO];
 }
 
 - (BOOL)isInfobarPresentingForWebState:(web::WebState*)webState {
@@ -120,37 +114,6 @@
   return NO;
 }
 
-#pragma mark - InfobarContainerStateDelegate
-
-- (void)infoBarContainerStateDidChangeAnimated:(BOOL)animated {
-  InfoBarContainerView* infoBarContainerView = self.containerView;
-  DCHECK(infoBarContainerView);
-  CGRect containerFrame = infoBarContainerView.frame;
-  CGFloat height = [infoBarContainerView topmostVisibleInfoBarHeight];
-  containerFrame.origin.y =
-      CGRectGetMaxY([self.positioner parentView].frame) - height;
-  containerFrame.size.height = height;
-
-  BOOL isViewVisible = [self.positioner isParentViewVisible];
-  ProceduralBlock frameUpdates = ^{
-    [infoBarContainerView setFrame:containerFrame];
-  };
-  void (^completion)(BOOL) = ^(BOOL finished) {
-    if (!isViewVisible)
-      return;
-    UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification,
-                                    infoBarContainerView);
-  };
-  if (animated) {
-    [UIView animateWithDuration:0.1
-                     animations:frameUpdates
-                     completion:completion];
-  } else {
-    frameUpdates();
-    completion(YES);
-  }
-}
-
 #pragma mark - TabModelObserver methods
 
 - (void)tabModel:(TabModel*)model
diff --git a/ios/chrome/browser/ui/settings/BUILD.gn b/ios/chrome/browser/ui/settings/BUILD.gn
index fe0c9841..f426520 100644
--- a/ios/chrome/browser/ui/settings/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/BUILD.gn
@@ -5,8 +5,8 @@
 source_set("settings") {
   configs += [ "//build/config/compiler:enable_arc" ]
   sources = [
-    "about_chrome_collection_view_controller.h",
-    "about_chrome_collection_view_controller.mm",
+    "about_chrome_table_view_controller.h",
+    "about_chrome_table_view_controller.mm",
     "accounts_collection_view_controller.h",
     "accounts_collection_view_controller.mm",
     "alpha_animated_collection_view_flow_layout.h",
@@ -268,7 +268,7 @@
   configs += [ "//build/config/compiler:enable_arc" ]
   testonly = true
   sources = [
-    "about_chrome_collection_view_controller_unittest.mm",
+    "about_chrome_table_view_controller_unittest.mm",
     "autofill_credit_card_collection_view_controller_unittest.mm",
     "autofill_profile_collection_view_controller_unittest.mm",
     "autofill_profile_edit_collection_view_controller_unittest.mm",
diff --git a/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h b/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h
deleted file mode 100644
index 31c4f2b..0000000
--- a/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// 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.
-
-#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_ABOUT_CHROME_COLLECTION_VIEW_CONTROLLER_H_
-#define IOS_CHROME_BROWSER_UI_SETTINGS_ABOUT_CHROME_COLLECTION_VIEW_CONTROLLER_H_
-
-#import "ios/chrome/browser/ui/settings/settings_root_collection_view_controller.h"
-
-// Controller for the About Google Chrome collection view, which allows users to
-// view open source licenses, terms of service, etc.
-@interface AboutChromeCollectionViewController
-    : SettingsRootCollectionViewController
-
-- (instancetype)init NS_DESIGNATED_INITIALIZER;
-
-- (instancetype)initWithLayout:(UICollectionViewLayout*)layout
-                         style:(CollectionViewControllerStyle)style
-    NS_UNAVAILABLE;
-
-@end
-
-#endif  // IOS_CHROME_BROWSER_UI_SETTINGS_ABOUT_CHROME_COLLECTION_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.mm b/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.mm
deleted file mode 100644
index dfa0018a..0000000
--- a/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.mm
+++ /dev/null
@@ -1,191 +0,0 @@
-// 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.
-
-#import "ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h"
-
-#import "base/ios/block_types.h"
-#include "base/logging.h"
-#import "base/mac/foundation_util.h"
-#include "base/strings/sys_string_conversions.h"
-#include "base/strings/utf_string_conversions.h"
-#include "components/version_info/version_info.h"
-#include "ios/chrome/browser/chrome_url_constants.h"
-#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
-#import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
-#import "ios/chrome/browser/ui/settings/cells/settings_text_item.h"
-#import "ios/chrome/browser/ui/settings/cells/version_item.h"
-#import "ios/chrome/browser/ui/settings/settings_utils.h"
-#include "ios/chrome/browser/ui/util/uikit_ui_util.h"
-#include "ios/chrome/common/channel_info.h"
-#include "ios/chrome/grit/ios_chromium_strings.h"
-#include "ios/chrome/grit/ios_strings.h"
-#import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
-#import "ios/third_party/material_components_ios/src/components/Snackbar/src/MaterialSnackbar.h"
-#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/l10n/l10n_util_mac.h"
-#include "url/gurl.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-
-typedef NS_ENUM(NSInteger, SectionIdentifier) {
-  SectionIdentifierLinks = kSectionIdentifierEnumZero,
-  SectionIdentifierFooter,
-};
-
-typedef NS_ENUM(NSInteger, ItemType) {
-  ItemTypeLinksCredits = kItemTypeEnumZero,
-  ItemTypeLinksTerms,
-  ItemTypeLinksPrivacy,
-  ItemTypeVersion,
-};
-
-}  // namespace
-
-@implementation AboutChromeCollectionViewController
-
-#pragma mark Initialization
-
-- (instancetype)init {
-  UICollectionViewLayout* layout = [[MDCCollectionViewFlowLayout alloc] init];
-  self =
-      [super initWithLayout:layout style:CollectionViewControllerStyleAppBar];
-  if (self) {
-    self.title = l10n_util::GetNSString(IDS_IOS_ABOUT_PRODUCT_NAME);
-    // TODO(crbug.com/764578): -loadModel should not be called from
-    // initializer. A possible fix is to move this call to -viewDidLoad.
-    [self loadModel];
-  }
-  return self;
-}
-
-#pragma mark SettingsRootCollectionViewController
-
-- (void)loadModel {
-  [super loadModel];
-  CollectionViewModel* model = self.collectionViewModel;
-
-  [model addSectionWithIdentifier:SectionIdentifierLinks];
-
-  SettingsTextItem* credits =
-      [[SettingsTextItem alloc] initWithType:ItemTypeLinksCredits];
-  credits.text = l10n_util::GetNSString(IDS_IOS_OPEN_SOURCE_LICENSES);
-  credits.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator;
-  credits.accessibilityTraits = UIAccessibilityTraitButton;
-  [model addItem:credits toSectionWithIdentifier:SectionIdentifierLinks];
-
-  SettingsTextItem* terms =
-      [[SettingsTextItem alloc] initWithType:ItemTypeLinksTerms];
-  terms.text = l10n_util::GetNSString(IDS_IOS_TERMS_OF_SERVICE);
-  terms.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator;
-  terms.accessibilityTraits = UIAccessibilityTraitButton;
-  [model addItem:terms toSectionWithIdentifier:SectionIdentifierLinks];
-
-  SettingsTextItem* privacy =
-      [[SettingsTextItem alloc] initWithType:ItemTypeLinksPrivacy];
-  privacy.text = l10n_util::GetNSString(IDS_IOS_PRIVACY_POLICY);
-  privacy.accessoryType = MDCCollectionViewCellAccessoryDisclosureIndicator;
-  privacy.accessibilityTraits = UIAccessibilityTraitButton;
-  [model addItem:privacy toSectionWithIdentifier:SectionIdentifierLinks];
-
-  [model addSectionWithIdentifier:SectionIdentifierFooter];
-
-  VersionItem* version = [[VersionItem alloc] initWithType:ItemTypeVersion];
-  version.text = [self versionDescriptionString];
-  version.accessibilityTraits = UIAccessibilityTraitButton;
-  [model addItem:version toSectionWithIdentifier:SectionIdentifierFooter];
-}
-
-#pragma mark UICollectionViewDelegate
-
-- (void)collectionView:(UICollectionView*)collectionView
-    didSelectItemAtIndexPath:(NSIndexPath*)indexPath {
-  [super collectionView:collectionView didSelectItemAtIndexPath:indexPath];
-  NSInteger itemType =
-      [self.collectionViewModel itemTypeForIndexPath:indexPath];
-  switch (itemType) {
-    case ItemTypeLinksCredits:
-      [self openURL:GURL(kChromeUICreditsURL)];
-      break;
-    case ItemTypeLinksTerms:
-      [self openURL:GURL(kChromeUITermsURL)];
-      break;
-    case ItemTypeLinksPrivacy:
-      [self openURL:GURL(l10n_util::GetStringUTF8(IDS_IOS_PRIVACY_POLICY_URL))];
-      break;
-    case ItemTypeVersion:
-      [self copyVersionToPasteboard];
-      break;
-    default:
-      NOTREACHED();
-      break;
-  }
-}
-
-#pragma mark MDCCollectionViewStylingDelegate
-
-// MDCCollectionViewStylingDelegate protocol is implemented so that the version
-// cell has an invisible background.
-- (MDCCollectionViewCellStyle)collectionView:(UICollectionView*)collectionView
-                         cellStyleForSection:(NSInteger)section {
-  NSInteger sectionIdentifier =
-      [self.collectionViewModel sectionIdentifierForSection:section];
-  switch (sectionIdentifier) {
-    case SectionIdentifierFooter:
-      return MDCCollectionViewCellStyleDefault;
-    default:
-      return self.styler.cellStyle;
-  }
-}
-
-- (BOOL)collectionView:(UICollectionView*)collectionView
-    shouldHideItemBackgroundAtIndexPath:(NSIndexPath*)indexPath {
-  NSInteger sectionIdentifier =
-      [self.collectionViewModel sectionIdentifierForSection:indexPath.section];
-  switch (sectionIdentifier) {
-    case SectionIdentifierFooter:
-      return YES;
-    default:
-      return NO;
-  }
-}
-
-#pragma mark Private methods
-
-- (void)openURL:(GURL)URL {
-  BlockToOpenURL(self, self.dispatcher)(URL);
-}
-
-- (void)copyVersionToPasteboard {
-  [[UIPasteboard generalPasteboard] setString:[self versionOnlyString]];
-  TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
-  NSString* messageText = l10n_util::GetNSString(IDS_IOS_VERSION_COPIED);
-  MDCSnackbarMessage* message =
-      [MDCSnackbarMessage messageWithText:messageText];
-  message.category = @"version copied";
-  [MDCSnackbarManager showMessage:message];
-}
-
-- (std::string)versionString {
-  std::string versionString = version_info::GetVersionNumber();
-  std::string versionStringModifier = GetChannelString();
-  if (!versionStringModifier.empty()) {
-    versionString = versionString + " " + versionStringModifier;
-  }
-  return versionString;
-}
-
-- (NSString*)versionDescriptionString {
-  return l10n_util::GetNSStringF(IDS_IOS_VERSION,
-                                 base::UTF8ToUTF16([self versionString]));
-}
-
-- (NSString*)versionOnlyString {
-  return base::SysUTF8ToNSString([self versionString]);
-}
-
-@end
diff --git a/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller_unittest.mm
deleted file mode 100644
index 30907601..0000000
--- a/ios/chrome/browser/ui/settings/about_chrome_collection_view_controller_unittest.mm
+++ /dev/null
@@ -1,36 +0,0 @@
-// 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.
-
-#import "ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h"
-
-#import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h"
-#include "ios/chrome/grit/ios_strings.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-
-class AboutChromeCollectionViewControllerTest
-    : public CollectionViewControllerTest {
- public:
-  CollectionViewController* InstantiateController() override {
-    return [[AboutChromeCollectionViewController alloc] init];
-  }
-};
-
-TEST_F(AboutChromeCollectionViewControllerTest, TestModel) {
-  CreateController();
-  CheckController();
-
-  EXPECT_EQ(2, NumberOfSections());
-  EXPECT_EQ(3, NumberOfItemsInSection(0));
-  CheckTextCellTitleWithId(IDS_IOS_OPEN_SOURCE_LICENSES, 0, 0);
-  CheckTextCellTitleWithId(IDS_IOS_TERMS_OF_SERVICE, 0, 1);
-  CheckTextCellTitleWithId(IDS_IOS_PRIVACY_POLICY, 0, 2);
-}
-
-}  // namespace
diff --git a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.h b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.h
new file mode 100644
index 0000000..ce1baf3
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.h
@@ -0,0 +1,23 @@
+// 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.
+
+#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_ABOUT_CHROME_TABLE_VIEW_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_UI_SETTINGS_ABOUT_CHROME_TABLE_VIEW_CONTROLLER_H_
+
+#import "ios/chrome/browser/ui/settings/settings_root_table_view_controller.h"
+
+// Controller for the About Google Chrome Table View, which allows users to
+// view open source licenses, terms of service, etc.
+@interface AboutChromeTableViewController : SettingsRootTableViewController
+
+- (instancetype)init NS_DESIGNATED_INITIALIZER;
+
+- (instancetype)initWithTableViewStyle:(UITableViewStyle)style
+                           appBarStyle:
+                               (ChromeTableViewControllerStyle)appBarStyle
+    NS_UNAVAILABLE;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_SETTINGS_ABOUT_CHROME_TABLE_VIEW_CONTROLLER_H_
diff --git a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
new file mode 100644
index 0000000..367a3a2c
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller.mm
@@ -0,0 +1,179 @@
+// 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.
+
+#import "ios/chrome/browser/ui/settings/about_chrome_table_view_controller.h"
+
+#import "base/ios/block_types.h"
+#include "base/logging.h"
+#import "base/mac/foundation_util.h"
+#include "base/strings/sys_string_conversions.h"
+#include "base/strings/utf_string_conversions.h"
+#include "components/version_info/version_info.h"
+#include "ios/chrome/browser/chrome_url_constants.h"
+#import "ios/chrome/browser/ui/settings/cells/version_item.h"
+#import "ios/chrome/browser/ui/settings/settings_utils.h"
+#import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
+#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
+#include "ios/chrome/browser/ui/util/uikit_ui_util.h"
+#include "ios/chrome/common/channel_info.h"
+#include "ios/chrome/grit/ios_chromium_strings.h"
+#include "ios/chrome/grit/ios_strings.h"
+#import "ios/third_party/material_components_ios/src/components/Snackbar/src/MaterialSnackbar.h"
+#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/l10n/l10n_util_mac.h"
+#include "url/gurl.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+typedef NS_ENUM(NSInteger, SectionIdentifier) {
+  SectionIdentifierLinks = kSectionIdentifierEnumZero,
+};
+
+typedef NS_ENUM(NSInteger, ItemType) {
+  ItemTypeLinksCredits = kItemTypeEnumZero,
+  ItemTypeLinksTerms,
+  ItemTypeLinksPrivacy,
+  ItemTypeVersion,
+};
+
+const CGFloat kDefaultHeight = 70;
+
+}  // namespace
+
+@interface AboutChromeTableViewController ()<VersionFooterDelegate>
+@end
+
+@implementation AboutChromeTableViewController
+
+#pragma mark - Public
+
+- (instancetype)init {
+  self =
+      [super initWithTableViewStyle:UITableViewStyleGrouped
+                        appBarStyle:ChromeTableViewControllerStyleWithAppBar];
+  if (self) {
+    self.title = l10n_util::GetNSString(IDS_IOS_ABOUT_PRODUCT_NAME);
+  }
+  return self;
+}
+
+#pragma mark - UIViewController
+
+- (void)viewDidLoad {
+  [super viewDidLoad];
+  [self loadModel];
+  self.tableView.rowHeight = UITableViewAutomaticDimension;
+  self.tableView.estimatedRowHeight = kDefaultHeight;
+  self.tableView.sectionFooterHeight = UITableViewAutomaticDimension;
+  self.tableView.estimatedSectionFooterHeight = kDefaultHeight;
+  self.styler.cellTitleColor = [UIColor blackColor];
+}
+
+#pragma mark - SettingsRootTableViewController
+
+- (void)loadModel {
+  [super loadModel];
+  TableViewModel* model = self.tableViewModel;
+
+  [model addSectionWithIdentifier:SectionIdentifierLinks];
+
+  TableViewDetailTextItem* credits =
+      [[TableViewDetailTextItem alloc] initWithType:ItemTypeLinksCredits];
+  credits.text = l10n_util::GetNSString(IDS_IOS_OPEN_SOURCE_LICENSES);
+  credits.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+  credits.accessibilityTraits = UIAccessibilityTraitButton;
+  [model addItem:credits toSectionWithIdentifier:SectionIdentifierLinks];
+
+  TableViewDetailTextItem* terms =
+      [[TableViewDetailTextItem alloc] initWithType:ItemTypeLinksTerms];
+  terms.text = l10n_util::GetNSString(IDS_IOS_TERMS_OF_SERVICE);
+  terms.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+  terms.accessibilityTraits = UIAccessibilityTraitButton;
+  [model addItem:terms toSectionWithIdentifier:SectionIdentifierLinks];
+
+  TableViewDetailTextItem* privacy =
+      [[TableViewDetailTextItem alloc] initWithType:ItemTypeLinksPrivacy];
+  privacy.text = l10n_util::GetNSString(IDS_IOS_PRIVACY_POLICY);
+  privacy.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+  privacy.accessibilityTraits = UIAccessibilityTraitButton;
+  [model addItem:privacy toSectionWithIdentifier:SectionIdentifierLinks];
+
+  VersionItem* version = [[VersionItem alloc] initWithType:ItemTypeVersion];
+  version.text = [self versionDescriptionString];
+  version.accessibilityTraits = UIAccessibilityTraitButton;
+  [model setFooter:version forSectionWithIdentifier:SectionIdentifierLinks];
+}
+
+#pragma mark - UITableViewDelegate
+
+- (UIView*)tableView:(UITableView*)tableView
+    viewForFooterInSection:(NSInteger)section {
+  UIView* footer = [super tableView:tableView viewForFooterInSection:section];
+  VersionFooter* versionFooter =
+      base::mac::ObjCCastStrict<VersionFooter>(footer);
+  versionFooter.delegate = self;
+  return footer;
+}
+
+- (void)tableView:(UITableView*)tableView
+    didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
+  NSInteger itemType = [self.tableViewModel itemTypeForIndexPath:indexPath];
+  switch (itemType) {
+    case ItemTypeLinksCredits:
+      [self openURL:GURL(kChromeUICreditsURL)];
+      break;
+    case ItemTypeLinksTerms:
+      [self openURL:GURL(kChromeUITermsURL)];
+      break;
+    case ItemTypeLinksPrivacy:
+      [self openURL:GURL(l10n_util::GetStringUTF8(IDS_IOS_PRIVACY_POLICY_URL))];
+      break;
+    case ItemTypeVersion:
+      // Version is a footer, it is not interactable.
+      NOTREACHED();
+      break;
+  }
+}
+
+#pragma mark - VersionFooterDelegate
+
+- (void)didTapVersionFooter:(VersionFooter*)footer {
+  [[UIPasteboard generalPasteboard] setString:[self versionOnlyString]];
+  TriggerHapticFeedbackForNotification(UINotificationFeedbackTypeSuccess);
+  NSString* messageText = l10n_util::GetNSString(IDS_IOS_VERSION_COPIED);
+  MDCSnackbarMessage* message =
+      [MDCSnackbarMessage messageWithText:messageText];
+  message.category = @"version copied";
+  [MDCSnackbarManager showMessage:message];
+}
+
+#pragma mark - Private methods
+
+- (void)openURL:(GURL)URL {
+  BlockToOpenURL(self, self.dispatcher)(URL);
+}
+
+- (std::string)versionString {
+  std::string versionString = version_info::GetVersionNumber();
+  std::string versionStringModifier = GetChannelString();
+  if (!versionStringModifier.empty()) {
+    versionString = versionString + " " + versionStringModifier;
+  }
+  return versionString;
+}
+
+- (NSString*)versionDescriptionString {
+  return l10n_util::GetNSStringF(IDS_IOS_VERSION,
+                                 base::UTF8ToUTF16([self versionString]));
+}
+
+- (NSString*)versionOnlyString {
+  return base::SysUTF8ToNSString([self versionString]);
+}
+
+@end
diff --git a/ios/chrome/browser/ui/settings/about_chrome_table_view_controller_unittest.mm b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller_unittest.mm
new file mode 100644
index 0000000..3452b47
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/about_chrome_table_view_controller_unittest.mm
@@ -0,0 +1,37 @@
+// 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.
+
+#import "ios/chrome/browser/ui/settings/about_chrome_table_view_controller.h"
+
+#import "ios/chrome/browser/ui/table_view/chrome_table_view_controller_test.h"
+#include "ios/chrome/grit/ios_strings.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+
+class AboutChromeTableViewControllerTest
+    : public ChromeTableViewControllerTest {
+ public:
+  ChromeTableViewController* InstantiateController() override {
+    return [[AboutChromeTableViewController alloc] init];
+  }
+};
+
+TEST_F(AboutChromeTableViewControllerTest, TestModel) {
+  CreateController();
+  CheckController();
+
+  EXPECT_EQ(1, NumberOfSections());
+  EXPECT_EQ(3, NumberOfItemsInSection(0));
+  EXPECT_NE(nil, [controller().tableViewModel footerForSection:0]);
+  CheckTextCellTextWithId(IDS_IOS_OPEN_SOURCE_LICENSES, 0, 0);
+  CheckTextCellTextWithId(IDS_IOS_TERMS_OF_SERVICE, 0, 1);
+  CheckTextCellTextWithId(IDS_IOS_PRIVACY_POLICY, 0, 2);
+}
+
+}  // namespace
diff --git a/ios/chrome/browser/ui/settings/cells/BUILD.gn b/ios/chrome/browser/ui/settings/cells/BUILD.gn
index 9400949..cd7723a7 100644
--- a/ios/chrome/browser/ui/settings/cells/BUILD.gn
+++ b/ios/chrome/browser/ui/settings/cells/BUILD.gn
@@ -26,6 +26,8 @@
     "passphrase_error_item.mm",
     "password_details_item.h",
     "password_details_item.mm",
+    "settings_cells_constants.h",
+    "settings_cells_constants.mm",
     "settings_collapsible_item.h",
     "settings_collapsible_item.mm",
     "settings_detail_item.h",
@@ -34,6 +36,8 @@
     "settings_image_detail_text_item.mm",
     "settings_search_item.h",
     "settings_search_item.mm",
+    "settings_switch_item.h",
+    "settings_switch_item.mm",
     "settings_text_item.h",
     "settings_text_item.mm",
     "sync_switch_item.h",
@@ -100,6 +104,7 @@
     "//ios/chrome/browser/browsing_data:counters",
     "//ios/chrome/browser/ui/collection_view/cells",
     "//ios/chrome/browser/ui/collection_view/cells:test_support",
+    "//ios/chrome/browser/ui/table_view:styler",
     "//ios/web/public/test:test",
     "//testing/gtest",
     "//ui/base",
diff --git a/ios/chrome/browser/ui/settings/cells/settings_cells_constants.h b/ios/chrome/browser/ui/settings/cells/settings_cells_constants.h
new file mode 100644
index 0000000..531d3e0
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/cells/settings_cells_constants.h
@@ -0,0 +1,11 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CELLS_CONSTANTS_H_
+#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CELLS_CONSTANTS_H_
+
+// The color of the detail text for the settings cells.
+extern const int kSettingsCellsDetailTextColor;
+
+#endif  // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_CELLS_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/settings/cells/settings_cells_constants.mm b/ios/chrome/browser/ui/settings/cells/settings_cells_constants.mm
new file mode 100644
index 0000000..da3a3a3
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/cells/settings_cells_constants.mm
@@ -0,0 +1,11 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+const int kSettingsCellsDetailTextColor = 0x767676;
diff --git a/ios/chrome/browser/ui/settings/cells/settings_detail_item.mm b/ios/chrome/browser/ui/settings/cells/settings_detail_item.mm
index 83b91b2..b077668 100644
--- a/ios/chrome/browser/ui/settings/cells/settings_detail_item.mm
+++ b/ios/chrome/browser/ui/settings/cells/settings_detail_item.mm
@@ -6,6 +6,7 @@
 
 #include <algorithm>
 
+#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
 #import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
 #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
 #import "ios/chrome/common/ui_util/constraints_ui_util.h"
@@ -29,8 +30,6 @@
 // Size of the icon image.
 const CGFloat kIconImageSize = 28;
 
-const int kDetailTextColor = 0x767676;
-
 // Minimum proportion of the available width to guarantee to the main and detail
 // labels.
 const CGFloat kMinTextWidthRatio = 0.75f;
@@ -129,7 +128,7 @@
     _detailTextLabel.font =
         [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
     _detailTextLabel.adjustsFontForContentSizeCategory = YES;
-    _detailTextLabel.textColor = UIColorFromRGB(kDetailTextColor);
+    _detailTextLabel.textColor = UIColorFromRGB(kSettingsCellsDetailTextColor);
     _detailTextLabel.backgroundColor = [UIColor clearColor];
     [contentView addSubview:_detailTextLabel];
 
diff --git a/ios/chrome/browser/ui/settings/cells/settings_switch_item.h b/ios/chrome/browser/ui/settings/cells/settings_switch_item.h
new file mode 100644
index 0000000..0477663
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/cells/settings_switch_item.h
@@ -0,0 +1,51 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_SWITCH_ITEM_H_
+#define IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_SWITCH_ITEM_H_
+
+#import <UIKit/UIKit.h>
+
+#import "ios/chrome/browser/ui/table_view/cells/table_view_item.h"
+
+// SettingsSwitchItem is a model class that uses SettingsSwitchCell.
+@interface SettingsSwitchItem : TableViewItem
+// The filename for the leading icon.  If empty, no icon will be shown.
+@property(nonatomic, copy) NSString* iconImageName;
+
+// The text to display.
+@property(nonatomic, copy) NSString* text;
+
+// The current state of the switch.
+@property(nonatomic, assign, getter=isOn) BOOL on;
+
+// Whether or not the switch is enabled.  Disabled switches are automatically
+// drawn as in the "off" state, with dimmed text.
+@property(nonatomic, assign, getter=isEnabled) BOOL enabled;
+
+@end
+
+// SettingsSwitchCell implements a UITableViewCell subclass containing an icon,
+// a text label, and a switch.
+// If the preferred content size category is an accessibility category, the
+// switch is displayed below the label. Otherwise, it is on the trailing side.
+@interface SettingsSwitchCell : UITableViewCell
+
+// UILabel corresponding to |text| from the item.
+@property(nonatomic, readonly, strong) UILabel* textLabel;
+
+// The switch view.
+@property(nonatomic, readonly, strong) UISwitch* switchView;
+
+// Returns the default text color used for the given |state|.
++ (UIColor*)defaultTextColorForState:(UIControlState)state;
+
+// Sets the image that should be displayed at the leading edge of the cell. If
+// set to nil, the icon will be hidden and the remaining content will expand to
+// fill the full width of the cell.
+- (void)setIconImage:(UIImage*)image;
+
+@end
+
+#endif  // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_SETTINGS_SWITCH_ITEM_H_
diff --git a/ios/chrome/browser/ui/settings/cells/settings_switch_item.mm b/ios/chrome/browser/ui/settings/cells/settings_switch_item.mm
new file mode 100644
index 0000000..9604f01
--- /dev/null
+++ b/ios/chrome/browser/ui/settings/cells/settings_switch_item.mm
@@ -0,0 +1,259 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
+
+#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
+#include "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
+#import "ios/chrome/browser/ui/util/uikit_ui_util.h"
+#import "ios/chrome/common/ui_util/constraints_ui_util.h"
+#include "ios/chrome/grit/ios_strings.h"
+#include "ui/base/l10n/l10n_util_mac.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+namespace {
+// Padding used between the icon and the text labels.
+const CGFloat kIconTrailingPadding = 12;
+
+// Padding used on the top and bottom edges of the cell.
+const CGFloat kVerticalPadding = 16;
+
+// Size of the icon image.
+const CGFloat kIconImageSize = 28;
+}  // namespace
+
+@implementation SettingsSwitchItem
+
+- (instancetype)initWithType:(NSInteger)type {
+  self = [super initWithType:type];
+  if (self) {
+    self.cellClass = [SettingsSwitchCell class];
+    self.enabled = YES;
+  }
+  return self;
+}
+
+#pragma mark TableViewItem
+
+- (void)configureCell:(SettingsSwitchCell*)cell
+           withStyler:(ChromeTableViewStyler*)styler {
+  [super configureCell:cell withStyler:styler];
+  cell.textLabel.text = self.text;
+  cell.switchView.enabled = self.enabled;
+  cell.switchView.on = self.on;
+  cell.textLabel.textColor =
+      [SettingsSwitchCell defaultTextColorForState:cell.switchView.state];
+
+  // Update the icon image, if one is present.
+  UIImage* iconImage = nil;
+  if ([self.iconImageName length]) {
+    iconImage = [UIImage imageNamed:self.iconImageName];
+  }
+  [cell setIconImage:iconImage];
+}
+
+@end
+
+#pragma mark - SettingsSwitchCell
+
+@interface SettingsSwitchCell ()
+
+// The image view for the leading icon.
+@property(nonatomic, readonly, strong) UIImageView* iconImageView;
+
+// Constraints that are used when the iconImageView is visible and hidden.
+@property(nonatomic, strong) NSLayoutConstraint* iconVisibleConstraint;
+@property(nonatomic, strong) NSLayoutConstraint* iconHiddenConstraint;
+
+// Constraints that are used when the preferred content size is an
+// "accessibility" category.
+@property(nonatomic, strong) NSArray* accessibilityConstraints;
+// Constraints that are used when the preferred content size is *not* an
+// "accessibility" category.
+@property(nonatomic, strong) NSArray* standardConstraints;
+
+@end
+
+@implementation SettingsSwitchCell
+
+@synthesize accessibilityConstraints = _accessibilityConstraints;
+@synthesize standardConstraints = _standardConstraints;
+@synthesize iconHiddenConstraint = _iconHiddenConstraint;
+@synthesize iconVisibleConstraint = _iconVisibleConstraint;
+@synthesize textLabel = _textLabel;
+
+- (instancetype)initWithStyle:(UITableViewCellStyle)style
+              reuseIdentifier:(NSString*)reuseIdentifier {
+  self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+  if (self) {
+    self.isAccessibilityElement = YES;
+
+    _iconImageView = [[UIImageView alloc] init];
+    _iconImageView.translatesAutoresizingMaskIntoConstraints = NO;
+    _iconImageView.hidden = YES;
+    [self.contentView addSubview:_iconImageView];
+
+    _textLabel = [[UILabel alloc] init];
+    _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
+    _textLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody];
+    _textLabel.adjustsFontForContentSizeCategory = YES;
+    _textLabel.textColor = [UIColor blackColor];
+    _textLabel.numberOfLines = 0;
+    [self.contentView addSubview:_textLabel];
+
+    _switchView = [[UISwitch alloc] initWithFrame:CGRectZero];
+    _switchView.translatesAutoresizingMaskIntoConstraints = NO;
+    _switchView.onTintColor = UIColorFromRGB(kTableViewSwitchTintColor);
+    _switchView.accessibilityHint = l10n_util::GetNSString(
+        IDS_IOS_TOGGLE_SETTING_SWITCH_ACCESSIBILITY_HINT);
+    [self.contentView addSubview:_switchView];
+
+    // Set up the constraints assuming that the icon image is hidden.
+    _iconVisibleConstraint = [_textLabel.leadingAnchor
+        constraintEqualToAnchor:_iconImageView.trailingAnchor
+                       constant:kIconTrailingPadding];
+    _iconHiddenConstraint = [_textLabel.leadingAnchor
+        constraintEqualToAnchor:self.contentView.leadingAnchor
+                       constant:kTableViewHorizontalSpacing];
+
+    _standardConstraints = @[
+      [_switchView.centerYAnchor
+          constraintEqualToAnchor:self.contentView.centerYAnchor],
+      [_textLabel.trailingAnchor
+          constraintLessThanOrEqualToAnchor:_switchView.leadingAnchor
+                                   constant:-kTableViewHorizontalSpacing],
+    ];
+    _accessibilityConstraints = @[
+      [_switchView.topAnchor constraintEqualToAnchor:_textLabel.bottomAnchor
+                                            constant:kVerticalPadding],
+      [_switchView.leadingAnchor
+          constraintEqualToAnchor:self.contentView.leadingAnchor
+                         constant:kTableViewHorizontalSpacing],
+      [_switchView.bottomAnchor
+          constraintEqualToAnchor:self.contentView.bottomAnchor
+                         constant:-kVerticalPadding],
+      [_textLabel.trailingAnchor
+          constraintLessThanOrEqualToAnchor:self.contentView.trailingAnchor
+                                   constant:-kTableViewHorizontalSpacing],
+    ];
+
+    [NSLayoutConstraint activateConstraints:@[
+      [_iconImageView.leadingAnchor
+          constraintEqualToAnchor:self.contentView.leadingAnchor
+                         constant:kTableViewHorizontalSpacing],
+      [_iconImageView.widthAnchor constraintEqualToConstant:kIconImageSize],
+      [_iconImageView.heightAnchor constraintEqualToConstant:kIconImageSize],
+
+      [_switchView.trailingAnchor
+          constraintEqualToAnchor:self.contentView.trailingAnchor
+                         constant:-kTableViewHorizontalSpacing],
+
+      [_iconImageView.centerYAnchor
+          constraintEqualToAnchor:self.contentView.centerYAnchor],
+      [_textLabel.centerYAnchor
+          constraintEqualToAnchor:self.contentView.centerYAnchor],
+
+      _iconHiddenConstraint,
+    ]];
+
+    if (ContentSizeCategoryIsAccessibilityCategory(
+            self.traitCollection.preferredContentSizeCategory)) {
+      [NSLayoutConstraint activateConstraints:_accessibilityConstraints];
+    } else {
+      [NSLayoutConstraint activateConstraints:_standardConstraints];
+    }
+
+    AddOptionalVerticalPadding(self.contentView, _textLabel, kVerticalPadding);
+  }
+  return self;
+}
+
++ (UIColor*)defaultTextColorForState:(UIControlState)state {
+  return (state & UIControlStateDisabled)
+             ? UIColorFromRGB(kSettingsCellsDetailTextColor)
+             : [UIColor blackColor];
+}
+
+- (void)setIconImage:(UIImage*)image {
+  BOOL hidden = (image == nil);
+  if (hidden == self.iconImageView.hidden) {
+    return;
+  }
+
+  self.iconImageView.image = image;
+  self.iconImageView.hidden = hidden;
+  if (hidden) {
+    self.iconVisibleConstraint.active = NO;
+    self.iconHiddenConstraint.active = YES;
+  } else {
+    self.iconHiddenConstraint.active = NO;
+    self.iconVisibleConstraint.active = YES;
+  }
+}
+
+#pragma mark - UIView
+
+- (void)traitCollectionDidChange:(UITraitCollection*)previousTraitCollection {
+  [super traitCollectionDidChange:previousTraitCollection];
+  BOOL isCurrentContentSizeAccessibility =
+      ContentSizeCategoryIsAccessibilityCategory(
+          self.traitCollection.preferredContentSizeCategory);
+  if (ContentSizeCategoryIsAccessibilityCategory(
+          previousTraitCollection.preferredContentSizeCategory) !=
+      isCurrentContentSizeAccessibility) {
+    if (isCurrentContentSizeAccessibility) {
+      [NSLayoutConstraint deactivateConstraints:_standardConstraints];
+      [NSLayoutConstraint activateConstraints:_accessibilityConstraints];
+    } else {
+      [NSLayoutConstraint deactivateConstraints:_accessibilityConstraints];
+      [NSLayoutConstraint activateConstraints:_standardConstraints];
+    }
+  }
+}
+
+#pragma mark - UITableViewCell
+
+- (void)prepareForReuse {
+  [super prepareForReuse];
+
+  [self setIconImage:nil];
+  [_switchView removeTarget:nil
+                     action:nil
+           forControlEvents:[_switchView allControlEvents]];
+}
+
+#pragma mark - UIAccessibility
+
+- (CGPoint)accessibilityActivationPoint {
+  // Center the activation point over the switch, so that double-tapping toggles
+  // the switch.
+  CGRect switchFrame =
+      UIAccessibilityConvertFrameToScreenCoordinates(_switchView.frame, self);
+  return CGPointMake(CGRectGetMidX(switchFrame), CGRectGetMidY(switchFrame));
+}
+
+- (NSString*)accessibilityHint {
+  if (_switchView.enabled) {
+    return _switchView.accessibilityHint;
+  } else {
+    return @"";
+  }
+}
+
+- (NSString*)accessibilityLabel {
+  return _textLabel.text;
+}
+
+- (NSString*)accessibilityValue {
+  if (_switchView.on) {
+    return l10n_util::GetNSString(IDS_IOS_SETTING_ON);
+  } else {
+    return l10n_util::GetNSString(IDS_IOS_SETTING_OFF);
+  }
+}
+
+@end
diff --git a/ios/chrome/browser/ui/settings/cells/version_item.h b/ios/chrome/browser/ui/settings/cells/version_item.h
index 91bee81a..3692563 100644
--- a/ios/chrome/browser/ui/settings/cells/version_item.h
+++ b/ios/chrome/browser/ui/settings/cells/version_item.h
@@ -7,23 +7,35 @@
 
 #import <UIKit/UIKit.h>
 
-#import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
-#import "ios/third_party/material_components_ios/src/components/CollectionCells/src/MaterialCollectionCells.h"
+#import "ios/chrome/browser/ui/table_view/cells/table_view_header_footer_item.h"
+
+@class VersionFooter;
+
+// Protocol notified when the footer is tapped.
+@protocol VersionFooterDelegate
+
+// Called when the version footer is tapped.
+- (void)didTapVersionFooter:(VersionFooter*)footer;
+
+@end
 
 // Item to display the version of the current build.
-@interface VersionItem : CollectionViewItem
+@interface VersionItem : TableViewHeaderFooterItem
 
 // The display string representing the version.
 @property(nonatomic, copy) NSString* text;
 
 @end
 
-// Cell class associated to VersionItem.
-@interface VersionCell : MDCCollectionViewCell
+// Footer view class associated to VersionItem.
+@interface VersionFooter : UITableViewHeaderFooterView
 
 // Label for the current build version.
 @property(nonatomic, readonly, strong) UILabel* textLabel;
 
+// Delegate.
+@property(nonatomic, weak) id<VersionFooterDelegate> delegate;
+
 @end
 
 #endif  // IOS_CHROME_BROWSER_UI_SETTINGS_CELLS_VERSION_ITEM_H_
diff --git a/ios/chrome/browser/ui/settings/cells/version_item.mm b/ios/chrome/browser/ui/settings/cells/version_item.mm
index b00fd248..32421f99 100644
--- a/ios/chrome/browser/ui/settings/cells/version_item.mm
+++ b/ios/chrome/browser/ui/settings/cells/version_item.mm
@@ -5,16 +5,22 @@
 #import "ios/chrome/browser/ui/settings/cells/version_item.h"
 
 #include "ios/chrome/browser/ui/collection_view/cells/collection_view_cell_constants.h"
+#import "ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h"
 #import "ios/chrome/browser/ui/util/uikit_ui_util.h"
+#import "ios/chrome/common/ui_util/constraints_ui_util.h"
 #include "ios/chrome/grit/ios_strings.h"
-#import "ios/third_party/material_components_ios/src/components/Palettes/src/MaterialPalettes.h"
-#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
 #include "ui/base/l10n/l10n_util_mac.h"
 
 #if !defined(__has_feature) || !__has_feature(objc_arc)
 #error "This file requires ARC support."
 #endif
 
+namespace {
+const CGFloat kVerticalSpacing = 16;
+}  // namespace
+
+#pragma mark - VersionItem
+
 @implementation VersionItem
 
 @synthesize text = _text;
@@ -23,26 +29,29 @@
   self = [super initWithType:type];
   if (self) {
     self.accessibilityIdentifier = @"Version cell";
-    self.cellClass = [VersionCell class];
+    self.cellClass = [VersionFooter class];
   }
   return self;
 }
 
-#pragma mark CollectionViewItem
+#pragma mark - TableViewHeaderFooterItem
 
-- (void)configureCell:(VersionCell*)cell {
-  [super configureCell:cell];
-  cell.textLabel.text = self.text;
+- (void)configureHeaderFooterView:(VersionFooter*)headerFooter
+                       withStyler:(ChromeTableViewStyler*)styler {
+  [super configureHeaderFooterView:headerFooter withStyler:styler];
+  headerFooter.textLabel.text = self.text;
 }
 
 @end
 
-@implementation VersionCell
+#pragma mark - VersionFooter
+
+@implementation VersionFooter
 
 @synthesize textLabel = _textLabel;
 
-- (instancetype)initWithFrame:(CGRect)frame {
-  self = [super initWithFrame:frame];
+- (instancetype)initWithReuseIdentifier:(NSString*)reuseIdentifier {
+  self = [super initWithReuseIdentifier:reuseIdentifier];
   if (self) {
     self.isAccessibilityElement = YES;
     self.accessibilityTraits |= UIAccessibilityTraitButton;
@@ -50,19 +59,35 @@
 
     _textLabel = [[UILabel alloc] init];
     _textLabel.translatesAutoresizingMaskIntoConstraints = NO;
-    _textLabel.font = [UIFont systemFontOfSize:kUIKitFooterFontSize];
-    _textLabel.textColor = UIColorFromRGB(kUIKitFooterTextColor);
+    _textLabel.font =
+        [UIFont preferredFontForTextStyle:UIFontTextStyleFootnote];
+    _textLabel.textColor =
+        UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
     _textLabel.backgroundColor = [UIColor clearColor];
     _textLabel.textAlignment = NSTextAlignmentCenter;
-    [self addSubview:_textLabel];
+    [self.contentView addSubview:_textLabel];
 
-    // Set up the constraints.
+    UIButton* button = [[UIButton alloc] init];
+    button.translatesAutoresizingMaskIntoConstraints = NO;
+    [button addTarget:self
+                  action:@selector(buttonTapped)
+        forControlEvents:UIControlEventTouchUpInside];
+    [self.contentView addSubview:button];
+
+    AddSameConstraints(button, self.contentView);
     [NSLayoutConstraint activateConstraints:@[
-      [_textLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor],
-      [_textLabel.centerYAnchor constraintEqualToAnchor:self.centerYAnchor],
+      [self.contentView.heightAnchor constraintGreaterThanOrEqualToConstant:
+                                         kTableViewHeaderFooterViewHeight],
+      [_textLabel.leadingAnchor
+          constraintEqualToAnchor:self.contentView.leadingAnchor],
+      [_textLabel.trailingAnchor
+          constraintEqualToAnchor:self.contentView.trailingAnchor],
+      [_textLabel.topAnchor constraintEqualToAnchor:self.contentView.topAnchor
+                                           constant:kVerticalSpacing],
+      [_textLabel.bottomAnchor
+          constraintEqualToAnchor:self.contentView.bottomAnchor
+                         constant:-kVerticalSpacing]
     ]];
-
-    self.shouldHideSeparator = YES;
   }
   return self;
 }
@@ -71,4 +96,18 @@
   return self.textLabel.text;
 }
 
+#pragma mark - UITableViewHeaderFooterView
+
+- (void)prepareForReuse {
+  [super prepareForReuse];
+  self.delegate = nil;
+}
+
+#pragma mark - Private
+
+// Callback for the button
+- (void)buttonTapped {
+  [self.delegate didTapVersionFooter:self];
+}
+
 @end
diff --git a/ios/chrome/browser/ui/settings/cells/version_item_unittest.mm b/ios/chrome/browser/ui/settings/cells/version_item_unittest.mm
index eac2c61..dcb1430 100644
--- a/ios/chrome/browser/ui/settings/cells/version_item_unittest.mm
+++ b/ios/chrome/browser/ui/settings/cells/version_item_unittest.mm
@@ -5,6 +5,7 @@
 #import "ios/chrome/browser/ui/settings/cells/version_item.h"
 
 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_item.h"
+#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/gtest_mac.h"
 #include "testing/platform_test.h"
@@ -19,11 +20,12 @@
 
 TEST_F(VersionItemTest, TextLabelGetsText) {
   VersionItem* item = [[VersionItem alloc] initWithType:0];
-  VersionCell* cell = [[[item cellClass] alloc] init];
-  EXPECT_TRUE([cell isMemberOfClass:[VersionCell class]]);
+  VersionFooter* cell = [[[item cellClass] alloc] init];
+  EXPECT_TRUE([cell isMemberOfClass:[VersionFooter class]]);
 
   item.text = @"Foo";
-  [item configureCell:cell];
+  [item configureHeaderFooterView:cell
+                       withStyler:[[ChromeTableViewStyler alloc] init]];
   EXPECT_NSEQ(@"Foo", cell.textLabel.text);
 }
 
diff --git a/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm b/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
index f2d19bdf..e3421b77 100644
--- a/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/settings_collection_view_controller.mm
@@ -42,7 +42,7 @@
 #import "ios/chrome/browser/ui/collection_view/collection_view_model.h"
 #import "ios/chrome/browser/ui/colors/MDCPalette+CrAdditions.h"
 #import "ios/chrome/browser/ui/commands/settings_main_page_commands.h"
-#import "ios/chrome/browser/ui/settings/about_chrome_collection_view_controller.h"
+#import "ios/chrome/browser/ui/settings/about_chrome_table_view_controller.h"
 #import "ios/chrome/browser/ui/settings/accounts_collection_view_controller.h"
 #import "ios/chrome/browser/ui/settings/autofill_credit_card_collection_view_controller.h"
 #import "ios/chrome/browser/ui/settings/autofill_profile_collection_view_controller.h"
@@ -887,7 +887,7 @@
           initWithBrowserState:_browserState];
       break;
     case ItemTypeAboutChrome:
-      controller = [[AboutChromeCollectionViewController alloc] init];
+      controller = [[AboutChromeTableViewController alloc] init];
       break;
     case ItemTypeMemoryDebugging:
     case ItemTypeViewSource:
diff --git a/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm b/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
index 3b0c2b323..037f5aa 100644
--- a/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
+++ b/ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.mm
@@ -5,6 +5,7 @@
 #import "ios/chrome/browser/ui/settings/table_cell_catalog_view_controller.h"
 
 #import "ios/chrome/browser/ui/settings/cells/settings_detail_item.h"
+#import "ios/chrome/browser/ui/settings/cells/settings_switch_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_accessory_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_link_header_footer_item.h"
@@ -12,6 +13,7 @@
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_header_footer_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_text_item.h"
 #import "ios/chrome/browser/ui/table_view/cells/table_view_url_item.h"
+#import "ios/chrome/browser/ui/table_view/chrome_table_view_styler.h"
 #import "ios/chrome/browser/ui/table_view/table_view_model.h"
 #include "url/gurl.h"
 
@@ -42,6 +44,7 @@
   ItemTypeTextSettingsDetail,
   ItemTypeLinkFooter,
   ItemTypeDetailText,
+  ItemTypeSettingsSwitch,
 };
 }
 
@@ -147,6 +150,12 @@
   [model addItem:settingsDetailItemLong
       toSectionWithIdentifier:SectionIdentifierSettings];
 
+  SettingsSwitchItem* settingsSwitchItem =
+      [[SettingsSwitchItem alloc] initWithType:ItemTypeSettingsSwitch];
+  settingsSwitchItem.text = @"This is a switch item";
+  [model addItem:settingsSwitchItem
+      toSectionWithIdentifier:SectionIdentifierSettings];
+
   TableViewLinkHeaderFooterItem* linkFooter =
       [[TableViewLinkHeaderFooterItem alloc] initWithType:ItemTypeLinkFooter];
   linkFooter.text =
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h b/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h
index 20d6aee..20e9c93 100644
--- a/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h
+++ b/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.h
@@ -30,9 +30,13 @@
 extern const CGFloat kTableViewLabelVerticalTopSpacing;
 
 // Hex Value for light gray label text color.
-extern const CGFloat kTableViewTextLabelColorLightGrey;
+extern const int kTableViewTextLabelColorLightGrey;
 
-// The text color of the secondary labels (e.g. details, URL, metadata...).
-extern const CGFloat kSecondaryLabelLightGrayTextColor;
+// Hex Value for the text color of the secondary labels (e.g. details, URL,
+// metadata...).
+extern const int kTableViewSecondaryLabelLightGrayTextColor;
+
+// Hex Value for the tint color for switches.
+extern const int kTableViewSwitchTintColor;
 
 #endif  // IOS_CHROME_BROWSER_UI_TABLE_VIEW_CELLS_TABLE_VIEW_CELLS_CONSTANTS_H_
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.mm b/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.mm
index 65d8c718..e5ff911 100644
--- a/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.mm
+++ b/ios/chrome/browser/ui/table_view/cells/table_view_cells_constants.mm
@@ -16,5 +16,6 @@
 const CGFloat kUseDefaultFontSize = 0.0;
 const CGFloat kTableViewLabelVerticalTopSpacing = 13.0;
 
-const CGFloat kTableViewTextLabelColorLightGrey = 0x6D6D72;
-const CGFloat kSecondaryLabelLightGrayTextColor = 0x8E8E93;
+const int kTableViewTextLabelColorLightGrey = 0x6D6D72;
+const int kTableViewSecondaryLabelLightGrayTextColor = 0x8E8E93;
+const int kTableViewSwitchTintColor = 0x1A73E8;
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h b/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h
index 4227086..df303d5f 100644
--- a/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h
+++ b/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.h
@@ -27,7 +27,7 @@
 @property(nonatomic, strong) NSString* text;
 
 // UIColor for the cell's detailTextLabel. Default is
-// kSecondaryLabelLightGrayTextColor.
+// kTableViewSecondaryLabelLightGrayTextColor.
 @property(nonatomic, assign) UIColor* detailTextColor;
 // Detail text to be displayed.
 @property(nonatomic, strong) NSString* detailText;
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.mm b/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.mm
index fe61239..b9f2c3a34 100644
--- a/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.mm
+++ b/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item.mm
@@ -62,7 +62,7 @@
     cell.detailTextLabel.textColor = self.detailTextColor;
   } else {
     cell.detailTextLabel.textColor =
-        UIColorFromRGB(kSecondaryLabelLightGrayTextColor);
+        UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
   }
   cell.textLabel.textAlignment =
       self.textAlignment ? self.textAlignment : NSTextAlignmentNatural;
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item_unittest.mm b/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item_unittest.mm
index 00e9543..867148e 100644
--- a/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item_unittest.mm
+++ b/ios/chrome/browser/ui/table_view/cells/table_view_detail_text_item_unittest.mm
@@ -90,6 +90,6 @@
   EXPECT_NSEQ(detailText, cell.detailTextLabel.text);
   EXPECT_NSEQ(UIColorFromRGB(kTableViewTextLabelColorLightGrey),
               cell.textLabel.textColor);
-  EXPECT_NSEQ(UIColorFromRGB(kSecondaryLabelLightGrayTextColor),
+  EXPECT_NSEQ(UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor),
               cell.detailTextLabel.textColor);
 }
diff --git a/ios/chrome/browser/ui/table_view/cells/table_view_url_item.mm b/ios/chrome/browser/ui/table_view/cells/table_view_url_item.mm
index 2f0f5a72..00d82a514 100644
--- a/ios/chrome/browser/ui/table_view/cells/table_view_url_item.mm
+++ b/ios/chrome/browser/ui/table_view/cells/table_view_url_item.mm
@@ -164,12 +164,13 @@
     _titleLabel.adjustsFontForContentSizeCategory = YES;
     _URLLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];
     _URLLabel.adjustsFontForContentSizeCategory = YES;
-    _URLLabel.textColor = UIColorFromRGB(kSecondaryLabelLightGrayTextColor);
+    _URLLabel.textColor =
+        UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
     _URLLabel.hidden = YES;
     _metadataLabel.font =
         [UIFont preferredFontForTextStyle:UIFontTextStyleCaption1];
     _metadataLabel.textColor =
-        UIColorFromRGB(kSecondaryLabelLightGrayTextColor);
+        UIColorFromRGB(kTableViewSecondaryLabelLightGrayTextColor);
     _metadataLabel.adjustsFontForContentSizeCategory = YES;
     _metadataLabel.hidden = YES;
 
diff --git a/ios/chrome/browser/ui/toolbar/BUILD.gn b/ios/chrome/browser/ui/toolbar/BUILD.gn
index cccbb91..c508d0a 100644
--- a/ios/chrome/browser/ui/toolbar/BUILD.gn
+++ b/ios/chrome/browser/ui/toolbar/BUILD.gn
@@ -55,6 +55,7 @@
     "//ios/chrome/browser/web_state_list",
     "//ios/chrome/common",
     "//ios/public/provider/chrome/browser",
+    "//ios/public/provider/chrome/browser/images",
     "//ios/public/provider/chrome/browser/voice",
     "//ios/web",
   ]
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
index 5fbc4d1..6000e36a 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator.mm
@@ -6,6 +6,7 @@
 
 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
 #include "ios/chrome/browser/browser_state/chrome_browser_state.h"
+#include "ios/chrome/browser/search_engines/template_url_service_factory.h"
 #import "ios/chrome/browser/ui/ntp/ntp_util.h"
 #import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_coordinator+subclassing.h"
 #import "ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.h"
@@ -53,6 +54,8 @@
   self.viewController.longPressDelegate = self.longPressDelegate;
 
   self.mediator = [[ToolbarMediator alloc] init];
+  self.mediator.templateURLService =
+      ios::TemplateURLServiceFactory::GetForBrowserState(self.browserState);
   self.mediator.consumer = self.viewController;
   self.mediator.webStateList = self.webStateList;
   self.mediator.bookmarkModel =
diff --git a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm
index 1f00d7c..241813aa 100644
--- a/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm
+++ b/ios/chrome/browser/ui/toolbar/adaptive_toolbar_view_controller.mm
@@ -225,6 +225,10 @@
   _isNTP = isNTP;
 }
 
+- (void)setSearchIcon:(UIImage*)searchIcon {
+  [self.view.omniboxButton setImage:searchIcon forState:UIControlStateNormal];
+}
+
 #pragma mark - NewTabPageControllerDelegate
 
 - (void)setScrollProgressForTabletOmnibox:(CGFloat)progress {
diff --git a/ios/chrome/browser/ui/toolbar/buttons/toolbar_search_button.mm b/ios/chrome/browser/ui/toolbar/buttons/toolbar_search_button.mm
index 2d30d7c7..cd363385 100644
--- a/ios/chrome/browser/ui/toolbar/buttons/toolbar_search_button.mm
+++ b/ios/chrome/browser/ui/toolbar/buttons/toolbar_search_button.mm
@@ -48,7 +48,10 @@
   spotlightView.layer.cornerRadius = kSpotlightHeight / 2;
   spotlightView.backgroundColor =
       [self.configuration locationBarBackgroundColorWithVisibility:1];
-  [self addSubview:spotlightView];
+  // Make sure that the spotlightView is below the image to avoid changing the
+  // color of the image.
+  [self insertSubview:spotlightView belowSubview:self.imageView];
+
   AddSameCenterConstraints(self, spotlightView);
   [spotlightView.heightAnchor constraintEqualToConstant:kSpotlightHeight]
       .active = YES;
diff --git a/ios/chrome/browser/ui/toolbar/public/BUILD.gn b/ios/chrome/browser/ui/toolbar/public/BUILD.gn
index 9cfa0aa..6f67a1c 100644
--- a/ios/chrome/browser/ui/toolbar/public/BUILD.gn
+++ b/ios/chrome/browser/ui/toolbar/public/BUILD.gn
@@ -27,8 +27,8 @@
 
 source_set("feature_flags") {
   sources = [
-    "features.cc",
     "features.h",
+    "features.mm",
   ]
   deps = [
     "//base",
diff --git a/ios/chrome/browser/ui/toolbar/public/features.cc b/ios/chrome/browser/ui/toolbar/public/features.cc
deleted file mode 100644
index 79623758..0000000
--- a/ios/chrome/browser/ui/toolbar/public/features.cc
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/chrome/browser/ui/toolbar/public/features.h"
-
-#include "base/command_line.h"
-
-const base::Feature kMemexTabSwitcher{"MemexTabSwitcher",
-                                      base::FEATURE_DISABLED_BY_DEFAULT};
diff --git a/ios/chrome/browser/ui/toolbar/public/features.h b/ios/chrome/browser/ui/toolbar/public/features.h
index 3211f4712..195f29b 100644
--- a/ios/chrome/browser/ui/toolbar/public/features.h
+++ b/ios/chrome/browser/ui/toolbar/public/features.h
@@ -5,10 +5,33 @@
 #ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_FEATURES_H_
 #define IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_FEATURES_H_
 
+#import <Foundation/Foundation.h>
+
 #include "base/feature_list.h"
 
+// Enum for the different icons for the search button.
+typedef NS_ENUM(NSUInteger, ToolbarSearchButtonIcon) {
+  ToolbarSearchButtonIconGrey,
+  ToolbarSearchButtonIconColorful,
+  ToolbarSearchButtonIconMagnifying,
+};
+
 // Feature to choose whether to use the memex prototype tab switcher or the
 // regular native tab switcher.
 extern const base::Feature kMemexTabSwitcher;
 
+// Feature for changing the different icons for search icon in the bottom
+// toolbar.
+extern const base::Feature kIconForSearchButtonFeature;
+
+// Switch with the different values for the search icon on the bottom adaptive
+// toolbar.
+extern const char kIconForSearchButtonFeatureParameterName[];
+extern const char kIconForSearchButtonParameterGrey[];
+extern const char kIconForSearchButtonParameterColorful[];
+extern const char kIconForSearchButtonParameterMagnifying[];
+
+// Returns the currently selected icon option.
+ToolbarSearchButtonIcon IconForSearchButton();
+
 #endif  // IOS_CHROME_BROWSER_UI_TOOLBAR_PUBLIC_FEATURES_H_
diff --git a/ios/chrome/browser/ui/toolbar/public/features.mm b/ios/chrome/browser/ui/toolbar/public/features.mm
new file mode 100644
index 0000000..0b3d9d2
--- /dev/null
+++ b/ios/chrome/browser/ui/toolbar/public/features.mm
@@ -0,0 +1,39 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#import "ios/chrome/browser/ui/toolbar/public/features.h"
+
+#include "base/command_line.h"
+#include "base/metrics/field_trial_params.h"
+
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
+const base::Feature kMemexTabSwitcher{"MemexTabSwitcher",
+                                      base::FEATURE_DISABLED_BY_DEFAULT};
+
+const base::Feature kIconForSearchButtonFeature{
+    "IconForSearchButtonFeature", base::FEATURE_DISABLED_BY_DEFAULT};
+
+const char kIconForSearchButtonFeatureParameterName[] = "icon";
+
+const char kIconForSearchButtonParameterGrey[] = "grey";
+const char kIconForSearchButtonParameterColorful[] = "colorful";
+const char kIconForSearchButtonParameterMagnifying[] = "magnifying";
+
+ToolbarSearchButtonIcon IconForSearchButton() {
+  if (base::FeatureList::IsEnabled(kIconForSearchButtonFeature)) {
+    std::string parameter = base::GetFieldTrialParamValueByFeature(
+        kIconForSearchButtonFeature, kIconForSearchButtonFeatureParameterName);
+    if (parameter == kIconForSearchButtonParameterGrey) {
+      return ToolbarSearchButtonIconGrey;
+    } else if (parameter == kIconForSearchButtonParameterColorful) {
+      return ToolbarSearchButtonIconColorful;
+    } else if (parameter == kIconForSearchButtonParameterMagnifying) {
+      return ToolbarSearchButtonIconMagnifying;
+    }
+  }
+  return ToolbarSearchButtonIconMagnifying;
+}
diff --git a/ios/chrome/browser/ui/toolbar/secondary_toolbar_view.mm b/ios/chrome/browser/ui/toolbar/secondary_toolbar_view.mm
index 0e521eeb..b6ad656 100644
--- a/ios/chrome/browser/ui/toolbar/secondary_toolbar_view.mm
+++ b/ios/chrome/browser/ui/toolbar/secondary_toolbar_view.mm
@@ -111,8 +111,9 @@
   AddSameConstraints(self.blur, self);
 
   UIView* contentView = self;
-  if (UIVisualEffect* vibrancy = [self.buttonFactory.toolbarConfiguration
-          vibrancyEffectForBlurEffect:blurEffect]) {
+  UIVisualEffect* vibrancy = [self.buttonFactory.toolbarConfiguration
+      vibrancyEffectForBlurEffect:blurEffect];
+  if (vibrancy && IconForSearchButton() != ToolbarSearchButtonIconColorful) {
     // Add vibrancy only if we have a vibrancy effect.
     UIVisualEffectView* vibrancyView =
         [[UIVisualEffectView alloc] initWithEffect:vibrancy];
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_consumer.h b/ios/chrome/browser/ui/toolbar/toolbar_consumer.h
index dab7cf3..c7f1b76 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_consumer.h
+++ b/ios/chrome/browser/ui/toolbar/toolbar_consumer.h
@@ -29,6 +29,8 @@
 - (void)setShareMenuEnabled:(BOOL)enabled;
 // Sets whether the toolbar is displaying for an NTP.
 - (void)setIsNTP:(BOOL)isNTP;
+// Sets the image for the search button of the toolbar.
+- (void)setSearchIcon:(UIImage*)searchIcon;
 @end
 
 #endif  // IOS_CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_CONSUMER_H_
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_mediator.h b/ios/chrome/browser/ui/toolbar/toolbar_mediator.h
index 33f6b29..3f773af 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_mediator.h
+++ b/ios/chrome/browser/ui/toolbar/toolbar_mediator.h
@@ -15,12 +15,16 @@
 namespace web {
 class WebState;
 }
+class TemplateURLService;
 class WebStateList;
 
 // A mediator object that provides the relevant properties of a web state
 // to a consumer.
 @interface ToolbarMediator : NSObject
 
+// TemplateURLService used to check the default search engine.
+@property(nonatomic, assign) TemplateURLService* templateURLService;
+
 // The WebStateList that this mediator listens for any changes on the total
 // number of Webstates.
 @property(nonatomic, assign) WebStateList* webStateList;
diff --git a/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm b/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
index 6d85dc7..97abfcc 100644
--- a/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
+++ b/ios/chrome/browser/ui/toolbar/toolbar_mediator.mm
@@ -9,12 +9,14 @@
 #include "base/strings/sys_string_conversions.h"
 #include "components/bookmarks/browser/bookmark_model.h"
 #include "ios/chrome/browser/chrome_url_constants.h"
+#import "ios/chrome/browser/search_engines/search_engine_observer_bridge.h"
 #include "ios/chrome/browser/ui/bookmarks/bookmark_model_bridge_observer.h"
 #import "ios/chrome/browser/ui/ntp/ntp_util.h"
 #import "ios/chrome/browser/ui/toolbar/toolbar_consumer.h"
 #import "ios/chrome/browser/web_state_list/web_state_list.h"
 #import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h"
 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
+#import "ios/public/provider/chrome/browser/images/branded_image_provider.h"
 #import "ios/public/provider/chrome/browser/voice/voice_search_provider.h"
 #import "ios/web/public/navigation_manager.h"
 #import "ios/web/public/web_client.h"
@@ -27,6 +29,7 @@
 
 @interface ToolbarMediator ()<BookmarkModelBridgeObserver,
                               CRWWebStateObserver,
+                              SearchEngineObserving,
                               WebStateListObserving>
 
 // The current web state associated with the toolbar.
@@ -39,6 +42,8 @@
   std::unique_ptr<WebStateListObserverBridge> _webStateListObserver;
   // Bridge to register for bookmark changes.
   std::unique_ptr<bookmarks::BookmarkModelBridge> _bookmarkModelBridge;
+  // Listen for default search engine changes.
+  std::unique_ptr<SearchEngineObserverBridge> _searchEngineObserver;
 }
 
 @synthesize bookmarkModel = _bookmarkModel;
@@ -80,6 +85,7 @@
     _webState = nullptr;
   }
   _bookmarkModelBridge.reset();
+  _searchEngineObserver.reset();
 }
 
 #pragma mark - CRWWebStateObserver
@@ -168,6 +174,16 @@
 
 #pragma mark - Setters
 
+- (void)setTemplateURLService:(TemplateURLService*)templateURLService {
+  _templateURLService = templateURLService;
+  if (templateURLService) {
+    // Listen for default search engine changes.
+    _searchEngineObserver =
+        std::make_unique<SearchEngineObserverBridge>(self, templateURLService);
+    templateURLService->Load();
+  }
+}
+
 - (void)setWebState:(web::WebState*)webState {
   if (_webState) {
     _webState->RemoveObserver(_webStateObserver.get());
@@ -301,4 +317,21 @@
   // No-op -- required by BookmarkModelBridgeObserver but not used.
 }
 
+#pragma mark - SearchEngineObserving
+
+- (void)searchEngineChanged {
+  SearchEngineIcon searchEngineIcon = SEARCH_ENGINE_ICON_OTHER;
+  if (self.templateURLService &&
+      self.templateURLService->GetDefaultSearchProvider() &&
+      self.templateURLService->GetDefaultSearchProvider()->GetEngineType(
+          self.templateURLService->search_terms_data()) ==
+          SEARCH_ENGINE_GOOGLE) {
+    searchEngineIcon = SEARCH_ENGINE_ICON_GOOGLE_SEARCH;
+  }
+  UIImage* searchIcon = ios::GetChromeBrowserProvider()
+                            ->GetBrandedImageProvider()
+                            ->GetToolbarSearchIcon(searchEngineIcon);
+  [self.consumer setSearchIcon:searchIcon];
+}
+
 @end
diff --git a/ios/chrome/browser/ui/util/uikit_ui_util.mm b/ios/chrome/browser/ui/util/uikit_ui_util.mm
index da083945b..c3a34572 100644
--- a/ios/chrome/browser/ui/util/uikit_ui_util.mm
+++ b/ios/chrome/browser/ui/util/uikit_ui_util.mm
@@ -735,10 +735,12 @@
   if (@available(iOS 11.0, *)) {
     return UIContentSizeCategoryIsAccessibilityCategory(category);
   } else {
-    return category == UIContentSizeCategoryAccessibilityExtraExtraExtraLarge ||
-           category == UIContentSizeCategoryAccessibilityExtraExtraLarge ||
-           category == UIContentSizeCategoryAccessibilityExtraLarge ||
-           category == UIContentSizeCategoryAccessibilityLarge ||
-           category == UIContentSizeCategoryAccessibilityMedium;
+    return
+        [category
+            isEqual:UIContentSizeCategoryAccessibilityExtraExtraExtraLarge] ||
+        [category isEqual:UIContentSizeCategoryAccessibilityExtraExtraLarge] ||
+        [category isEqual:UIContentSizeCategoryAccessibilityExtraLarge] ||
+        [category isEqual:UIContentSizeCategoryAccessibilityLarge] ||
+        [category isEqual:UIContentSizeCategoryAccessibilityMedium];
   }
 }
diff --git a/ios/chrome/browser/unified_consent/unified_consent_service_factory.cc b/ios/chrome/browser/unified_consent/unified_consent_service_factory.cc
index 7d61c9b8..8f02bbd 100644
--- a/ios/chrome/browser/unified_consent/unified_consent_service_factory.cc
+++ b/ios/chrome/browser/unified_consent/unified_consent_service_factory.cc
@@ -49,9 +49,6 @@
 std::unique_ptr<KeyedService>
 UnifiedConsentServiceFactory::BuildServiceInstanceFor(
     web::BrowserState* context) const {
-  if (!unified_consent::IsUnifiedConsentFeatureEnabled())
-    return nullptr;
-
   ios::ChromeBrowserState* browser_state =
       ios::ChromeBrowserState::FromBrowserState(context);
   PrefService* user_pref_service = browser_state->GetPrefs();
@@ -59,10 +56,18 @@
   std::unique_ptr<unified_consent::UnifiedConsentServiceClient> service_client =
       std::make_unique<UnifiedConsentServiceClientImpl>(user_pref_service,
                                                         local_pref_service);
+
   identity::IdentityManager* identity_manager =
       IdentityManagerFactory::GetForBrowserState(browser_state);
   syncer::SyncService* sync_service =
       ProfileSyncServiceFactory::GetForBrowserState(browser_state);
+
+  if (!unified_consent::IsUnifiedConsentFeatureEnabled()) {
+    unified_consent::UnifiedConsentService::RollbackIfNeeded(
+        user_pref_service, sync_service, service_client.get());
+    return nullptr;
+  }
+
   return std::make_unique<unified_consent::UnifiedConsentService>(
       std::move(service_client), user_pref_service, identity_manager,
       sync_service);
diff --git a/ios/public/provider/chrome/browser/images/branded_image_provider.h b/ios/public/provider/chrome/browser/images/branded_image_provider.h
index b3b5b78..4c6c660 100644
--- a/ios/public/provider/chrome/browser/images/branded_image_provider.h
+++ b/ios/public/provider/chrome/browser/images/branded_image_provider.h
@@ -50,6 +50,9 @@
   // on Download Manager UI.
   virtual UIImage* GetDownloadGoogleDriveImage();
 
+  // Returns the 28pt x 28pt image to use for the "Search" icon in the toolbar.
+  virtual UIImage* GetToolbarSearchIcon(SearchEngineIcon type);
+
  private:
   DISALLOW_COPY_AND_ASSIGN(BrandedImageProvider);
 };
diff --git a/ios/public/provider/chrome/browser/images/branded_image_provider.mm b/ios/public/provider/chrome/browser/images/branded_image_provider.mm
index 1ff8388a..c5aa6a1e 100644
--- a/ios/public/provider/chrome/browser/images/branded_image_provider.mm
+++ b/ios/public/provider/chrome/browser/images/branded_image_provider.mm
@@ -46,3 +46,7 @@
 UIImage* BrandedImageProvider::GetDownloadGoogleDriveImage() {
   return nil;
 }
+
+UIImage* BrandedImageProvider::GetToolbarSearchIcon(SearchEngineIcon type) {
+  return [UIImage imageNamed:@"toolbar_search"];
+}
diff --git a/ios/third_party/material_components_ios/BUILD.gn b/ios/third_party/material_components_ios/BUILD.gn
index ee525a4..395b4c7d1 100644
--- a/ios/third_party/material_components_ios/BUILD.gn
+++ b/ios/third_party/material_components_ios/BUILD.gn
@@ -110,8 +110,14 @@
     "src/components/ButtonBar/src/private/MDCButtonBarButton.m",
     "src/components/Buttons/src/ButtonThemer/MDCButtonScheme.h",
     "src/components/Buttons/src/ButtonThemer/MDCButtonScheme.m",
+    "src/components/Buttons/src/ButtonThemer/MDCContainedButtonThemer.h",
+    "src/components/Buttons/src/ButtonThemer/MDCContainedButtonThemer.m",
     "src/components/Buttons/src/ButtonThemer/MDCTextButtonThemer.h",
     "src/components/Buttons/src/ButtonThemer/MDCTextButtonThemer.m",
+    "src/components/Buttons/src/ColorThemer/MDCContainedButtonColorThemer.h",
+    "src/components/Buttons/src/ColorThemer/MDCContainedButtonColorThemer.m",
+    "src/components/Buttons/src/ColorThemer/MDCOutlinedButtonColorThemer.h",
+    "src/components/Buttons/src/ColorThemer/MDCOutlinedButtonColorThemer.m",
     "src/components/Buttons/src/ColorThemer/MDCTextButtonColorThemer.h",
     "src/components/Buttons/src/ColorThemer/MDCTextButtonColorThemer.m",
     "src/components/Buttons/src/MDCButton.h",
@@ -172,6 +178,8 @@
     "src/components/Dialogs/src/MaterialDialogs.h",
     "src/components/Dialogs/src/UIViewController+MaterialDialogs.h",
     "src/components/Dialogs/src/UIViewController+MaterialDialogs.m",
+    "src/components/Dialogs/src/private/MDCAlertActionManager.h",
+    "src/components/Dialogs/src/private/MDCAlertActionManager.m",
     "src/components/Dialogs/src/private/MDCAlertControllerView+Private.h",
     "src/components/Dialogs/src/private/MDCAlertControllerView+Private.m",
     "src/components/Dialogs/src/private/MDCDialogShadowedView.h",
diff --git a/mojo/core/invitation_unittest.cc b/mojo/core/invitation_unittest.cc
index 791bb08..58603897 100644
--- a/mojo/core/invitation_unittest.cc
+++ b/mojo/core/invitation_unittest.cc
@@ -299,8 +299,10 @@
   launch_options.start_hidden = true;
 #endif
 
-  base::Optional<PlatformChannel> channel;
+#if !defined(OS_FUCHSIA)
   base::Optional<NamedPlatformChannel> named_channel;
+#endif
+  base::Optional<PlatformChannel> channel;
   PlatformHandle local_endpoint_handle;
   if (transport_type == TransportType::kChannel) {
     channel.emplace();
@@ -308,9 +310,7 @@
                                 &command_line);
     local_endpoint_handle = channel->TakeLocalEndpoint().TakePlatformHandle();
   } else {
-#if defined(OS_FUCHSIA)
-    NOTREACHED() << "Named pipe support does not exist for Mojo on Fuchsia.";
-#else
+#if !defined(OS_FUCHSIA)
     NamedPlatformChannel::Options named_channel_options;
 #if !defined(OS_WIN)
     CHECK(base::PathService::Get(base::DIR_TEMP,
@@ -320,7 +320,9 @@
     named_channel->PassServerNameOnCommandLine(&command_line);
     local_endpoint_handle =
         named_channel->TakeServerEndpoint().TakePlatformHandle();
-#endif
+#else   //  !defined(OS_FUCHSIA)
+    NOTREACHED() << "Named pipe support does not exist for Mojo on Fuchsia.";
+#endif  //  !defined(OS_FUCHSIA)
   }
 
   base::Process child_process = base::SpawnMultiProcessTestChild(
@@ -395,8 +397,10 @@
   static MojoHandle AcceptInvitation(MojoAcceptInvitationFlags flags,
                                      base::StringPiece switch_name = {}) {
     const auto& command_line = *base::CommandLine::ForCurrentProcess();
-    PlatformChannelEndpoint channel_endpoint =
-        NamedPlatformChannel::ConnectToServer(command_line);
+    PlatformChannelEndpoint channel_endpoint;
+#if !defined(OS_FUCHSIA)
+    channel_endpoint = NamedPlatformChannel::ConnectToServer(command_line);
+#endif
     if (!channel_endpoint.is_valid()) {
       if (switch_name.empty()) {
         channel_endpoint =
diff --git a/mojo/core/test/multiprocess_test_helper.cc b/mojo/core/test/multiprocess_test_helper.cc
index df7f4eb..3f5173cc 100644
--- a/mojo/core/test/multiprocess_test_helper.cc
+++ b/mojo/core/test/multiprocess_test_helper.cc
@@ -26,7 +26,6 @@
 #include "base/task_runner.h"
 #include "base/threading/thread_task_runner_handle.h"
 #include "build/build_config.h"
-#include "mojo/public/cpp/platform/named_platform_channel.h"
 #include "mojo/public/cpp/platform/platform_channel.h"
 #include "mojo/public/cpp/platform/platform_channel_endpoint.h"
 #include "mojo/public/cpp/platform/platform_channel_server_endpoint.h"
@@ -39,15 +38,20 @@
 #include "base/mac/mach_port_broker.h"
 #endif
 
+#if !defined(OS_FUCHSIA)
+#include "mojo/public/cpp/platform/named_platform_channel.h"
+#endif
+
 namespace mojo {
 namespace core {
 namespace test {
 
 namespace {
 
+#if !defined(OS_FUCHSIA)
 const char kNamedPipeName[] = "named-pipe-name";
+#endif
 const char kRunAsBrokerClient[] = "run-as-broker-client";
-
 const char kTestChildMessagePipeName[] = "test_pipe";
 
 // For use (and only valid) in a test child process:
@@ -106,8 +110,10 @@
       command_line.AppendSwitchNative(entry.first, entry.second);
   }
 
-  mojo::PlatformChannel channel;
-  mojo::NamedPlatformChannel::ServerName server_name;
+#if !defined(OS_FUCHSIA)
+  NamedPlatformChannel::ServerName server_name;
+#endif
+  PlatformChannel channel;
   base::LaunchOptions options;
   switch (launch_type) {
     case LaunchType::CHILD:
@@ -205,14 +211,14 @@
     DCHECK(local_channel_endpoint.is_valid());
     OutgoingInvitation::Send(std::move(child_invitation), test_child_.Handle(),
                              std::move(local_channel_endpoint),
-                             mojo::ProcessErrorCallback());
+                             ProcessErrorCallback());
   }
 #if !defined(OS_FUCHSIA)
   else if (launch_type == LaunchType::NAMED_CHILD) {
     DCHECK(server_endpoint.is_valid());
     OutgoingInvitation::Send(std::move(child_invitation), test_child_.Handle(),
                              std::move(server_endpoint),
-                             mojo::ProcessErrorCallback());
+                             ProcessErrorCallback());
   }
 #endif  //  !defined(OS_FUCHSIA)
 
@@ -239,31 +245,33 @@
   CHECK(base::CommandLine::InitializedForCurrentProcess());
 
   auto& command_line = *base::CommandLine::ForCurrentProcess();
-  NamedPlatformChannel::ServerName named_pipe(
-      command_line.GetSwitchValueNative(kNamedPipeName));
-  if (command_line.HasSwitch(kRunAsBrokerClient)) {
-    mojo::IncomingInvitation invitation;
+
+  bool run_as_broker_client = command_line.HasSwitch(kRunAsBrokerClient);
 #if defined(OS_MACOSX) && !defined(OS_IOS)
+  if (run_as_broker_client)
     CHECK(base::MachPortBroker::ChildSendTaskPortToParent("mojo_test"));
 #endif
-    if (!named_pipe.empty()) {
-      invitation = mojo::IncomingInvitation::Accept(
-          mojo::NamedPlatformChannel::ConnectToServer(named_pipe));
-    } else {
-      auto endpoint =
-          mojo::PlatformChannel::RecoverPassedEndpointFromCommandLine(
-              command_line);
-      invitation = IncomingInvitation::Accept(std::move(endpoint));
-    }
+
+  PlatformChannelEndpoint endpoint;
+#if !defined(OS_FUCHSIA)
+  NamedPlatformChannel::ServerName named_pipe(
+      command_line.GetSwitchValueNative(kNamedPipeName));
+  if (!named_pipe.empty()) {
+    endpoint = NamedPlatformChannel::ConnectToServer(named_pipe);
+  } else
+#endif  // !defined(OS_FUCHSIA)
+  {
+    endpoint =
+        PlatformChannel::RecoverPassedEndpointFromCommandLine(command_line);
+  }
+
+  if (run_as_broker_client) {
+    IncomingInvitation invitation =
+        IncomingInvitation::Accept(std::move(endpoint));
     primordial_pipe = invitation.ExtractMessagePipe(kTestChildMessagePipeName);
   } else {
-    if (!named_pipe.empty()) {
-      primordial_pipe = g_child_isolated_connection.Get().Connect(
-          NamedPlatformChannel::ConnectToServer(named_pipe));
-    } else {
-      primordial_pipe = g_child_isolated_connection.Get().Connect(
-          PlatformChannel::RecoverPassedEndpointFromCommandLine(command_line));
-    }
+    primordial_pipe =
+        g_child_isolated_connection.Get().Connect(std::move(endpoint));
   }
 }
 
@@ -290,8 +298,7 @@
       true /* pass_pipe_ownership_to_main */);
 }
 
-// static
-mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe;
+ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe;
 
 }  // namespace test
 }  // namespace core
diff --git a/mojo/public/cpp/platform/BUILD.gn b/mojo/public/cpp/platform/BUILD.gn
index b2504c5..6fbc9ae 100644
--- a/mojo/public/cpp/platform/BUILD.gn
+++ b/mojo/public/cpp/platform/BUILD.gn
@@ -8,7 +8,6 @@
   output_name = "mojo_cpp_platform"
 
   public = [
-    "named_platform_channel.h",
     "platform_channel.h",
     "platform_channel_endpoint.h",
     "platform_channel_server_endpoint.h",
@@ -16,7 +15,6 @@
   ]
 
   sources = [
-    "named_platform_channel.cc",
     "named_platform_channel_win.cc",
     "platform_channel.cc",
     "platform_channel_endpoint.cc",
@@ -34,17 +32,21 @@
     "//mojo/public/c/system:headers",
   ]
 
-  if (is_posix && (!is_nacl && !is_fuchsia)) {
+  if (is_posix && !is_nacl) {
     sources += [ "named_platform_channel_posix.cc" ]
   }
 
   if (is_fuchsia) {
-    sources += [ "named_platform_channel_fuchsia.cc" ]
     public_deps += [
       "//third_party/fuchsia-sdk/sdk:fdio",
       "//third_party/fuchsia-sdk/sdk:zx",
     ]
   }
 
+  if (!is_fuchsia) {
+    sources += [ "named_platform_channel.cc" ]
+    public += [ "named_platform_channel.h" ]
+  }
+
   defines = [ "IS_MOJO_CPP_PLATFORM_IMPL" ]
 }
diff --git a/mojo/public/cpp/platform/named_platform_channel_fuchsia.cc b/mojo/public/cpp/platform/named_platform_channel_fuchsia.cc
deleted file mode 100644
index 44ae4af..0000000
--- a/mojo/public/cpp/platform/named_platform_channel_fuchsia.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2018 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "mojo/public/cpp/platform/named_platform_channel.h"
-
-namespace mojo {
-
-// static
-PlatformChannelServerEndpoint NamedPlatformChannel::CreateServerEndpoint(
-    const Options& options,
-    ServerName* server_name) {
-  // TODO(https://crbug.com/754038): Implement, or remove dependencies.
-  NOTREACHED();
-  return {};
-}
-
-// static
-PlatformChannelEndpoint NamedPlatformChannel::CreateClientEndpoint(
-    const ServerName& server_name) {
-  // TODO(https://crbug.com/754038): Implement, or remove dependencies.
-  NOTREACHED();
-  return {};
-}
-
-}  // namespace mojo
diff --git a/mojo/public/cpp/system/tests/invitation_unittest.cc b/mojo/public/cpp/system/tests/invitation_unittest.cc
index d97c0d0..9c85816 100644
--- a/mojo/public/cpp/system/tests/invitation_unittest.cc
+++ b/mojo/public/cpp/system/tests/invitation_unittest.cc
@@ -20,7 +20,6 @@
 #include "base/test/scoped_task_environment.h"
 #include "base/test/test_timeouts.h"
 #include "build/build_config.h"
-#include "mojo/public/cpp/platform/named_platform_channel.h"
 #include "mojo/public/cpp/platform/platform_channel.h"
 #include "mojo/public/cpp/system/message_pipe.h"
 #include "mojo/public/cpp/system/platform_handle.h"
@@ -28,6 +27,10 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/multiprocess_func_list.h"
 
+#if !defined(OS_FUCHSIA)
+#include "mojo/public/cpp/platform/named_platform_channel.h"
+#endif
+
 namespace mojo {
 namespace {
 
@@ -38,14 +41,18 @@
 
 enum class TransportType {
   kChannel,
+#if !defined(OS_FUCHSIA)
   kChannelServer,
+#endif
 };
 
 // Switches and values to tell clients of parameterized test runs what mode they
 // should be testing against.
 const char kTransportTypeSwitch[] = "test-transport-type";
 const char kTransportTypeChannel[] = "channel";
+#if !defined(OS_FUCHSIA)
 const char kTransportTypeChannelServer[] = "channel-server";
+#endif
 
 class InvitationCppTest : public testing::Test,
                           public testing::WithParamInterface<TransportType> {
@@ -67,30 +74,33 @@
     base::Optional<PlatformChannel> channel;
     PlatformChannelEndpoint channel_endpoint;
     PlatformChannelServerEndpoint server_endpoint;
-    if (transport_type == TransportType::kChannel) {
-      command_line.AppendSwitchASCII(kTransportTypeSwitch,
-                                     kTransportTypeChannel);
-      channel.emplace();
-      channel->PrepareToPassRemoteEndpoint(&launch_options, &command_line);
+    switch (transport_type) {
+      case TransportType::kChannel: {
+        command_line.AppendSwitchASCII(kTransportTypeSwitch,
+                                       kTransportTypeChannel);
+        channel.emplace();
+        channel->PrepareToPassRemoteEndpoint(&launch_options, &command_line);
 #if defined(OS_WIN)
-      launch_options.start_hidden = true;
+        launch_options.start_hidden = true;
 #endif
-      channel_endpoint = channel->TakeLocalEndpoint();
-    } else if (transport_type == TransportType::kChannelServer) {
-      command_line.AppendSwitchASCII(kTransportTypeSwitch,
-                                     kTransportTypeChannelServer);
-#if defined(OS_FUCHSIA)
-      NOTREACHED() << "Named pipe support does not exist for Mojo on Fuchsia.";
-#else
-      NamedPlatformChannel::Options named_channel_options;
+        channel_endpoint = channel->TakeLocalEndpoint();
+        break;
+      }
+#if !defined(OS_FUCHSIA)
+      case TransportType::kChannelServer: {
+        command_line.AppendSwitchASCII(kTransportTypeSwitch,
+                                       kTransportTypeChannelServer);
+        NamedPlatformChannel::Options named_channel_options;
 #if !defined(OS_WIN)
-      CHECK(base::PathService::Get(base::DIR_TEMP,
-                                   &named_channel_options.socket_dir));
+        CHECK(base::PathService::Get(base::DIR_TEMP,
+                                     &named_channel_options.socket_dir));
 #endif
-      NamedPlatformChannel named_channel(named_channel_options);
-      named_channel.PassServerNameOnCommandLine(&command_line);
-      server_endpoint = named_channel.TakeServerEndpoint();
-#endif
+        NamedPlatformChannel named_channel(named_channel_options);
+        named_channel.PassServerNameOnCommandLine(&command_line);
+        server_endpoint = named_channel.TakeServerEndpoint();
+        break;
+      }
+#endif  //  !defined(OS_FUCHSIA)
     }
 
     child_process_ = base::SpawnMultiProcessTestChild(
@@ -104,28 +114,35 @@
         primordial_pipes[name] = invitation.AttachMessagePipe(name);
     }
 
-    if (transport_type == TransportType::kChannel) {
-      DCHECK(channel_endpoint.is_valid());
-      if (invitation_type == InvitationType::kNormal) {
-        OutgoingInvitation::Send(std::move(invitation), child_process_.Handle(),
-                                 std::move(channel_endpoint), error_callback);
-      } else {
-        DCHECK(primordial_pipes);
-        DCHECK_EQ(num_primordial_pipes, 1u);
-        primordial_pipes[0] =
-            OutgoingInvitation::SendIsolated(std::move(channel_endpoint));
-      }
-    } else if (transport_type == TransportType::kChannelServer) {
-      DCHECK(server_endpoint.is_valid());
-      if (invitation_type == InvitationType::kNormal) {
-        OutgoingInvitation::Send(std::move(invitation), child_process_.Handle(),
-                                 std::move(server_endpoint), error_callback);
-      } else {
-        DCHECK(primordial_pipes);
-        DCHECK_EQ(num_primordial_pipes, 1u);
-        primordial_pipes[0] =
-            OutgoingInvitation::SendIsolated(std::move(server_endpoint));
-      }
+    switch (transport_type) {
+      case TransportType::kChannel:
+        DCHECK(channel_endpoint.is_valid());
+        if (invitation_type == InvitationType::kNormal) {
+          OutgoingInvitation::Send(std::move(invitation),
+                                   child_process_.Handle(),
+                                   std::move(channel_endpoint), error_callback);
+        } else {
+          DCHECK(primordial_pipes);
+          DCHECK_EQ(num_primordial_pipes, 1u);
+          primordial_pipes[0] =
+              OutgoingInvitation::SendIsolated(std::move(channel_endpoint));
+        }
+        break;
+#if !defined(OS_FUCHSIA)
+      case TransportType::kChannelServer:
+        DCHECK(server_endpoint.is_valid());
+        if (invitation_type == InvitationType::kNormal) {
+          OutgoingInvitation::Send(std::move(invitation),
+                                   child_process_.Handle(),
+                                   std::move(server_endpoint), error_callback);
+        } else {
+          DCHECK(primordial_pipes);
+          DCHECK_EQ(num_primordial_pipes, 1u);
+          primordial_pipes[0] =
+              OutgoingInvitation::SendIsolated(std::move(server_endpoint));
+        }
+        break;
+#endif  // !defined(OS_FUCHSIA)
     }
   }
 
@@ -165,15 +182,15 @@
  public:
   static PlatformChannelEndpoint RecoverEndpointFromCommandLine() {
     const auto& command_line = *base::CommandLine::ForCurrentProcess();
+#if !defined(OS_FUCHSIA)
     std::string transport_type_string =
         command_line.GetSwitchValueASCII(kTransportTypeSwitch);
     CHECK(!transport_type_string.empty());
-    if (transport_type_string == kTransportTypeChannel) {
-      return PlatformChannel::RecoverPassedEndpointFromCommandLine(
-          command_line);
-    } else {
+    if (transport_type_string != kTransportTypeChannel) {
       return NamedPlatformChannel::ConnectToServer(command_line);
     }
+#endif
+    return PlatformChannel::RecoverPassedEndpointFromCommandLine(command_line);
   }
 
   static IncomingInvitation AcceptInvitation() {
diff --git a/net/BUILD.gn b/net/BUILD.gn
index 5c757ac..fe331806 100644
--- a/net/BUILD.gn
+++ b/net/BUILD.gn
@@ -5263,6 +5263,7 @@
     "//net/dns:tests",
     "//net/http:transport_security_state_unittest_data",
     "//net/http:transport_security_state_unittest_data_default",
+    "//net/interfaces:tests",
     "//testing/gmock",
     "//testing/gtest",
     "//third_party/protobuf:protobuf_lite",
diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn
index 65b77b7..ce75d633 100644
--- a/net/dns/BUILD.gn
+++ b/net/dns/BUILD.gn
@@ -230,6 +230,7 @@
     "//chromeos/network",
     "//components/cronet/*",
     "//net/*",
+    "//services/network:tests",
   ]
 
   sources = []
diff --git a/net/dns/dns_config.cc b/net/dns/dns_config.cc
index 499546716..b3fe56a0 100644
--- a/net/dns/dns_config.cc
+++ b/net/dns/dns_config.cc
@@ -24,8 +24,14 @@
 
 DnsConfig::DnsConfig(const DnsConfig& other) = default;
 
+DnsConfig::DnsConfig(DnsConfig&& other) = default;
+
 DnsConfig::~DnsConfig() = default;
 
+DnsConfig& DnsConfig::operator=(const DnsConfig& other) = default;
+
+DnsConfig& DnsConfig::operator=(DnsConfig&& other) = default;
+
 bool DnsConfig::Equals(const DnsConfig& d) const {
   return EqualsIgnoreHosts(d) && (hosts == d.hosts);
 }
diff --git a/net/dns/dns_config.h b/net/dns/dns_config.h
index 225f9949..c870ece1 100644
--- a/net/dns/dns_config.h
+++ b/net/dns/dns_config.h
@@ -27,8 +27,12 @@
 struct NET_EXPORT DnsConfig {
   DnsConfig();
   DnsConfig(const DnsConfig& other);
+  DnsConfig(DnsConfig&& other);
   ~DnsConfig();
 
+  DnsConfig& operator=(const DnsConfig& other);
+  DnsConfig& operator=(DnsConfig&& other);
+
   bool Equals(const DnsConfig& d) const;
 
   bool EqualsIgnoreHosts(const DnsConfig& d) const;
diff --git a/net/dns/dns_config_overrides.cc b/net/dns/dns_config_overrides.cc
index ae0e054..037e59a8 100644
--- a/net/dns/dns_config_overrides.cc
+++ b/net/dns/dns_config_overrides.cc
@@ -26,6 +26,10 @@
          dns_over_https_servers == other.dns_over_https_servers;
 }
 
+bool DnsConfigOverrides::operator!=(const DnsConfigOverrides& other) const {
+  return !(*this == other);
+}
+
 DnsConfig DnsConfigOverrides::ApplyOverrides(const DnsConfig& config) const {
   DnsConfig overridden(config);
 
diff --git a/net/dns/dns_config_overrides.h b/net/dns/dns_config_overrides.h
index 6ef1608..6b2913a 100644
--- a/net/dns/dns_config_overrides.h
+++ b/net/dns/dns_config_overrides.h
@@ -26,6 +26,7 @@
   DnsConfigOverrides& operator=(const DnsConfigOverrides& other);
 
   bool operator==(const DnsConfigOverrides& other) const;
+  bool operator!=(const DnsConfigOverrides& other) const;
 
   // Creates a new DnsConfig where any field with an overriding value in |this|
   // is replaced with that overriding value. Any field without an overriding
diff --git a/net/dns/dns_test_util.cc b/net/dns/dns_test_util.cc
index acc3829f..75f3f53 100644
--- a/net/dns/dns_test_util.cc
+++ b/net/dns/dns_test_util.cc
@@ -126,14 +126,51 @@
           // 12 is the sum of sizes of the compressed name reference, TYPE,
           // CLASS, TTL and RDLENGTH.
           size_t answer_size = 12 + rdata_size;
-          header->ancount = base::HostToNet16(1);
+          uint16_t answer_count = 1;
+
+          // Compressed name reference for the owner of the current RR.
+          uint16_t last_owner_ptr = kPointerToQueryName;
+
+          std::string cname_as_labels;
+
+          // There are two modes of operation distinguished based on whether
+          // |result_.canonical_name| is empty or not. If it's empty, then the
+          // resource records presented are of the form:
+          //
+          //     <question>       86400 IN <question type> <answer>
+          //
+          // However, if the canonical name is not empty, then:
+          //
+          //     <question>       86400 IN CNAME <canonical name>
+          //     <canonical name> 86400 IN <question type> <answer>
+          if (!result_.canonical_name.empty()) {
+            DNSDomainFromDot(result_.canonical_name, &cname_as_labels);
+            EXPECT_FALSE(cname_as_labels.empty());
+            answer_size += 12 + cname_as_labels.size();
+            ++answer_count;
+          }
+          header->ancount = base::HostToNet16(answer_count);
+
           base::BigEndianWriter writer(buffer + nbytes, answer_size);
-          writer.WriteU16(kPointerToQueryName);
+
+          // CNAME record goes first.
+          if (!result_.canonical_name.empty()) {
+            writer.WriteU16(last_owner_ptr);
+            writer.WriteU16(dns_protocol::kTypeCNAME);
+            writer.WriteU16(dns_protocol::kClassIN);
+            writer.WriteU32(kTTL);
+            writer.WriteU16(static_cast<uint16_t>(cname_as_labels.size()));
+            writer.WriteBytes(cname_as_labels.data(), cname_as_labels.size());
+            last_owner_ptr = static_cast<uint16_t>(0xc000 | (nbytes + 12));
+          }
+
+          writer.WriteU16(last_owner_ptr);
           writer.WriteU16(qtype_);
           writer.WriteU16(dns_protocol::kClassIN);
           writer.WriteU32(kTTL);
           writer.WriteU16(static_cast<uint16_t>(rdata_size));
           writer.WriteBytes(result_.ip.bytes().data(), rdata_size);
+
           nbytes += answer_size;
         } else {
           // authority will be 12 bytes.
diff --git a/net/dns/dns_test_util.h b/net/dns/dns_test_util.h
index 5ebcdeb..baba2049 100644
--- a/net/dns/dns_test_util.h
+++ b/net/dns/dns_test_util.h
@@ -170,9 +170,12 @@
   struct Result {
     explicit Result(const IPAddress& ip) : type(OK), ip(ip) {}
     explicit Result(ResultType type) : type(type) {}
+    Result(const IPAddress& ip, const std::string& name)
+        : type(OK), ip(ip), canonical_name(name) {}
 
     ResultType type;
     IPAddress ip;
+    std::string canonical_name;
   };
 
   // If |delay| is true, matching transactions will be delayed until triggered
diff --git a/net/dns/host_resolver.cc b/net/dns/host_resolver.cc
index 24e2f4d1b..46afc19 100644
--- a/net/dns/host_resolver.cc
+++ b/net/dns/host_resolver.cc
@@ -89,6 +89,12 @@
       enable_caching(true) {
 }
 
+std::unique_ptr<HostResolver> HostResolver::Factory::CreateResolver(
+    const Options& options,
+    NetLog* net_log) {
+  return CreateSystemResolver(options, net_log);
+}
+
 HostResolver::RequestInfo::RequestInfo(const HostPortPair& host_port_pair)
     : RequestInfo() {
   host_port_pair_ = host_port_pair;
diff --git a/net/dns/host_resolver.h b/net/dns/host_resolver.h
index 4c615be..27d2967 100644
--- a/net/dns/host_resolver.h
+++ b/net/dns/host_resolver.h
@@ -114,6 +114,17 @@
     bool enable_caching;
   };
 
+  // Factory class. Useful for classes that need to inject and override resolver
+  // creation for tests.
+  class NET_EXPORT Factory {
+   public:
+    virtual ~Factory() = default;
+
+    // See HostResolver::CreateSystemResolver.
+    virtual std::unique_ptr<HostResolver> CreateResolver(const Options& options,
+                                                         NetLog* net_log);
+  };
+
   // The parameters for doing a Resolve(). A hostname and port are
   // required; the rest are optional (and have reasonable defaults).
   //
diff --git a/net/dns/host_resolver_impl.cc b/net/dns/host_resolver_impl.cc
index 357e0617..3e2bfaf7 100644
--- a/net/dns/host_resolver_impl.cc
+++ b/net/dns/host_resolver_impl.cc
@@ -1247,6 +1247,16 @@
       addr_list_.insert(addr_list_.begin(), addr_list.begin(), addr_list.end());
     }
 
+    // If requested via HOST_RESOLVER_CANONNAME, store the canonical name from
+    // the response. Prefer the name from the AAAA response. Only look at name
+    // if there is at least one address record.
+    if ((key_.host_resolver_flags & HOST_RESOLVER_CANONNAME) != 0 &&
+        !addr_list.empty() &&
+        (transaction->GetType() == dns_protocol::kTypeAAAA ||
+         addr_list_.canonical_name().empty())) {
+      addr_list_.set_canonical_name(addr_list.canonical_name());
+    }
+
     if (needs_two_transactions() && num_completed_transactions_ == 1) {
       // No need to repeat the suffix search.
       key_.hostname = transaction->GetHostname();
@@ -2149,8 +2159,7 @@
   OnConnectionTypeChanged(NetworkChangeNotifier::GetConnectionType());
 
   {
-    DnsConfig dns_config;
-    NetworkChangeNotifier::GetDnsConfig(&dns_config);
+    DnsConfig dns_config = GetBaseDnsConfig();
     received_dns_config_ = dns_config.IsValid();
     // Conservatively assume local IPv6 is needed when DnsConfig is not valid.
     use_local_ipv6_ = !dns_config.IsValid() || dns_config.use_local_ipv6;
@@ -2178,8 +2187,7 @@
   dns_client_ = std::move(dns_client);
   if (dns_client_ && !dns_client_->GetConfig() &&
       num_dns_failures_ < kMaximumDnsFailures) {
-    DnsConfig dns_config;
-    NetworkChangeNotifier::GetDnsConfig(&dns_config);
+    DnsConfig dns_config = GetBaseDnsConfig();
     DnsConfig overridden_config =
         dns_config_overrides_.ApplyOverrides(dns_config);
     dns_client_->SetConfig(overridden_config);
@@ -2388,6 +2396,12 @@
   mdns_client_ = std::move(client);
 }
 
+void HostResolverImpl::SetBaseDnsConfigForTesting(
+    const DnsConfig& base_config) {
+  test_base_config_ = base_config;
+  UpdateDNSConfig(true);
+}
+
 void HostResolverImpl::SetTaskRunnerForTesting(
     scoped_refptr<base::TaskRunner> task_runner) {
   proc_task_runner_ = std::move(task_runner);
@@ -2862,12 +2876,24 @@
 }
 
 void HostResolverImpl::OnDNSChanged() {
+  // Ignore changes if we're using a test config.
+  if (test_base_config_)
+    return;
+
   UpdateDNSConfig(true);
 }
 
-void HostResolverImpl::UpdateDNSConfig(bool config_changed) {
+DnsConfig HostResolverImpl::GetBaseDnsConfig() const {
   DnsConfig dns_config;
-  NetworkChangeNotifier::GetDnsConfig(&dns_config);
+  if (test_base_config_)
+    dns_config = test_base_config_.value();
+  else
+    NetworkChangeNotifier::GetDnsConfig(&dns_config);
+  return dns_config;
+}
+
+void HostResolverImpl::UpdateDNSConfig(bool config_changed) {
+  DnsConfig dns_config = GetBaseDnsConfig();
 
   if (net_log_) {
     net_log_->AddGlobalEntry(NetLogEventType::DNS_CONFIG_CHANGED,
diff --git a/net/dns/host_resolver_impl.h b/net/dns/host_resolver_impl.h
index 6bbbde49..b85b883 100644
--- a/net/dns/host_resolver_impl.h
+++ b/net/dns/host_resolver_impl.h
@@ -194,6 +194,8 @@
       std::unique_ptr<MDnsSocketFactory> socket_factory);
   void SetMdnsClientForTesting(std::unique_ptr<MDnsClient> client);
 
+  void SetBaseDnsConfigForTesting(const DnsConfig& base_config);
+
  protected:
   // Callback from HaveOnlyLoopbackAddresses probe.
   void SetHaveOnlyLoopbackAddresses(bool result);
@@ -343,6 +345,7 @@
   void OnDNSChanged() override;
   void OnInitialDNSConfigRead() override;
 
+  DnsConfig GetBaseDnsConfig() const;
   void UpdateDNSConfig(bool config_changed);
 
   // True if have a DnsClient with a valid DnsConfig.
@@ -390,6 +393,11 @@
   // to measure performance of DnsConfigService: http://crbug.com/125599
   bool received_dns_config_;
 
+  // If set, used instead of getting DNS configuration from
+  // NetworkChangeNotifier. Changes sent from NetworkChangeNotifier will also be
+  // ignored and not cancel any pending requests.
+  base::Optional<DnsConfig> test_base_config_;
+
   // Overrides or adds to DNS configuration read from the system for DnsClient
   // resolution.
   DnsConfigOverrides dns_config_overrides_;
diff --git a/net/dns/host_resolver_impl_unittest.cc b/net/dns/host_resolver_impl_unittest.cc
index fb433d78..b77ed78 100644
--- a/net/dns/host_resolver_impl_unittest.cc
+++ b/net/dns/host_resolver_impl_unittest.cc
@@ -5474,6 +5474,105 @@
   EXPECT_THAT(cache_entry->ttl(), base::TimeDelta::FromSeconds(86400));
 }
 
+TEST_F(HostResolverImplDnsTest, NoCanonicalName) {
+  AddDnsRule("alias", dns_protocol::kTypeA,
+             MockDnsClientRule::Result(IPAddress::IPv4Localhost(), "canonical"),
+             false);
+  AddDnsRule("alias", dns_protocol::kTypeAAAA,
+             MockDnsClientRule::Result(IPAddress::IPv6Localhost(), "canonical"),
+             false);
+  CreateResolver();
+  ChangeDnsConfig(CreateValidDnsConfig());
+  set_fallback_to_proctask(false);
+  Request* request = CreateRequest("alias", 80);
+  EXPECT_THAT(request->Resolve(), IsError(ERR_IO_PENDING));
+  ASSERT_THAT(request->WaitForResult(), IsOk());
+
+  EXPECT_TRUE(request->list().canonical_name().empty());
+}
+
+TEST_F(HostResolverImplDnsTest, NoCanonicalName_CreateRequest) {
+  AddDnsRule("alias", dns_protocol::kTypeA,
+             MockDnsClientRule::Result(IPAddress::IPv4Localhost(), "canonical"),
+             false);
+  AddDnsRule("alias", dns_protocol::kTypeAAAA,
+             MockDnsClientRule::Result(IPAddress::IPv6Localhost(), "canonical"),
+             false);
+  CreateResolver();
+  ChangeDnsConfig(CreateValidDnsConfig());
+  set_fallback_to_proctask(false);
+  HostResolver::ResolveHostParameters params;
+  params.source = HostResolverSource::DNS;
+  ResolveHostResponseHelper response(resolver_->CreateRequest(
+      HostPortPair("alias", 80), NetLogWithSource(), params));
+  ASSERT_THAT(response.result_error(), IsOk());
+
+  EXPECT_TRUE(
+      response.request()->GetAddressResults().value().canonical_name().empty());
+}
+
+TEST_F(HostResolverImplDnsTest, CanonicalName_CreateRequest) {
+  AddDnsRule("alias", dns_protocol::kTypeA,
+             MockDnsClientRule::Result(IPAddress::IPv4Localhost(), "canonical"),
+             false);
+  AddDnsRule("alias", dns_protocol::kTypeAAAA,
+             MockDnsClientRule::Result(IPAddress::IPv6Localhost(), "canonical"),
+             false);
+  CreateResolver();
+  ChangeDnsConfig(CreateValidDnsConfig());
+  set_fallback_to_proctask(false);
+  HostResolver::ResolveHostParameters params;
+  params.source = HostResolverSource::DNS;
+  params.include_canonical_name = true;
+  ResolveHostResponseHelper response(resolver_->CreateRequest(
+      HostPortPair("alias", 80), NetLogWithSource(), params));
+  ASSERT_THAT(response.result_error(), IsOk());
+
+  EXPECT_EQ(response.request()->GetAddressResults().value().canonical_name(),
+            "canonical");
+}
+
+TEST_F(HostResolverImplDnsTest, CanonicalName_PreferV6_CreateRequest) {
+  AddDnsRule("alias", dns_protocol::kTypeA,
+             MockDnsClientRule::Result(IPAddress::IPv4Localhost(), "wrong"),
+             false);
+  AddDnsRule("alias", dns_protocol::kTypeAAAA,
+             MockDnsClientRule::Result(IPAddress::IPv6Localhost(), "correct"),
+             true);
+  CreateResolver();
+  ChangeDnsConfig(CreateValidDnsConfig());
+  set_fallback_to_proctask(false);
+  HostResolver::ResolveHostParameters params;
+  params.source = HostResolverSource::DNS;
+  params.include_canonical_name = true;
+  ResolveHostResponseHelper response(resolver_->CreateRequest(
+      HostPortPair("alias", 80), NetLogWithSource(), params));
+  ASSERT_FALSE(response.complete());
+  base::RunLoop().RunUntilIdle();
+  dns_client_->CompleteDelayedTransactions();
+  ASSERT_THAT(response.result_error(), IsOk());
+  EXPECT_EQ(response.request()->GetAddressResults().value().canonical_name(),
+            "correct");
+}
+
+TEST_F(HostResolverImplDnsTest, CanonicalName_V4Only_CreateRequest) {
+  AddDnsRule("alias", dns_protocol::kTypeA,
+             MockDnsClientRule::Result(IPAddress::IPv4Localhost(), "correct"),
+             false);
+  CreateResolver();
+  ChangeDnsConfig(CreateValidDnsConfig());
+  set_fallback_to_proctask(false);
+  HostResolver::ResolveHostParameters params;
+  params.source = HostResolverSource::DNS;
+  params.dns_query_type = HostResolver::DnsQueryType::A;
+  params.include_canonical_name = true;
+  ResolveHostResponseHelper response(resolver_->CreateRequest(
+      HostPortPair("alias", 80), NetLogWithSource(), params));
+  ASSERT_THAT(response.result_error(), IsOk());
+  EXPECT_EQ(response.request()->GetAddressResults().value().canonical_name(),
+            "correct");
+}
+
 TEST_F(HostResolverImplTest, ResolveLocalHostname) {
   AddressList addresses;
 
diff --git a/net/interfaces/BUILD.gn b/net/interfaces/BUILD.gn
index e6684efc..fbf4ca9 100644
--- a/net/interfaces/BUILD.gn
+++ b/net/interfaces/BUILD.gn
@@ -16,3 +16,19 @@
     "//url/mojom:url_mojom_gurl",
   ]
 }
+
+source_set("tests") {
+  testonly = true
+
+  sources = [
+    "ip_address_struct_traits_unittest.cc",
+  ]
+
+  deps = [
+    ":interfaces",
+    "//mojo/public/cpp/bindings",
+    "//mojo/public/cpp/test_support:test_utils",
+    "//net",
+    "//testing/gtest",
+  ]
+}
diff --git a/net/interfaces/ip_address_struct_traits_unittest.cc b/net/interfaces/ip_address_struct_traits_unittest.cc
new file mode 100644
index 0000000..580eeb5
--- /dev/null
+++ b/net/interfaces/ip_address_struct_traits_unittest.cc
@@ -0,0 +1,46 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/interfaces/ip_address_struct_traits.h"
+
+#include "mojo/public/cpp/test_support/test_utils.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace net {
+namespace {
+
+TEST(IPAddressStructTraitsTest, Ipv4) {
+  IPAddress original(1, 2, 3, 4);
+
+  IPAddress deserialized;
+  EXPECT_TRUE(mojo::test::SerializeAndDeserialize<interfaces::IPAddress>(
+      &original, &deserialized));
+
+  EXPECT_EQ(original, deserialized);
+}
+
+TEST(IPAddressStructTraitsTest, Ipv6) {
+  IPAddress original(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16);
+
+  IPAddress deserialized;
+  EXPECT_TRUE(mojo::test::SerializeAndDeserialize<interfaces::IPAddress>(
+      &original, &deserialized));
+
+  EXPECT_EQ(original, deserialized);
+}
+
+// Serialization/deserialization not expected to work for invalid addresses,
+// e.g. an address with 5 octets.
+TEST(IPAddressStructTraitsTest, InvalidAddress) {
+  uint8_t bad_address_bytes[] = {1, 2, 3, 4, 5};
+  IPAddress original(bad_address_bytes);
+  ASSERT_FALSE(original.IsValid());
+
+  IPAddress deserialized;
+  EXPECT_FALSE(mojo::test::SerializeAndDeserialize<interfaces::IPAddress>(
+      &original, &deserialized));
+}
+
+}  // namespace
+}  // namespace net
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 74dcddaf..f478c92 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -2243,14 +2243,10 @@
 }
 
 TEST_P(QuicStreamFactoryTest, MigrateOnNetworkMadeDefaultWithSynchronousWrite) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestMigrationOnNetworkMadeDefault(SYNCHRONOUS);
 }
 
 TEST_P(QuicStreamFactoryTest, MigrateOnNetworkMadeDefaultWithAsyncWrite) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestMigrationOnNetworkMadeDefault(ASYNC);
 }
 
@@ -2433,8 +2429,6 @@
 // successfully, the probing writer will be unblocked on the network level, it
 // will not attempt to write new packets until the socket level is unblocked.
 TEST_P(QuicStreamFactoryTest, MigratedToBlockedSocketAfterProbing) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test({kDefaultNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
   crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
@@ -2615,8 +2609,6 @@
 //   comes up in the next kWaitTimeForNewNetworkSecs seonds.
 // - no new network is connected, migration times out. Session is closed.
 TEST_P(QuicStreamFactoryTest, MigrationTimeoutWithNoNewNetwork) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test({kDefaultNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
   crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
@@ -2688,8 +2680,6 @@
 // successfully probed path, any non-migratable stream will be reset. And if
 // the connection becomes idle then, close the connection.
 TEST_P(QuicStreamFactoryTest, OnNetworkMadeDefaultNonMigratableStream) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test(
       {kDefaultNetworkForTests, kNewNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
@@ -3283,8 +3273,6 @@
 // connection being closed with INTERNAL_ERROR as pending ACK frame is not
 // allowed when processing a new packet.
 TEST_P(QuicStreamFactoryTest, MigrateToProbingSocket) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test(
       {kDefaultNetworkForTests, kNewNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
@@ -3447,8 +3435,6 @@
 // early when path degrading is detected with an ASYNCHRONOUS write before
 // migration.
 TEST_P(QuicStreamFactoryTest, MigrateEarlyOnPathDegradingAysnc) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestMigrationOnPathDegrading(/*async_write_before_migration*/ true);
 }
 
@@ -3456,8 +3442,6 @@
 // early when path degrading is detected with a SYNCHRONOUS write before
 // migration.
 TEST_P(QuicStreamFactoryTest, MigrateEarlyOnPathDegradingSync) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestMigrationOnPathDegrading(/*async_write_before_migration*/ false);
 }
 
@@ -3832,8 +3816,6 @@
 // The first packet being written after migration is a synchrnous write, which
 // will cause a PING packet being sent.
 TEST_P(QuicStreamFactoryTest, MigrateSessionWithDrainingStreamSync) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestMigrateSessionWithDrainingStream(SYNCHRONOUS);
 }
 
@@ -3843,8 +3825,6 @@
 // The first packet being written after migration is an asynchronous write, no
 // PING packet will be sent.
 TEST_P(QuicStreamFactoryTest, MigrateSessionWithDrainingStreamAsync) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestMigrateSessionWithDrainingStream(ASYNC);
 }
 
@@ -4016,8 +3996,6 @@
 // This test verifies that the connection migrates to the alternate network
 // when the alternate network is connected after path has been degrading.
 TEST_P(QuicStreamFactoryTest, MigrateOnNewNetworkConnectAfterPathDegrading) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test({kDefaultNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
   crypto_client_stream_factory_.AddProofVerifyDetails(&verify_details);
@@ -4385,8 +4363,6 @@
 // alternate network on path degrading, and close the non-migratable streams
 // when probe is successful.
 TEST_P(QuicStreamFactoryTest, MigrateSessionEarlyNonMigratableStream) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test(
       {kDefaultNetworkForTests, kNewNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
@@ -4681,8 +4657,6 @@
 // - session attempts to migrate back to default network post migration;
 // - migration back to the default network is successful.
 TEST_P(QuicStreamFactoryTest, MigrateBackToDefaultPostMigrationOnWriteError) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   InitializeConnectionMigrationV2Test(
       {kDefaultNetworkForTests, kNewNetworkForTests});
   ProofVerifyDetailsChromium verify_details = DefaultProofVerifyDetails();
@@ -4943,15 +4917,11 @@
 }
 
 TEST_P(QuicStreamFactoryTest, NewConnectionBeforeHandshakeAfterIdleTimeout) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestNewConnectionOnAlternateNetworkBeforeHandshake(
       quic::QUIC_NETWORK_IDLE_TIMEOUT);
 }
 
 TEST_P(QuicStreamFactoryTest, NewConnectionAfterHandshakeTimeout) {
-  if (version_ == quic::QUIC_VERSION_99)
-    return;
   TestNewConnectionOnAlternateNetworkBeforeHandshake(
       quic::QUIC_HANDSHAKE_TIMEOUT);
 }
diff --git a/net/quic/quic_test_packet_maker.cc b/net/quic/quic_test_packet_maker.cc
index 2673aeac..e6bd8cc 100644
--- a/net/quic/quic_test_packet_maker.cc
+++ b/net/quic/quic_test_packet_maker.cc
@@ -11,6 +11,7 @@
 #include "net/quic/quic_http_utils.h"
 #include "net/third_party/quic/core/quic_framer.h"
 #include "net/third_party/quic/core/quic_utils.h"
+#include "net/third_party/quic/test_tools/mock_random.h"
 #include "net/third_party/quic/test_tools/quic_test_utils.h"
 
 namespace net {
@@ -74,8 +75,23 @@
   size_t max_plaintext_size =
       framer.GetMaxPlaintextSize(quic::kDefaultMaxPacketSize);
   char buffer[quic::kDefaultMaxPacketSize];
-  size_t length =
-      framer.BuildConnectivityProbingPacket(header, buffer, max_plaintext_size);
+  size_t length;
+  if (version_ != quic::QUIC_VERSION_99) {
+    length = framer.BuildConnectivityProbingPacket(header, buffer,
+                                                   max_plaintext_size);
+  } else if (perspective_ == quic::Perspective::IS_CLIENT) {
+    quic::test::MockRandom rand(0);
+    quic::QuicPathFrameBuffer payload;
+    length = framer.BuildPaddedPathChallengePacket(
+        header, buffer, max_plaintext_size, &payload, &rand);
+  } else {
+    quic::test::MockRandom rand(0);
+    quic::QuicPathFrameBuffer payload;
+    rand.RandBytes(payload.data(), payload.size());
+    quic::QuicDeque<quic::QuicPathFrameBuffer> payloads{payload};
+    length = framer.BuildPathResponsePacket(header, buffer, max_plaintext_size,
+                                            payloads, true);
+  }
   size_t encrypted_size = framer.EncryptInPlace(
       quic::ENCRYPTION_NONE, header.packet_number,
       GetStartOfEncryptedData(framer.transport_version(), header), length,
diff --git a/net/third_party/quic/core/quic_connection.cc b/net/third_party/quic/core/quic_connection.cc
index 79712bd..b1ef7c0 100644
--- a/net/third_party/quic/core/quic_connection.cc
+++ b/net/third_party/quic/core/quic_connection.cc
@@ -1167,6 +1167,7 @@
   // PING, so as a stopgap, tell the FSM that determines whether we have a
   // Padded PING or not that we received a PING.
   UpdatePacketContent(FIRST_FRAME_IS_PING);
+  should_last_packet_instigate_acks_ = true;
   return true;
 }
 
@@ -1176,6 +1177,7 @@
     return true;
   }
   UpdatePacketContent(FIRST_FRAME_IS_PING);
+  should_last_packet_instigate_acks_ = true;
   return true;
 }
 
diff --git a/net/third_party/quic/core/quic_packet_creator.cc b/net/third_party/quic/core/quic_packet_creator.cc
index 8518c93..f998227 100644
--- a/net/third_party/quic/core/quic_packet_creator.cc
+++ b/net/third_party/quic/core/quic_packet_creator.cc
@@ -32,9 +32,19 @@
 QuicPacketCreator::QuicPacketCreator(QuicConnectionId connection_id,
                                      QuicFramer* framer,
                                      DelegateInterface* delegate)
+    : QuicPacketCreator(connection_id,
+                        framer,
+                        QuicRandom::GetInstance(),
+                        delegate) {}
+
+QuicPacketCreator::QuicPacketCreator(QuicConnectionId connection_id,
+                                     QuicFramer* framer,
+                                     QuicRandom* random,
+                                     DelegateInterface* delegate)
     : delegate_(delegate),
       debug_delegate_(nullptr),
       framer_(framer),
+      random_(random),
       send_version_in_packet_(framer->perspective() == Perspective::IS_CLIENT),
       have_diversification_nonce_(false),
       max_packet_length_(0),
@@ -577,8 +587,7 @@
 
   std::unique_ptr<char[]> buffer(new char[kMaxPacketSize]);
   size_t length = framer_->BuildPaddedPathChallengePacket(
-      header, buffer.get(), max_plaintext_size_, payload,
-      QuicRandom::GetInstance());
+      header, buffer.get(), max_plaintext_size_, payload, random_);
   DCHECK(length);
 
   const size_t encrypted_length = framer_->EncryptInPlace(
diff --git a/net/third_party/quic/core/quic_packet_creator.h b/net/third_party/quic/core/quic_packet_creator.h
index 523fcbd..8336bcb7 100644
--- a/net/third_party/quic/core/quic_packet_creator.h
+++ b/net/third_party/quic/core/quic_packet_creator.h
@@ -55,6 +55,10 @@
   QuicPacketCreator(QuicConnectionId connection_id,
                     QuicFramer* framer,
                     DelegateInterface* delegate);
+  QuicPacketCreator(QuicConnectionId connection_id,
+                    QuicFramer* framer,
+                    QuicRandom* random,
+                    DelegateInterface* delegate);
   QuicPacketCreator(const QuicPacketCreator&) = delete;
   QuicPacketCreator& operator=(const QuicPacketCreator&) = delete;
 
@@ -311,6 +315,7 @@
   DelegateInterface* delegate_;
   DebugDelegate* debug_delegate_;
   QuicFramer* framer_;
+  QuicRandom* random_;
 
   // Controls whether version should be included while serializing the packet.
   // send_version_in_packet_ should never be read directly, use
diff --git a/net/third_party/quic/core/quic_packet_generator.cc b/net/third_party/quic/core/quic_packet_generator.cc
index c997864..0cb0047 100644
--- a/net/third_party/quic/core/quic_packet_generator.cc
+++ b/net/third_party/quic/core/quic_packet_generator.cc
@@ -20,7 +20,7 @@
                                          QuicRandom* random_generator,
                                          DelegateInterface* delegate)
     : delegate_(delegate),
-      packet_creator_(connection_id, framer, delegate),
+      packet_creator_(connection_id, framer, random_generator, delegate),
       flusher_attached_(false),
       should_send_ack_(false),
       should_send_stop_waiting_(false),
diff --git a/net/third_party/spdy/core/array_output_buffer_test.cc b/net/third_party/spdy/core/array_output_buffer_test.cc
index 92282f1..f314d158 100644
--- a/net/third_party/spdy/core/array_output_buffer_test.cc
+++ b/net/third_party/spdy/core/array_output_buffer_test.cc
@@ -4,6 +4,7 @@
 
 #include "net/third_party/spdy/core/array_output_buffer.h"
 
+#include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace spdy {
diff --git a/net/third_party/spdy/core/hpack/hpack_constants.h b/net/third_party/spdy/core/hpack/hpack_constants.h
index 7c7626f..aaba7a2f 100644
--- a/net/third_party/spdy/core/hpack/hpack_constants.h
+++ b/net/third_party/spdy/core/hpack/hpack_constants.h
@@ -5,8 +5,8 @@
 #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_
 #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_CONSTANTS_H_
 
-#include <stddef.h>
-#include <stdint.h>
+#include <cstddef>
+#include <cstdint>
 
 #include <vector>
 
diff --git a/net/third_party/spdy/core/hpack/hpack_decoder_adapter.h b/net/third_party/spdy/core/hpack/hpack_decoder_adapter.h
index 465097e..5048b46 100644
--- a/net/third_party/spdy/core/hpack/hpack_decoder_adapter.h
+++ b/net/third_party/spdy/core/hpack/hpack_decoder_adapter.h
@@ -10,6 +10,7 @@
 
 #include <stddef.h>
 
+#include <cstdint>
 #include <memory>
 
 #include "base/macros.h"
diff --git a/net/third_party/spdy/core/hpack/hpack_decoder_adapter_test.cc b/net/third_party/spdy/core/hpack/hpack_decoder_adapter_test.cc
index 551acb1..63adb094 100644
--- a/net/third_party/spdy/core/hpack/hpack_decoder_adapter_test.cc
+++ b/net/third_party/spdy/core/hpack/hpack_decoder_adapter_test.cc
@@ -636,7 +636,7 @@
 TEST_P(HpackDecoderAdapterTest, TruncatedIndex) {
   // Indexed Header, varint for index requires multiple bytes,
   // but only one provided.
-  EXPECT_FALSE(DecodeHeaderBlock(SpdyStringPiece("\xff", 1)));
+  EXPECT_FALSE(DecodeHeaderBlock("\xff"));
 }
 
 TEST_P(HpackDecoderAdapterTest, TruncatedHuffmanLiteral) {
@@ -1014,8 +1014,8 @@
 }
 
 // Regression test: Found that entries with dynamic indexed names and literal
-// values caused "use after free" memory sanity checker failures if the name
-// was evicted as it was being re-used.
+// values caused "use after free" MSAN failures if the name was evicted as it
+// was being re-used.
 TEST_P(HpackDecoderAdapterTest, ReuseNameOfEvictedEntry) {
   // Each entry is measured as 32 bytes plus the sum of the lengths of the name
   // and the value. Set the size big enough for at most one entry, and a fairly
diff --git a/net/third_party/spdy/core/hpack/hpack_encoder.h b/net/third_party/spdy/core/hpack/hpack_encoder.h
index 5b5dcb67..1843ea5 100644
--- a/net/third_party/spdy/core/hpack/hpack_encoder.h
+++ b/net/third_party/spdy/core/hpack/hpack_encoder.h
@@ -39,7 +39,7 @@
 
   // Callers may provide a HeaderListener to be informed of header name-value
   // pairs processed by this encoder.
-  typedef std::function<void(SpdyStringPiece, SpdyStringPiece)> HeaderListener;
+  using HeaderListener = std::function<void(SpdyStringPiece, SpdyStringPiece)>;
 
   // An indexing policy should return true if the provided header name-value
   // pair should be inserted into the HPACK dynamic table.
diff --git a/net/third_party/spdy/core/hpack/hpack_entry.cc b/net/third_party/spdy/core/hpack/hpack_entry.cc
index 4776017..bebde49 100644
--- a/net/third_party/spdy/core/hpack/hpack_entry.cc
+++ b/net/third_party/spdy/core/hpack/hpack_entry.cc
@@ -5,7 +5,6 @@
 #include "net/third_party/spdy/core/hpack/hpack_entry.h"
 
 #include "base/logging.h"
-#include "base/strings/string_number_conversions.h"
 #include "net/third_party/spdy/platform/api/spdy_estimate_memory_usage.h"
 #include "net/third_party/spdy/platform/api/spdy_string_utils.h"
 
@@ -72,7 +71,6 @@
 size_t HpackEntry::Size(SpdyStringPiece name, SpdyStringPiece value) {
   return name.size() + value.size() + kSizeOverhead;
 }
-
 size_t HpackEntry::Size() const {
   return Size(name(), value());
 }
diff --git a/net/third_party/spdy/core/hpack/hpack_huffman_table.h b/net/third_party/spdy/core/hpack/hpack_huffman_table.h
index 007f522..c88f377 100644
--- a/net/third_party/spdy/core/hpack/hpack_huffman_table.h
+++ b/net/third_party/spdy/core/hpack/hpack_huffman_table.h
@@ -5,9 +5,9 @@
 #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_HUFFMAN_TABLE_H_
 #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_HUFFMAN_TABLE_H_
 
-#include <stdint.h>
 
 #include <cstddef>
+#include <cstdint>
 #include <vector>
 
 #include "net/third_party/spdy/core/hpack/hpack_constants.h"
diff --git a/net/third_party/spdy/core/hpack/hpack_huffman_table_test.cc b/net/third_party/spdy/core/hpack/hpack_huffman_table_test.cc
index be63fce6..de13d2a8 100644
--- a/net/third_party/spdy/core/hpack/hpack_huffman_table_test.cc
+++ b/net/third_party/spdy/core/hpack/hpack_huffman_table_test.cc
@@ -4,12 +4,8 @@
 
 #include "net/third_party/spdy/core/hpack/hpack_huffman_table.h"
 
-#include <stdint.h>
-
-#include <bitset>
 #include <utility>
 
-#include "base/logging.h"
 #include "base/macros.h"
 #include "net/third_party/http2/hpack/huffman/hpack_huffman_decoder.h"
 #include "net/third_party/spdy/core/hpack/hpack_constants.h"
@@ -32,10 +28,7 @@
   const std::vector<uint8_t>& length_by_id() const {
     return table_.length_by_id_;
   }
-  char pad_bits() const {
-    // Cast to match signed-ness of bits8().
-    return static_cast<char>(table_.pad_bits_);
-  }
+  uint8_t pad_bits() const { return table_.pad_bits_; }
   uint16_t failed_symbol_id() const { return table_.failed_symbol_id_; }
 
  private:
@@ -65,60 +58,51 @@
   HpackHuffmanTablePeer peer_;
 };
 
-uint32_t bits32(const SpdyString& bitstring) {
-  return std::bitset<32>(bitstring).to_ulong();
-}
-char bits8(const SpdyString& bitstring) {
-  return static_cast<char>(std::bitset<8>(bitstring).to_ulong());
-}
-
 TEST_F(GenericHuffmanTableTest, InitializeEdgeCases) {
   {
     // Verify eight symbols can be encoded with 3 bits per symbol.
-    HpackHuffmanSymbol code[] = {
-        {bits32("00000000000000000000000000000000"), 3, 0},
-        {bits32("00100000000000000000000000000000"), 3, 1},
-        {bits32("01000000000000000000000000000000"), 3, 2},
-        {bits32("01100000000000000000000000000000"), 3, 3},
-        {bits32("10000000000000000000000000000000"), 3, 4},
-        {bits32("10100000000000000000000000000000"), 3, 5},
-        {bits32("11000000000000000000000000000000"), 3, 6},
-        {bits32("11100000000000000000000000000000"), 8, 7}};
+    HpackHuffmanSymbol code[] = {{0b00000000000000000000000000000000, 3, 0},
+                                 {0b00100000000000000000000000000000, 3, 1},
+                                 {0b01000000000000000000000000000000, 3, 2},
+                                 {0b01100000000000000000000000000000, 3, 3},
+                                 {0b10000000000000000000000000000000, 3, 4},
+                                 {0b10100000000000000000000000000000, 3, 5},
+                                 {0b11000000000000000000000000000000, 3, 6},
+                                 {0b11100000000000000000000000000000, 8, 7}};
     HpackHuffmanTable table;
     EXPECT_TRUE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
   }
   {
     // But using 2 bits with one symbol overflows the code.
     HpackHuffmanSymbol code[] = {
-        {bits32("01000000000000000000000000000000"), 3, 0},
-        {bits32("01100000000000000000000000000000"), 3, 1},
-        {bits32("00000000000000000000000000000000"), 2, 2},
-        {bits32("10000000000000000000000000000000"), 3, 3},
-        {bits32("10100000000000000000000000000000"), 3, 4},
-        {bits32("11000000000000000000000000000000"), 3, 5},
-        {bits32("11100000000000000000000000000000"), 3, 6},
-        {bits32("00000000000000000000000000000000"), 8, 7}};  // Overflow.
+        {0b01000000000000000000000000000000, 3, 0},
+        {0b01100000000000000000000000000000, 3, 1},
+        {0b00000000000000000000000000000000, 2, 2},
+        {0b10000000000000000000000000000000, 3, 3},
+        {0b10100000000000000000000000000000, 3, 4},
+        {0b11000000000000000000000000000000, 3, 5},
+        {0b11100000000000000000000000000000, 3, 6},
+        {0b00000000000000000000000000000000, 8, 7}};  // Overflow.
     HpackHuffmanTable table;
     EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
     EXPECT_EQ(7, HpackHuffmanTablePeer(table).failed_symbol_id());
   }
   {
     // Verify four symbols can be encoded with incremental bits per symbol.
-    HpackHuffmanSymbol code[] = {
-        {bits32("00000000000000000000000000000000"), 1, 0},
-        {bits32("10000000000000000000000000000000"), 2, 1},
-        {bits32("11000000000000000000000000000000"), 3, 2},
-        {bits32("11100000000000000000000000000000"), 8, 3}};
+    HpackHuffmanSymbol code[] = {{0b00000000000000000000000000000000, 1, 0},
+                                 {0b10000000000000000000000000000000, 2, 1},
+                                 {0b11000000000000000000000000000000, 3, 2},
+                                 {0b11100000000000000000000000000000, 8, 3}};
     HpackHuffmanTable table;
     EXPECT_TRUE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
   }
   {
     // But repeating a length overflows the code.
     HpackHuffmanSymbol code[] = {
-        {bits32("00000000000000000000000000000000"), 1, 0},
-        {bits32("10000000000000000000000000000000"), 2, 1},
-        {bits32("11000000000000000000000000000000"), 2, 2},
-        {bits32("00000000000000000000000000000000"), 8, 3}};  // Overflow.
+        {0b00000000000000000000000000000000, 1, 0},
+        {0b10000000000000000000000000000000, 2, 1},
+        {0b11000000000000000000000000000000, 2, 2},
+        {0b00000000000000000000000000000000, 8, 3}};  // Overflow.
     HpackHuffmanTable table;
     EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
     EXPECT_EQ(3, HpackHuffmanTablePeer(table).failed_symbol_id());
@@ -126,21 +110,20 @@
   {
     // Symbol IDs must be assigned sequentially with no gaps.
     HpackHuffmanSymbol code[] = {
-        {bits32("00000000000000000000000000000000"), 1, 0},
-        {bits32("10000000000000000000000000000000"), 2, 1},
-        {bits32("11000000000000000000000000000000"), 3, 1},  // Repeat.
-        {bits32("11100000000000000000000000000000"), 8, 3}};
+        {0b00000000000000000000000000000000, 1, 0},
+        {0b10000000000000000000000000000000, 2, 1},
+        {0b11000000000000000000000000000000, 3, 1},  // Repeat.
+        {0b11100000000000000000000000000000, 8, 3}};
     HpackHuffmanTable table;
     EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
     EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
   }
   {
     // Canonical codes must begin with zero.
-    HpackHuffmanSymbol code[] = {
-        {bits32("10000000000000000000000000000000"), 4, 0},
-        {bits32("10010000000000000000000000000000"), 4, 1},
-        {bits32("10100000000000000000000000000000"), 4, 2},
-        {bits32("10110000000000000000000000000000"), 8, 3}};
+    HpackHuffmanSymbol code[] = {{0b10000000000000000000000000000000, 4, 0},
+                                 {0b10010000000000000000000000000000, 4, 1},
+                                 {0b10100000000000000000000000000000, 4, 2},
+                                 {0b10110000000000000000000000000000, 8, 3}};
     HpackHuffmanTable table;
     EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
     EXPECT_EQ(0, HpackHuffmanTablePeer(table).failed_symbol_id());
@@ -148,21 +131,20 @@
   {
     // Codes must match the expected canonical sequence.
     HpackHuffmanSymbol code[] = {
-        {bits32("00000000000000000000000000000000"), 2, 0},
-        {bits32("01000000000000000000000000000000"), 2, 1},
-        {bits32("11000000000000000000000000000000"), 2, 2},  // Not canonical.
-        {bits32("10000000000000000000000000000000"), 8, 3}};
+        {0b00000000000000000000000000000000, 2, 0},
+        {0b01000000000000000000000000000000, 2, 1},
+        {0b11000000000000000000000000000000, 2, 2},  // Code not canonical.
+        {0b10000000000000000000000000000000, 8, 3}};
     HpackHuffmanTable table;
     EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
     EXPECT_EQ(2, HpackHuffmanTablePeer(table).failed_symbol_id());
   }
   {
     // At least one code must have a length of 8 bits (to ensure pad-ability).
-    HpackHuffmanSymbol code[] = {
-        {bits32("00000000000000000000000000000000"), 1, 0},
-        {bits32("10000000000000000000000000000000"), 2, 1},
-        {bits32("11000000000000000000000000000000"), 3, 2},
-        {bits32("11100000000000000000000000000000"), 7, 3}};
+    HpackHuffmanSymbol code[] = {{0b00000000000000000000000000000000, 1, 0},
+                                 {0b10000000000000000000000000000000, 2, 1},
+                                 {0b11000000000000000000000000000000, 3, 2},
+                                 {0b11100000000000000000000000000000, 7, 3}};
     HpackHuffmanTable table;
     EXPECT_FALSE(table.Initialize(code, SPDY_ARRAYSIZE(code)));
   }
@@ -170,15 +152,16 @@
 
 TEST_F(GenericHuffmanTableTest, ValidateInternalsWithSmallCode) {
   HpackHuffmanSymbol code[] = {
-      {bits32("01100000000000000000000000000000"), 4, 0},  // 3rd.
-      {bits32("01110000000000000000000000000000"), 4, 1},  // 4th.
-      {bits32("00000000000000000000000000000000"), 2, 2},  // 1st assigned code.
-      {bits32("01000000000000000000000000000000"), 3, 3},  // 2nd.
-      {bits32("10000000000000000000000000000000"), 5, 4},  // 5th.
-      {bits32("10001000000000000000000000000000"), 5, 5},  // 6th.
-      {bits32("10011000000000000000000000000000"), 8, 6},  // 8th.
-      {bits32("10010000000000000000000000000000"), 5, 7}};  // 7th.
+      {0b01100000000000000000000000000000, 4, 0},   // 3rd.
+      {0b01110000000000000000000000000000, 4, 1},   // 4th.
+      {0b00000000000000000000000000000000, 2, 2},   // 1st assigned code.
+      {0b01000000000000000000000000000000, 3, 3},   // 2nd.
+      {0b10000000000000000000000000000000, 5, 4},   // 5th.
+      {0b10001000000000000000000000000000, 5, 5},   // 6th.
+      {0b10011000000000000000000000000000, 8, 6},   // 8th.
+      {0b10010000000000000000000000000000, 5, 7}};  // 7th.
   EXPECT_TRUE(table_.Initialize(code, SPDY_ARRAYSIZE(code)));
+
   ASSERT_EQ(SPDY_ARRAYSIZE(code), peer_.code_by_id().size());
   ASSERT_EQ(SPDY_ARRAYSIZE(code), peer_.length_by_id().size());
   for (size_t i = 0; i < SPDY_ARRAYSIZE(code); ++i) {
@@ -186,13 +169,12 @@
     EXPECT_EQ(code[i].length, peer_.length_by_id()[i]);
   }
 
-  EXPECT_EQ(bits8("10011000"), peer_.pad_bits());
+  EXPECT_EQ(0b10011000, peer_.pad_bits());
 
   char input_storage[] = {2, 3, 2, 7, 4};
   SpdyStringPiece input(input_storage, SPDY_ARRAYSIZE(input_storage));
   // By symbol: (2) 00 (3) 010 (2) 00 (7) 10010 (4) 10000 (6 as pad) 1001100.
-  char expect_storage[] = {bits8("00010001"), bits8("00101000"),
-                           bits8("01001100")};
+  char expect_storage[] = {0b00010001, 0b00101000, 0b01001100};
   SpdyStringPiece expect(expect_storage, SPDY_ARRAYSIZE(expect_storage));
   EXPECT_EQ(expect, EncodeString(input));
 }
@@ -216,7 +198,7 @@
 };
 
 TEST_F(HpackHuffmanTableTest, InitializeHpackCode) {
-  EXPECT_EQ(peer_.pad_bits(), '\xFF');  // First 8 bits of EOS.
+  EXPECT_EQ(peer_.pad_bits(), 0b11111111);  // First 8 bits of EOS.
 }
 
 TEST_F(HpackHuffmanTableTest, SpecRequestExamples) {
@@ -290,7 +272,6 @@
     storage[511 - i] = static_cast<char>(i);
   }
   SpdyStringPiece input(storage, SPDY_ARRAYSIZE(storage));
-
   SpdyString buffer_in = EncodeString(input);
   SpdyString buffer_out;
   DecodeString(buffer_in, &buffer_out);
diff --git a/net/third_party/spdy/core/hpack/hpack_output_stream.h b/net/third_party/spdy/core/hpack/hpack_output_stream.h
index bb61e46..f6f0751 100644
--- a/net/third_party/spdy/core/hpack/hpack_output_stream.h
+++ b/net/third_party/spdy/core/hpack/hpack_output_stream.h
@@ -5,8 +5,7 @@
 #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_OUTPUT_STREAM_H_
 #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_OUTPUT_STREAM_H_
 
-#include <stddef.h>
-#include <stdint.h>
+#include <cstdint>
 
 #include <map>
 
diff --git a/net/third_party/spdy/core/hpack/hpack_round_trip_test.cc b/net/third_party/spdy/core/hpack/hpack_round_trip_test.cc
index f60d376..cf9b38fb 100644
--- a/net/third_party/spdy/core/hpack/hpack_round_trip_test.cc
+++ b/net/third_party/spdy/core/hpack/hpack_round_trip_test.cc
@@ -3,6 +3,7 @@
 // found in the LICENSE file.
 
 #include <cmath>
+#include <cstdint>
 #include <ctime>
 #include <vector>
 
diff --git a/net/third_party/spdy/core/hpack/hpack_static_table.h b/net/third_party/spdy/core/hpack/hpack_static_table.h
index 0b39e6d..e74da2c 100644
--- a/net/third_party/spdy/core/hpack/hpack_static_table.h
+++ b/net/third_party/spdy/core/hpack/hpack_static_table.h
@@ -5,8 +5,6 @@
 #ifndef NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_STATIC_TABLE_H_
 #define NET_THIRD_PARTY_SPDY_CORE_HPACK_HPACK_STATIC_TABLE_H_
 
-#include <stddef.h>
-
 #include "net/third_party/spdy/core/hpack/hpack_header_table.h"
 #include "net/third_party/spdy/platform/api/spdy_export.h"
 
diff --git a/net/third_party/spdy/core/mock_spdy_framer_visitor.h b/net/third_party/spdy/core/mock_spdy_framer_visitor.h
index 028c18e..2a531f7 100644
--- a/net/third_party/spdy/core/mock_spdy_framer_visitor.h
+++ b/net/third_party/spdy/core/mock_spdy_framer_visitor.h
@@ -5,9 +5,6 @@
 #ifndef NET_THIRD_PARTY_SPDY_CORE_MOCK_SPDY_FRAMER_VISITOR_H_
 #define NET_THIRD_PARTY_SPDY_CORE_MOCK_SPDY_FRAMER_VISITOR_H_
 
-#include <stddef.h>
-#include <stdint.h>
-
 #include <cstdint>
 #include <memory>
 
diff --git a/net/third_party/spdy/core/spdy_deframer_visitor.cc b/net/third_party/spdy/core/spdy_deframer_visitor.cc
index be0d1b1..2ebb805 100644
--- a/net/third_party/spdy/core/spdy_deframer_visitor.cc
+++ b/net/third_party/spdy/core/spdy_deframer_visitor.cc
@@ -130,7 +130,7 @@
   explicit SpdyTestDeframerImpl(
       std::unique_ptr<SpdyDeframerVisitorInterface> listener)
       : listener_(std::move(listener)) {
-    CHECK(listener_);
+    CHECK(listener_ != nullptr);
   }
   SpdyTestDeframerImpl(const SpdyTestDeframerImpl&) = delete;
   SpdyTestDeframerImpl& operator=(const SpdyTestDeframerImpl&) = delete;
@@ -291,9 +291,9 @@
   CHECK(end_) << "   frame_type_=" << Http2FrameTypeToString(frame_type_);
   CHECK(got_hpack_end_);
 
-  CHECK(headers_ir_);
-  CHECK(headers_);
-  CHECK(headers_handler_);
+  CHECK(headers_ir_ != nullptr);
+  CHECK(headers_ != nullptr);
+  CHECK(headers_handler_ != nullptr);
 
   CHECK_LE(0u, padding_len_);
   CHECK_LE(padding_len_, 256u);
@@ -318,9 +318,9 @@
       << "   frame_type_=" << Http2FrameTypeToString(frame_type_);
   CHECK(end_) << "   frame_type_=" << Http2FrameTypeToString(frame_type_);
 
-  CHECK(push_promise_ir_);
-  CHECK(headers_);
-  CHECK(headers_handler_);
+  CHECK(push_promise_ir_ != nullptr);
+  CHECK(headers_ != nullptr);
+  CHECK(headers_handler_ != nullptr);
 
   CHECK_EQ(headers_ir_.get(), nullptr);
 
@@ -495,7 +495,7 @@
   DVLOG(1) << "OnGoAwayFrameData";
   CHECK_EQ(frame_type_, GOAWAY)
       << "   frame_type_=" << Http2FrameTypeToString(frame_type_);
-  CHECK(goaway_description_);
+  CHECK(goaway_description_ != nullptr);
   goaway_description_->append(goaway_data, len);
   return true;
 }
@@ -615,7 +615,7 @@
   DVLOG(1) << "OnSetting id: " << id << std::hex << "    value: " << value;
   CHECK_EQ(frame_type_, SETTINGS)
       << "   frame_type_=" << Http2FrameTypeToString(frame_type_);
-  CHECK(settings_);
+  CHECK(settings_ != nullptr);
   SpdyKnownSettingsId known_id;
   if (ParseSettingsId(id, &known_id)) {
     settings_->push_back(std::make_pair(known_id, value));
@@ -753,7 +753,7 @@
 void SpdyTestDeframerImpl::OnHeaderBlockStart() {
   CHECK(frame_type_ == HEADERS || frame_type_ == PUSH_PROMISE)
       << "   frame_type_=" << Http2FrameTypeToString(frame_type_);
-  CHECK(headers_);
+  CHECK(headers_ != nullptr);
   CHECK_EQ(0u, headers_->size());
   got_hpack_end_ = false;
 }
@@ -901,24 +901,18 @@
   return *this;
 }
 
-AssertionResult CollectedFrame::VerifyHasHeaders(
+::testing::AssertionResult CollectedFrame::VerifyHasHeaders(
     const StringPairVector& expected_headers) const {
-  if (headers.get() == nullptr)
-    return AssertionFailure();
-  if (*headers != expected_headers)
-    return AssertionFailure();
-
-  return AssertionSuccess();
+  VERIFY_NE(headers.get(), nullptr);
+  VERIFY_THAT(*headers, ::testing::ContainerEq(expected_headers));
+  return ::testing::AssertionSuccess();
 }
 
-AssertionResult CollectedFrame::VerifyHasSettings(
+::testing::AssertionResult CollectedFrame::VerifyHasSettings(
     const SettingVector& expected_settings) const {
-  if (settings.get() == nullptr)
-    return AssertionFailure();
-  if (*settings != expected_settings)
-    return AssertionFailure();
-
-  return AssertionSuccess();
+  VERIFY_NE(settings.get(), nullptr);
+  VERIFY_THAT(*settings, testing::ContainerEq(expected_settings));
+  return ::testing::AssertionSuccess();
 }
 
 DeframerCallbackCollector::DeframerCallbackCollector(
diff --git a/net/third_party/spdy/core/spdy_deframer_visitor.h b/net/third_party/spdy/core/spdy_deframer_visitor.h
index f7ca577..2913d9b 100644
--- a/net/third_party/spdy/core/spdy_deframer_visitor.h
+++ b/net/third_party/spdy/core/spdy_deframer_visitor.h
@@ -67,7 +67,7 @@
 // with the expected frames, which it would pop-off the list as its expectations
 // are met.
 
-#include <stdint.h>
+#include <cstdint>
 
 #include <memory>
 #include <type_traits>
diff --git a/net/third_party/spdy/core/spdy_frame_reader.h b/net/third_party/spdy/core/spdy_frame_reader.h
index 44a211e..6c211bc 100644
--- a/net/third_party/spdy/core/spdy_frame_reader.h
+++ b/net/third_party/spdy/core/spdy_frame_reader.h
@@ -5,8 +5,7 @@
 #ifndef NET_THIRD_PARTY_SPDY_CORE_SPDY_FRAME_READER_H_
 #define NET_THIRD_PARTY_SPDY_CORE_SPDY_FRAME_READER_H_
 
-#include <stddef.h>
-#include <stdint.h>
+#include <cstdint>
 
 #include "net/third_party/spdy/platform/api/spdy_export.h"
 #include "net/third_party/spdy/platform/api/spdy_string_piece.h"
diff --git a/net/third_party/spdy/core/spdy_framer_test.cc b/net/third_party/spdy/core/spdy_framer_test.cc
index 3fab3a5..196936c 100644
--- a/net/third_party/spdy/core/spdy_framer_test.cc
+++ b/net/third_party/spdy/core/spdy_framer_test.cc
@@ -1611,7 +1611,8 @@
       ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1631,7 +1632,8 @@
       ASSERT_TRUE(framer_.SerializeRstStream(rst_stream, &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 }
 
@@ -1658,7 +1660,8 @@
       ASSERT_TRUE(framer_.SerializeSettings(settings_ir, &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1693,7 +1696,8 @@
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
 
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1712,7 +1716,8 @@
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
 
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 }
 
@@ -1744,7 +1749,8 @@
       ASSERT_TRUE(framer_.SerializePing(ping_ir, &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
 
     // Tests SpdyPingIR when the ping is an ack.
     ping_ir.set_is_ack(true);
@@ -1778,7 +1784,8 @@
       ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1800,7 +1807,8 @@
       ASSERT_TRUE(framer_.SerializeGoAway(goaway_ir, &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 }
 
@@ -1834,7 +1842,8 @@
     headers.SetHeader("foo", "bar");
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1865,7 +1874,8 @@
     headers.SetHeader("foo", "bar");
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1896,7 +1906,8 @@
     headers_ir.SetHeader("foo", "");
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers_ir, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1932,7 +1943,8 @@
     headers_ir.SetHeader("foo", "");
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers_ir, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -1971,7 +1983,8 @@
     headers_ir.SetHeader("foo", "");
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers_ir, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kV4FrameData, SPDY_ARRAYSIZE(kV4FrameData));
+    CompareFrame(kDescription, frame, kV4FrameData,
+                 SPDY_ARRAYSIZE(kV4FrameData));
   }
 
   {
@@ -2010,7 +2023,8 @@
     headers_ir.SetHeader("foo", "");
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers_ir, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kV4FrameData, SPDY_ARRAYSIZE(kV4FrameData));
+    CompareFrame(kDescription, frame, kV4FrameData,
+                 SPDY_ARRAYSIZE(kV4FrameData));
   }
 
   {
@@ -2047,7 +2061,8 @@
     headers_ir.set_padding_len(6);
     SpdySerializedFrame frame(SpdyFramerPeer::SerializeHeaders(
         &framer, headers_ir, use_output_ ? &output_ : nullptr));
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 }
 
@@ -2069,7 +2084,8 @@
           SpdyWindowUpdateIR(/* stream_id = */ 1, /* delta = */ 1), &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -2090,7 +2106,8 @@
           &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 
   {
@@ -2111,7 +2128,8 @@
           &output_));
       frame = SpdySerializedFrame(output_.Begin(), output_.Size(), false);
     }
-    CompareFrame(kDescription, frame, kH2FrameData, SPDY_ARRAYSIZE(kH2FrameData));
+    CompareFrame(kDescription, frame, kH2FrameData,
+                 SPDY_ARRAYSIZE(kH2FrameData));
   }
 }
 
diff --git a/net/third_party/spdy/core/spdy_no_op_visitor.h b/net/third_party/spdy/core/spdy_no_op_visitor.h
index 03a937d..e8a612c 100644
--- a/net/third_party/spdy/core/spdy_no_op_visitor.h
+++ b/net/third_party/spdy/core/spdy_no_op_visitor.h
@@ -1,7 +1,7 @@
 // Copyright (c) 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.
-//
+
 // SpdyNoOpVisitor implements several of the visitor and handler interfaces
 // to make it easier to write tests that need to provide instances. Other
 // interfaces can be added as needed.
diff --git a/net/third_party/spdy/core/spdy_protocol_test_utils.cc b/net/third_party/spdy/core/spdy_protocol_test_utils.cc
index e9218e63..3e39dc9f 100644
--- a/net/third_party/spdy/core/spdy_protocol_test_utils.cc
+++ b/net/third_party/spdy/core/spdy_protocol_test_utils.cc
@@ -2,9 +2,10 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include <stdint.h>
-
 #include "net/third_party/spdy/core/spdy_protocol_test_utils.h"
+
+#include <cstdint>
+
 #include "net/third_party/spdy/platform/api/spdy_string_piece.h"
 
 namespace spdy {
@@ -16,22 +17,17 @@
 ::testing::AssertionResult VerifySpdyFrameWithHeaderBlockIREquals(
     const SpdyFrameWithHeaderBlockIR& expected,
     const SpdyFrameWithHeaderBlockIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameWithHeaderBlockIREquals";
-  if (actual.header_block() != expected.header_block())
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameWithHeaderBlockIREquals";
+  VERIFY_TRUE(actual.header_block() == expected.header_block());
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyAltSvcIR& expected,
                                                    const SpdyAltSvcIR& actual) {
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.origin() != actual.origin())
-    return ::testing::AssertionFailure();
-  if (actual.altsvc_vector() != expected.altsvc_vector())
-    return ::testing::AssertionFailure();
-
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_EQ(expected.origin(), actual.origin());
+  VERIFY_THAT(actual.altsvc_vector(),
+              ::testing::ContainerEq(expected.altsvc_vector()));
   return ::testing::AssertionSuccess();
 }
 
@@ -44,133 +40,103 @@
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyDataIR& expected,
                                                    const SpdyDataIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyDataIR";
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.fin() != actual.fin())
-    return ::testing::AssertionFailure();
-  if (expected.data_len() != actual.data_len())
-    return ::testing::AssertionFailure();
-  if (expected.data() == nullptr && actual.data() != nullptr)
-    return ::testing::AssertionFailure();
-  if (SpdyStringPiece(expected.data(), expected.data_len()) !=
-      SpdyStringPiece(actual.data(), actual.data_len()))
-    return ::testing::AssertionFailure();
-  if (!VerifySpdyFrameWithPaddingIREquals(expected, actual))
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyDataIR";
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_EQ(expected.fin(), actual.fin());
+  VERIFY_EQ(expected.data_len(), actual.data_len());
+  if (expected.data() == nullptr) {
+    VERIFY_EQ(nullptr, actual.data());
+  } else {
+    VERIFY_EQ(SpdyStringPiece(expected.data(), expected.data_len()),
+              SpdyStringPiece(actual.data(), actual.data_len()));
+  }
+  VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyGoAwayIR& expected,
                                                    const SpdyGoAwayIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyGoAwayIR";
-  if (expected.last_good_stream_id() != actual.last_good_stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.error_code() != actual.error_code())
-    return ::testing::AssertionFailure();
-  if (expected.description() != actual.description())
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyGoAwayIR";
+  VERIFY_EQ(expected.last_good_stream_id(), actual.last_good_stream_id());
+  VERIFY_EQ(expected.error_code(), actual.error_code());
+  VERIFY_EQ(expected.description(), actual.description());
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(
     const SpdyHeadersIR& expected,
     const SpdyHeadersIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyHeadersIR";
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.fin() != actual.fin())
-    return ::testing::AssertionFailure();
-  if (!VerifySpdyFrameWithHeaderBlockIREquals(expected, actual))
-    return ::testing::AssertionFailure();
-  if (expected.has_priority() != actual.has_priority())
-    return ::testing::AssertionFailure();
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyHeadersIR";
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_EQ(expected.fin(), actual.fin());
+  VERIFY_SUCCESS(VerifySpdyFrameWithHeaderBlockIREquals(expected, actual));
+  VERIFY_EQ(expected.has_priority(), actual.has_priority());
   if (expected.has_priority()) {
-    if (!VerifySpdyFrameWithPriorityIREquals(expected, actual))
-      return ::testing::AssertionFailure();
+    VERIFY_SUCCESS(VerifySpdyFrameWithPriorityIREquals(expected, actual));
   }
-  if (!VerifySpdyFrameWithPaddingIREquals(expected, actual))
-    return ::testing::AssertionFailure();
-
+  VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(const SpdyPingIR& expected,
                                                    const SpdyPingIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyPingIR";
-  if (expected.id() != actual.id())
-    return ::testing::AssertionFailure();
-  if (expected.is_ack() != actual.is_ack())
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyPingIR";
+  VERIFY_EQ(expected.id(), actual.id());
+  VERIFY_EQ(expected.is_ack(), actual.is_ack());
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(
     const SpdyPriorityIR& expected,
     const SpdyPriorityIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyPriorityIR";
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (!VerifySpdyFrameWithPriorityIREquals(expected, actual))
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyPriorityIR";
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_SUCCESS(VerifySpdyFrameWithPriorityIREquals(expected, actual));
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(
     const SpdyPushPromiseIR& expected,
     const SpdyPushPromiseIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyPushPromiseIR";
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (!VerifySpdyFrameWithPaddingIREquals(expected, actual))
-    return ::testing::AssertionFailure();
-  if (expected.promised_stream_id() != actual.promised_stream_id())
-    return ::testing::AssertionFailure();
-  if (!VerifySpdyFrameWithHeaderBlockIREquals(expected, actual))
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyPushPromiseIR";
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_SUCCESS(VerifySpdyFrameWithPaddingIREquals(expected, actual));
+  VERIFY_EQ(expected.promised_stream_id(), actual.promised_stream_id());
+  VERIFY_SUCCESS(VerifySpdyFrameWithHeaderBlockIREquals(expected, actual));
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(
     const SpdyRstStreamIR& expected,
     const SpdyRstStreamIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyRstStreamIR";
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.error_code() != actual.error_code())
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyRstStreamIR";
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_EQ(expected.error_code(), actual.error_code());
   return ::testing::AssertionSuccess();
 }
 
 ::testing::AssertionResult VerifySpdyFrameIREquals(
     const SpdySettingsIR& expected,
     const SpdySettingsIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdySettingsIR";
+  VLOG(1) << "VerifySpdyFrameIREquals SpdySettingsIR";
   // Note, ignoring non-HTTP/2 fields such as clear_settings.
-  if (expected.is_ack() != actual.is_ack())
-    return ::testing::AssertionFailure();
+  VERIFY_EQ(expected.is_ack(), actual.is_ack());
 
-  if (expected.values().size() != actual.values().size())
-    return ::testing::AssertionFailure();
+  // Note, the following doesn't work because there isn't a comparator and
+  // formatter for SpdySettingsIR::Value. Fixable if we cared.
+  //
+  //   VERIFY_THAT(actual.values(), ::testing::ContainerEq(actual.values()));
+
+  VERIFY_EQ(expected.values().size(), actual.values().size());
   for (const auto& entry : expected.values()) {
     const auto& param = entry.first;
     auto actual_itr = actual.values().find(param);
-    if (actual_itr == actual.values().end()) {
-      DVLOG(1) << "actual doesn't contain param: " << param;
-      return ::testing::AssertionFailure();
-    }
+    VERIFY_TRUE(!(actual_itr == actual.values().end()))
+        << "actual doesn't contain param: " << param;
     uint32_t expected_value = entry.second;
     uint32_t actual_value = actual_itr->second;
-    if (expected_value != actual_value) {
-      DVLOG(1) << "Values don't match for parameter: " << param;
-      return ::testing::AssertionFailure();
-    }
+    VERIFY_EQ(expected_value, actual_value)
+        << "Values don't match for parameter: " << param;
   }
 
   return ::testing::AssertionSuccess();
@@ -179,12 +145,9 @@
 ::testing::AssertionResult VerifySpdyFrameIREquals(
     const SpdyWindowUpdateIR& expected,
     const SpdyWindowUpdateIR& actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals SpdyWindowUpdateIR";
-  if (expected.stream_id() != actual.stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.delta() != actual.delta())
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals SpdyWindowUpdateIR";
+  VERIFY_EQ(expected.stream_id(), actual.stream_id());
+  VERIFY_EQ(expected.delta(), actual.delta());
   return ::testing::AssertionSuccess();
 }
 
diff --git a/net/third_party/spdy/core/spdy_protocol_test_utils.h b/net/third_party/spdy/core/spdy_protocol_test_utils.h
index eb8cc7c..75860ef 100644
--- a/net/third_party/spdy/core/spdy_protocol_test_utils.h
+++ b/net/third_party/spdy/core/spdy_protocol_test_utils.h
@@ -23,6 +23,7 @@
 #include "net/third_party/spdy/core/spdy_protocol.h"
 #include "net/third_party/spdy/core/spdy_test_utils.h"
 #include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
 
 namespace spdy {
 namespace test {
@@ -37,12 +38,10 @@
 template <class T>
 ::testing::AssertionResult VerifySpdyFrameWithPaddingIREquals(const T& expected,
                                                               const T& actual) {
-  DVLOG(1) << "VerifySpdyFrameWithPaddingIREquals";
-  if (expected.padded() != actual.padded())
-    return ::testing::AssertionFailure();
+  VLOG(1) << "VerifySpdyFrameWithPaddingIREquals";
+  VERIFY_EQ(expected.padded(), actual.padded());
   if (expected.padded()) {
-    if (expected.padding_payload_len() != actual.padding_payload_len())
-      return ::testing::AssertionFailure();
+    VERIFY_EQ(expected.padding_payload_len(), actual.padding_payload_len());
   }
 
   return ::testing::AssertionSuccess();
@@ -53,14 +52,10 @@
 ::testing::AssertionResult VerifySpdyFrameWithPriorityIREquals(
     const T& expected,
     const T& actual) {
-  DVLOG(1) << "VerifySpdyFrameWithPriorityIREquals";
-  if (expected.parent_stream_id() != actual.parent_stream_id())
-    return ::testing::AssertionFailure();
-  if (expected.weight() != actual.weight())
-    return ::testing::AssertionFailure();
-  if (expected.exclusive() != actual.exclusive())
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameWithPriorityIREquals";
+  VERIFY_EQ(expected.parent_stream_id(), actual.parent_stream_id());
+  VERIFY_EQ(expected.weight(), actual.weight());
+  VERIFY_EQ(expected.exclusive(), actual.exclusive());
   return ::testing::AssertionSuccess();
 }
 
@@ -128,19 +123,14 @@
 ::testing::AssertionResult VerifySpdyFrameIREquals(const E* expected,
                                                    const SpdyFrameIR* actual) {
   if (expected == nullptr || actual == nullptr) {
-    DVLOG(1) << "VerifySpdyFrameIREquals one null";
-    if (expected != nullptr)
-      return ::testing::AssertionFailure();
-    if (actual != nullptr)
-      return ::testing::AssertionFailure();
-
+    VLOG(1) << "VerifySpdyFrameIREquals one null";
+    VERIFY_EQ(expected, nullptr);
+    VERIFY_EQ(actual, nullptr);
     return ::testing::AssertionSuccess();
   }
-  DVLOG(1) << "VerifySpdyFrameIREquals not null";
-  const E* actual2 = reinterpret_cast<const E*>(actual);
-  if (actual2 == nullptr)
-    return ::testing::AssertionFailure();
-
+  VLOG(1) << "VerifySpdyFrameIREquals not null";
+  VERIFY_EQ(actual->frame_type(), expected->frame_type());
+  const E* actual2 = static_cast<const E*>(actual);
   return VerifySpdyFrameIREquals(*expected, *actual2);
 }
 
@@ -149,7 +139,7 @@
 template <class E>
 ::testing::AssertionResult VerifySpdyFrameIREquals(const E& expected,
                                                    const SpdyFrameIR* actual) {
-  DVLOG(1) << "VerifySpdyFrameIREquals";
+  VLOG(1) << "VerifySpdyFrameIREquals";
   return VerifySpdyFrameIREquals(&expected, actual);
 }
 
diff --git a/net/third_party/spdy/core/spdy_test_utils.h b/net/third_party/spdy/core/spdy_test_utils.h
index 4b8adcd..b006940 100644
--- a/net/third_party/spdy/core/spdy_test_utils.h
+++ b/net/third_party/spdy/core/spdy_test_utils.h
@@ -12,6 +12,7 @@
 #include <memory>
 
 #include "net/test/gtest_util.h"
+#include "net/third_party/http2/tools/failure.h"
 #include "net/third_party/spdy/core/spdy_bug_tracker.h"
 #include "net/third_party/spdy/core/spdy_header_block.h"
 #include "net/third_party/spdy/core/spdy_headers_handler_interface.h"
diff --git a/sandbox/mac/sandbox_logging.cc b/sandbox/mac/sandbox_logging.cc
index 933776a..4eebcea 100644
--- a/sandbox/mac/sandbox_logging.cc
+++ b/sandbox/mac/sandbox_logging.cc
@@ -93,6 +93,12 @@
   asl_set(asl_message.get(), ASL_KEY_LEVEL, asl_level_string.c_str());
   asl_set(asl_message.get(), ASL_KEY_MSG, message);
   asl_send(asl_client.get(), asl_message.get());
+
+  if (__builtin_available(macOS 10.11, *)) {
+    if (level == Level::FATAL) {
+      abort_report_np(message);
+    }
+  }
 }
 
 // |error| is strerror(errno) when a P* logging function is called. Pass
@@ -122,17 +128,6 @@
     SendAslLog(level, "warning: previous log message truncated");
 }
 
-void AnnotateCrash(const char* fmt, va_list args) {
-  if (__builtin_available(macOS 10.11, *)) {
-    char message[4096];
-    int ret = vsnprintf(message, sizeof(message), fmt, args);
-
-    if (ret >= 0) {
-      abort_report_np(message);
-    }
-  }
-}
-
 }  // namespace
 
 void Info(const char* fmt, ...) {
@@ -162,10 +157,6 @@
   DoLogging(Level::FATAL, fmt, args, nullptr);
   va_end(args);
 
-  va_start(args, fmt);
-  AnnotateCrash(fmt, args);
-  va_end(args);
-
   ABORT();
 }
 
@@ -184,10 +175,6 @@
   DoLogging(Level::FATAL, fmt, args, &error);
   va_end(args);
 
-  va_start(args, fmt);
-  AnnotateCrash(fmt, args);
-  va_end(args);
-
   ABORT();
 }
 
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
index 6b33be1c..6a5e0a9 100644
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -45,7 +45,6 @@
 #include "net/cert/multi_log_ct_verifier.h"
 #include "net/cookies/cookie_monster.h"
 #include "net/dns/host_cache.h"
-#include "net/dns/host_resolver.h"
 #include "net/dns/mapped_host_resolver.h"
 #include "net/extras/sqlite/sqlite_channel_id_store.h"
 #include "net/extras/sqlite/sqlite_persistent_cookie_store.h"
@@ -425,7 +424,8 @@
       app_status_listener_(
           std::make_unique<NetworkContextApplicationStatusListener>()),
 #endif
-      binding_(this, std::move(request)) {
+      binding_(this, std::move(request)),
+      host_resolver_factory_(std::make_unique<net::HostResolver::Factory>()) {
   url_request_context_owner_ = MakeURLRequestContext();
   url_request_context_ = url_request_context_owner_.url_request_context.get();
 
@@ -458,7 +458,8 @@
       app_status_listener_(
           std::make_unique<NetworkContextApplicationStatusListener>()),
 #endif
-      binding_(this, std::move(request)) {
+      binding_(this, std::move(request)),
+      host_resolver_factory_(std::make_unique<net::HostResolver::Factory>()) {
   url_request_context_owner_ = ApplyContextParamsToBuilder(builder.get());
   url_request_context_ = url_request_context_owner_.url_request_context.get();
 
@@ -486,7 +487,8 @@
                                           nullptr)),
       socket_factory_(
           std::make_unique<SocketFactory>(url_request_context_->net_log(),
-                                          url_request_context)) {
+                                          url_request_context)),
+      host_resolver_factory_(std::make_unique<net::HostResolver::Factory>()) {
   // May be nullptr in tests.
   if (network_service_)
     network_service_->RegisterNetworkContext(this);
@@ -618,7 +620,7 @@
   if (internal_host_resolver_)
     sum += internal_host_resolver_->GetNumOutstandingRequestsForTesting();
   for (const auto& host_resolver : host_resolvers_)
-    sum += host_resolver->GetNumOutstandingRequestsForTesting();
+    sum += host_resolver.first->GetNumOutstandingRequestsForTesting();
   return sum;
 }
 
@@ -924,12 +926,40 @@
                                        std::move(response_client));
 }
 
-void NetworkContext::CreateHostResolver(mojom::HostResolverRequest request) {
-  host_resolvers_.emplace(std::make_unique<HostResolver>(
-      std::move(request),
-      base::BindOnce(&NetworkContext::OnHostResolverShutdown,
-                     base::Unretained(this)),
-      url_request_context_->host_resolver(), url_request_context_->net_log()));
+void NetworkContext::CreateHostResolver(
+    const base::Optional<net::DnsConfigOverrides>& config_overrides,
+    mojom::HostResolverRequest request) {
+  net::HostResolver* internal_resolver = url_request_context_->host_resolver();
+  std::unique_ptr<net::HostResolver> private_internal_resolver;
+
+  if (config_overrides &&
+      config_overrides.value() != net::DnsConfigOverrides()) {
+    // If custom configuration is needed, create a separate internal resolver
+    // with the specified configuration overrides. Because we are using a non-
+    // standard resolver, disable the cache.
+    //
+    // TODO(crbug.com/846423): Consider allowing per-resolve overrides, so the
+    // same net::HostResolver with the same scheduler and cache can be used with
+    // different overrides.  But since this is only used for special cases for
+    // now, much easier to create entirely separate net::HostResolver instances.
+    net::HostResolver::Options options;
+    options.enable_caching = false;
+
+    private_internal_resolver = host_resolver_factory_->CreateResolver(
+        options, url_request_context_->net_log());
+    internal_resolver = private_internal_resolver.get();
+
+    internal_resolver->SetDnsClientEnabled(true);
+    internal_resolver->SetDnsConfigOverrides(config_overrides.value());
+  }
+
+  host_resolvers_.emplace(
+      std::make_unique<HostResolver>(
+          std::move(request),
+          base::BindOnce(&NetworkContext::OnHostResolverShutdown,
+                         base::Unretained(this)),
+          internal_resolver, url_request_context_->net_log()),
+      std::move(private_internal_resolver));
 }
 
 void NetworkContext::VerifyCertForSignedExchange(
diff --git a/services/network/network_context.h b/services/network/network_context.h
index a5ccc25..1ddf058c 100644
--- a/services/network/network_context.h
+++ b/services/network/network_context.h
@@ -7,9 +7,11 @@
 
 #include <stdint.h>
 
+#include <map>
 #include <memory>
 #include <set>
 #include <string>
+#include <utility>
 #include <vector>
 
 #include "base/callback.h"
@@ -18,12 +20,15 @@
 #include "base/containers/unique_ptr_adapters.h"
 #include "base/files/file.h"
 #include "base/macros.h"
+#include "base/optional.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
 #include "mojo/public/cpp/bindings/binding.h"
 #include "mojo/public/cpp/bindings/strong_binding_set.h"
 #include "net/cert/cert_verifier.h"
 #include "net/cert/cert_verify_result.h"
+#include "net/dns/dns_config_overrides.h"
+#include "net/dns/host_resolver.h"
 #include "services/network/http_cache_data_counter.h"
 #include "services/network/http_cache_data_remover.h"
 #include "services/network/public/cpp/cors/origin_access_list.h"
@@ -229,7 +234,9 @@
   void ResolveHost(const net::HostPortPair& host,
                    mojom::ResolveHostParametersPtr optional_parameters,
                    mojom::ResolveHostClientPtr response_client) override;
-  void CreateHostResolver(mojom::HostResolverRequest request) override;
+  void CreateHostResolver(
+      const base::Optional<net::DnsConfigOverrides>& config_overrides,
+      mojom::HostResolverRequest request) override;
   void WriteCacheMetadata(const GURL& url,
                           net::RequestPriority priority,
                           base::Time expected_response_time,
@@ -286,6 +293,11 @@
     return proxy_delegate_.get();
   }
 
+  void set_host_resolver_factory_for_testing(
+      std::unique_ptr<net::HostResolver::Factory> factory) {
+    host_resolver_factory_ = std::move(factory);
+  }
+
  private:
   class ContextNetworkDelegate;
 
@@ -398,8 +410,14 @@
 
   // Created on-demand. Null if unused.
   std::unique_ptr<HostResolver> internal_host_resolver_;
-  std::set<std::unique_ptr<HostResolver>, base::UniquePtrComparator>
+  // Map values set to non-null only if that HostResolver has its own private
+  // internal net::HostResolver.
+  std::map<std::unique_ptr<HostResolver>,
+           std::unique_ptr<net::HostResolver>,
+           base::UniquePtrComparator>
       host_resolvers_;
+  // Factory used to create any needed private internal net::HostResolvers.
+  std::unique_ptr<net::HostResolver::Factory> host_resolver_factory_;
 
   std::unique_ptr<NetworkServiceProxyDelegate> proxy_delegate_;
 
diff --git a/services/network/network_context_unittest.cc b/services/network/network_context_unittest.cc
index b866c08..2641ec6f 100644
--- a/services/network/network_context_unittest.cc
+++ b/services/network/network_context_unittest.cc
@@ -46,6 +46,7 @@
 #include "net/base/host_port_pair.h"
 #include "net/base/ip_endpoint.h"
 #include "net/base/net_errors.h"
+#include "net/base/network_change_notifier.h"
 #include "net/base/test_completion_callback.h"
 #include "net/cert/cert_verify_result.h"
 #include "net/cert/mock_cert_verifier.h"
@@ -53,6 +54,9 @@
 #include "net/cookies/cookie_options.h"
 #include "net/cookies/cookie_store.h"
 #include "net/disk_cache/disk_cache.h"
+#include "net/dns/dns_test_util.h"
+#include "net/dns/host_resolver_impl.h"
+#include "net/dns/host_resolver_source.h"
 #include "net/dns/mock_host_resolver.h"
 #include "net/http/http_auth.h"
 #include "net/http/http_cache.h"
@@ -2911,12 +2915,48 @@
             network_context->GetNumOutstandingResolveHostRequestsForTesting());
 }
 
+// Test factory of net::HostResolvers. Creates standard net::HostResolverImpl.
+// Keeps pointers to all created resolvers.
+class TestResolverFactory : public net::HostResolver::Factory {
+ public:
+  static TestResolverFactory* CreateAndSetFactory(NetworkContext* context) {
+    auto factory = std::make_unique<TestResolverFactory>();
+    auto* factory_ptr = factory.get();
+    context->set_host_resolver_factory_for_testing(std::move(factory));
+    return factory_ptr;
+  }
+
+  std::unique_ptr<net::HostResolver> CreateResolver(
+      const net::HostResolver::Options& options,
+      net::NetLog* net_log) override {
+    std::unique_ptr<net::HostResolverImpl> resolver =
+        net::HostResolver::CreateSystemResolverImpl(options, net_log);
+    resolvers_.push_back(resolver.get());
+    return resolver;
+  }
+
+  const std::vector<net::HostResolverImpl*>& resolvers() const {
+    return resolvers_;
+  }
+
+ private:
+  std::vector<net::HostResolverImpl*> resolvers_;
+};
+
 TEST_F(NetworkContextTest, CreateHostResolver) {
   std::unique_ptr<NetworkContext> network_context =
       CreateContextWithParams(CreateContextParams());
 
+  // Inject a factory to control and capture created net::HostResolvers.
+  TestResolverFactory* factory =
+      TestResolverFactory::CreateAndSetFactory(network_context.get());
+
   mojom::HostResolverPtr resolver;
-  network_context->CreateHostResolver(mojo::MakeRequest(&resolver));
+  network_context->CreateHostResolver(base::nullopt,
+                                      mojo::MakeRequest(&resolver));
+
+  // Expected to use shared internal HostResolver.
+  EXPECT_TRUE(factory->resolvers().empty());
 
   base::RunLoop run_loop;
   mojom::ResolveHostClientPtr response_client_ptr;
@@ -2946,7 +2986,8 @@
       internal_resolver.get());
 
   mojom::HostResolverPtr resolver;
-  network_context->CreateHostResolver(mojo::MakeRequest(&resolver));
+  network_context->CreateHostResolver(base::nullopt,
+                                      mojo::MakeRequest(&resolver));
 
   ASSERT_EQ(0, internal_resolver->num_cancellations());
 
@@ -2988,7 +3029,8 @@
       internal_resolver.get());
 
   mojom::HostResolverPtr resolver;
-  network_context->CreateHostResolver(mojo::MakeRequest(&resolver));
+  network_context->CreateHostResolver(base::nullopt,
+                                      mojo::MakeRequest(&resolver));
 
   ASSERT_EQ(0, internal_resolver->num_cancellations());
 
@@ -3029,6 +3071,74 @@
   EXPECT_TRUE(resolver_closed);
 }
 
+TEST_F(NetworkContextTest, CreateHostResolverWithConfigOverrides) {
+  std::unique_ptr<NetworkContext> network_context =
+      CreateContextWithParams(CreateContextParams());
+
+  // Inject a factory to control and capture created net::HostResolvers.
+  TestResolverFactory* factory =
+      TestResolverFactory::CreateAndSetFactory(network_context.get());
+
+  net::DnsConfigOverrides overrides;
+  overrides.nameservers = std::vector<net::IPEndPoint>{
+      CreateExpectedEndPoint("100.100.100.100", 22)};
+
+  mojom::HostResolverPtr resolver;
+  network_context->CreateHostResolver(overrides, mojo::MakeRequest(&resolver));
+
+  // Should create 1 private resolver with a DnsClient (if DnsClient is
+  // enablable for the build config).
+  ASSERT_EQ(1u, factory->resolvers().size());
+  net::HostResolverImpl* internal_resolver = factory->resolvers().front();
+#if defined(ENABLE_BUILT_IN_DNS)
+  EXPECT_TRUE(internal_resolver->GetDnsConfigAsValue());
+#endif
+
+  // Override DnsClient with a basic mock.
+  const std::string kQueryHostname = "example.com";
+  const std::string kResult = "1.2.3.4";
+  net::IPAddress result;
+  CHECK(result.AssignFromIPLiteral(kResult));
+  net::MockDnsClientRuleList rules{
+      net::MockDnsClientRule(kQueryHostname, net::dns_protocol::kTypeA,
+                             net::MockDnsClientRule::Result(result), false),
+      net::MockDnsClientRule(kQueryHostname, net::dns_protocol::kTypeAAAA,
+                             net::MockDnsClientRule::Result(
+                                 net::MockDnsClientRule::ResultType::EMPTY),
+                             false)};
+  auto mock_dns_client =
+      std::make_unique<net::MockDnsClient>(net::DnsConfig(), rules);
+  auto* mock_dns_client_ptr = mock_dns_client.get();
+  internal_resolver->SetDnsClient(std::move(mock_dns_client));
+
+  // Force the base configuration to ensure consistent overriding.
+  net::DnsConfig base_configuration;
+  base_configuration.nameservers = {CreateExpectedEndPoint("12.12.12.12", 53)};
+  internal_resolver->SetBaseDnsConfigForTesting(base_configuration);
+
+  // Test that the DnsClient is getting the overridden configuration.
+  EXPECT_TRUE(overrides.ApplyOverrides(base_configuration)
+                  .Equals(*mock_dns_client_ptr->GetConfig()));
+
+  // Ensure we are using the private resolver by testing that we get results
+  // from the overridden DnsClient.
+  base::RunLoop run_loop;
+  mojom::ResolveHostParametersPtr optional_parameters =
+      mojom::ResolveHostParameters::New();
+  optional_parameters->dns_query_type = net::HostResolver::DnsQueryType::A;
+  optional_parameters->source = net::HostResolverSource::DNS;
+  mojom::ResolveHostClientPtr response_client_ptr;
+  TestResolveHostClient response_client(&response_client_ptr, &run_loop);
+  resolver->ResolveHost(net::HostPortPair(kQueryHostname, 80),
+                        std::move(optional_parameters),
+                        std::move(response_client_ptr));
+  run_loop.Run();
+
+  EXPECT_EQ(net::OK, response_client.result_error());
+  EXPECT_THAT(response_client.result_addresses().value().endpoints(),
+              testing::ElementsAre(CreateExpectedEndPoint(kResult, 80)));
+}
+
 TEST_F(NetworkContextTest, PrivacyModeDisabledByDefault) {
   std::unique_ptr<NetworkContext> network_context =
       CreateContextWithParams(CreateContextParams());
diff --git a/services/network/public/cpp/BUILD.gn b/services/network/public/cpp/BUILD.gn
index 5086f0b..c33a373 100644
--- a/services/network/public/cpp/BUILD.gn
+++ b/services/network/public/cpp/BUILD.gn
@@ -166,6 +166,7 @@
     "cors/preflight_result_unittest.cc",
     "cross_thread_shared_url_loader_factory_info_unittest.cc",
     "digitally_signed_mojom_traits_unittest.cc",
+    "host_resolver_mojom_traits_unittest.cc",
     "mutable_network_traffic_annotation_tag_mojom_traits_unittest.cc",
     "mutable_partial_network_traffic_annotation_tag_mojom_traits_unittest.cc",
     "network_connection_tracker_unittest.cc",
diff --git a/services/network/public/cpp/host_resolver.typemap b/services/network/public/cpp/host_resolver.typemap
index f4054b0..8348c54 100644
--- a/services/network/public/cpp/host_resolver.typemap
+++ b/services/network/public/cpp/host_resolver.typemap
@@ -3,7 +3,10 @@
 # found in the LICENSE file.

 
 mojom = "//services/network/public/mojom/host_resolver.mojom"
-public_headers = [ "//net/dns/host_resolver.h" ]
+public_headers = [
+  "//net/dns/dns_config_overrides.h",
+  "//net/dns/host_resolver.h",
+]
 traits_headers =
     [ "//services/network/public/cpp/host_resolver_mojom_traits.h" ]
 sources = [
@@ -13,6 +16,7 @@
   "//net",
 ]
 type_mappings = [
+  "network.mojom.DnsConfigOverrides=net::DnsConfigOverrides",
   "network.mojom.ResolveHostParameters.DnsQueryType=net::HostResolver::DnsQueryType",
   "network.mojom.ResolveHostParameters.Source=net::HostResolverSource",
 ]
diff --git a/services/network/public/cpp/host_resolver_mojom_traits.cc b/services/network/public/cpp/host_resolver_mojom_traits.cc
index 0364c3e..c2cf862 100644
--- a/services/network/public/cpp/host_resolver_mojom_traits.cc
+++ b/services/network/public/cpp/host_resolver_mojom_traits.cc
@@ -4,10 +4,216 @@
 
 #include "services/network/public/cpp/host_resolver_mojom_traits.h"
 
+#include "mojo/public/cpp/base/time_mojom_traits.h"
+#include "net/interfaces/ip_address_struct_traits.h"
+#include "net/interfaces/ip_endpoint_struct_traits.h"
+
 namespace mojo {
 
+using network::mojom::DnsConfigOverrides;
+using network::mojom::DnsConfigOverridesDataView;
+using network::mojom::DnsHost;
+using network::mojom::DnsHostDataView;
+using network::mojom::DnsHostPtr;
+using network::mojom::DnsOverHttpsServer;
+using network::mojom::DnsOverHttpsServerDataView;
+using network::mojom::DnsOverHttpsServerPtr;
 using network::mojom::ResolveHostParameters;
 
+namespace {
+
+DnsConfigOverrides::Tristate ToTristate(base::Optional<bool> optional) {
+  if (!optional)
+    return DnsConfigOverrides::Tristate::NO_OVERRIDE;
+  if (optional.value())
+    return DnsConfigOverrides::Tristate::TRISTATE_TRUE;
+  return DnsConfigOverrides::Tristate::TRISTATE_FALSE;
+}
+
+base::Optional<bool> FromTristate(DnsConfigOverrides::Tristate tristate) {
+  switch (tristate) {
+    case DnsConfigOverrides::Tristate::NO_OVERRIDE:
+      return base::nullopt;
+    case DnsConfigOverrides::Tristate::TRISTATE_TRUE:
+      return true;
+    case DnsConfigOverrides::Tristate::TRISTATE_FALSE:
+      return false;
+  }
+}
+
+bool ReadHostData(mojo::ArrayDataView<DnsHostDataView> data,
+                  base::Optional<net::DnsHosts>* out) {
+  if (data.is_null()) {
+    out->reset();
+    return true;
+  }
+
+  out->emplace();
+  for (size_t i = 0; i < data.size(); ++i) {
+    DnsHostDataView host_data;
+    data.GetDataView(i, &host_data);
+
+    std::string hostname;
+    if (!host_data.ReadHostname(&hostname))
+      return false;
+
+    net::IPAddress address;
+    if (!host_data.ReadAddress(&address) || !address.IsValid())
+      return false;
+
+    net::AddressFamily address_family;
+    if (address.IsIPv4()) {
+      address_family = net::ADDRESS_FAMILY_IPV4;
+    } else if (address.IsIPv6()) {
+      address_family = net::ADDRESS_FAMILY_IPV6;
+    } else {
+      return false;
+    }
+
+    net::DnsHostsKey key = std::make_pair(std::move(hostname), address_family);
+    if (out->value().find(key) != out->value().end()) {
+      // Each DnsHostsKey expected to be unique.
+      return false;
+    }
+    out->value()[std::move(key)] = std::move(address);
+  }
+
+  return true;
+}
+
+bool ReadDnsOverHttpsServerData(
+    mojo::ArrayDataView<DnsOverHttpsServerDataView> data,
+    base::Optional<std::vector<net::DnsConfig::DnsOverHttpsServerConfig>>*
+        out) {
+  if (data.is_null()) {
+    out->reset();
+    return true;
+  }
+
+  out->emplace();
+  for (size_t i = 0; i < data.size(); ++i) {
+    DnsOverHttpsServerDataView server_data;
+    data.GetDataView(i, &server_data);
+
+    std::string server_template;
+    if (!server_data.ReadServerTemplate(&server_template))
+      return false;
+
+    out->value().emplace_back(std::move(server_template),
+                              server_data.use_post());
+  }
+
+  return true;
+}
+
+}  // namespace
+
+// static
+base::Optional<std::vector<DnsHostPtr>>
+StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::hosts(
+    const net::DnsConfigOverrides& overrides) {
+  if (!overrides.dns_over_https_servers)
+    return base::nullopt;
+
+  std::vector<DnsHostPtr> out_hosts;
+  for (const net::DnsHosts::value_type& host : overrides.hosts.value()) {
+    out_hosts.push_back(DnsHost::New(host.first.first, host.second));
+  }
+
+  return out_hosts;
+}
+
+// static
+DnsConfigOverrides::Tristate
+StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::
+    append_to_multi_label_name(const net::DnsConfigOverrides& overrides) {
+  return ToTristate(overrides.append_to_multi_label_name);
+}
+
+// static
+DnsConfigOverrides::Tristate
+StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::
+    randomize_ports(const net::DnsConfigOverrides& overrides) {
+  return ToTristate(overrides.randomize_ports);
+}
+
+// static
+DnsConfigOverrides::Tristate
+StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::rotate(
+    const net::DnsConfigOverrides& overrides) {
+  return ToTristate(overrides.rotate);
+}
+
+// static
+DnsConfigOverrides::Tristate
+StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::
+    use_local_ipv6(const net::DnsConfigOverrides& overrides) {
+  return ToTristate(overrides.use_local_ipv6);
+}
+
+// static
+base::Optional<std::vector<DnsOverHttpsServerPtr>>
+StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::
+    dns_over_https_servers(const net::DnsConfigOverrides& overrides) {
+  if (!overrides.dns_over_https_servers)
+    return base::nullopt;
+
+  std::vector<DnsOverHttpsServerPtr> out_servers;
+  for (net::DnsConfig::DnsOverHttpsServerConfig server :
+       overrides.dns_over_https_servers.value()) {
+    out_servers.push_back(
+        DnsOverHttpsServer::New(server.server_template, server.use_post));
+  }
+
+  return out_servers;
+}
+
+// static
+bool StructTraits<DnsConfigOverridesDataView, net::DnsConfigOverrides>::Read(
+    DnsConfigOverridesDataView data,
+    net::DnsConfigOverrides* out) {
+  if (!data.ReadNameservers(&out->nameservers))
+    return false;
+  if (!data.ReadSearch(&out->search))
+    return false;
+
+  mojo::ArrayDataView<DnsHostDataView> hosts_data;
+  data.GetHostsDataView(&hosts_data);
+  if (!ReadHostData(hosts_data, &out->hosts))
+    return false;
+
+  out->append_to_multi_label_name =
+      FromTristate(data.append_to_multi_label_name());
+  out->randomize_ports = FromTristate(data.randomize_ports());
+
+  if (data.ndots() < -1)
+    return false;
+  if (data.ndots() >= 0)
+    out->ndots = data.ndots();
+  // if == -1, leave nullopt.
+
+  if (!data.ReadTimeout(&out->timeout))
+    return false;
+
+  if (data.attempts() < -1)
+    return false;
+  if (data.attempts() >= 0)
+    out->attempts = data.attempts();
+  // if == -1, leave nullopt.
+
+  out->rotate = FromTristate(data.rotate());
+  out->use_local_ipv6 = FromTristate(data.use_local_ipv6());
+
+  mojo::ArrayDataView<DnsOverHttpsServerDataView> dns_over_https_servers_data;
+  data.GetDnsOverHttpsServersDataView(&dns_over_https_servers_data);
+  if (!ReadDnsOverHttpsServerData(dns_over_https_servers_data,
+                                  &out->dns_over_https_servers)) {
+    return false;
+  }
+
+  return true;
+}
+
 // static
 ResolveHostParameters::DnsQueryType EnumTraits<
     ResolveHostParameters::DnsQueryType,
diff --git a/services/network/public/cpp/host_resolver_mojom_traits.h b/services/network/public/cpp/host_resolver_mojom_traits.h
index fab0ed1..33e09d4 100644
--- a/services/network/public/cpp/host_resolver_mojom_traits.h
+++ b/services/network/public/cpp/host_resolver_mojom_traits.h
@@ -5,13 +5,72 @@
 #ifndef SERVICES_NETWORK_PUBLIC_CPP_HOST_RESOLVER_MOJOM_TRAITS_H_
 #define SERVICES_NETWORK_PUBLIC_CPP_HOST_RESOLVER_MOJOM_TRAITS_H_
 
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "base/optional.h"
+#include "base/time/time.h"
+#include "mojo/public/cpp/bindings/array_traits.h"
 #include "mojo/public/cpp/bindings/enum_traits.h"
+#include "mojo/public/cpp/bindings/struct_traits.h"
+#include "net/base/address_family.h"
+#include "net/base/ip_address.h"
+#include "net/base/ip_endpoint.h"
+#include "net/dns/dns_config_overrides.h"
+#include "net/dns/dns_hosts.h"
 #include "net/dns/host_resolver.h"
 #include "services/network/public/mojom/host_resolver.mojom.h"
 
 namespace mojo {
 
 template <>
+struct StructTraits<network::mojom::DnsConfigOverridesDataView,
+                    net::DnsConfigOverrides> {
+  static const base::Optional<std::vector<net::IPEndPoint>>& nameservers(
+      const net::DnsConfigOverrides& overrides) {
+    return overrides.nameservers;
+  }
+
+  static const base::Optional<std::vector<std::string>>& search(
+      const net::DnsConfigOverrides& overrides) {
+    return overrides.search;
+  }
+
+  static base::Optional<std::vector<network::mojom::DnsHostPtr>> hosts(
+      const net::DnsConfigOverrides& overrides);
+
+  static network::mojom::DnsConfigOverrides::Tristate
+  append_to_multi_label_name(const net::DnsConfigOverrides& overrides);
+  static network::mojom::DnsConfigOverrides::Tristate randomize_ports(
+      const net::DnsConfigOverrides& overrides);
+
+  static int ndots(const net::DnsConfigOverrides& overrides) {
+    return overrides.ndots.value_or(-1);
+  }
+
+  static const base::Optional<base::TimeDelta>& timeout(
+      const net::DnsConfigOverrides& overrides) {
+    return overrides.timeout;
+  }
+
+  static int attempts(const net::DnsConfigOverrides& overrides) {
+    return overrides.attempts.value_or(-1);
+  }
+
+  static network::mojom::DnsConfigOverrides::Tristate rotate(
+      const net::DnsConfigOverrides& overrides);
+  static network::mojom::DnsConfigOverrides::Tristate use_local_ipv6(
+      const net::DnsConfigOverrides& overrides);
+
+  static base::Optional<std::vector<network::mojom::DnsOverHttpsServerPtr>>
+  dns_over_https_servers(const net::DnsConfigOverrides& overrides);
+
+  static bool Read(network::mojom::DnsConfigOverridesDataView data,
+                   net::DnsConfigOverrides* out);
+};
+
+template <>
 struct EnumTraits<network::mojom::ResolveHostParameters::DnsQueryType,
                   net::HostResolver::DnsQueryType> {
   static network::mojom::ResolveHostParameters::DnsQueryType ToMojom(
diff --git a/services/network/public/cpp/host_resolver_mojom_traits_unittest.cc b/services/network/public/cpp/host_resolver_mojom_traits_unittest.cc
new file mode 100644
index 0000000..3c86e7e
--- /dev/null
+++ b/services/network/public/cpp/host_resolver_mojom_traits_unittest.cc
@@ -0,0 +1,89 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "services/network/public/cpp/host_resolver_mojom_traits.h"
+
+#include "mojo/public/cpp/base/time_mojom_traits.h"
+#include "mojo/public/cpp/test_support/test_utils.h"
+#include "net/interfaces/ip_address_struct_traits.h"
+#include "net/interfaces/ip_endpoint_struct_traits.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace network {
+namespace {
+
+TEST(HostResolverMojomTraitsTest, DnsConfigOverridesRoundtrip_Empty) {
+  net::DnsConfigOverrides original;
+
+  net::DnsConfigOverrides deserialized;
+  EXPECT_TRUE(mojo::test::SerializeAndDeserialize<mojom::DnsConfigOverrides>(
+      &original, &deserialized));
+
+  EXPECT_EQ(original, deserialized);
+}
+
+TEST(HostResolverMojomTraitsTest, DnsConfigOverridesRoundtrip_FullySpecified) {
+  net::DnsConfigOverrides original;
+  original.nameservers.emplace(
+      {net::IPEndPoint(net::IPAddress(1, 2, 3, 4), 80)});
+  original.search.emplace({std::string("str")});
+  original.hosts = net::DnsHosts(
+      {std::make_pair(net::DnsHostsKey("host1", net::ADDRESS_FAMILY_IPV4),
+                      net::IPAddress(2, 3, 4, 5)),
+       std::make_pair(net::DnsHostsKey("host2", net::ADDRESS_FAMILY_IPV4),
+                      net::IPAddress(2, 3, 4, 5))});
+  original.append_to_multi_label_name = true;
+  original.randomize_ports = false;
+  original.ndots = 2;
+  original.timeout = base::TimeDelta::FromHours(4);
+  original.attempts = 1;
+  original.rotate = true;
+  original.use_local_ipv6 = false;
+  original.dns_over_https_servers.emplace(
+      {net::DnsConfig::DnsOverHttpsServerConfig("example.com", false)});
+
+  net::DnsConfigOverrides deserialized;
+  EXPECT_TRUE(mojo::test::SerializeAndDeserialize<mojom::DnsConfigOverrides>(
+      &original, &deserialized));
+
+  EXPECT_EQ(original, deserialized);
+}
+
+TEST(HostResolverMojomTraitsTest, DnsConfigOverrides_BadInt) {
+  mojom::DnsConfigOverridesPtr overrides = mojom::DnsConfigOverrides::New();
+  overrides->ndots = -10;
+
+  std::vector<uint8_t> serialized =
+      mojom::DnsConfigOverrides::Serialize(&overrides);
+
+  net::DnsConfigOverrides deserialized;
+  EXPECT_FALSE(
+      mojom::DnsConfigOverrides::Deserialize(serialized, &deserialized));
+}
+
+TEST(HostResolverMojomTraitsTest, DnsConfigOverrides_NonUniqueHostKeys) {
+  mojom::DnsConfigOverridesPtr overrides = mojom::DnsConfigOverrides::New();
+  overrides->hosts.emplace();
+
+  // Create two different entries that share the key ("host", IPV4).
+  mojom::DnsHostPtr host_entry1 = mojom::DnsHost::New();
+  host_entry1->hostname = "host";
+  host_entry1->address = net::IPAddress(1, 1, 1, 1);
+  overrides->hosts.value().push_back(std::move(host_entry1));
+
+  mojom::DnsHostPtr host_entry2 = mojom::DnsHost::New();
+  host_entry2->hostname = "host";
+  host_entry2->address = net::IPAddress(2, 2, 2, 2);
+  overrides->hosts.value().push_back(std::move(host_entry2));
+
+  std::vector<uint8_t> serialized =
+      mojom::DnsConfigOverrides::Serialize(&overrides);
+
+  net::DnsConfigOverrides deserialized;
+  EXPECT_FALSE(
+      mojom::DnsConfigOverrides::Deserialize(serialized, &deserialized));
+}
+
+}  // namespace
+}  // namespace network
diff --git a/services/network/public/mojom/host_resolver.mojom b/services/network/public/mojom/host_resolver.mojom
index 400a9fc..8bd8761 100644
--- a/services/network/public/mojom/host_resolver.mojom
+++ b/services/network/public/mojom/host_resolver.mojom
@@ -4,10 +4,83 @@
 

 module network.mojom;

 

+import "mojo/public/mojom/base/time.mojom";

 import "net/interfaces/address_list.mojom";

+import "net/interfaces/ip_address.mojom";

+import "net/interfaces/ip_endpoint.mojom";

 import "services/network/public/mojom/network_param.mojom";

 import "services/network/public/mojom/url_loader.mojom";

 

+// A single entry from a HOSTS file.

+struct DnsHost {

+  string hostname;

+  net.interfaces.IPAddress address;

+};

+

+// An HTTPS server to send DNS queries to, per the DNS Queries over HTTPS spec.
+// spec:  https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-12
+struct DnsOverHttpsServer {
+  // DNS over HTTPS server URI template. Must be HTTPS.
+  string server_template;
+
+  // Whether to use POST to do DNS lookups. Otherwise, GET is used. See spec
+  // for more details.
+  bool use_post = false;
+};

+

+// Overridable DNS configuration values for host resolution. All fields default

+// to a non-overriding state where the relevant value will be used from system

+// DNS configuration.

+struct DnsConfigOverrides {

+  // Representation of an optional boolean. Needed because Mojo does not support

+  // optional primitive types.

+  enum Tristate {

+    NO_OVERRIDE,

+    TRISTATE_TRUE,

+    TRISTATE_FALSE,

+  };

+

+  // List of nameserver addresses.

+  array<net.interfaces.IPEndPoint>? nameservers;

+

+  // Suffix search list, used on first lookup when number of dots in given name
+  // is less than |ndots|.

+  array<string>? search;

+

+  // Entries from a HOSTS file. This array is intended for serialization to/from

+  // a lookup map, so unlike the source data from actual HOSTS files, each entry

+  // should represent a unique host query key (|hostname| and AddressFamily).

+  array<DnsHost>? hosts;

+

+  // Whether suffix search should be performed for multi-label names.

+  Tristate append_to_multi_label_name = Tristate.NO_OVERRIDE;

+

+  // Whether source port randomization is required. This uses additional
+  // resources on some platforms.

+  Tristate randomize_ports = Tristate.NO_OVERRIDE;

+

+  // Minimum number of dots before global resolution precedes |search|.

+  int8 ndots = -1;  // -1 for no override.

+

+  // Time between retransmissions, see res_state.retrans.

+  mojo_base.mojom.TimeDelta? timeout;

+

+  // Maximum number of attempts, see res_state.retry.

+  int32 attempts = -1;  // -1 for no override.

+

+  // Whether to roundrobin entries in |nameservers| for subsequent requests.

+  Tristate rotate = Tristate.NO_OVERRIDE;

+

+  // Whether system configuration uses local IPv6 connectivity, e.g.,
+  // DirectAccess. This is exposed for HostResolver to skip IPv6 probes,
+  // as it may cause them to return incorrect results.

+  Tristate use_local_ipv6 = Tristate.NO_OVERRIDE;

+

+  // List of servers to query over HTTPS, queried in order
+  // (https://tools.ietf.org/id/draft-ietf-doh-dns-over-https-12.txt).

+  array<DnsOverHttpsServer>? dns_over_https_servers;

+};

+

 // Control handle used to control outstanding NetworkContext::ResolveHost
 // requests. Handle is optional for all requests, and may be closed at any time
 // without affecting the request.
diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
index d06a4dd2..5e5d35b6 100644
--- a/services/network/public/mojom/network_context.mojom
+++ b/services/network/public/mojom/network_context.mojom
@@ -601,6 +601,10 @@
   // Creates a HostResolver interface that can be passed to code/processes
   // without direct access to NetworkContext to make ResolveHost requests.
   //
+  // If set, |config_overrides| will override configuration read from the system
+  // DNS configuration when resolution is performed using the built-in resolver
+  // (which can be forced using ResolveHostParameters::source = Source.DNS).
+  //
   // If this NetworkContext is destroyed, all outstanding requests from child
   // HostResolvers will be cancelled. Such requests will receive ERR_FAILED via
   // |response_client|.
@@ -608,7 +612,8 @@
   // TODO(crbug.com/821021): If necessary as usage and functionality is added to
   // the contained ResolveHost method, consider adding the ability for this to
   // be a restricted resolver with some functionality disabled (eg maybe MDNS).
-  CreateHostResolver(HostResolver& host_resolver);
+  CreateHostResolver(DnsConfigOverrides? config_overrides,
+                     HostResolver& host_resolver);
 
   // Caches |data| associated with |url| and |expected_response_time| in the
   // HttpCache related to this NetworkContext.
diff --git a/services/network/public/mojom/network_service.mojom b/services/network/public/mojom/network_service.mojom
index 1d2cbe76..7413d04d 100644
--- a/services/network/public/mojom/network_service.mojom
+++ b/services/network/public/mojom/network_service.mojom
@@ -10,6 +10,7 @@
 import "mojo/public/mojom/base/string16.mojom";
 import "mojo/public/mojom/base/values.mojom";
 import "services/network/public/mojom/cookie_manager.mojom";
+import "services/network/public/mojom/host_resolver.mojom";
 import "services/network/public/mojom/net_log.mojom";
 import "services/network/public/mojom/network_change_manager.mojom";
 import "services/network/public/mojom/network_context.mojom";
@@ -147,17 +148,6 @@
                   int64 sent_bytes);
 };
 
-// An HTTPS server to send DNS queries to, per the DNS Queries over HTTPS spec.
-// spec:  https://tools.ietf.org/html/draft-ietf-doh-dns-over-https-12
- struct DnsOverHttpsServer {
-  // DNS over HTTPS server URI template. Must be HTTPS.
-  string server_template;
-
-  // Whether to use POST to do DNS lookups. Otherwise, GET is used. See spec
-  // for more details.
-  bool use_post = false;
-};
-
 // Values for configuring HTTP authentication that can only be set once.
 struct HttpAuthStaticParams {
   // List of supported auth schemes. Unrecognized schemes are ignored.
diff --git a/services/network/resource_scheduler_params_manager.cc b/services/network/resource_scheduler_params_manager.cc
index f363f2a..2ad854a 100644
--- a/services/network/resource_scheduler_params_manager.cc
+++ b/services/network/resource_scheduler_params_manager.cc
@@ -12,15 +12,121 @@
 #include "net/nqe/network_quality_estimator.h"
 #include "services/network/public/cpp/features.h"
 
+namespace network {
+
 namespace {
 
 // The maximum number of delayable requests to allow to be in-flight at any
 // point in time (across all hosts).
 static const size_t kDefaultMaxNumDelayableRequestsPerClient = 10;
 
-}  // namespace
+// Reads experiment parameters and returns them.
+ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer
+GetParamsForNetworkQualityContainer() {
+  // Look for configuration parameters with sequential numeric suffixes, and
+  // stop looking after the first failure to find an experimetal parameter.
+  // A sample configuration is given below:
+  // "EffectiveConnectionType1": "Slow-2G",
+  // "MaxDelayableRequests1": "6",
+  // "NonDelayableWeight1": "2.0",
+  // "EffectiveConnectionType2": "3G",
+  // "MaxDelayableRequests2": "12",
+  // "NonDelayableWeight2": "3.0",
+  // This config implies that when Effective Connection Type (ECT) is Slow-2G,
+  // then the maximum number of non-delayable requests should be
+  // limited to 6, and the non-delayable request weight should be set to 2.
+  // When ECT is 3G, it should be limited to 12. For all other values of ECT,
+  // the default values are used.
+  static const char kMaxDelayableRequestsBase[] = "MaxDelayableRequests";
+  static const char kEffectiveConnectionTypeBase[] = "EffectiveConnectionType";
+  static const char kNonDelayableWeightBase[] = "NonDelayableWeight";
 
-namespace network {
+  ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer result;
+  // Set the default params for networks with ECT Slow2G and 2G. These params
+  // can still be overridden using the field trial.
+  result.emplace(std::make_pair(
+      net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G,
+      ResourceSchedulerParamsManager::ParamsForNetworkQuality(8, 3.0, false)));
+  result.emplace(std::make_pair(
+      net::EFFECTIVE_CONNECTION_TYPE_2G,
+      ResourceSchedulerParamsManager::ParamsForNetworkQuality(8, 3.0, false)));
+
+  for (int config_param_index = 1; config_param_index <= 20;
+       ++config_param_index) {
+    size_t max_delayable_requests;
+
+    if (!base::StringToSizeT(base::GetFieldTrialParamValueByFeature(
+                                 features::kThrottleDelayable,
+                                 kMaxDelayableRequestsBase +
+                                     base::IntToString(config_param_index)),
+                             &max_delayable_requests)) {
+      break;
+    }
+
+    base::Optional<net::EffectiveConnectionType> effective_connection_type =
+        net::GetEffectiveConnectionTypeForName(
+            base::GetFieldTrialParamValueByFeature(
+                features::kThrottleDelayable,
+                kEffectiveConnectionTypeBase +
+                    base::IntToString(config_param_index)));
+    DCHECK(effective_connection_type.has_value());
+
+    double non_delayable_weight = base::GetFieldTrialParamByFeatureAsDouble(
+        features::kThrottleDelayable,
+        kNonDelayableWeightBase + base::IntToString(config_param_index), 0.0);
+
+    // Check if the entry is already present. This will happen if the default
+    // params are being overridden by the field trial.
+    ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer::iterator
+        iter = result.find(effective_connection_type.value());
+    if (iter != result.end()) {
+      iter->second.max_delayable_requests = max_delayable_requests;
+      iter->second.non_delayable_weight = non_delayable_weight;
+    } else {
+      result.emplace(std::make_pair(
+          effective_connection_type.value(),
+          ResourceSchedulerParamsManager::ParamsForNetworkQuality(
+              max_delayable_requests, non_delayable_weight, false)));
+    }
+  }
+
+  // Next, read the experiments params for
+  // DelayRequestsOnMultiplexedConnections finch experiment, and modify |result|
+  // based on the experiment params.
+  if (base::FeatureList::IsEnabled(
+          features::kDelayRequestsOnMultiplexedConnections)) {
+    base::Optional<net::EffectiveConnectionType> max_effective_connection_type =
+        net::GetEffectiveConnectionTypeForName(
+            base::GetFieldTrialParamValueByFeature(
+                features::kDelayRequestsOnMultiplexedConnections,
+                "MaxEffectiveConnectionType"));
+
+    if (!max_effective_connection_type) {
+      // Use a default value if one is not set using field trial params.
+      max_effective_connection_type = net::EFFECTIVE_CONNECTION_TYPE_3G;
+    }
+
+    for (int ect = net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G;
+         ect <= max_effective_connection_type.value(); ++ect) {
+      net::EffectiveConnectionType effective_connection_type =
+          static_cast<net::EffectiveConnectionType>(ect);
+      ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer::iterator
+          iter = result.find(effective_connection_type);
+      if (iter != result.end()) {
+        iter->second.delay_requests_on_multiplexed_connections = true;
+      } else {
+        result.emplace(std::make_pair(
+            effective_connection_type,
+            ResourceSchedulerParamsManager::ParamsForNetworkQuality(
+                kDefaultMaxNumDelayableRequestsPerClient, 0.0, true)));
+      }
+    }
+  }
+
+  return result;
+}
+
+}  // namespace
 
 ResourceSchedulerParamsManager::ParamsForNetworkQuality::
     ParamsForNetworkQuality()
@@ -39,9 +145,7 @@
           delay_requests_on_multiplexed_connections) {}
 
 ResourceSchedulerParamsManager::ResourceSchedulerParamsManager()
-    : ResourceSchedulerParamsManager(
-          GetParamsForDelayRequestsOnMultiplexedConnections(
-              GetParamsForNetworkQualityContainer())) {}
+    : ResourceSchedulerParamsManager(GetParamsForNetworkQualityContainer()) {}
 
 ResourceSchedulerParamsManager::ResourceSchedulerParamsManager(
     const ParamsForNetworkQualityContainer&
@@ -70,102 +174,4 @@
                                  false);
 }
 
-// static
-ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer
-ResourceSchedulerParamsManager::
-    GetParamsForDelayRequestsOnMultiplexedConnections(
-        ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer
-            result) {
-  if (!base::FeatureList::IsEnabled(
-          features::kDelayRequestsOnMultiplexedConnections)) {
-    return result;
-  }
-
-  base::Optional<net::EffectiveConnectionType> max_effective_connection_type =
-      net::GetEffectiveConnectionTypeForName(
-          base::GetFieldTrialParamValueByFeature(
-              features::kDelayRequestsOnMultiplexedConnections,
-              "MaxEffectiveConnectionType"));
-
-  if (!max_effective_connection_type) {
-    // Use a default value if one is not set using field trial params.
-    max_effective_connection_type = net::EFFECTIVE_CONNECTION_TYPE_3G;
-  }
-
-  for (int ect = net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G;
-       ect <= max_effective_connection_type.value(); ++ect) {
-    net::EffectiveConnectionType effective_connection_type =
-        static_cast<net::EffectiveConnectionType>(ect);
-    ParamsForNetworkQualityContainer::iterator iter =
-        result.find(effective_connection_type);
-    if (iter != result.end()) {
-      iter->second.delay_requests_on_multiplexed_connections = true;
-    } else {
-      result.emplace(std::make_pair(
-          effective_connection_type,
-          ParamsForNetworkQuality(kDefaultMaxNumDelayableRequestsPerClient, 0.0,
-                                  true)));
-    }
-  }
-  return result;
-}
-
-// static
-ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer
-ResourceSchedulerParamsManager::GetParamsForNetworkQualityContainer() {
-  static const char kMaxDelayableRequestsBase[] = "MaxDelayableRequests";
-  static const char kEffectiveConnectionTypeBase[] = "EffectiveConnectionType";
-  static const char kNonDelayableWeightBase[] = "NonDelayableWeight";
-
-  ResourceSchedulerParamsManager::ParamsForNetworkQualityContainer result;
-  // Set the default params for networks with ECT Slow2G and 2G. These params
-  // can still be overridden using the field trial.
-  result.emplace(std::make_pair(net::EFFECTIVE_CONNECTION_TYPE_SLOW_2G,
-                                ParamsForNetworkQuality(8, 3.0, false)));
-  result.emplace(std::make_pair(net::EFFECTIVE_CONNECTION_TYPE_2G,
-                                ParamsForNetworkQuality(8, 3.0, false)));
-
-  for (int config_param_index = 1; config_param_index <= 20;
-       ++config_param_index) {
-    size_t max_delayable_requests;
-
-    if (!base::StringToSizeT(base::GetFieldTrialParamValueByFeature(
-                                 features::kThrottleDelayable,
-                                 kMaxDelayableRequestsBase +
-                                     base::IntToString(config_param_index)),
-                             &max_delayable_requests)) {
-      return result;
-    }
-
-    base::Optional<net::EffectiveConnectionType> effective_connection_type =
-        net::GetEffectiveConnectionTypeForName(
-            base::GetFieldTrialParamValueByFeature(
-                features::kThrottleDelayable,
-                kEffectiveConnectionTypeBase +
-                    base::IntToString(config_param_index)));
-    DCHECK(effective_connection_type.has_value());
-
-    double non_delayable_weight = base::GetFieldTrialParamByFeatureAsDouble(
-        features::kThrottleDelayable,
-        kNonDelayableWeightBase + base::IntToString(config_param_index), 0.0);
-
-    // Check if the entry is already present. This will happen if the default
-    // params are being overridden by the field trial.
-    ParamsForNetworkQualityContainer::iterator iter =
-        result.find(effective_connection_type.value());
-    if (iter != result.end()) {
-      iter->second.max_delayable_requests = max_delayable_requests;
-      iter->second.non_delayable_weight = non_delayable_weight;
-    } else {
-      result.emplace(
-          std::make_pair(effective_connection_type.value(),
-                         ParamsForNetworkQuality(max_delayable_requests,
-                                                 non_delayable_weight, false)));
-    }
-  }
-  // There should not have been more than 20 params indices specified.
-  NOTREACHED();
-  return result;
-}
-
 }  // namespace network
diff --git a/services/network/resource_scheduler_params_manager.h b/services/network/resource_scheduler_params_manager.h
index 40249bc1..76d37be 100644
--- a/services/network/resource_scheduler_params_manager.h
+++ b/services/network/resource_scheduler_params_manager.h
@@ -73,31 +73,6 @@
   }
 
  private:
-  // Reads the experiments params for DelayRequestsOnMultiplexedConnections
-  // finch experiment, modifies |result| based on the experiment params, and
-  // returns the modified |result|.
-  static ParamsForNetworkQualityContainer
-  GetParamsForDelayRequestsOnMultiplexedConnections(
-      ParamsForNetworkQualityContainer result);
-
-  // Reads experiment parameters and populates
-  // |params_for_network_quality_container_|. It looks for configuration
-  // parameters with sequential numeric suffixes, and stops looking after the
-  // first failure to find an experimetal parameter. A sample configuration is
-  // given below:
-  // "EffectiveConnectionType1": "Slow-2G",
-  // "MaxDelayableRequests1": "6",
-  // "NonDelayableWeight1": "2.0",
-  // "EffectiveConnectionType2": "3G",
-  // "MaxDelayableRequests2": "12",
-  // "NonDelayableWeight2": "3.0",
-  // This config implies that when Effective Connection Type (ECT) is Slow-2G,
-  // then the maximum number of non-delayable requests should be
-  // limited to 6, and the non-delayable request weight should be set to 2.
-  // When ECT is 3G, it should be limited to 12. For all other values of ECT,
-  // the default values are used.
-  static ParamsForNetworkQualityContainer GetParamsForNetworkQualityContainer();
-
   // The number of delayable requests in-flight for different ranges of the
   // network quality.
   ParamsForNetworkQualityContainer params_for_network_quality_container_;
diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
index 33a699fb..a5f14b8 100644
--- a/services/network/test/test_network_context.h
+++ b/services/network/test/test_network_context.h
@@ -115,7 +115,9 @@
   void ResolveHost(const net::HostPortPair& host,
                    mojom::ResolveHostParametersPtr optional_parameters,
                    mojom::ResolveHostClientPtr response_client) override {}
-  void CreateHostResolver(mojom::HostResolverRequest request) override {}
+  void CreateHostResolver(
+      const base::Optional<net::DnsConfigOverrides>& config_overrides,
+      mojom::HostResolverRequest request) override {}
   void WriteCacheMetadata(const GURL& url,
                           net::RequestPriority priority,
                           base::Time expected_response_time,
diff --git a/services/service_manager/sandbox/mac/cdm.sb b/services/service_manager/sandbox/mac/cdm.sb
index a7ba200..69d157d7 100644
--- a/services/service_manager/sandbox/mac/cdm.sb
+++ b/services/service_manager/sandbox/mac/cdm.sb
@@ -8,7 +8,6 @@
 (allow file-read* (extension "com.apple.app-sandbox.read"))
 
 ; Allow to read framework and CDM resources files for CDM host verification
-(define bundle-version-path "BUNDLE_VERSION_PATH")
 (allow file-read* (subpath (param bundle-version-path)))
 
 ; mach IPC
diff --git a/services/service_manager/sandbox/mac/common.sb b/services/service_manager/sandbox/mac/common.sb
index 0e90c9ab..51f6a4b9 100644
--- a/services/service_manager/sandbox/mac/common.sb
+++ b/services/service_manager/sandbox/mac/common.sb
@@ -14,6 +14,7 @@
 (define (param-defined? str) (string? (param str)))
 
 ; Define constants for all of the parameter strings passed in.
+(define bundle-version-path "BUNDLE_VERSION_PATH")
 (define disable-sandbox-denial-logging "DISABLE_SANDBOX_DENIAL_LOGGING")
 (define enable-logging "ENABLE_LOGGING")
 (define homedir-as-literal "USER_HOMEDIR_AS_LITERAL")
diff --git a/services/service_manager/sandbox/mac/gpu.sb b/services/service_manager/sandbox/mac/gpu.sb
index 576976f0..619e630 100644
--- a/services/service_manager/sandbox/mac/gpu.sb
+++ b/services/service_manager/sandbox/mac/gpu.sb
@@ -28,4 +28,7 @@
   (allow file-read* (subpath "/System/Library/Extensions")))
 
 ; Needed for VideoToolbox usage - https://crbug.com/767037
-(allow mach-lookup (global-name "com.apple.coremedia.videodecoder"))
\ No newline at end of file
+(allow mach-lookup (global-name "com.apple.coremedia.videodecoder"))
+
+; Needed for GPU process to fallback to SwiftShader - https://crbug.com/897914
+(allow file-read-data file-read-metadata (subpath (param bundle-version-path)))
diff --git a/services/service_manager/sandbox/mac/sandbox_mac.mm b/services/service_manager/sandbox/mac/sandbox_mac.mm
index 36b90f6..df34f4d 100644
--- a/services/service_manager/sandbox/mac/sandbox_mac.mm
+++ b/services/service_manager/sandbox/mac/sandbox_mac.mm
@@ -242,7 +242,8 @@
   if (!compiler.InsertBooleanParam(kSandboxMacOS1013, macos_1013))
     return false;
 
-  if (sandbox_type == service_manager::SANDBOX_TYPE_CDM) {
+  if (sandbox_type == service_manager::SANDBOX_TYPE_CDM ||
+      sandbox_type == service_manager::SANDBOX_TYPE_GPU) {
     base::FilePath bundle_path = SandboxMac::GetCanonicalPath(
         base::mac::FrameworkBundlePath().DirName());
     if (!compiler.InsertStringParam(kSandboxBundleVersionPath,
diff --git a/testing/buildbot/chromium.goma.json b/testing/buildbot/chromium.goma.json
index 266c900..cf9c7ce1 100644
--- a/testing/buildbot/chromium.goma.json
+++ b/testing/buildbot/chromium.goma.json
@@ -134,6 +134,25 @@
       }
     ]
   },
+  "Chromium Mac Goma RBE Staging (clobber)": {
+    "additional_compile_targets": [
+      "all"
+    ],
+    "gtest_tests": [
+      {
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        },
+        "test": "base_unittests"
+      },
+      {
+        "swarming": {
+          "can_use_on_swarming_builders": true
+        },
+        "test": "content_unittests"
+      }
+    ]
+  },
   "Chromium Mac Goma Staging": {
     "additional_compile_targets": [
       "all"
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl
index 0b8916e3..b59fc75f 100644
--- a/testing/buildbot/waterfalls.pyl
+++ b/testing/buildbot/waterfalls.pyl
@@ -1581,6 +1581,14 @@
           'gtest_tests': 'goma_gtests',
         },
       },
+      'Chromium Mac Goma RBE Staging (clobber)': {
+        'additional_compile_targets': [
+          'all',
+        ],
+        'test_suites': {
+          'gtest_tests': 'goma_gtests',
+        },
+      },
       'Chromium Mac Goma Staging': {
         'additional_compile_targets': [
           'all',
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json
index 15e9398..529a2da 100644
--- a/testing/variations/fieldtrial_testing_config.json
+++ b/testing/variations/fieldtrial_testing_config.json
@@ -5538,6 +5538,25 @@
             ]
         }
     ],
+    "WorkStealingInScriptRunner": [
+        {
+            "platforms": [
+                "android",
+                "chromeos",
+                "linux",
+                "mac",
+                "windows"
+            ],
+            "experiments": [
+                {
+                    "name": "Enabled2",
+                    "enable_features": [
+                        "WorkStealingInScriptRunner"
+                    ]
+                }
+            ]
+        }
+    ],
     "use-new-media-cache": [
         {
             "platforms": [
diff --git a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
index 8f443cf..52d469f 100644
--- a/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
+++ b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
@@ -26,7 +26,7 @@
 
 # text-overflow:ellipsis and paint fragment
 crbug.com/873957 accessibility/ellipsis-text.html [ Failure ]
-crbug.com/873957 fast/css/getComputedStyle/getComputedStyle-text-overflow.html [ Failure Pass ]
+crbug.com/873957 fast/css/getComputedStyle/getComputedStyle-text-overflow.html [ Failure ]
 crbug.com/873957 http/tests/devtools/network/network-cookies-pane.js [ Failure ]
 
 # rightsizing-grid.html is truly flaky, show flakiness on reload
@@ -54,10 +54,19 @@
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-vlr-in-htb-001.xht [ Pass ]
 crbug.com/626703 external/wpt/css/css-writing-modes/sizing-orthog-vlr-in-htb-004.xht [ Pass ]
 crbug.com/591099 external/wpt/css/css-writing-modes/two-levels-of-orthogonal-flows-percentage.html [ Pass ]
-crbug.com/855279 fast/css/text-overflow-ellipsis-vertical-hittest.html [ Failure Pass ]
+crbug.com/855279 fast/css/text-overflow-ellipsis-vertical-hittest.html [ Failure ]
 crbug.com/591099 fast/dom/nodesFromRect/nodesFromRect-basic.html [ Failure ]
 
 # New failures are appended below by the script.
+crbug.com/591099 accessibility/aom-relation-list-properties.html [ Failure ]
+crbug.com/591099 accessibility/aria-labelledby-stay-within.html [ Failure ]
+crbug.com/591099 accessibility/aria-owns.html [ Failure ]
+crbug.com/591099 accessibility/aria-tab-roles.html [ Failure ]
+crbug.com/591099 accessibility/focusable-div.html [ Failure ]
+crbug.com/591099 accessibility/listitem-presentation-inherited.html [ Failure ]
+crbug.com/591099 accessibility/name-calc-aria-owns.html [ Failure ]
+crbug.com/591099 accessibility/presentation-owned-elements.html [ Failure ]
+crbug.com/591099 accessibility/role-attribute.html [ Failure ]
 crbug.com/728378 compositing/culling/tile-occlusion-boundaries.html [ Failure ]
 crbug.com/864398 compositing/iframes/floating-self-painting-frame.html [ Failure ]
 crbug.com/591099 css3/filters/composited-layer-child-bounds-after-composited-to-sw-shadow-change.html [ Failure ]
@@ -254,6 +263,9 @@
 crbug.com/591099 external/wpt/service-workers/service-worker/update-after-navigation-redirect.https.html [ Pass ]
 crbug.com/591099 external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Pass ]
 crbug.com/591099 external/wpt/webrtc/RTCPeerConnection-setLocalDescription-answer.html [ Pass ]
+crbug.com/591099 external/wpt/workers/Worker_cross_origin_security_err.htm [ Pass ]
+crbug.com/591099 external/wpt/workers/constructors/SharedWorker/same-origin.html [ Pass ]
+crbug.com/591099 external/wpt/workers/constructors/Worker/same-origin.html [ Pass ]
 crbug.com/591099 external/wpt/xhr/send-content-type-string.htm [ Pass ]
 crbug.com/591099 external/wpt/xhr/send-entity-body-document.htm [ Pass ]
 crbug.com/591099 fast/backgrounds/quirks-mode-line-box-backgrounds.html [ Failure ]
@@ -265,14 +277,13 @@
 crbug.com/591099 fast/css-intrinsic-dimensions/height-positioned.html [ Pass ]
 crbug.com/807708 fast/css-intrinsic-dimensions/width-avoid-floats.html [ Failure ]
 crbug.com/591099 fast/css/absolute-inline-alignment-2.html [ Pass ]
-crbug.com/591099 fast/css/case-transform.html [ Failure Pass ]
 crbug.com/835484 fast/css/focus-ring-recursive-continuations.html [ Failure ]
 crbug.com/835484 fast/css/outline-narrowLine.html [ Failure ]
 crbug.com/591099 fast/css3-text/css3-text-decoration/text-underline-position/text-underline-position-under.html [ Failure ]
 crbug.com/591099 fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
-crbug.com/591099 fast/events/touch/gesture/touch-gesture-scroll-input-field.html [ Failure Pass ]
 crbug.com/591099 fast/events/wheel/mainthread-touchpad-fling-latching.html [ Pass ]
 crbug.com/591099 fast/events/wheel/wheel-scroll-latching-on-scrollbar.html [ Pass ]
+crbug.com/591099 fast/forms/textarea/basic-textareas-quirks.html [ Failure ]
 crbug.com/889721 fast/inline/continuation-outlines-with-layers.html [ Failure ]
 crbug.com/889721 fast/inline/continuation-outlines.html [ Failure ]
 crbug.com/835484 fast/inline/inline-focus-ring-under-absolute-enclosing-relative-div.html [ Failure ]
@@ -310,6 +321,7 @@
 crbug.com/591099 http/tests/devtools/network/network-datareceived.js [ Failure ]
 crbug.com/591099 http/tests/devtools/network/network-datasaver-warning.js [ Failure ]
 crbug.com/591099 http/tests/devtools/persistence/persistence-merge-editor-tabs.js [ Failure ]
+crbug.com/591099 http/tests/devtools/service-workers/service-worker-v8-cache.js [ Failure Pass ]
 crbug.com/591099 http/tests/images/restyle-decode-error.html [ Failure ]
 crbug.com/591099 http/tests/intersection-observer/v2/cross-origin-effects.html [ Failure ]
 crbug.com/591099 http/tests/intersection-observer/v2/cross-origin-occlusion.html [ Failure ]
@@ -318,10 +330,13 @@
 crbug.com/591099 http/tests/security/cors-rfc1918/addressspace-document-appcache.https.html [ Crash Failure ]
 crbug.com/591099 http/tests/security/cors-rfc1918/addressspace-document-csp-appcache.https.html [ Crash Failure Pass ]
 crbug.com/591099 http/tests/security/setDomainRelaxationForbiddenForURLScheme.html [ Crash ]
-crbug.com/591099 idle-callback/test-runner-run-idle-tasks.html [ Crash Pass Timeout ]
+crbug.com/591099 idle-callback/test-runner-run-idle-tasks.html [ Crash Pass ]
 crbug.com/591099 images/color-profile-image-filter-all.html [ Failure ]
+crbug.com/591099 inspector-protocol/accessibility/accessibility-ignoredNodes.js [ Failure ]
+crbug.com/591099 inspector-protocol/accessibility/accessibility-nameSources-labelledby.js [ Failure ]
 crbug.com/591099 inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-pseudo-element.js [ Failure ]
 crbug.com/714962 inspector-protocol/layout-fonts/languages-emoji-rare-glyphs.js [ Failure ]
+crbug.com/591099 inspector-protocol/runtime/runtime-console-log-handle-navigate.js [ Pass ]
 crbug.com/591099 inspector-protocol/timeline/page-frames.js [ Failure ]
 crbug.com/591099 intersection-observer/v2/text-shadow.html [ Failure ]
 crbug.com/591099 paint/float/float-under-inline-self-painting-change.html [ Failure ]
@@ -357,10 +372,10 @@
 crbug.com/591099 printing/absolute-position-headers-and-footers.html [ Failure ]
 crbug.com/591099 printing/iframe-svg-in-object-print.html [ Failure ]
 crbug.com/591099 scrollbars/auto-scrollbar-fit-content.html [ Failure ]
-crbug.com/591099 storage/indexeddb/mozilla/test_objectStore_openKeyCursor.html [ Pass ]
+crbug.com/591099 storage/indexeddb/mozilla/test_objectStore_openKeyCursor.html [ Pass Timeout ]
 crbug.com/591099 storage/indexeddb/objectstore-cursor.html [ Pass ]
-crbug.com/591099 svg/hixie/error/013.xml [ Failure ]
-crbug.com/591099 svg/transforms/svg-css-transforms.xhtml [ Failure ]
+crbug.com/591099 svg/hixie/error/013.xml [ Failure Pass ]
+crbug.com/591099 svg/transforms/svg-css-transforms.xhtml [ Failure Pass ]
 crbug.com/591099 svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-svg-float-border-padding.xml [ Failure ]
 crbug.com/591099 svg/zoom/page/zoom-svg-through-object-with-absolute-size-2.xhtml [ Failure ]
@@ -373,14 +388,16 @@
 crbug.com/591099 tables/mozilla/bugs/bug50695-2.html [ Failure ]
 crbug.com/591099 tables/mozilla/bugs/bug55527.html [ Failure ]
 crbug.com/591099 transforms/3d/general/perspective-units.html [ Failure ]
-crbug.com/591099 transforms/svg-vs-css.xhtml [ Failure ]
+crbug.com/591099 transforms/svg-vs-css.xhtml [ Failure Pass ]
 crbug.com/870008 virtual/android/rootscroller/position-fixed-in-unscrollable-document-iframe.html [ Failure Pass ]
-crbug.com/870008 virtual/android/rootscroller/position-fixed-in-unscrollable-document.html [ Failure Pass ]
+crbug.com/870008 virtual/android/rootscroller/position-fixed-in-unscrollable-document.html [ Failure ]
+crbug.com/591099 virtual/android/url-bar/bottom-and-top-fixed-sticks-to-top.html [ Failure Pass ]
 crbug.com/591099 virtual/exotic-color-space/ [ Skip ]
 crbug.com/591099 virtual/feature-policy-vibrate/ [ Skip ]
 crbug.com/591099 virtual/gpu-rasterization/images/color-profile-image-filter-all.html [ Failure ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-blending-color-over-image.html [ Pass ]
 crbug.com/591099 virtual/gpu/fast/canvas/canvas-blending-gradient-over-pattern.html [ Pass Timeout ]
+crbug.com/591099 virtual/gpu/fast/canvas/canvas-with-overflowing-object-fit.html [ Pass ]
 crbug.com/591099 virtual/intersection-observer-v2/intersection-observer/v2/text-shadow.html [ Failure ]
 crbug.com/591099 virtual/layout_ng/ [ Skip ]
 crbug.com/824918 virtual/layout_ng_experimental/ [ Skip ]
@@ -418,4 +435,5 @@
 crbug.com/591099 virtual/user-activation-v2/fast/events/mouse-cursor.html [ Failure ]
 crbug.com/591099 virtual/user-activation-v2/fast/events/touch/compositor-touch-hit-rects.html [ Failure ]
 crbug.com/591099 virtual/user-activation-v2/fast/events/touch/gesture/touch-gesture-scroll-input-field.html [ Failure Pass ]
+crbug.com/591099 virtual/video-surface-layer/media/stable/video-object-fit-stable.html [ Pass ]
 crbug.com/591099 virtual/webrtc-wpt-unified-plan/external/wpt/webrtc/RTCDTMFSender-ontonechange.https.html [ Pass ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 15da024c..ddaf0f54 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -647,6 +647,7 @@
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-034.xht [ Skip ]
 crbug.com/635619 virtual/layout_ng/external/wpt/css/CSS2/positioning/position-relative-036.xht [ Skip ]
 
+crbug.com/829028 virtual/layout_ng_experimental/external/wpt/css/css-multicol/filter-with-abspos.html [ Failure ]
 crbug.com/829028 virtual/layout_ng_experimental/external/wpt/css/css-multicol/going-out-of-flow-after-spanner.html [ Failure ]
 crbug.com/829028 virtual/layout_ng_experimental/external/wpt/css/css-multicol/inline-block-and-column-span-all.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/external/wpt/css/css-multicol/multicol-basic-001.html [ Failure ]
@@ -877,8 +878,6 @@
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/first-line-in-float-with-margin.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/fixedpos-child-becomes-static.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/flexbox.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/flexbox-starts-at-column-boundary.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/flexbox-starts-at-column-boundary-with-block.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/flexbox-with-overflow-auto-child-crash.html [ Crash ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/flipped-blocks-border-after.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/flipped-blocks-hit-test.html [ Failure ]
@@ -888,7 +887,6 @@
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-break.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-content-break.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-edge.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-margin-at-row-boundary-fixed-multicol-height.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-margin-at-row-boundary.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-moved-by-child-line-and-unbreakable.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/float-paginate-empty-lines.html [ Failure ]
@@ -929,6 +927,7 @@
 crbug.com/714962 virtual/layout_ng_experimental/fast/multicol/multicol-becomes-abspos-crash.html [ Failure ]
 crbug.com/626703 virtual/layout_ng_experimental/fast/multicol/multicol-becomes-paged-auto-height.html [ Crash Pass ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/multicol-with-child-renderLayer-for-input.html [ Failure ]
+crbug.com/829028 virtual/layout_ng_experimental/fast/multicol/multicol-with-spanner-becomes-paged.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/nested-3-multicols-fixed-height.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/nested-auto-height-extra-block-inbetween.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/nested-auto-height.html [ Failure ]
@@ -1070,9 +1069,6 @@
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/span/with-border.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/static-child-becomes-fixedpos.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/svg-change-column-crash.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/table-caption-and-cells-fixed-width.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/table-caption-and-cells.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/table-caption-with-block.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/table-cell-content-change.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/table-cell-content-change-with-decorations.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/table-margin-collapse.html [ Failure ]
@@ -1133,7 +1129,7 @@
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/vertical-rl/unsplittable-inline-block.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/widows-and-orphans.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/multicol/widows.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/auto-height.html [ Crash Pass ]
+crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/auto-height.html [ Crash Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/auto-height-with-break.html [ Failure ]
 crbug.com/879467 virtual/layout_ng_experimental/fast/pagination/body-make-paginated-table-abspos-crash.html [ Crash ]
 crbug.com/591099 virtual/layout_ng_experimental/fast/pagination/break-in-paged-overflow.html [ Failure ]
@@ -1182,7 +1178,6 @@
 crbug.com/591099 virtual/layout_ng_experimental/fragmentation/float-margin-top.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fragmentation/float-pushed-to-next-fragmentainer-by-floats.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fragmentation/forced-break-clearance-unsplittable-content.html [ Failure ]
-crbug.com/591099 virtual/layout_ng_experimental/fragmentation/foreignobject-no-pagination.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-rowspan-alignment.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-rowspan.html [ Failure ]
 crbug.com/591099 virtual/layout_ng_experimental/fragmentation/fragmented-table-cell.html [ Failure ]
@@ -3978,7 +3973,7 @@
 # This test times out on debug builds, see https://crbug.com/755810
 crbug.com/626703 [ Debug ] external/wpt/html/semantics/tabular-data/processing-model-1/span-limits.html [ Skip ]
 
-crbug.com/666993 [ Win ] external/wpt/requestidlecallback/callback-idle-periods.html [ Timeout ]
+crbug.com/666993 [ Debug ] external/wpt/requestidlecallback/callback-idle-periods.html [ Pass Timeout ]
 
 # Crashes with DCHECK enabled, but not on normal Release builds.
 crbug.com/809935 external/wpt/css/css-fonts/variations/font-style-interpolation.html [ Timeout ]
@@ -5467,3 +5462,4 @@
 # Sheriff 2018-10-24
 crbug.com/898394 [ Linux ] virtual/android/url-bar/bottom-and-top-fixed-sticks-to-top.html [ Failure ]
 crbug.com/898378 [ Mac10.13 ] virtual/scroll_customization/fast/scroll-behavior/smooth-scroll/keyboard-scroll.html [ Timeout ]
+crbug.com/898485 [ Mac ] paint/invalidation/table/cached-69296.html [ Failure Pass ]
diff --git a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST_5.json b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST_5.json
index 970684ff..eb2bf754 100644
--- a/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST_5.json
+++ b/third_party/WebKit/LayoutTests/external/WPT_BASE_MANIFEST_5.json
@@ -187232,6 +187232,12 @@
      {}
     ]
    ],
+   "2dcontext/imagebitmap/createImageBitmap-blob-invalidtype.html": [
+    [
+     "/2dcontext/imagebitmap/createImageBitmap-blob-invalidtype.html",
+     {}
+    ]
+   ],
    "2dcontext/imagebitmap/createImageBitmap-bounds.html": [
     [
      "/2dcontext/imagebitmap/createImageBitmap-bounds.html",
@@ -286573,6 +286579,10 @@
    "7f993963d8632b180cf80314adcfebdf55a5f9a4",
    "support"
   ],
+  "2dcontext/imagebitmap/createImageBitmap-blob-invalidtype.html": [
+   "9b9669f186dc546036ff9f03aa0cc34316488d21",
+   "testharness"
+  ],
   "2dcontext/imagebitmap/createImageBitmap-bounds.html": [
    "544bd77b8852a2495595c52a0628d0830214d582",
    "testharness"
@@ -312754,11 +312764,11 @@
    "support"
   ],
   "css/build-css-testsuites.sh": [
-   "cf40f562471753084f18a570e62f833d79a7ceaf",
+   "4aad0bbbb19e79d97a9d4c46dc239bec8c311108",
    "support"
   ],
   "css/css-align/META.yml": [
-   "1dc14690529dd63704c09c847c55b8fdf582f8f5",
+   "bd26585d9e639e3133a650c26d3f3cb93579e4ae",
    "support"
   ],
   "css/css-align/OWNERS": [
@@ -339098,7 +339108,7 @@
    "testharness"
   ],
   "css/css-shapes/shape-outside/values/support/parsing-utils.js": [
-   "06007f50939e251851be58a896208d03bb58d0dd",
+   "81bcf7da56dbb228badb80f1dbb2865487fc2a18",
    "support"
   ],
   "css/css-shapes/spec-examples/reference/shape-outside-001-ref.html": [
@@ -411842,7 +411852,7 @@
    "testharness"
   ],
   "picture-in-picture/picture-in-picture-window.html": [
-   "c32787f46f771c7e8d7f689ea328f626dce70908",
+   "6d14cf54c71bd3ec30e0818e0af0713562c4cfcf",
    "testharness"
   ],
   "picture-in-picture/request-picture-in-picture-twice.html": [
diff --git a/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-blob-invalidtype.html b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-blob-invalidtype.html
new file mode 100644
index 0000000..9b9669f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/2dcontext/imagebitmap/createImageBitmap-blob-invalidtype.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<title>createImageBitmap: blob with wrong mime type</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/common/canvas-tests.js"></script>
+<script>
+promise_test(t => {
+  // Source: https://commons.wikimedia.org/wiki/File:1x1.png (Public Domain)
+  const IMAGE = atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAA" +
+                     "ACnej3aAAAAAXRSTlMAQObYZgAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=");
+
+  let bytes = new Array(IMAGE.length);
+  for (let i = 0; i < IMAGE.length; i++) {
+    bytes[i] = IMAGE.charCodeAt(i);
+  }
+
+  let blob = new Blob([new Uint8Array(bytes)], { type: "text/html"});
+
+  return window.createImageBitmap(blob)
+    .then(imageBitmap => {
+      assert_true(true, "Image created!");
+      assert_equals(imageBitmap.width, 1, "Image is 1x1");
+      assert_equals(imageBitmap.height, 1, "Image is 1x1");
+    });
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/build-css-testsuites.sh b/third_party/WebKit/LayoutTests/external/wpt/css/build-css-testsuites.sh
index cf40f56..4aad0bb 100755
--- a/third_party/WebKit/LayoutTests/external/wpt/css/build-css-testsuites.sh
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/build-css-testsuites.sh
@@ -35,6 +35,12 @@
             exit 1
         fi
 
+        # The maximum Unicode code point is U+10FFFF = 1114111
+        if [ `$PYTHON -c 'import sys; print(sys.maxunicode)'` != "1114111" ]; then
+            echo "UCS-4 support for Python is required"
+            exit 1
+        fi
+
         virtualenv -p $PYTHON $VENV || { echo "Please ensure virtualenv is installed"; exit 2; }
     fi
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-align/META.yml b/third_party/WebKit/LayoutTests/external/wpt/css/css-align/META.yml
index 1dc1469..bd26585 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-align/META.yml
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-align/META.yml
@@ -2,3 +2,4 @@
 suggested_reviewers:
   - dholbert
   - emilio
+  - javifernandez
diff --git a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/shape-outside/values/support/parsing-utils.js b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/shape-outside/values/support/parsing-utils.js
index 06007f5..81bcf7d 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/shape-outside/values/support/parsing-utils.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/css/css-shapes/shape-outside/values/support/parsing-utils.js
@@ -458,15 +458,18 @@
             savedValues[key] = document.body.style.getPropertyValue(key);
             document.body.style.setProperty(key, value);
         });
-        func.apply(this, arguments);
-        each(fontProperties, function (key, value) {
-            if (value) {
-                document.body.style.setProperty(key, value);
-            }
-            else {
-                document.body.style.removeProperty(key);
-            }
-        });
+        try {
+            func.apply(this, arguments);
+        } finally {
+            each(savedValues, function (key, value) {
+                if (value) {
+                    document.body.style.setProperty(key, value);
+                }
+                else {
+                    document.body.style.removeProperty(key);
+                }
+            });
+        }
     };
 }
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/picture-in-picture-window.html b/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/picture-in-picture-window.html
index c32787f4..6d14cf5 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/picture-in-picture-window.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/picture-in-picture/picture-in-picture-window.html
@@ -14,6 +14,9 @@
   .then(pipWindow => {
     assert_not_equals(pipWindow.width, 0);
     assert_not_equals(pipWindow.height, 0);
+    const videoAspectRatio = video.videoWidth / video.videoHeight;
+    const pipWindowAspectRatio = pipWindow.width / pipWindow.height;
+    assert_equals(videoAspectRatio, pipWindowAspectRatio);
   });
 }, 'Picture-in-Picture window dimensions are set after entering Picture-in-Picture');
 
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-multi-channels.html b/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-multi-channels.html
index b7e6b93..4e0de21e 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-multi-channels.html
+++ b/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-multi-channels.html
@@ -28,7 +28,7 @@
         }, 'Creating context for testing').notThrow();
         should(
           Audit
-            .loadFileFromUrl('audiobuffersource-multi-channels-expected.wav')
+            .loadFileFromUrl('resources/audiobuffersource-multi-channels-expected.wav')
             .then(arrayBuffer => {
               context.decodeAudioData(arrayBuffer).then(audioBuffer => {
                 expectedAudio = audioBuffer;
diff --git a/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-multi-channels-expected.wav b/third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/resources/audiobuffersource-multi-channels-expected.wav
similarity index 100%
rename from third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/audiobuffersource-multi-channels-expected.wav
rename to third_party/WebKit/LayoutTests/external/wpt/webaudio/the-audio-api/the-audiobuffersourcenode-interface/resources/audiobuffersource-multi-channels-expected.wav
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/is.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/where.html
similarity index 81%
rename from third_party/WebKit/LayoutTests/fast/css/invalidation/is.html
rename to third_party/WebKit/LayoutTests/fast/css/invalidation/where.html
index b202155..f25cfcd 100644
--- a/third_party/WebKit/LayoutTests/fast/css/invalidation/is.html
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/where.html
@@ -2,10 +2,10 @@
 <html>
   <head>
     <!-- Move to external/wpt/css/selectors/invalidation once the selector name is resolved. -->
-    <title>CSS Selectors Invalidation: :is()</title>
+    <title>CSS Selectors Invalidation: :where()</title>
     <link rel="author" title="Victoria Su" href="mailto:victoriaytsu@google.com">
     <link rel="help" href="https://drafts.csswg.org/selectors-4/#zero-matches">
-    <meta name="assert" content="This tests that the :is() selector is effective">
+    <meta name="assert" content="This tests that the :where() selector is effective">
     <script src="../../../resources/testharness.js"></script>
     <script src="../../../resources/testharnessreport.js"></script>
     <style>
@@ -13,25 +13,25 @@
         color: yellow;
       }
       /*Simple selector arguments */
-      :is(.b, .c) {
+      :where(.b, .c) {
         color: red;
       }
       /*Compound selector arguments */
-      .a~:is(.c#d, .e) {
+      .a~:where(.c#d, .e) {
         color: green;
       }
       /* Complex selector arguments */
       .h {
         color: red;
       }
-      :is(.a~.h, .a~.h+.f) {
+      :where(.a~.h, .a~.h+.f) {
         color: yellow;
       }
       /* Nested */
-      :is(.a>:is(.g+.h, .b)~.i) {
+      :where(.a>:where(.g+.h, .b)~.i) {
         color: blue;
       }
-      :is(:matches(.a~.h)) {
+      :where(:matches(.a~.h)) {
         color: yellow;
       }
     </style>
@@ -83,23 +83,23 @@
         a1.className = "a";
         assert_equals(getComputedStyle(b1).color, yellow);
         assert_equals(getComputedStyle(c1).color, red);
-      }, "Invalidate :is() for simple selector arguments.");
+      }, "Invalidate :where() for simple selector arguments.");
 
       test(() => {
         a1.className = "a";
         assert_equals(getComputedStyle(d).color, green);
-      }, "Invalidate :is() for compound selector arguments.");
+      }, "Invalidate :where() for compound selector arguments.");
 
       test(() => {
         a1.className = "a";
         assert_equals(getComputedStyle(h1).color, red);
         assert_equals(getComputedStyle(f1).color, yellow);
-      }, "Invalidate :is() for complex selector arguments.");
+      }, "Invalidate :where() for complex selector arguments.");
 
       test(() => {
         a1.className = "a";
         assert_equals(getComputedStyle(i1).color, blue);
-      }, "Invalidate nested :is().");
+      }, "Invalidate nested :where().");
 
     </script>
   </body>
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/assert-generated-deprecated-flexbox-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/assert-generated-deprecated-flexbox-expected.txt
index 74bf52a..8c64824c 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/assert-generated-deprecated-flexbox-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/assert-generated-deprecated-flexbox-expected.txt
@@ -1,5 +1,3 @@
 Bug 91003: ASSERT(genChild->isListMarker() || genChild->style()->styleType() == FIRST_LETTER) triggered on flex-box content
 
 This test has passed if it doesn't crash or ASSERT.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/box-size-integer-overflow-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/box-size-integer-overflow-expected.txt
index c4338ae7..7be5bd5 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/box-size-integer-overflow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/box-size-integer-overflow-expected.txt
@@ -1,2 +1,2 @@
-PASS
+	PASS
 The green box should be the full width of the page.
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/child-flexing-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/child-flexing-expected.txt
index 0c68a39..df96fee 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/child-flexing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/child-flexing-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 vertically expanding
 PASS element.scrollHeight is 100
 PASS element.scrollWidth is 100
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-flexbox-no-layout-child-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-flexbox-no-layout-child-expected.txt
index 27317bf..ba360ba1 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-flexbox-no-layout-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/crash-flexbox-no-layout-child-expected.txt
@@ -1,3 +1,2 @@
- 
 Bug 64842: LayoutDeprecatedFlexibleBox does not call its children's layout method
 This test passes if it does not CRASH.
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/horizontal-box-float-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/horizontal-box-float-crash-expected.txt
index 8ff01865..d2337a7 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/horizontal-box-float-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/horizontal-box-float-crash-expected.txt
@@ -1,3 +1,2 @@
 This test passes if it does not crash.
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
index c81011d..3dd336b 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
@@ -1,7 +1,12 @@
 Check that min-width intrinsic size still applies if a fixed width is set.
 
- PASS
- PASS
- PASS
- PASS
- PASS
+
+PASS
+
+PASS
+
+PASS
+
+PASS
+
+PASS
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/layoutHorizontalBox-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/layoutHorizontalBox-crash-expected.txt
index 03ec814..ac465e6f 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/layoutHorizontalBox-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/layoutHorizontalBox-crash-expected.txt
@@ -1,3 +1,2 @@
-
 bug 70183: Crash in LayoutDeprecatedFlexibleBox::layoutHorizontalBox
 If this test did not CRASH or show errors in valgrind, it has PASSED.
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/ordinal-group-max-value-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/ordinal-group-max-value-expected.txt
index 28ac9a3..7d25a3b3 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/ordinal-group-max-value-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/ordinal-group-max-value-expected.txt
@@ -1,3 +1,2 @@
 if (window.testRunner) testRunner.dumpAsText();
 *{display:-webkit-box;} *:optional{-webkit-box-ordinal-group:4294967295;}
-
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/relayout-stretched-flexbox-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/relayout-stretched-flexbox-expected.txt
index 69cfc5a9..7ef22e9 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/relayout-stretched-flexbox-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/relayout-stretched-flexbox-expected.txt
@@ -1,2 +1 @@
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/repaint-scrollbar-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/repaint-scrollbar-expected.txt
index 49e4a765..baa5cf13 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/repaint-scrollbar-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/repaint-scrollbar-expected.txt
@@ -11,7 +11,6 @@
 
 
 
-
 meroL ipsum
 fooooooooooooooo meroL ipsum
 
diff --git a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/vertical-box-form-controls-expected.txt b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/vertical-box-form-controls-expected.txt
index 6e0384e..afa1e3c 100644
--- a/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/vertical-box-form-controls-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/deprecated-flexbox/vertical-box-form-controls-expected.txt
@@ -1,12 +1,7 @@
-
-
-
-
 Check if form controls in vertical flex box will stretch horizontally when rendered as box as opposed to inline-box. If you see any red, then the test has failed.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Button
 PASS element.offsetHeight is 100
 PASS element.offsetWidth is 100
diff --git a/third_party/WebKit/LayoutTests/fast/doctypes/doctype-parsing-expected.txt b/third_party/WebKit/LayoutTests/fast/doctypes/doctype-parsing-expected.txt
index 0a220e4..07c5644 100644
--- a/third_party/WebKit/LayoutTests/fast/doctypes/doctype-parsing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/doctypes/doctype-parsing-expected.txt
@@ -105,3 +105,4 @@
 PASS: the Doctype was Quirks as expected.
 PASS: the Doctype was Standards as expected.
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/access-longest-css-property-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/access-longest-css-property-expected.txt
index cd2d1a22..7a7b27e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/access-longest-css-property-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/access-longest-css-property-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(document.body).webkitBorderBottomRightRadius is "5px"
 PASS document.getElementById("target").style.webkitBorderBottomRightRadius is "5px"
 PASS document.body.style.webkitBorderBottomRightRadius is ""
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt
index b1e53ca..c194867 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-computed-style-item-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS typeof computedStyle.length is "number"
 PASS computedStyle[computedStyle.length] is undefined.
 PASS computedStyle[-1] is undefined.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt
index cc9fcf6..a54b2dd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-properties-case-sensitive-expected.txt
@@ -2,14 +2,16 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 normal cases
 
+
 PASS element.style.float is 'left'
 PASS element.style.Float is undefined.
 
+
 "css" prefix
 
+
 PASS element.style.cssFloat is 'left'
 PASS element.style.CssFloat is undefined.
 PASS element.style.Cssfloat is undefined.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt
index 4b1ea80..be84065 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/css-style-item-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS style.length is 1
 PASS style[0] is "color"
 PASS style[1] is undefined.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt
index fe7940f0..2ba5ae6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/CSSStyleDeclaration/transition-property-names-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS element.style.webkitTransitionProperty is 'height'
 PASS element.style.webkitTransitionProperty is 'opacity'
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMError-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMError-constructor-expected.txt
index 6223d09..8a5c97c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMError-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMError-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS error = new DOMError('NotFoundError', 'This item was not found.') did not throw exception.
 PASS error.name is "NotFoundError"
 PASS error.message is "This item was not found."
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMException/XPathException-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMException/XPathException-expected.txt
index c63a072b..134e0af 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMException/XPathException-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMException/XPathException-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS e.toString() is "TypeError: Failed to read the 'numberValue' property from 'XPathResult': The result type is not a number."
 PASS Object.prototype.toString.call(e) is "[object Error]"
 PASS Object.prototype.toString.call(e.__proto__) is "[object Object]"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMException/dispatch-event-exception-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMException/dispatch-event-exception-expected.txt
index 881edff..90566a3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMException/dispatch-event-exception-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMException/dispatch-event-exception-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.dispatchEvent(null) threw exception TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'..
 PASS document.dispatchEvent(document) threw exception TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'..
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMException/prototype-object-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMException/prototype-object-expected.txt
index 5f5a7af..6405e0e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMException/prototype-object-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMException/prototype-object-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS e.toString() is "HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type '#document' may not be inserted inside nodes of type '#document'."
 PASS Object.prototype.toString.call(e) is "[object DOMException]"
 FAIL Object.prototype.toString.call(e.__proto__) should be [object DOMExceptionPrototype]. Was [object DOMException].
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-XMLDocument-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-XMLDocument-expected.txt
index 6374b73..8cf5f275 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-XMLDocument-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-XMLDocument-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.XMLDocument.name is "XMLDocument"
 PASS XMLDocument.prototype.__proto__ is Document.prototype
 PASS document.implementation.createDocument("", "").__proto__ is XMLDocument.prototype
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
index f0839d9..569a8af 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.implementation.createDocument() threw exception TypeError: Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only 0 present..
 PASS document.implementation.createDocument("http://www.example.com") threw exception TypeError: Failed to execute 'createDocument' on 'DOMImplementation': 2 arguments required, but only 1 present..
 PASS createDocument(, , null)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt
index b3bcf8ee..a628e40 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocument-with-used-doctype-expected.txt
@@ -13,7 +13,10 @@
 
 
 
+
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt
index 1b19e62..d00744e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createDocumentType-err-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.implementation.createDocumentType('foo') threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 1 present..
 PASS document.implementation.createDocumentType('foo', null) threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present..
 PASS document.implementation.createDocumentType(undefined, undefined) threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 2 present..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt
index 7e84e1410..4d85033 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/createHTMLDocument-optional-title-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.implementation.createHTMLDocument().querySelector("title") is null
 PASS document.implementation.createHTMLDocument(undefined).querySelector("title") is null
 PASS document.implementation.createHTMLDocument(null).querySelector("title").textContent is "null"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/implementation-identity-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/implementation-identity-expected.txt
index 42bdffda..d616e94 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/implementation-identity-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/DOMImplementation/implementation-identity-expected.txt
@@ -5,3 +5,4 @@
 OK: Top-level document and iframe document have different DOMImplementation objects
 OK: DOMImplementation object is cached
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt
index 782ece22..e90b389 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt
@@ -2,4 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS Test completed successfully
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style-expected.txt
index 2bf6a31f..7b47614c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-with-before-style-expected.txt
@@ -1,13 +1,14 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS testIt("margin", -2) is "a"
 PASS testIt("margin", -1) is "a"
 PASS testIt("margin", 0) is "a"
 PASS testIt("margin", 1) is "b"
 
+
 PASS testIt("noMargin", -2) is "a"
 PASS testIt("noMargin", -1) is "a"
 PASS testIt("noMargin", 0) is "a"
 PASS testIt("noMargin", 1) is "b"
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport-expected.txt
index 7aea7d6..fc6b1f1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/CaretRangeFromPoint/hittest-relative-to-viewport-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Range.startContainer check (got [object Text], expected [object Text])
 PASS Range.startOffset check (got 0, expected 0)
 PASS Range.startContainer check (got [object Text], expected [object Text])
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/clone-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/clone-node-expected.txt
index df98b99..0fa09ff 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/clone-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/clone-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS doc.cloneNode(false).__proto__ is XMLDocument.prototype
 PASS className(doc.cloneNode(false)) is "XMLDocument"
 PASS doc.cloneNode(true).documentElement.localName is "root"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
index 084d075..5ef60f9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createAttributeNS-namespace-err-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS createAttributeNS(undefined, undefined)
 PASS createAttributeNS(null, undefined)
 PASS createAttributeNS(undefined, null)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt
index 784ec0b..3d6eae48 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-invalid-names-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.createElement('0ascii') threw exception InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('0ascii') is not a valid name..
 PASS document.createElement('.Ascii') threw exception InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('.Ascii') is not a valid name..
 PASS document.createElement('-Ascii') threw exception InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('-Ascii') is not a valid name..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-valid-names-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-valid-names-expected.txt
index 040f932b..1ac16ccb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-valid-names-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createElement-valid-names-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.createElement('ascii') is non-null.
 PASS document.createElement('Ascii') is non-null.
 PASS document.createElement('àscii') is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt
index 1597517..2e860a1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/createElementNS-namespace-err-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 HTML tests:
 PASS createElementNS(, )
 PASS createElementNS(null, )
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/designMode-non-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/designMode-non-html-expected.txt
index 0c3147f..1d64b5c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/designMode-non-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/designMode-non-html-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS xmlDocument.__proto__ is XMLDocument.prototype
 PASS xmlDocument.__proto__.__proto__ is Document.prototype
 PASS xmlDocument.designMode is "off"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-async-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-async-expected.txt
index 7062a3d6..5a9c4e0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-async-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-async-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-expected.txt
index afb8a84..770dcc7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-current-script-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 <script id="a">
 <script id="b">
 <script id="c">
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-empty-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-empty-document-expected.txt
index 2ea366a..a01a7b3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-empty-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-empty-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS unless crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-on-option-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-on-option-element-expected.txt
index 4a86ba38..1ab4bb4f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-on-option-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-elementFromPoint-on-option-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS result.tagName is "OPTION"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get-expected.txt
index 56f1bfbf..cbb7a71 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-title-get-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test with no title set
 PASS document.title is ""
 Test with empty title
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype-expected.txt
index 76698c7e..95fe4c7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/document-write-doctype-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 about:blank is quirksmode by default
 PASS iframeDocument.compatMode is "BackCompat"
 ensure that about:blank's DOM has an html and body element
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/embeds-non-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/embeds-non-html-expected.txt
index facecd7..9a2bad98 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/embeds-non-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/embeds-non-html-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS xmlDocument.__proto__ is XMLDocument.prototype
 PASS xmlDocument.__proto__.__proto__ is Document.prototype
 PASS xmlDocument.embeds.__proto__ is HTMLCollection.prototype
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception-expected.txt
index 6b14f63..d5a5c78 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/invalid-domain-change-throws-exception-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.domain = "apple.com" threw exception SecurityError: Failed to set the 'domain' property on 'Document': 'apple.com' is not a suffix of ''..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/parent-node-interface-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/parent-node-interface-expected.txt
index ef28e825..04541fc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/parent-node-interface-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/parent-node-interface-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS doc.children.length is 0
 PASS doc.childElementCount is 0
 PASS doc.firstElementChild is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/readystate-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/readystate-expected.txt
index daa8d9f3..d028fa0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/readystate-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/readystate-expected.txt
@@ -24,3 +24,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/replace-child-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/replace-child-expected.txt
index 57d5ba6..f289a89 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/replace-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/replace-child-expected.txt
@@ -2,31 +2,38 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 replacing element with element
 PASS doc.replaceChild(newChild, doc.documentElement) did not throw exception.
 <!DOCTYPE html><div/>
+
 replacing element with element in fragment
 PASS doc.replaceChild(fragment, doc.documentElement); did not throw exception.
 <!DOCTYPE html><div/>
+
 replacing element with multiple elements in fragment
 PASS doc.replaceChild(fragment, doc.documentElement); threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': Only one element on document allowed..
 <!DOCTYPE html><body/>
+
 replacing element with doctype
 PASS doc.replaceChild(newChild, doc.documentElement) did not throw exception.
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+
 replacing element with doctype when a doctype already exists
 PASS doc.replaceChild(newChild, doc.documentElement) threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': Only one doctype on document allowed..
 <!DOCTYPE html><body/>
+
 replacing doctype with doctype
 PASS doc.replaceChild(newChild, doc.doctype) did not throw exception.
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><body/>
+
 replacing doctype with element
 PASS doc.replaceChild(newChild, doc.doctype) did not throw exception.
 <bar/>
+
 replacing element with doctype when an element already exists
 PASS doc.replaceChild(newChild, doc.documentElement) threw exception HierarchyRequestError: Failed to execute 'replaceChild' on 'Node': Only one doctype on document allowed..
 <!DOCTYPE html><body/>
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild-expected.txt
index fb7969b..5f79f55 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/replaceChild-null-oldChild-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.replaceChild(document.firstChild, null) threw exception TypeError: Failed to execute 'replaceChild' on 'Node': parameter 2 is not of type 'Node'..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/scripts-non-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/scripts-non-html-expected.txt
index c5996db..cf0c893 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/scripts-non-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/scripts-non-html-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS xmlDocument.__proto__ is XMLDocument.prototype
 PASS xmlDocument.__proto__.__proto__ is Document.prototype
 PASS xmlDocument.scripts.__proto__ is HTMLCollection.prototype
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noLayout-quirks-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noLayout-quirks-expected.txt
index 7403018..cd6ee49 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noLayout-quirks-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noLayout-quirks-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.needsLayoutCount() is 0
 PASS document.scrollingElement is document.body
 Verifying layout hasn't been triggered
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noStyleUpdate-strict-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noStyleUpdate-strict-expected.txt
index bf44f7f9..c40480e5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noStyleUpdate-strict-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/scrollingElement-noStyleUpdate-strict-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.needsLayoutCount() is 0
 PASS document.scrollingElement is document.documentElement
 Verifying style update hadn't been triggered
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children-expected.txt
index 62475f0..9391ea6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Document/title-with-multiple-children-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementsByTagName('title').length is 0
 PASS document.title is ''
 PASS titleElement.text is ''
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt
index c24b843..e3756cd4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/attr-param-typechecking-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS element.setAttributeNode("style"); threw exception TypeError: Failed to execute 'setAttributeNode' on 'Element': parameter 1 is not of type 'Attr'..
 PASS element.setAttributeNode(null); threw exception TypeError: Failed to execute 'setAttributeNode' on 'Element': parameter 1 is not of type 'Attr'..
 PASS element.setAttributeNode(undefined); threw exception TypeError: Failed to execute 'setAttributeNode' on 'Element': parameter 1 is not of type 'Attr'..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-expected.txt
index 4463f5f..8b57f7a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS htmlElement.classList instanceof DOMTokenList is true
 PASS svgElement.classList instanceof DOMTokenList is true
 PASS xmlElement.classList instanceof DOMTokenList is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-move-between-document-with-different-quirks-mode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-move-between-document-with-different-quirks-mode-expected.txt
index c4e3dc0..c237f03 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-move-between-document-with-different-quirks-mode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-move-between-document-with-different-quirks-mode-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 In standards mode
 PASS htmlElement.classList.contains("A") is true
 PASS htmlElement.classList.contains("a") is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-update-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-update-expected.txt
index 27656a9..1425dde 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-update-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/class-list-update-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS htmlElement.classList.length is 1
 PASS htmlElement.classList.length is 0
 PASS svgElement.classList.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/class-name-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/class-name-expected.txt
index ab4cf4a..2c4ae5bf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/class-name-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/class-name-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS htmlElement.className is "foo"
 PASS xmlElement.className is "foo"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/client-rect-list-argument-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/client-rect-list-argument-expected.txt
index 200e6bdc..e4ec8516 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/client-rect-list-argument-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/client-rect-list-argument-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS clientRects.length is 3
 PASS clientRects.item(0) is not null
 PASS clientRects.item(1) is not null
@@ -15,6 +14,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 14. Block in inline
 
 Lorem
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered-expected.txt
index be74b98..a72c664 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/dimension-properties-unrendered-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testDiv.offsetLeft is 0
 PASS testDiv.offsetTop is 0
 PASS testDiv.offsetWidth is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal-expected.txt
index c8571b34..744a61c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/element-traversal-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test with no children
 PASS noChildren.firstElementChild is null
 PASS noChildren.lastElementChild is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt
index ad58bcd..4603bb5a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt
@@ -4,7 +4,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testGetAttributeCaseInsensitive() is "x"
 PASS testGetAttributeNodeMixedCase() is "x"
 PASS testGetAttributeNodeLowerCase() is "x"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/getBoundingClientRect-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/getBoundingClientRect-expected.txt
index 12b9f0b..57bdbd4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/getBoundingClientRect-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/getBoundingClientRect-expected.txt
@@ -6,6 +6,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 2
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "188.000"
@@ -14,6 +15,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 3
 PASS rect.left.toFixed(3) is "18.000"
 PASS rect.top.toFixed(3) is "356.000"
@@ -22,6 +24,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 4
 PASS rect.left.toFixed(3) is "37.289"
 PASS rect.top.toFixed(3) is "483.289"
@@ -30,6 +33,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 5
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "652.000"
@@ -38,9 +42,11 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 6
 Known failure. Skipping.
 
+
 Test 7
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "1484.000"
@@ -49,6 +55,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 8
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "1996.000"
@@ -57,6 +64,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 9
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "2134.000"
@@ -65,6 +73,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 10
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "2274.000"
@@ -73,6 +82,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 11
 PASS rect.left.toFixed(3) is "10.000"
 PASS rect.top.toFixed(3) is "2396.000"
@@ -81,6 +91,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 12
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "2532.000"
@@ -89,6 +100,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 13
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "2783.000"
@@ -97,6 +109,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 14
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "2863.000"
@@ -105,6 +118,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 15
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "3159.000"
@@ -113,6 +127,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/getClientRects-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/getClientRects-expected.txt
index bac2a5653..94d8b44 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/getClientRects-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/getClientRects-expected.txt
@@ -1,48 +1,63 @@
 Client bounding rects for #1
 PASS testRects.length is 1
 
+
 Client bounding rects for #2
 PASS testRects.length is 1
 
+
 Client bounding rects for #3
 PASS testRects.length is 1
 
+
 Client bounding rects for #4
 PASS testRects.length is 1
 
+
 Client bounding rects for #5
 PASS testRects.length is 1
 
+
 Client bounding rects for #6
 Known failure. Skipping.
 
+
 Client bounding rects for #7
 FAIL testRects.length should be 10. Was 11.
 
+
 Client bounding rects for #8
 PASS testRects.length is 1
 
+
 Client bounding rects for #9
 FAIL testRects.length should be 2. Was 1.
 
+
 Client bounding rects for #10
 PASS testRects.length is 1
 
+
 Client bounding rects for #11
 PASS testRects.length is 1
 
+
 Client bounding rects for #12
 PASS testRects.length is 1
 
+
 Client bounding rects for #13
 PASS testRects.length is 1
 
+
 Client bounding rects for #14
 PASS testRects.length is 3
 
+
 Client bounding rects for #15
 PASS testRects.length is 1
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-formcollection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-formcollection-expected.txt
index 350e251..e75babe 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-formcollection-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-formcollection-expected.txt
@@ -2,9 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS elems["ids1"][1].getAttribute("name") is "name2"
 PASS successfullyParsed is true
 
 TEST COMPLETE
- 
+
+FAILURE
+FAILURE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-frame-expected.txt
index 4101d1c..c1f2453 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-frame-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("theframe") is non-null.
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-getelement01-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-getelement01-expected.txt
index 1ff0b86..b177d562 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-getelement01-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-getelement01-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS elem.getAttribute("name") is "name1"
 PASS elem.getAttribute("name") is "name2"
 PASS elem is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-insert-hr-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-insert-hr-expected.txt
index 1ff7f35..5cf6b9a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-insert-hr-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-insert-hr-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS hr is non-null.
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 foobar
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-map-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-map-expected.txt
index 5111cce24..9160728b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-map-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-map-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("firstmap") is non-null.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-node-list-index01-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-node-list-index01-expected.txt
index f36780d..d756173e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-node-list-index01-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-node-list-index01-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS elems["id1"].getAttribute("name") is "name1"
 PASS elems["id2"].getAttribute("name") is "name2"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-param-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-param-expected.txt
index f8b3a0c..6e006a0b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-param-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/id-in-param-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("id1") is non-null.
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/node-list-identity-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/node-list-identity-expected.txt
index 685085b..9612f31 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/node-list-identity-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/node-list-identity-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementsByTagName("ol") === document.getElementsByTagName("ol") is true
 PASS document.getElementsByName("name1") === document.getElementsByName("name1") is true
 PASS document.getElementsByClassName("class1") === document.getElementsByClassName("class1") is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt
index 89d26cf..9c7930b9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt
@@ -2,7 +2,8 @@
 relative: body: (0, 0) child: (17, 17)
 fixed: body: (0, 0) child: (17, 17)
 absolute: body: (0, 0) child: (17, 17)
- 
- 
- 
+
+
+
+
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt
index 5e3da62..eb33acfc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt
@@ -1,6 +1,7 @@
 control: (0, 0)
 static: (10, 10)
 absolute: (20, 10)
- 
- 
+
+
+
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetTop-table-cell-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetTop-table-cell-expected.txt
index 0d3bbc33..759f744f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/offsetTop-table-cell-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/offsetTop-table-cell-expected.txt
@@ -9,7 +9,9 @@
 Table 3 cell 1 top offset:0
 Table 4 div 1 top offset:50
 Test result: PASS
+
+	
 x	
 This
 is more text.	And a lot more text that should have the smallest offsetTop.
-
+	
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/onclick-case-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/onclick-case-expected.txt
index 02706a21..119f580 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/onclick-case-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/onclick-case-expected.txt
@@ -1,4 +1,5 @@
 This tests whether an element's onclick attribute can be a function named "OnClick". Some older versions of WebKit had a bug in the DOM binding for Element that would prevent the function from being called because we have an attribute of the same name.
 
 
+
 Hooray! All is well!
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/parent-node-interface-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/parent-node-interface-expected.txt
index c103292..6a5e8a8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/parent-node-interface-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/parent-node-interface-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS element.children.length is 0
 PASS element.childElementCount is 0
 PASS element.firstElementChild is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/remove-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/remove-expected.txt
index a214380..2def8e7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/remove-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/remove-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testDiv.childNodes.length is 1
 PASS testDiv.childNodes.length is 0
 PASS testDiv.childNodes.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-bounding-client-rect-in-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-bounding-client-rect-in-frame-expected.txt
index 3e5a6181..656dfc5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-bounding-client-rect-in-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-bounding-client-rect-in-frame-expected.txt
@@ -1,2 +1 @@
-
 Pass
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-client-rects-in-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-client-rects-in-frame-expected.txt
index 3e5a6181..656dfc5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-client-rects-in-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scale-page-client-rects-in-frame-expected.txt
@@ -1,2 +1 @@
-
 Pass
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt
index 2ff6509..279ce18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-hidden-expected.txt
@@ -1,2 +1,3 @@
 Tests that element.clientWidth of visible element with scrollbars returns proper values
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt
index 2ff6509..279ce18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scroll-width-visible-expected.txt
@@ -1,2 +1,3 @@
 Tests that element.clientWidth of visible element with scrollbars returns proper values
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body-expected.txt
index 9d930785..b63606d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-body-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS iframeStrict1.contentDocument.scrollingElement is iframeStrict1.contentDocument.documentElement
 PASS iframeStrict1.contentDocument.documentElement.scrollTop is 0
 PASS iframeStrict1.contentDocument.documentElement.scrollLeft is 100
@@ -54,4 +53,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
        
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-frameset-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-frameset-expected.txt
index cc892ed3..803840c6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-frameset-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-frameset-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.scrollingElement is document.documentElement
 PASS iframeQuirks.contentDocument.body is iframeQuirks.contentDocument.querySelector('frameset')
 PASS iframeQuirks.contentDocument.scrollingElement is null
@@ -13,6 +12,7 @@
 PASS iframeQuirks.contentWindow.pageYOffset is 500
 PASS iframeQuirks.contentWindow.pageXOffset is 200
 
+
 Add extra body element
 PASS iframeQuirks.contentDocument.body is iframeQuirks.contentDocument.querySelector('frameset')
 PASS iframeQuirks.contentDocument.scrollingElement is bodyElement
@@ -29,3 +29,4 @@
 TEST COMPLETE
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes-expected.txt
index 6f9b9002..01dff7fa 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollTop-scrollLeft-strict-quirks-modes-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.scrollingElement is document.documentElement
 PASS iframeStrict.contentDocument.scrollingElement is iframeStrict.contentDocument.documentElement
 PASS iframeStrict.contentDocument.documentElement.scrollTop is 5000
@@ -32,3 +31,4 @@
 
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollingElement-null-body-documentElement-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollingElement-null-body-documentElement-expected.txt
index b4a0a6d..7a378d1e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/scrollingElement-null-body-documentElement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/scrollingElement-null-body-documentElement-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.scrollingElement is document.documentElement
 PASS nullbody.contentDocument.compatMode is "BackCompat"
 PASS nullbody.contentDocument.body is null
@@ -17,3 +16,4 @@
 
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt
index f4cf2e2..c16b04a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNS-namespace-err-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS element.setAttributeNS(undefined, undefined, 'value')
 PASS element.setAttributeNS(null, undefined, 'value')
 FAIL element.setAttributeNS(undefined, null, 'value')
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-xhtml-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-xhtml-expected.txt
index de1e63a..1c66192 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-xhtml-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Element/setAttributeNode-case-insensitivity-xhtml-expected.txt
@@ -1,4 +1,5 @@
 Test for Bugzilla bug: 90341: createAttribute/setAttributeNode does not properly normalize case.
 This test verifies that the setAttributeNode() API allows for creation of attributes case-sensitively for XHTML documents. Thus two different attributes with the same name but in different case can exist for XHTML documents.
 
+
 style attribute value = background-color: red and STYLE attribute value = background-color: green
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-expected.txt
index 8c125643..1306c1d8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/anchor-in-noscroll-iframe-expected.txt
@@ -1,2 +1,2 @@
 This tests whether clicking on an anchor in an iframe with scrolling="no" will scroll to anchor. If clicking on the link below triggers a scroll, the test passes.
-PASS
+ PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port-expected.txt
index 4889e15b..1f34e64 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-href-attribute-port-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Default port is empty
 PASS a.port is ''
 Unspecified port should return empty string
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-text-expected.txt
index 18f6a17..6f2f2c05 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/get-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS a.__proto__ is HTMLAnchorElement.prototype
 PASS a.text is "ab"
 PASS a.textContent is "ab"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
index 9e0f32b..2be2db5a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Hash value does not start with '#'
 PASS a.href is 'https://www.mydomain.com:8080/path/testurl.html#hash-value'
 Hash value starts with '#'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt
index e227931..ce26d28e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-host-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'https://www.otherdomain.com:0/path/'
 Set host without port
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
index b8eb2b4..4c364c0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'https://www.otherdomain.com:8080/path/'
 Extra slashes before hostname
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt
index 4d2910b..01a9786 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-pathname-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Set pathname that starts with slash
 PASS a.href is 'https://www.mydomain.com/path%20name?key=value'
 Set pathname that does not start with slash and contains '?'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
index f71c267..7b8f0af 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-port-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Default port as number
 PASS a.href is 'https://www.mydomain.com/path/testurl.html?key=value'
 Default port as string
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase-expected.txt
index c7de5cb..8e522b35 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-prevents-rebase-expected.txt
@@ -2,44 +2,51 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Search attribute, update document base URI without attribute having been set
 PASS a.href is 'http://new_base/?search'
 Search attribute, update document base URI after attribute has been set
 PASS a.href is 'http://old_base/?search'
 
+
 Pathname attribute, update document base URI without attribute having been set
 PASS a.href is 'http://new_base/path'
 Pathname attribute, update document base URI after attribute has been set
 PASS a.href is 'http://old_base/path'
 
+
 Hash attribute, update document base URI without attribute having been set
 PASS a.href is 'http://new_base/#hash'
 Pathname attribute, update document base URI after attribute has been set
 PASS a.href is 'http://old_base/#hash'
 
+
 Note that for the following attributes, updating the document base URI has no effect because we have to use an abosulte URL for the href in order to set an initial value for the attribute we wish to update. They are included for completeness.
 
+
 Host attribute, update document base URI without attribute having been set
 PASS a.href is 'http://host:0/'
 Host attribute, update document base URI after attribute has been set
 PASS a.href is 'http://host:0/'
 
+
 Hostname attribute, update document base URI without attribute having been set
 PASS a.href is 'http://host/'
 Hostname attribute, update document base URI after attribute has been set
 PASS a.href is 'http://host/'
 
+
 Protocol attribute, update document base URI without attribute having been set
 PASS a.href is 'protocol:'
 Protocol attribute, update document base URI after attribute has been set
 PASS a.href is 'protocol:'
 
+
 Port attribute, update document base URI without attribute having been set
 PASS a.href is 'http://host:0/'
 Port attribute, update document base URI after attribute has been set
 PASS a.href is 'http://host:0/'
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
index ea1ca715..f84485f7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'http-foo://www.mydomain.com/path/'
 Set a protocol that contains ':'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-rebase-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-rebase-expected.txt
index 8c3f030..e571a18b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-rebase-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-rebase-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS a.href is "http://old_base/foo?query"
 PASS document.querySelector('a').href is "http://new_base/foo?query"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
index f7dfc61..9ada29e3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-href-attribute-whitespace-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Set href that starts with a space
 PASS a.hostname is 'www.mydomain.com'
 Set href that starts with a newline
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-text-expected.txt
index 0fa02de..cb83ba05 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAnchorElement/set-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS a.__proto__ is HTMLAnchorElement.prototype
 PASS a.textContent is ""
 PASS a.text is ""
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-cursor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-cursor-expected.txt
index db5bb6b8..12e23ca 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-cursor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-cursor-expected.txt
@@ -1,4 +1,3 @@
- 
 Test for crbug.com/455253: cursor pointer on image-link
 
 Result: pointer
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-download-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-download-expected.txt
index f95efff..3ab11a58 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-download-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLAreaElement/area-download-expected.txt
@@ -1,2 +1,2 @@
 Download started
- 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash-expected.txt
index 25ed90fd..19be38e4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLCollection/HTMLCollection-namedItem-invalidate-no-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt
index c7a94a0..e5710bc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDivElement/align/getset-expected.txt
@@ -1,4 +1,6 @@
 Tests: getting and setting HTMLDivElement::align
+
+
 Condition(s):
 Testing valid, invalid, and empty values
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-expected.txt
index 4e180bf..749e793 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/active-element-gets-unforcusable-expected.txt
@@ -2,17 +2,18 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 ===> Setting display:none
 Event: blur
 PASS document.activeElement is document.body
 PASS The focusTarget element lost focus.
 
+
 ===> Setting visibility:hidden
 Event: blur
 PASS document.activeElement is document.body
 PASS The focusTarget element lost focus.
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/activeElement-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/activeElement-expected.txt
index 12c25ca..d333628 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/activeElement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/activeElement-expected.txt
@@ -1,4 +1,5 @@
- 
+
+
 [object HTMLBodyElement]
 [object HTMLInputElement] id: one
 [object HTMLInputElement] id: two
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/clone-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/clone-node-expected.txt
index aa73ab1..5989017 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/clone-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/clone-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.cloneNode(false).__proto__ is HTMLDocument.prototype
 PASS className(document.cloneNode(false)) is "HTMLDocument"
 PASS document.cloneNode(true).title is document.title
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-write-variadic-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-write-variadic-expected.txt
index 40a4602..7807148 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-write-variadic-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/document-write-variadic-expected.txt
@@ -6,9 +6,9 @@
 
 You should see exactly 2 'null' lines below:
 null
-null 
+null
 
 You should see exactly 2 'undefined' lines below:
 undefined
-undefined 
+undefined
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/get-iframe-with-integer-name-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/get-iframe-with-integer-name-expected.txt
index 8bd2fc80..5f663db 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/get-iframe-with-integer-name-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/get-iframe-with-integer-name-expected.txt
@@ -1,3 +1,2 @@
-
 This tests that an iframe with an integer name can be accessed on the document with indexing notation.
 SUCCESS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-multiple-match-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-multiple-match-expected.txt
index bfb9fa1..5bfd553 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-multiple-match-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/named-item-multiple-match-expected.txt
@@ -9,6 +9,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 Tests that the named item created for an image with an ID is correctly removed. The test passes, if you see a "PASS" message in the div below.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element-expected.txt
index 1a6e2d8..244b826 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/set-focus-on-valid-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 DOMFocusOut is called
 PASS document.activeElement is not willBeDisabled
 PASS document.activeElement.id is "body"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/write-multiple-calls-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/write-multiple-calls-expected.txt
index e2a009cb..bda3562 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/write-multiple-calls-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/write-multiple-calls-expected.txt
@@ -5,8 +5,12 @@
 Success message:
 
 passed
+
+
 Failure message:
 
 pa
 ssed
+
+
 passed
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/writeln-multiple-calls-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/writeln-multiple-calls-expected.txt
index 40e08ac..ba731a78 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/writeln-multiple-calls-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLDocument/writeln-multiple-calls-expected.txt
@@ -6,9 +6,13 @@
 
 line 1
 line 2
+
+
 Failure message:
 
 line 1line 2
+
+
 line 1
 line 2
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-before-text-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-before-text-node-expected.txt
index 999a00b..0dec9bf6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-before-text-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-before-text-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-child-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-child-node-expected.txt
index e7c1881..7255803 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-child-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-child-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-expected.txt
index 87e7371..21776c36 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-form-control-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-form-control-expected.txt
index 63f7dd10..397b833 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-form-control-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-change-text-form-control-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-children-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-children-expected.txt
index 99c3e45..8e5a588 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-children-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-children-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-expected.txt
index ac3155e..864ead8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-remove-add-children-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-remove-add-children-expected.txt
index 3a8c312..1546f487 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-remove-add-children-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-remove-add-children-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(parent1, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(parent2, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(parent3, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-child-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-child-expected.txt
index b4796e1..5c52f12 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-child-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-expected.txt
index 98357004..7b9dec1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-auto-text-form-control-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-expected.txt
index c0771862..a6b1241 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-dir-value-change-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(child2, null).getPropertyValue('border-right-color') is 'rgb(0, 128, 0)'
 PASS document.defaultView.getComputedStyle(el, null).getPropertyValue('border-right-color') is 'rgb(255, 0, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-empty-string-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-empty-string-expected.txt
index 2cf9af51..9b0a8cad 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-empty-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-empty-string-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("div").getAttribute("contentEditable") is ""
 PASS document.getElementById("div").contentEditable is "true"
 PASS document.getElementById("div").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-false-string-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-false-string-expected.txt
index c681031..3d97ca8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-false-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-false-string-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("div").getAttribute("contentEditable") is "false"
 PASS document.getElementById("div").contentEditable is "false"
 PASS document.getElementById("div").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-invalid-string-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-invalid-string-expected.txt
index 737c5073..8c03d771 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-invalid-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-invalid-string-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("d").getAttribute("contentEditable") is "abc"
 PASS document.getElementById("d").contentEditable is "inherit"
 PASS document.getElementById("d").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-false-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-false-expected.txt
index ff9d755..b3c53ec 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-false-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-false-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-true-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-true-expected.txt
index 3343865..b08f388 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-true-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-ancestor-true-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-ancestor-missing-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-ancestor-missing-expected.txt
index a0194d8..1f75f7b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-ancestor-missing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-ancestor-missing-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-false-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-false-expected.txt
index 8a976e433..760bfe1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-false-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-false-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-true-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-true-expected.txt
index 204a3094d..b1be6dd6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-true-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-missing-parent-true-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-true-string-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-true-string-expected.txt
index 2ee70ef..5b7bdf4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-true-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/attr-true-string-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("div").getAttribute("contentEditable") is "true"
 PASS document.getElementById("div").contentEditable is "true"
 PASS document.getElementById("div").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt
index 1aaa5a4..5dd411b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/
 PASS String(element.classList) is "y"
 PASS String(element.className) is "y"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc-expected.txt
index e1c25fb..e5c2fb3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-gc-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS d.classList.life is 42
 PASS d.classList.life is 42
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt
index 1aaa5a4..5dd411b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/class-list-quirks-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Tests from http://simon.html5.org/test/html/dom/reflecting/DOMTokenList/
 PASS String(element.classList) is "y"
 PASS String(element.className) is "y"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors-expected.txt
index e83b5785..785f3fe 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/insertAdjacentHTML-errors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS div.insertAdjacentHTML('beforeBegin', 'text') threw exception NoModificationAllowedError: Failed to execute 'insertAdjacentHTML' on 'Element': The element has no parent..
 PASS div.insertAdjacentHTML('afterEnd', 'text') threw exception NoModificationAllowedError: Failed to execute 'insertAdjacentHTML' on 'Element': The element has no parent..
 PASS div.insertAdjacentHTML('FOO', 'text') threw exception SyntaxError: Failed to execute 'insertAdjacentHTML' on 'Element': The value provided ('FOO') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-expected.txt
index 688feca..9eaef1d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 document.designMode = "on"
 PASS document.getElementById("div").contentEditable is "inherit"
 PASS document.getElementById("div").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor-expected.txt
index 47c1a91f..f545aac 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 document.designMode = "on"
 PASS document.getElementById("div").contentEditable is "inherit"
 PASS document.getElementById("div").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-expected.txt
index feb46eb67..e2160d4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 document.designMode = "on"
 PASS document.getElementById("div").getAttribute("contentEditable") is "false"
 PASS document.getElementById("div").contentEditable is "false"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-subframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-subframe-expected.txt
index 6290d76..69a2346 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-subframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/iscontenteditable-designmodeon-subframe-expected.txt
@@ -2,12 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 document.designMode = "on"
 PASS subDocument.designMode is "off"
 PASS subDocument.getElementById("div").contentEditable is "inherit"
 PASS subDocument.getElementById("div").isContentEditable is false
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-false-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-false-expected.txt
index 817ebff1..4f7a2386 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-false-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-false-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("div1").getAttribute("contentEditable") is "false"
 PASS document.getElementById("div1").contentEditable is "false"
 PASS document.getElementById("div1").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-false-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-false-expected.txt
index ce1601f..f9fac70 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-false-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-false-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-true-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-true-expected.txt
index 652c71b..fe60af81d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-true-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-inherit-parent-true-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("p").hasAttribute("contentEditable") is false
 PASS document.getElementById("p").contentEditable is "inherit"
 PASS document.getElementById("p").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-invalid-value-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-invalid-value-expected.txt
index 555284d..7aaad965 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-invalid-value-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-invalid-value-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('div').contentEditable = 'abc' threw exception SyntaxError: Failed to set the 'contentEditable' property on 'HTMLElement': The value provided ('abc') is not one of 'true', 'false', 'plaintext-only', or 'inherit'..
 PASS document.getElementById("div").getAttribute("contentEditable") is "true"
 PASS document.getElementById("div").contentEditable is "true"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-true-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-true-expected.txt
index 22234e9..39c9955 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-true-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-true-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("div1").getAttribute("contentEditable") is "true"
 PASS document.getElementById("div1").contentEditable is "true"
 PASS document.getElementById("div1").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-value-caseinsensitive-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-value-caseinsensitive-expected.txt
index 473290cb..00c35155 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-value-caseinsensitive-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/set-value-caseinsensitive-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("div1").getAttribute("contentEditable") is "true"
 PASS document.getElementById("div1").contentEditable is "true"
 PASS document.getElementById("div1").isContentEditable is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck-expected.txt
index 766fae40..c411a71c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/spellcheck-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS target.spellcheck is initialExpectation
 PASS target.spellcheck is lastExpectation
 PASS target.getAttribute('spellcheck') is lastAttributeExpectation
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/translate-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/translate-expected.txt
index 335b4f4..cd4684a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/translate-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLElement/translate-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 translate should be "yes" by default.
 PASS target.translate is true
 PASS target.getAttribute('translate') is null
@@ -55,6 +54,7 @@
 PASS target.translate is false
 PASS target.getAttribute('translate') is "no"
 
+
 PASS target.translate is initialExpectation
 PASS target.translate is lastExpectation
 PASS target.getAttribute('translate') is lastAttributeExpectation
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
index 53d19e4..8115b9b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLFontElement/size-attribute-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS fontSizeAttributeEffect("") is null
 PASS fontSizeAttributeEffect("1") is "10px"
 PASS fontSizeAttributeEffect("2") is "13px"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute-expected.txt
index f74b85f..a4a5405 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLHrElement/hr-color-noshade-attribute-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(document.getElementById('hrElement1'),null).getPropertyValue('border-color') is "rgb(255, 0, 0)"
 PASS window.getComputedStyle(document.getElementById('hrElement1'),null).getPropertyValue('background-color') is "rgb(255, 0, 0)"
 PASS window.getComputedStyle(document.getElementById('hrElement2'),null).getPropertyValue('border-color') is "rgb(0, 0, 255)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt
index 782fe8f1..993059a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLHtmlElement/set-version-expected.txt
@@ -1,6 +1,7 @@
 This tests to make sure that HTMLHtmlElement::version settable.
 
 You should see 2 lines with "SUCCESS" below:
+
 SUCCESS (value: "1")
 
 SUCCESS (value: "2")
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-crossOrigin-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-crossOrigin-expected.txt
index 0c1c0cdb..520c008 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-crossOrigin-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-crossOrigin-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS 'crossOrigin' in img is true
 PASS img.crossOrigin is null
 PASS img.setAttribute('crossorigin', ''); img.crossOrigin is "anonymous"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-dynamic-width-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-dynamic-width-expected.txt
index 24fb5cd5..f8b2582d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-dynamic-width-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-dynamic-width-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS currentResult is true
 PASS currentResult is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML-expected.txt
index c1f9ce5..055790e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-innerHTML-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS attemptedLoadDirect is true
 PASS attemptedLoadIndirect is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-load-cross-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-load-cross-document-expected.txt
index c0dd444..7f46de2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-load-cross-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-load-cross-document-expected.txt
@@ -3,4 +3,3 @@
 PASS: Test complete and passed unless a subsequent test crashes.
 
 
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-longdesc-absolute-url-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-longdesc-absolute-url-expected.txt
index e4dc1ba..89a7ca3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-longdesc-absolute-url-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-longdesc-absolute-url-expected.txt
@@ -2,6 +2,7 @@
 To match WinIE (but not FireFox), we resolve the image path in the getter, rather than the setter, allowing for pages to change the Document base URL via javascript and have object.longDesc reflect said change.
 
 SUCCESS (document.images[0].longDesc = file:///does/not/exist/test-description.html)
+
 After changing the base URL:
 
 SUCCESS (document.images[0].longDesc = file:///also/does/not/exist/test-description.html)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-lowsrc-getset-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-lowsrc-getset-expected.txt
index 254b7c7..f13bdeb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-lowsrc-getset-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-lowsrc-getset-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS image.lowsrc is 'http://hostname/lowsrc.png'
 PASS image.lowsrc is 'http://hostname/newlowsrc.png'
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x-expected.txt
index 09cfba14..1a17633 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-1x-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.getElementById("canary").clientWidth is 75
 PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
 PASS document.getElementById("simple").clientWidth is 800
@@ -27,4 +28,4 @@
 PASS currentSrcFileName("no_srcset") is "image-set-4x.png?3"
    
 some text
-         
+        
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt
index bb04a09d9..8ce21f7c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt
@@ -8,5 +8,6 @@
 
 TEST COMPLETE
 
- 
- 
+
+
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt
index 8832806a..b73c073 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.getElementById("canary").clientWidth is 75
 PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
 PASS document.getElementById("div_end_picture").clientWidth is 800
@@ -13,7 +14,6 @@
 PASS currentSrcFileName("not_in_picture") is "blue_rect.jpg"
 
 
- 
- 
- 
+
+
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-nested-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-nested-expected.txt
index 2f6d415c..3aea069f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-nested-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-nested-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.getElementById("canary").clientWidth is 75
 PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
 PASS document.getElementById("picture_in_picture").clientWidth is 800
@@ -20,6 +21,6 @@
 PASS document.getElementById("picture_no_source").clientWidth is 75
 PASS currentSrcFileName("picture_no_source") is "blue_rect.jpg?6"
  
- 
- 
-     
+
+
+    
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-react-to-media-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-react-to-media-changes-expected.txt
index 4e7f4d21..f05defb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-react-to-media-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-react-to-media-changes-expected.txt
@@ -4,3 +4,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt
index a213547..64c45c9cc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt
@@ -10,4 +10,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
- 
+
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-and-srcset-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-and-srcset-expected.txt
index 47718f1..c24cd83 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-and-srcset-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-and-srcset-expected.txt
@@ -1,2 +1,2 @@
 CONSOLE WARNING: <source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead.
- 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-expected.txt
index 47718f1..c24cd83 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-picture-source-src-expected.txt
@@ -1,2 +1,2 @@
 CONSOLE WARNING: <source src> with a <picture> parent is invalid and therefore ignored. Please use <source srcset> instead.
- 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt
index f5778473f..cb2562d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-2x-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.getElementById("simple").clientWidth is window.innerWidth
 PASS currentSrcFileNameNoParams("simple") is "image-set-2x.png"
 PASS document.getElementById("small_sizes").clientWidth is 300
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change-expected.txt
index 46cc32a..b8ab823 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-change-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS currentSrcFileName("foo") is "image-set-4x.png"
 PASS internals.isLoadingFromMemoryCache("resources/image-set-4x.png") is true
 PASS internals.isLoadingFromMemoryCache("../../hidpi/resources/image-set-2x.png") is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-innerhtml-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-innerhtml-expected.txt
index c97331d..092bcf81 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-innerhtml-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-sizes-js-innerhtml-expected.txt
@@ -1,5 +1,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS fileName(window.testdiv.children[0].currentSrc) is "image-set-4x.png"
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt
index 267f3b9..bce6ccf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-absolute-url-expected.txt
@@ -4,6 +4,7 @@
 
 SUCCESS (document.images[0].src = file:///does/not/exist/test.jpg)
 SUCCESS (IconImages['grey'].src = file:///does/not/exist/test.jpg)
+
 After changing the base URL:
 
 SUCCESS (document.images[0].src = file:///does/not/exist/test.jpg)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-added-srcset-w-descriptors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-added-srcset-w-descriptors-expected.txt
index c394f9b8..e69af21f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-added-srcset-w-descriptors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-src-added-srcset-w-descriptors-expected.txt
@@ -4,3 +4,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-deregistration-after-move-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-deregistration-after-move-expected.txt
index 43e5eeed..b0a12e0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-deregistration-after-move-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-deregistration-after-move-expected.txt
@@ -2,3 +2,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-expected.txt
index a0c3a91..33a9bf86 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-expected.txt
@@ -4,3 +4,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-external-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-external-expected.txt
index a0c3a91..33a9bf86 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-external-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-iframe-external-expected.txt
@@ -4,3 +4,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-template-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-template-expected.txt
index d063695..48cbf70 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-template-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-in-template-expected.txt
@@ -10,3 +10,4 @@
 
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-invalid-url-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-invalid-url-no-crash-expected.txt
index 7b4bd9d2..3fefbe8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-invalid-url-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-invalid-url-no-crash-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS no crash.
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt
index 5139a88..0e603cf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-expected.txt
@@ -4,3 +4,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-px-based-sizes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-px-based-sizes-expected.txt
index 5139a88..0e603cf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-px-based-sizes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/image-srcset-react-to-media-changes-px-based-sizes-expected.txt
@@ -4,3 +4,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src-expected.txt
index 8e16b9f..ced99fd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLImageElement/parse-src-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testURL("src", url) is url
 PASS testURL("src", "\n" + url) is url
 PASS testURL("src", " " + url) is url
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain-expected.txt
index d845a236..97c23bb8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLIsIndexElement/prototype-chain-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS isIndex.__proto__ is HTMLUnknownElement.prototype
 PASS isIndex.__proto__.__proto__ is HTMLElement.prototype
 PASS isIndex.prompt is undefined.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/disabled-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/disabled-attribute-expected.txt
index be6fc71..6047a00 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/disabled-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/disabled-attribute-expected.txt
@@ -2,13 +2,13 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS test.disabled is false
 PASS test.disabled is true
 PASS test.sheet.disabled is true
 PASS test.sheet.disabled is false
 FAIL test.disabled should be false. Was true.
 
+
 PASS test_nostyle.sheet is null
 PASS test_nostyle.disabled is false
 FAIL test_nostyle.disabled should be false. Was true.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt
index 09a568f..247dee5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-expected.txt
@@ -7,4 +7,3 @@
 NICK_ONLOAD called
 NICK_ONLOAD called
 SUCCESS. Two loads.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt
index a144013b..1d03ec6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-and-subresource-test-nonexistent-expected.txt
@@ -5,4 +5,3 @@
 DNE_ONERROR called
 DNE_ONERROR called
 SUCCESS. Two errors.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-crossOrigin-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-crossOrigin-expected.txt
index 07112919..8cd4576 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-crossOrigin-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-crossOrigin-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS 'crossOrigin' in link is true
 PASS link.crossOrigin is null
 PASS link.setAttribute('crossorigin', ''); link.crossOrigin is "anonymous"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash-expected.txt
index b9339bf..456f394 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/link-preload-settings-no-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS no crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt
index bc6cf746..03337d0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/onload-completion-test-expected.txt
@@ -1,4 +1,5 @@
 This test verifies that at the time a body onload function is called that the subresources of this page (in particular the image) are already loaded. The page verifies that the image has the expected dimensions at the time of the onload event, and prints its result based on that. This is a regression test for a bug introduced by the patch for bug 3652.
 
 
+
 SUCCESS.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt
index 44311f82..730ebf6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-detached-expected.txt
@@ -1,3 +1 @@
 This test passes if it doesn't crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt
index 035c81c5..8ac0b16 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-expected.txt
@@ -1,3 +1,4 @@
 prefetch.link has MIME type text/plain
 This test requires DumpRenderTree to see the log of what resources are loaded.
+
 SUCCESS! prefetch onload called.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt
index 99a8cd9..0ad12b4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onerror-expected.txt
@@ -5,4 +5,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS onerror was called
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt
index dac6e93..4d60de4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-onload-expected.txt
@@ -3,4 +3,3 @@
 If it works you should see a message below saying the test has passed.
 
 TEST PASSED.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-too-many-clients-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-too-many-clients-expected.txt
index bb659bc..e13906a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-too-many-clients-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/prefetch-too-many-clients-expected.txt
@@ -1,5 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS we didn't crash.
+
 This test makes sure that a single prefetch element is not a client of multiple cachedresources at the same time; by repeatedly changing an existing link element, we will induce a double-notify bug if that element is not releasing its cachedresource on update.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/subresource-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/subresource-expected.txt
index 99af9191..4e4a1c4b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/subresource-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLLinkElement/subresource-expected.txt
@@ -2,5 +2,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS onload called!
+
 This test will only print "PASS" or "FAIL" if link prefetches are enabled, otherwise it will show nothing below.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-form-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-form-expected.txt
index 230bf60e..a716a43 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-form-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-element-form-expected.txt
@@ -1,3 +1,2 @@
-
 This test passes if the meter element doesn't have form attribute.
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-percent-size-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-percent-size-expected.txt
index a7cffbd..01dd194 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-percent-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/meter-percent-size-expected.txt
@@ -1,3 +1,3 @@
 Tests that percentage sizes on a meter element doesn't crash.
 
-       PASS
+    PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt
index 3c67ade..17aeed4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLMeterElement/set-meter-properties-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test values before properties were set
 PASS m.min is 0
 PASS m.value is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/children-changed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/children-changed-expected.txt
index fdac5c3..85ab29c5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/children-changed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/children-changed-expected.txt
@@ -1,3 +1,2 @@
 This tests that adding a child node with only whitespace to an object tag does not create a new subframe, causing an assert.
 SUCCESS!
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/fallback-content-behaviour-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/fallback-content-behaviour-expected.txt
index 40f28988..91858ac 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/fallback-content-behaviour-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/fallback-content-behaviour-expected.txt
@@ -1,16 +1,11 @@
 crbug.com/2210 - Rendering of fallback content is very inconsistent among browsers. This captures Blink's current rendering of each test case.
 
-
 PASS
-
 PASS
 X
 PASS
-
 PASS
-
 PASS
-
 PASS
 PASS
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/form/nested-form-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/form/nested-form-element-expected.txt
index b60d1c31..350d24c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/form/nested-form-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/form/nested-form-element-expected.txt
@@ -1,5 +1,3 @@
 This test checks whether WebKit can parse a page that contains <object> elements which are in nested and defective <form> elements. WebKit should not crash when it renders this page.
 
 PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/object-as-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/object-as-frame-expected.txt
index 394a069..9a7f7d38 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/object-as-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/object-as-frame-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS window.frames.length is 2
 PASS window.frames[0].frameElement.name is "frame"
 PASS window.frames[1].frameElement.name is "obj"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/update-data-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/update-data-expected.txt
index 1c5e843f1..40ce228a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/update-data-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLObjectElement/update-data-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS var u = 'resources/message-ping-on-load.html'; obj.data = u; obj.data.substr(obj.data.indexOf(u)) is "resources/message-ping-on-load.html"
 PASS <object> updated and loaded.
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-clone-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-clone-expected.txt
index 393ff88c..d28a6a2e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-clone-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-clone-expected.txt
@@ -7,3 +7,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-form-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-form-expected.txt
index 26be5b2..cdc693e9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-form-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-form-expected.txt
@@ -1,3 +1,2 @@
-
 This test passes if the progress element doesn't have form attribute.
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-indeterminate-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-indeterminate-crash-expected.txt
index 1fd3770..f545aca 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-indeterminate-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-indeterminate-crash-expected.txt
@@ -1,5 +1,6 @@
 Test for Bug 102459. OK if not crashed.
 
+
 PASS unless crash.
 
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-child-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-child-crash-expected.txt
index 1e17a1f2..6797889 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-child-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-child-crash-expected.txt
@@ -1,2 +1 @@
 Test for Bug 48019. It is OK not to crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt
index 7fcde3e..825dd60 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/progress-element-with-style-crash-expected.txt
@@ -1,2 +1 @@
 Test for Bug 50341. It is not OK to crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt
index b4644d6..63c740f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLProgressElement/set-progress-properties-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test values before properties were set
 PASS p.value is 0
 PASS p.max is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/module-script-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/module-script-expected.txt
index dfd9e5b9..87b2565 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/module-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/module-script-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Module scripts should be executed...
 ...and should ignore any 'language' attribute
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-async-attr-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-async-attr-expected.txt
index e867f40..565c5504 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-async-attr-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-async-attr-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS isAsync('s0') is false
 PASS isAsync('s1') is true
 PASS isAsync('s2') is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-crossOrigin-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-crossOrigin-expected.txt
index a724cd9..cd00dfa1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-crossOrigin-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-crossOrigin-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS 'crossOrigin' in script is true
 PASS script.crossOrigin is null
 PASS script.setAttribute('crossorigin', ''); script.crossOrigin is "anonymous"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src-expected.txt
index 9492c139..cda830a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-decoding-error-after-setting-src-expected.txt
@@ -1,2 +1,3 @@
 This case is for testing script decoding after setting its src attribute. See bug: http://bugs.webkit.org/show_bug.cgi?id=17732
+
 SUCCESS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-crash-expected.txt
index 5bbcdfa..14de7365 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-crash-expected.txt
@@ -3,3 +3,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-sync-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-sync-crash-expected.txt
index cacbbb7..1017a6ba 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-sync-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-by-onerror-sync-crash-expected.txt
@@ -3,3 +3,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-to-detached-document-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-to-detached-document-crash-expected.txt
index 6840c5d9..3fe0b78e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-to-detached-document-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-element-moved-to-detached-document-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution-expected.txt
index 5081faa..e770e7a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-for-attribute-unexpected-execution-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS for=window
 PASS for=anything
 PASS event=onload
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-load-events-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-load-events-expected.txt
index f510449..dc5b6f9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-load-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-load-events-expected.txt
@@ -1,2 +1,3 @@
 This tests for regressions against https://bugs.webkit.org/show_bug.cgi?id=5812 Generate load events for <script> elements.
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-load-failure-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-load-failure-expected.txt
index 32ce2f2..a125af1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-load-failure-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-load-failure-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated-expected.txt
index 392a70d7..db27e70 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLScriptElement/script-sync-onerror-not-repeated-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS numberOfTimesOnErrorHandlerHasRun is 0
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cloneNode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cloneNode-expected.txt
index e477924..481c50a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cloneNode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cloneNode-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS template.content.childNodes.length is 1
 PASS clone.content.childNodes.length is 1
 PASS clone.outerHTML is template.outerHTML
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/contentWrappers-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/contentWrappers-expected.txt
index 1b206aa..9dd39615 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/contentWrappers-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/contentWrappers-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS span.tagName is "SPAN"
 PASS span.expando is "present"
 PASS span.tagName is "SPAN"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt
index 79b2ff24..f0a70de 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing major GC...
 PASS customElement.expando is "present"
 Testing minor GC...
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-expected.txt
index 3ebed7b2..6e78d58 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS template.content.appendChild(template) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent..
 PASS template.content.appendChild(outerDiv) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent..
 PASS innerDiv.appendChild(template) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow-expected.txt
index 75d2a24..fdfa35c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/cycles-in-shadow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS shadowDiv.appendChild(outerDiv) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/import-template-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/import-template-expected.txt
index d7db191..3b4358a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/import-template-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/import-template-expected.txt
@@ -1,8 +1,8 @@
 CONSOLE WARNING: line 19: document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 mf1 created
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/importNode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/importNode-expected.txt
index 93850c9..fdc1a4d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/importNode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/importNode-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS template.content.childNodes.length is 1
 PASS imported.content.childNodes.length is 1
 PASS imported.outerHTML is template.outerHTML
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/inertContents-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/inertContents-expected.txt
index 8d954b0..d55cc25 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/inertContents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/inertContents-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testVal is "script has not run"
 PASS testVal is "script has run"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/innerHTML-inert-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/innerHTML-inert-expected.txt
index 344807f..0e2d00e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/innerHTML-inert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/innerHTML-inert-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS attemptedLoad is false
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association-expected.txt
index e83020b..a5bb96a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/no-form-association-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Form in document, input inside template:
 PASS form.length is 0
 PASS input.form is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-adoptNode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-adoptNode-expected.txt
index eeaa4fb..2fa0b60f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-adoptNode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-adoptNode-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Before adoption:
 PASS template.ownerDocument is not frameTemplate.ownerDocument
 PASS template.content.ownerDocument is not frameTemplate.content.ownerDocument
@@ -11,6 +10,7 @@
 PASS template.ownerDocument is frameTemplate.ownerDocument
 PASS template.content.ownerDocument is frameTemplate.content.ownerDocument
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-expected.txt
index 41880b6a..d86648a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS template.ownerDocument is document
 PASS template.content is content
 PASS templateContentOwnerDocument instanceof HTMLDocument is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt
index c4174d2..26e98c61 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS template.ownerDocument is not template.content.ownerDocument
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-no-defaultView-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-no-defaultView-expected.txt
index 350eaa52..54c9074 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-no-defaultView-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocument-no-defaultView-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS template.ownerDocument is not template.content.ownerDocument
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML-expected.txt
index bf69bffd..629dd3c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/HTMLTemplateElement/ownerDocumentXHTML-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document instanceof HTMLDocument is false
 PASS document is not templateContentOwnerDocument
 PASS templateContentOwnerDocument instanceof HTMLDocument is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/added-out-of-order-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/added-out-of-order-expected.txt
index dffbbb3..8bb0f37 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/added-out-of-order-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/added-out-of-order-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutations.length is 3
 PASS mutations[0].addedNodes.length is 0
 PASS mutations[0].removedNodes.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/callback-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/callback-arguments-expected.txt
index 89e32c9..2483557 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/callback-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/callback-arguments-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS thisArgument is mutationObserver
 PASS argument2 is mutationObserver
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/clear-transient-without-delivery-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/clear-transient-without-delivery-expected.txt
index 0f4d215..5422880 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/clear-transient-without-delivery-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/clear-transient-without-delivery-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutationsDelivered is false
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/create-during-delivery-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/create-during-delivery-expected.txt
index 1386dfa..4ac0561a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/create-during-delivery-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/create-during-delivery-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS order.length is 4
 PASS order[0] is 1
 PASS order[1] is 2
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/cross-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/cross-document-expected.txt
index 91ed4390..5cac2c7e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/cross-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/cross-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing basic aspects of cross-document observation.
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
@@ -10,6 +9,7 @@
 PASS mutations[0].attributeName is "id"
 PASS mutations[0].attributeNamespace is null
 
+
 Testing that subtree observation works after node is moved.
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
@@ -17,6 +17,7 @@
 PASS mutations[0].attributeName is "id"
 PASS mutations[0].attributeNamespace is null
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/database-callback-delivery-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/database-callback-delivery-expected.txt
index 4b4ef90..8e824c7c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/database-callback-delivery-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/database-callback-delivery-expected.txt
@@ -2,11 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
 PASS mutations[0].attributeName is "foo"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/delivery-order-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/delivery-order-expected.txt
index dae714eb..2f7b7eb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/delivery-order-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/delivery-order-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS order.length is 10
 PASS order[0] is 0
 PASS order[1] is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/disconnect-cancel-pending-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/disconnect-cancel-pending-expected.txt
index 3b5d97e7..58b05eb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/disconnect-cancel-pending-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/disconnect-cancel-pending-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Disconnecting should cancel any pending delivery...
 PASS mutations is null
 ...and re-observing should not see any of the previously-generated records.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/document-fragment-insertion-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/document-fragment-insertion-expected.txt
index f2f3ee3..5a062006 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/document-fragment-insertion-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/document-fragment-insertion-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing appendChild
 PASS mutations.length is 2
 PASS mutations[0].addedNodes.length is 0
@@ -10,6 +9,7 @@
 PASS mutations[1].addedNodes.length is 2
 PASS mutations[1].removedNodes.length is 0
 
+
 Testing insertBefore
 PASS mutations.length is 2
 PASS mutations[0].addedNodes.length is 0
@@ -17,6 +17,7 @@
 PASS mutations[1].addedNodes.length is 2
 PASS mutations[1].removedNodes.length is 0
 
+
 Testing replaceChild
 PASS mutations.length is 2
 PASS mutations[0].addedNodes.length is 0
@@ -24,6 +25,7 @@
 PASS mutations[1].addedNodes.length is 2
 PASS mutations[1].removedNodes.length is 1
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/filesystem-callback-delivery-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/filesystem-callback-delivery-expected.txt
index 6249761a..d98b2ffc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/filesystem-callback-delivery-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/filesystem-callback-delivery-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
 PASS mutations[0].attributeName is "foo"
@@ -10,6 +9,7 @@
 PASS mutations[0].type is "attributes"
 PASS mutations[0].attributeName is "baz"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutate-during-delivery-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutate-during-delivery-expected.txt
index 096c0d7..8b52a10 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutate-during-delivery-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutate-during-delivery-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS order.length is 3
 PASS order[0] is 1
 PASS order[1] is 3
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race-expected.txt
index 74fe9c0..b363f92 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-and-deletion-race-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt
index 5d16c5c..4b07ca02 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.WebKitMutationObserver is non-null.
 PASS typeof WebKitMutationObserver.prototype.observe is "function"
 PASS typeof WebKitMutationObserver.prototype.disconnect is "function"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-prefix-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-prefix-expected.txt
index ba7777e..627141f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-prefix-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-observer-prefix-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS noPrefixObserver instanceof WebKitMutationObserver is true
 PASS prefixObserver instanceof WebKitMutationObserver is true
 PASS noPrefixObserver instanceof MutationObserver is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-constructor-expected.txt
index 90c85dc..e75f280 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.MutationRecord is non-null.
 PASS typeof MutationRecord is "function"
 PASS new MutationRecord threw exception TypeError: Illegal constructor.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-nullity-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-nullity-expected.txt
index 7205664..4d758c4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-nullity-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/mutation-record-nullity-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 characterData record:
 PASS record.attributeName is null
 PASS record.attributeNamespace is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-attributes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-attributes-expected.txt
index cb949aa..06f783e6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-attributes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-attributes-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing basic aspects of attribute observation.
 ...can attribute changes be observed at all
 PASS mutations.length is 2
@@ -23,9 +22,11 @@
 PASS mutations[1].attributeName is "bar"
 PASS mutations[1].attributeNamespace is null
 
+
 Testing that observing without specifying "attributes" does not result in hearing about attribute changes.
 PASS mutations is null
 
+
 Testing that re-observing the same node with the same observer has the effect of resetting the options.
 PASS calls is 1
 PASS mutations.length is 1
@@ -33,6 +34,7 @@
 PASS mutations[0].attributeName is "foo"
 PASS mutations is null
 
+
 Testing that multiple observers can be registered to a given node and both receive mutations.
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
@@ -41,12 +43,14 @@
 PASS mutations2[0].type is "attributes"
 PASS mutations2[0].attributeName is "foo"
 
+
 Testing that "attributeNamespace" value is delivered properly.
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
 PASS mutations[0].attributeName is "foo"
 PASS mutations[0].attributeNamespace is "http://www.foo.com/bar"
 
+
 Testing that modifications to node properties which delegate to attribute storage deliver mutations.
 PASS mutations.length is 2
 PASS mutations[0].type is "attributes"
@@ -54,6 +58,7 @@
 PASS mutations[1].type is "attributes"
 PASS mutations[1].attributeName is "href"
 
+
 Testing mutation records are enqueued for attributes before DOMSubtreeModified is dispatched.
 PASS mutations.length is 2
 PASS mutations[0].type is "attributes"
@@ -61,6 +66,7 @@
 PASS mutations[1].type is "attributes"
 PASS mutations[1].attributeName is "baz"
 
+
 Testing basic oldValue delivery.
 PASS mutations.length is 3
 PASS mutations[0].type is "attributes"
@@ -73,6 +79,7 @@
 PASS mutations[2].attributeName is "bar"
 PASS mutations[2].oldValue is "boo"
 
+
 Testing that oldValue is delivered as requested (or not).
 PASS mutationsWithOldValue.length is 1
 PASS mutationsWithOldValue[0].type is "attributes"
@@ -83,12 +90,14 @@
 PASS mutations[0].attributeName is "foo"
 PASS mutations[0].oldValue is null
 
+
 An observer with multiple observations will get attributeOldValue if any entries request it.
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
 PASS mutations[0].attributeName is "foo"
 PASS mutations[0].oldValue is "bar"
 
+
 Testing setting an attribute via reflected IDL attribute.
 PASS mutations.length is 3
 PASS mutations[0].type is "attributes"
@@ -101,6 +110,7 @@
 PASS mutations[2].attributeName is "id"
 PASS mutations[2].oldValue is "bar"
 
+
 Testing that attributeFilter works as expected and observes case with HTML elements.
 ...only foo and bar should be received.
 PASS mutations.length is 2
@@ -111,6 +121,7 @@
 PASS mutations[1].attributeName is "bar"
 PASS mutations[1].attributeNamespace is null
 
+
 Testing the behavior of attributeFilter when the same observer observes at multiple nodes in a subtree with different filter options.
 ...only foo, bar & bat should be received.
 PASS mutations.length is 3
@@ -135,10 +146,12 @@
 PASS mutations[2].attributeName is "baz"
 PASS mutations[2].attributeNamespace is null
 
+
 Testing that setting an attributeFilter filters out namespaced attributes.
 ...pathLength should not be received.
 PASS mutations is null
 
+
 Testing that attributeFilter respects case with non-HTML elements.
 ...only ID, id, booM should be received.
 PASS mutations.length is 3
@@ -152,6 +165,7 @@
 PASS mutations[2].attributeName is "booM"
 PASS mutations[2].attributeNamespace is null
 
+
 Testing that modifying an elements style property dispatches Mutation Records.
 PASS mutations.length is 3
 PASS mutations[0].type is "attributes"
@@ -166,6 +180,7 @@
 ...mutation record created.
 PASS mutations is null
 
+
 Testing that modifying an elements style property dispatches Mutation Records with correct oldValues.
 PASS mutations.length is 3
 PASS mutations[0].type is "attributes"
@@ -180,9 +195,11 @@
 ...mutation record created.
 PASS mutations is null
 
+
 Testing that a no-op style property mutation does not create Mutation Records.
 PASS mutations is null
 
+
 Test that mutating an attribute through an attr node delivers mutation records
 PASS mutations.length is 1
 PASS mutations[0].target is div
@@ -190,6 +207,7 @@
 PASS mutations[0].attributeName is "data-test"
 PASS mutations[0].oldValue is "foo"
 
+
 Test that mutating via setAttributeNode delivers mutation records
 PASS mutations.length is 3
 PASS mutations[0].target is div
@@ -205,6 +223,7 @@
 PASS mutations[2].attributeName is "id"
 PASS mutations[2].oldValue is "myId"
 
+
 Test that setAttribute on an attribute with an existing Attr delivers mutation records
 PASS mutations.length is 1
 PASS mutations[0].target is div
@@ -212,6 +231,7 @@
 PASS mutations[0].attributeName is "data-test"
 PASS mutations[0].oldValue is "foo"
 
+
 Test that setNamedItem and removeNamedItem deliver mutation records
 PASS mutations.length is 2
 PASS mutations[0].target is div
@@ -223,6 +243,7 @@
 PASS mutations[1].attributeName is "data-test"
 PASS mutations[1].oldValue is "bar"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-characterdata-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-characterdata-expected.txt
index 1dff3b55..95868a9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-characterdata-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-characterdata-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing basic aspects of characterData observation.
 ...can characterData changes be observed at all
 PASS mutations.length is 1
@@ -17,9 +16,11 @@
 PASS mutations[1].type is "characterData"
 PASS mutations[1].target is charDataNode
 
+
 Testing that observing without specifying "characterData" does not result in hearing about characterData changes.
 PASS mutations is null
 
+
 Testing that multiple observers can be registered to a given node and both receive mutations.
 PASS mutations.length is 1
 PASS mutations[0].type is "characterData"
@@ -28,11 +29,13 @@
 PASS mutations2[0].type is "characterData"
 PASS mutations2[0].target is charDataNode
 
+
 Testing mutation records are enqueued for characterData before DOMSubtreeModified is dispatched.
 PASS mutations.length is 2
 PASS mutations[0].type is "characterData"
 PASS mutations[1].type is "attributes"
 
+
 Testing that oldValue is returned when requested.
 PASS mutations.length is 2
 PASS mutations[0].type is "characterData"
@@ -42,6 +45,7 @@
 PASS mutations[1].target is charDataNode
 PASS mutations[1].oldValue is "bar"
 
+
 Testing that oldValue is delivered as requested (or not).
 PASS mutationsWithOldValue.length is 1
 PASS mutationsWithOldValue[0].type is "characterData"
@@ -50,11 +54,13 @@
 PASS mutations[0].type is "characterData"
 PASS mutations[0].oldValue is null
 
+
 An observer with multiple observations will get characterDataOldValue if any entries request it.
 PASS mutations.length is 1
 PASS mutations[0].type is "characterData"
 PASS mutations[0].oldValue is "foo"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-childList-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-childList-expected.txt
index d7bb2764..48ae5a9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-childList-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-childList-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing basic aspects of childList observation.
 ...can childList changes be observed at all
 PASS mutations.length is 1
@@ -20,21 +19,25 @@
 PASS mutations[1].removedNodes.length is 1
 PASS mutations[1].removedNodes[0] is removedDiv2
 
+
 Testing that observing without specifying "childList" does not result in hearing about childList changes.
 PASS mutations is null
 
+
 Testing that re-observing the same node with the same observer has the effect of resetting the options.
 PASS calls is 1
 PASS mutations.length is 1
 PASS mutations[0].type is "childList"
 PASS mutations is null
 
+
 Testing that multiple observers can be registered to a given node and both receive mutations.
 PASS mutations.length is 1
 PASS mutations[0].type is "childList"
 PASS mutations2.length is 1
 PASS mutations2[0].type is "childList"
 
+
 Testing that innerText and innerHTML always result in a single childList mutation.
 ...innerHTML
 PASS mutations.length is 1
@@ -52,6 +55,7 @@
 PASS mutations[0].addedNodes.length is 1
 PASS mutations[0].removedNodes.length is 3
 
+
 Testing that replaceChild results in minimal childList mutations.
 ...simple replace child
 PASS mutations.length is 1
@@ -69,6 +73,7 @@
 PASS mutations[0].removedNodes.length is 1
 PASS mutations[0].removedNodes[0] is removedDiv1
 
+
 Testing that insertBefore results in minimal childList mutations.
 PASS mutations.length is 1
 PASS mutations[0].type is "childList"
@@ -77,6 +82,7 @@
 PASS mutations[0].addedNodes[1] is addedDiv2
 PASS mutations[0].removedNodes.length is 0
 
+
 Testing that appendChild results in minimal childList mutations.
 PASS mutations.length is 1
 PASS mutations[0].type is "childList"
@@ -85,9 +91,11 @@
 PASS mutations[0].addedNodes[1] is addedDiv2
 PASS mutations[0].removedNodes.length is 0
 
+
 Setting an empty childlist to the empty string with innerHTML should not assert.
 PASS mutations is null
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt
index 621b3907..1e92755 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-exceptions-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS observer.observe() threw exception TypeError: Failed to execute 'observe' on 'MutationObserver': 1 argument required, but only 0 present..
 PASS observer.observe(null) threw exception TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'..
 PASS observer.observe(undefined) threw exception TypeError: Failed to execute 'observe' on 'MutationObserver': parameter 1 is not of type 'Node'..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-options-character-data-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-options-character-data-expected.txt
index 06961c1..6b2dc1c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-options-character-data-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-options-character-data-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS records.length is 1
 PASS records[0].oldValue is "0"
 PASS records.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-subtree-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-subtree-expected.txt
index b894dcd..7a9b97e1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-subtree-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observe-subtree-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing basic aspects of subtree observation.
 ...attribute and characterData changes in subtree
 PASS mutations.length is 2
@@ -13,6 +12,7 @@
 PASS mutations[1].type is "characterData"
 PASS mutations[1].target is subDiv.firstChild
 
+
 Testing two observers at different depths.
 PASS mutations.length is 1
 PASS mutations[0].type is "attributes"
@@ -25,6 +25,7 @@
 PASS mutations2[0].attributeName is "foo"
 PASS mutations2[0].attributeNamespace is null
 
+
 Testing one observer at two different depths.
 PASS calls is 1
 PASS mutations.length is 1
@@ -33,6 +34,7 @@
 PASS mutations[0].attributeName is "foo"
 PASS mutations[0].attributeNamespace is null
 
+
 Testing that transiently detached nodes are still observed via subtree.
 ...both changes should be received. Change detached subDiv again.
 PASS mutations.length is 2
@@ -54,6 +56,7 @@
 PASS mutations[0].type is "characterData"
 PASS mutations[0].target is subDiv.firstChild
 
+
 Testing correct behavior of transient observation with complex movement .
 ...All changes should be received except for setting the "d" attribute on subDiv3 before it was reachable from div.
 PASS mutations.length is 6
@@ -75,6 +78,7 @@
 PASS mutations[5].target is subDiv2
 PASS mutations[5].attributeName is "g"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-expected.txt
index c8c0f2e..0283e49 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS observer.testProperty is true
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-transient-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-transient-expected.txt
index 963a553..abac1994 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-transient-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/observer-wrapper-dropoff-transient-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS observer.testProperty is true
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/parser-mutations-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/parser-mutations-expected.txt
index a84ead7c2..dd21042b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/parser-mutations-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/parser-mutations-expected.txt
@@ -35,7 +35,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-Mutation records should be delivered for all parser mutations after the above script.
 
 
+Mutation records should be delivered for all parser mutations after the above script.
+
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/removed-out-of-order-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/removed-out-of-order-expected.txt
index 0dce8bdd..0a8654e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/removed-out-of-order-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/removed-out-of-order-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutations.length is 2
 PASS mutations[0].addedNodes.length is 2
 PASS mutations[0].removedNodes.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-append-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-append-expected.txt
index 4c89f3e..523bf6b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-append-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-append-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutationsDelivered is false
 PASS scriptDidRun is false
 PASS scriptDidRun is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-end-tag-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-end-tag-expected.txt
index 56a637b..4966155 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-end-tag-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/script-end-tag-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutationsDelivered is false
 PASS mutationsDelivered is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/shadow-dom-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/shadow-dom-expected.txt
index ebbdfdd0..85e0556 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/shadow-dom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/shadow-dom-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Mutations in shadow DOM should have been observed:
 PASS mutations.length is 4
 PASS mutations[0].type is "attributes"
@@ -16,3 +15,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/takeRecords-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/takeRecords-expected.txt
index ac64426a..837c9c38 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/takeRecords-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/takeRecords-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing takeRecords.
 ...records are taken synchronously.
 PASS mutations.length is 2
@@ -18,6 +17,7 @@
 PASS mutations[0].target is subDiv
 PASS mutations[0].attributeName is "foo"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/transient-gc-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/transient-gc-crash-expected.txt
index a10c01f..bfefc7fb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/transient-gc-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/MutationObserver/transient-gc-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutations.length is 1
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/detach-no-op-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/detach-no-op-expected.txt
index ecee368..5a4cc3e6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/detach-no-op-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeIterator/detach-no-op-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS iterator.nextNode().id is "a"
 PASS iterator.detach() did not throw exception.
 PASS iterator.nextNode().id is "b"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt
index c5b8ca4b..e30e6d7a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-1-expected.txt
@@ -1,3 +1 @@
 Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt
index c5b8ca4b..e30e6d7a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/5725058-crash-scenario-3-expected.txt
@@ -1,3 +1 @@
 Test for (rdar://problem/5725058). If you see this text, then all is well and no crash has occurred.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
index 58181780..d4c72ee8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/adoptNode-node-list-cache-expected.txt
@@ -1,2 +1 @@
-
 TEST PASSED - Unless an assertion or crash happens soon.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt
index f1c8c04..d0de93f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/invalidate-node-lists-when-parsing-expected.txt
@@ -7,4 +7,3 @@
 before: not found
 after: found
 onload: found
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt
index 814b456..a1cd775 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-assignment-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS first == null is false
 PASS nodeList[0] is first
 PASS nodeList[0] is first
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt
index 633ce28..4fda8e3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-call-as-function-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS nodeList(0) threw exception TypeError: nodeList is not a function.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt
index 1c4040d..8ac246e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-index-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 text1
 text2
 
+
 PASS div0 == div0s is true
 PASS div0 == div0s_ is false
 PASS div0 == div1 is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt
index 32ff0a7..9e7470a0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-item-with-name-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 text1
 text2
 
+
 PASS div1 instanceof HTMLDivElement is true
 PASS div2 instanceof HTMLDivElement is true
 PASS div1.innerHTML is 'text1'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt
index a3b5f18..b1028dd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-namespace-invalidation-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS appendImageWithId('firstImage'); nodeList = container.getElementsByTagNameNS(namespace, 'img'); nodeList.item(0).id is 'firstImage'
 PASS nodeList.length is 1
 PASS appendImageWithId('secondImage'); container.removeChild(container.firstChild); nodeList.item(0).id is 'secondImage'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable-expected.txt
index 50943e4..dd11cd40 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/NodeList/nodelist-reachable-expected.txt
@@ -7,4 +7,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
  
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/acid3-surround-contents-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/acid3-surround-contents-expected.txt
index 5ddf6aa..80ffe61d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/acid3-surround-contents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/acid3-surround-contents-expected.txt
@@ -1,4 +1,3 @@
-
 The test below should report no failures, and should say PASS at the end.
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-1-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-1-expected.txt
index d4481dd..4e5deff5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-1-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-1-expected.txt
@@ -1,4 +1,3 @@
 This tests to see that Range::compareBoundaryPoints throws a WrongDocumentError exception if the two ranges are in different documents, or if one is detached.
 
 food
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-2-expected.txt
index b6d15e8..68bf4e3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/compareBoundaryPoints-2-expected.txt
@@ -2,6 +2,7 @@
 
 Some text.
 
+
 START_TO_START = 1
 START_TO_END = 1
 END_TO_START = -1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/deleteContents-doctype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/deleteContents-doctype-expected.txt
index 0d48686..80d4fce 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/deleteContents-doctype-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/deleteContents-doctype-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS range.deleteContents() did not throw exception.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/detach-no-op-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/detach-no-op-expected.txt
index 4fab79505..ee3e85b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/detach-no-op-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/detach-no-op-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS range.startContainer is link
 PASS range.startOffset is 0
 PASS range.endContainer is link
@@ -19,4 +18,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 testlink
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/getBoundingClientRect-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/getBoundingClientRect-expected.txt
index df54d6d..395a8e96 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/getBoundingClientRect-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/getBoundingClientRect-expected.txt
@@ -6,6 +6,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 2
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "452.000"
@@ -14,6 +15,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 3
 PASS rect.left.toFixed(3) is "8.000"
 PASS rect.top.toFixed(3) is "1044.000"
@@ -22,6 +24,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 4
 PASS rect.left.toFixed(3) is "0.000"
 PASS rect.top.toFixed(3) is "0.000"
@@ -30,6 +33,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 Test 5
 PASS rect.left.toFixed(3) is "-14.574"
 PASS rect.top.toFixed(3) is "1761.947"
@@ -38,6 +42,7 @@
 PASS Math.abs(rect.left + rect.width - rect.right) < 0.001 is true
 PASS Math.abs(rect.top + rect.height - rect.bottom) < 0.001 is true
 
+
 Test 6
 PASS rect.left.toFixed(3) is "0.000"
 PASS rect.top.toFixed(3) is "0.000"
@@ -46,6 +51,7 @@
 PASS rect.right is rect.left + rect.width
 PASS rect.bottom is rect.top + rect.height
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/getClientRects-character-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/getClientRects-character-expected.txt
index 123764d..c26c191 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/getClientRects-character-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/getClientRects-character-expected.txt
@@ -9,5 +9,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
 ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash-expected.txt
index 6fd8d8ea..2c78f9eb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/insertNode-empty-fragment-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS r.toString() is ""
 PASS p.childNodes.length is 2
 PASS p.childNodes[0] is t1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty-expected.txt
index e62b471..2357d3dc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-clone-empty-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS r.cloneContents() != undefined is true
 PASS r.cloneContents() != null is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-comparePoint-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-comparePoint-expected.txt
index fdcd7206..cbe919e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-comparePoint-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-comparePoint-expected.txt
@@ -1,23 +1,33 @@
 test 1 passed
 
+
 test 2 passed
 
+
 test 3 passed
 
+
 test 4 passed
 
+
 test 5 passed
 
+
 test 6 passed
 
+
 test 7 passed
 
+
 test 8 passed
 
+
 test 9 passed
 
+
 test 10 passed
 
+
 test 11 passed
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-constructor-expected.txt
index 397d271..473e5ef 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-constructor-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS typeof new Range is "object"
 PASS Object.prototype.toString.call(new Range) is "[object Range]"
 PASS new Range instanceof Range is true
@@ -14,5 +13,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Test
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions-expected.txt
index 670454b..64d2d5c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-exceptions-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS node.innerHTML is '<bar>AB<moo>C</moo>DE</bar>'
 PASS r.surroundContents(document.createElement('a')) threw exception InvalidStateError: Failed to execute 'surroundContents' on 'Range': The Range has partially selected a non-Text node..
 PASS r.surroundContents(document.createElement('a')) threw exception HierarchyRequestError: Failed to execute 'surroundContents' on 'Range': Nodes of type 'A' may not be inserted inside nodes of type '#comment'..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-expand-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-expand-expected.txt
index aa8996d5..a7246497 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-expand-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-expand-expected.txt
@@ -9,12 +9,13 @@
 Cell A1	Cell B1
 Cell A2	Cell B2
 Section 1
+
 text.
 
 Section 2
+
 text.
 
 Here is a positioned element.
 在甲型H1N1流感可能出现大流行的警告声中,昨天召开的江苏省2009-2010年度流感防制研讨会注定与往年不同。每年都会召开的一次例会,今年足足提前了一个月;会上研讨的主题,已从以前的季节性流感,变成以甲型H1N1流感为重点。
 בלשכת שר החוץ הגיבו להתקפות עליו בעקבות הנחייתו לדרוש מהמועמדים לקורס צוערים שירות צבאי או לאומי: "המתקיפים צבועים, מי שרוצה לייצג את המדינה רוצה גם לשרת אותה"
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-assertion-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-assertion-expected.txt
index dd3fdbdf..55bbf60 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-assertion-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-assertion-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS if this did not crash.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer-expected.txt
index 553ca5a..dea9bafd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-separate-endContainer-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS r.toString() is "ABC"
 PASS p.childNodes.length is 4
 PASS p.childNodes[0] is t1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext-expected.txt
index 344c2a4..47f03617 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-insertNode-splittext-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS p.childNodes.length is 3
 PASS p.childNodes[0] is t1
 PASS p.childNodes[0].data is "12"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt
index 6030c6c..4dd3e9c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-intersectsNode-expected.txt
@@ -3,64 +3,82 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 1.1 Node starts before the range and ends before the range
 PASS intersects is false
 
+
 1.2 Node starts before the range, and range ends on a 1
 PASS intersects is true
 
+
 1.3 Node starts before the range and ends within the range
 PASS intersects is true
 
+
 1.4 Range starts on 0, and node starts before range and ends in range
 PASS intersects is true
 
+
 1.5 Node starts and ends in range
 PASS intersects is true
 
+
 1.6 Node starts in the range, and the range ends on 1
 PASS intersects is true
 
+
 1.7 Node starts in the range, and ends after the range
 PASS intersects is true
 
+
 1.8 Range start on 1, node starts in range and ends after
 PASS intersects is true
 
+
 1.9 Node starts on range start and ends on range end
 PASS intersects is true
 
+
 1.10 Node starts after range end and ends after range end
 PASS intersects is false
 
+
 1.11 Node starts before range start and ends after range end
 PASS intersects is true
 
+
 1.12 Node starts before range start and range begins and ends on 1
 PASS intersects is true
 
+
 1.13 Range starts at 0 and ends at 1
 PASS intersects is true
 
+
 2.1 Detached Range, attached node
 PASS detachedRange.intersectsNode(document.getElementById('a1')) is false
 
+
 2.2 attached range, detached node
 PASS intersects is false
 
+
 2.3 Node has no parent
 PASS intersects is true
 
+
 2.4 Range has no parent
 PASS range.selectNode(document) threw exception InvalidNodeTypeError: Failed to execute 'selectNode' on 'Range': the given Node has no parent..
 
+
 2.5 Wrong documents
 PASS intersects is false
 
+
 2.6 Node deleted
 PASS range.intersectsNode(node) threw exception TypeError: Failed to execute 'intersectsNode' on 'Range': parameter 1 is not of type 'Node'..
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-isPointInRange-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-isPointInRange-expected.txt
index 1a39881..dfaaafa 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-isPointInRange-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-isPointInRange-expected.txt
@@ -1,21 +1,30 @@
 test 1 passed
 
+
 test 2 passed
 
+
 test 3 passed
 
+
 test 4 passed
 
+
 test 5 passed
 
+
 test 6 passed
 
+
 test 7 passed
 
+
 test 8 passed
 
+
 test 9 passed
 
+
 test 10 passed
 
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents-expected.txt
index 1a0b54d..0acbfb4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-modifycontents-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Start test 1
 PASS r.startOffset is 0
 PASS r.endOffset is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/range-toString-non-anchor-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/range-toString-non-anchor-no-crash-expected.txt
index f1bd3fd..0eddc3f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/range-toString-non-anchor-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/range-toString-non-anchor-no-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS r.toString() is "PASS"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/select-node-different-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/select-node-different-document-expected.txt
index f107aac..57c03c0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/select-node-different-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/select-node-different-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS selectNodeRange.startContainer === otherDocument.documentElement is true
 PASS selectNodeRange.endContainer === otherDocument.documentElement is true
 PASS selectNodeRange.startContainer.ownerDocument === otherDocument is true
@@ -17,3 +16,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/set-wrong-document-err-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/set-wrong-document-err-expected.txt
index c6cdaaded..cfc21d6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/set-wrong-document-err-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/set-wrong-document-err-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS range.setStart(iframe.contentDocument.body, 0) did not throw exception.
 PASS range.startContainer is iframe.contentDocument.body
 PASS range.collapsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/split-text-in-range-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/split-text-in-range-expected.txt
index b4f23da..536aafe 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/split-text-in-range-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/split-text-in-range-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS  if the test wasn't terminated by an assertion.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/surround-contents-font-face-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/surround-contents-font-face-crash-expected.txt
index 5043424..a8d3008 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/surround-contents-font-face-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/surround-contents-font-face-crash-expected.txt
@@ -1,5 +1,5 @@
 ALERT: PASS. WebKit didn't crash.
 This page contains the following errors:
 error on line 20 at column 10: Extra content at the end of the document
-Below is a rendering of the page up to the first error.
 
+Below is a rendering of the page up to the first error.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-check-boundary-points-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-check-boundary-points-expected.txt
index 432a8e0..c4ee24d5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-check-boundary-points-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-check-boundary-points-expected.txt
@@ -1,4 +1,3 @@
 Test for bug 21060: Range#surroundContents incorrectly throws BAD_BOUNDARYPOINTS_ERR.
 
-
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-crash-expected.txt
index 80e74e57..5c7932d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Range/surroundContents-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS textContainer.childNodes.length is 2
 PASS range.startContainer === textContainer is true
 PASS range.startOffset is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/bug-17313-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/bug-17313-expected.txt
index 760626a..71dbe3b0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/bug-17313-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/bug-17313-expected.txt
@@ -1,2 +1,3 @@
 Test case for bug 17313
+
 The test has passed if reloading the page does not crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element-expected.txt
index 52d5d65..7dfd52da 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/detached-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS root.querySelector('div') is correctNode
 PASS root.querySelector('#testId') is correctNode
 PASS root.querySelectorAll('div').length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/document-fragment-nth-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/document-fragment-nth-expected.txt
index 2a4517a..4c270f7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/document-fragment-nth-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/document-fragment-nth-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS fragment.querySelector(":nth-child(12)").id is "pass"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2-expected.txt
index e9e8b6f..e4cccb2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-2-expected.txt
@@ -1,4 +1,5 @@
 line 4
+
 line 5
 
 PASS testQuerySelectorAll(document, ".target + div") is "[object HTMLDivElement], [object HTMLDivElement], length: 2"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict-expected.txt
index 6b37fc92..4dcacf5e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-almost-strict-expected.txt
@@ -1,8 +1,10 @@
 Line 1
 Line 2
+
 Line 3
 
 line 4
+
 line 5
 
 Document.querySelectorAll
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-expected.txt
index 6b37fc92..4dcacf5e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/dumpNodeList-expected.txt
@@ -1,8 +1,10 @@
 Line 1
 Line 2
+
 Line 3
 
 line 4
+
 line 5
 
 Document.querySelectorAll
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt
index 4170a20..2ceaa5a1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/duplicate-id-scope-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelectorAll('#duplicateId1').length is 6
 PASS document.querySelectorAll('#duplicateId2').length is 2
 PASS scopeDiv.querySelectorAll('#duplicateId1').length is 4
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot-expected.txt
index b6b2cad..3f08cdcb4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/elementRoot-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS root.querySelector('div') is correctNode
 PASS root.querySelectorAll('div').length is 1
 PASS root.querySelectorAll('div').item(0) is correctNode
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-almost-strict-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-almost-strict-expected.txt
index d6ef615c..805bbdcebb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-almost-strict-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-almost-strict-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelector('#testId') is correctNode
 PASS document.querySelector('div#testId') is correctNode
 PASS document.querySelector('ul#testId') is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-expected.txt
index 5bba8e0..35507c5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelector('div#testid') is correctNode
 PASS document.querySelector('#testid') is correctNode
 PASS document.querySelector('ul#testid') is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-strict-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-strict-expected.txt
index eb9317a..56d67c8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-strict-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/id-fastpath-strict-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelector('#testId') is correctNode
 PASS document.querySelector('div#testId') is correctNode
 PASS document.querySelector('ul#testId') is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth-expected.txt
index a65775e..2216eade 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/loose-subtree-nth-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS root.querySelector(":nth-child(12)").id is "pass"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/namespaced-elements-and-selectors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/namespaced-elements-and-selectors-expected.txt
index 22a2eb7..0eb400f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/namespaced-elements-and-selectors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/namespaced-elements-and-selectors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS sandbox.querySelectorAll('span').length is 3
 PASS sandbox.querySelectorAll('*|span').length is 3
 PASS sandbox.querySelectorAll('|span').length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt
index 0f9a110..fda304a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelector('body /deep/ #target').id is "target"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test-expected.txt
index 77b42ee..d0d5ab52 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/resig-SelectorsAPI-test-expected.txt
@@ -1,4 +1,5 @@
 Selectors API Test Suite
+
 Testrunner by John Resig, tests by John Resig, Disruptive Innovations, W3C CSS Working Group, jQuery JavaScript Library.
 
  Show only failing tests.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify-expected.txt
index 6e97ed3..781625e2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/undefined-null-stringify-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelector(null) is nullNode
 PASS document.querySelector(undefined) is undefinedNode
 PASS document.querySelectorAll(null).length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document-expected.txt
index 011c114ba..4e54eea 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/SelectorAPI/viewless-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testDoc.querySelector('p') is p1
 PASS testDoc.querySelectorAll('span').length is 2
 PASS testDoc.querySelectorAll('span').item(1) is s2
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt
index 37da51a..0196746 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/css-medialist-item-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mediaList.length is 2
 PASS mediaList[0] is "screen"
 PASS mediaList[1] is "print"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper-expected.txt
index 7e31a5f..9e6f05ae 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-parent-rule-without-wrapper-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getStyleSheetRules().length is 1
 Removing <style>...
 PASS rule.parentRule is not null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-expected.txt
index 2cf0ea7b..b872cbcf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-link-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-link-expected.txt
index 2cf0ea7b..b872cbcf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-link-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-sheet-owner-node-link-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-style-pi-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-style-pi-expected.txt
index 5eca1e4..10666ff 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-style-pi-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-style-pi-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS sheet.ownerNode is pi
 PASS pi.sheet === sheet is true
 Removing <pi>...
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper-expected.txt
index a3df174..39062d0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/detached-stylesheet-without-wrapper-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS rule.parentStyleSheet is not null
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt
index 0a2374c9..7258522 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS oldSheet.ownerNode is null
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt
index 90bd866..eb613232 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-declaration-parent-rule-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS style.parentRule.foo is "bar"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt
index 28aebd9fae..ce9867bf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-rule-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS style.sheet is an instance of CSSStyleSheet
 PASS style.sheet is null
 PASS rule.parentRule.foo is "bar"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt
index a983fa28..5d0856ce 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-parent-stylesheet-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS style.sheet is an instance of CSSStyleSheet
 PASS style.sheet is null
 PASS rule.parentStyleSheet.foo is "0"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers-expected.txt
index 97907ea..e925e99 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-rule-children-wrappers-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.styleSheets[0].cssRules[0].type is CSSRule.IMPORT_RULE
 PASS document.styleSheets[0].cssRules[0].media.foo is 'bar'
 PASS document.styleSheets[0].cssRules[0].type is CSSRule.IMPORT_RULE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-styleheet-wrapper-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-styleheet-wrapper-expected.txt
index bb6ce88..790a942 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-styleheet-wrapper-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/gc-styleheet-wrapper-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.firstChild.sheet.title is 'testSheet'
 PASS document.firstChild.sheet.foo is 'bar'
 PASS document.getElementsByTagName('link')[0].sheet.title is 'testSheet'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt
index 31fb4c8..8a3b83e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/StyleSheet/get-stylesheet-byname-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.styleSheets["test"] is styleElement.sheet
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt
index f42f30f..397c4e1a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/TreeWalker-currentNode-expected.txt
@@ -2,21 +2,25 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test that TreeWalker.parent() doesn't set the currentNode to a node not under the root.
 
+
 PASS w.currentNode is subTree
 PASS w.parentNode() is null
 PASS w.currentNode is subTree
 
+
 Test that setting the currentNode to non-Node values throws.
 
+
 PASS w.currentNode = null threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': The provided value is not of type 'Node'..
 PASS w.currentNode = {} threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': The provided value is not of type 'Node'..
 PASS w.currentNode = window threw exception TypeError: Failed to set the 'currentNode' property on 'TreeWalker': The provided value is not of type 'Node'..
 
+
 Test that we handle setting the currentNode to arbitrary nodes not under the root element.
 
+
 PASS w.parentNode() is null
 PASS w.currentNode is document.documentElement
 PASS w.nextNode() is document.documentElement.firstChild
@@ -32,8 +36,10 @@
 PASS w.previousSibling() is null
 PASS w.currentNode is document.documentElement
 
+
 Test how we handle the case when the traversed to node within the root, but the currentElement is not.
 
+
 PASS w.nextNode() is subTree
 PASS w.lastChild() is subTree
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt
index eebe3da3..52af07a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/acceptNode-filter-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing with raw function filter
  filtering node A1 [this=[object Window]]
 PASS walker.firstChild(); walker.currentNode.id is 'A1'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
index c7213aac..662029b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/filter-throw-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing with object filter
 Test with filter function
 PASS walker.firstChild(); threw exception filter exception.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt
index 0ba7bb45..05a95a5a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousNodeLastChildReject-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS walker.firstChild(); walker.currentNode.id is 'A1'
 PASS walker.nextNode(); walker.currentNode.id is 'B1'
 PASS walker.nextNode(); walker.currentNode.id is 'C1'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt
index 4cc3b5ed..bf992e6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/previousSiblingLastChildSkip-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS walker.firstChild(); walker.currentNode.id is 'A1'
 PASS walker.nextNode(); walker.currentNode.id is 'C1'
 PASS walker.nextNode(); walker.currentNode.id is 'C2'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt
index 89a3127..bd92b13 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-reject-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 Testing nextNode
 PASS walker.nextNode(); walker.currentNode.id is 'A1'
 PASS walker.nextNode(); walker.currentNode.id is 'B2'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt
index 65bf98f5..f19f1dd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 Testing nextNode
 PASS walker.nextNode(); walker.currentNode.id is 'A1'
 PASS walker.nextNode(); walker.currentNode.id is 'C1'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt
index 2be59a2..ba5f340 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/TreeWalker/traversal-skip-most-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 Testing nextSibling
 PASS walker.firstChild(); walker.currentNode.id is 'B1'
 PASS walker.nextSibling(); walker.currentNode.id is 'B3'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
index a7b745e..d5917d0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/URL-attribute-reflection-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testURLReflection('attribute', 'element') is 'none'
 PASS testURLReflection('id', 'element') is 'non-URL'
 PASS testURLReflection('action', 'form') is 'URL'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes-expected.txt
index 881f051..6ed089f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLBodyElement-window-eventListener-attributes-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.onblur is func
 PASS window.onblur is document.body.onblur
 PASS window.onfocus is func
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes-expected.txt
index e28b08b..acd4845 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/HTMLFrameSetElement-window-eventListener-attributes-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.onblur is func
 PASS window.onblur is frameSet.onblur
 PASS window.onfocus is func
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt
index 83a0849..9580641 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/Location/set-location-after-close-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString-expected.txt
index 118917d..d553896 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-js-object-with-toString-expected.txt
@@ -1,5 +1,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS result is 'pass.html'
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-string-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-string-expected.txt
index 118917d..d553896 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/Location/window-shadow-location-using-string-expected.txt
@@ -1,5 +1,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS result is 'pass.html'
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt
index 23f9d0d..8c6fd51 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/anonymous-slot-with-changes-expected.txt
@@ -61,3 +61,4 @@
 PASS: eventData is done of type string
 PASS: eventData is done of type string
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/closure-access-after-navigation-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/closure-access-after-navigation-iframe-expected.txt
index 53ee75a..0c8c899 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/closure-access-after-navigation-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/closure-access-after-navigation-iframe-expected.txt
@@ -13,3 +13,4 @@
 getObjectOfParent().myVal = parent
 getGlobalOfParent().myGlobalVal = parent
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/customized-property-survives-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/customized-property-survives-gc-expected.txt
index b836e4c..565e194 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/customized-property-survives-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/customized-property-survives-gc-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.screen.myProp is 10
 PASS window.history.myProp is 10
 PASS window.locationbar.myProp is 10
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/device-pixel-ratio-on-zoom-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/device-pixel-ratio-on-zoom-expected.txt
index e932e9e..fea0dd18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/device-pixel-ratio-on-zoom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/device-pixel-ratio-on-zoom-expected.txt
@@ -16,4 +16,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 Tests that window.devicePixelRatio is updated on zoom.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent-expected.txt
index c4c97e96..92d7866 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/dispatchEvent-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.dispatchEvent(event) threw exception TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'..
 PASS window.dispatchEvent(event) threw exception InvalidStateError: Failed to execute 'dispatchEvent' on 'EventTarget': The event provided is uninitialized..
 PASS myEventDispatched is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/dom-access-from-closure-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/dom-access-from-closure-iframe-expected.txt
index e3238d4c..f72ab9f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/dom-access-from-closure-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/dom-access-from-closure-iframe-expected.txt
@@ -3,3 +3,4 @@
 name: child
 window.name: child
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/es52-globals-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/es52-globals-expected.txt
index b7d3026f..9ea8aece 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/es52-globals-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/es52-globals-expected.txt
@@ -14,3 +14,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/file-origin-window-open-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/file-origin-window-open-expected.txt
index 2271d96..68726f20 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/file-origin-window-open-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/file-origin-window-open-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS SecurityError: Blocked a frame with origin "null" from accessing a cross-origin frame.
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol-expected.txt
index 7d1cec4..8203a8a94 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/invalid-protocol-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS location.protocol = '' threw exception SyntaxError: Failed to set the 'protocol' property on 'Location': '' is an invalid protocol..
 PASS location.protocol = ':' threw exception SyntaxError: Failed to set the 'protocol' property on 'Location': ':' is an invalid protocol..
 PASS location.protocol = 'é' threw exception SyntaxError: Failed to set the 'protocol' property on 'Location': 'é' is an invalid protocol..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/name-and-opener-on-detached-window-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/name-and-opener-on-detached-window-expected.txt
index 3f353264..ccc587d4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/name-and-opener-on-detached-window-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/name-and-opener-on-detached-window-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS childWindow.name is 'oldname'
 PASS childWindow.opener is null
 PASS childWindow.name is ''
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/open-after-frame-detached-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/open-after-frame-detached-expected.txt
index 5f73321..32a89b8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/open-after-frame-detached-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/open-after-frame-detached-expected.txt
@@ -2,8 +2,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS childWindow.open('about:blank') is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/open-invalid-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/open-invalid-arguments-expected.txt
index e23fe6b..21e9b94a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/open-invalid-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/open-invalid-arguments-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS newWindow = window.open(nonConvertibleToString) threw exception Exception in toString().
 PASS newWindow is null
 PASS newWindow = window.open('about:blank', nonConvertibleToString) threw exception Exception in toString().
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt
index e737600..0175dd8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-detach-in-handler-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Received message msg
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-to-self-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-to-self-expected.txt
index 8ef5fdf..44de9e8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-to-self-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/post-message-to-self-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Received message msg
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt
index accdd4a..acd2ed3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-in-closure-after-navigation-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window is self
 PASS window is frames
 PASS parent is top
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
index cb70d277..35bde7b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-navigated-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.cached_applicationCache.oncached is null
 PASS window.cached_applicationCache.onchecking is null
 PASS window.cached_applicationCache.ondownloading is null
@@ -119,4 +118,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
  
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
index a558dde..e47d0d6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.cached_applicationCache.oncached is null
 PASS window.cached_applicationCache.onchecking is null
 PASS window.cached_applicationCache.ondownloading is null
@@ -120,3 +119,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
index e2133f2..6041ee0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-properties-after-frame-removed-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.cached_applicationCache.oncached is null
 PASS window.cached_applicationCache.onchecking is null
 PASS window.cached_applicationCache.ondownloading is null
@@ -120,3 +119,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
index 1cd2e1e..8afbc7a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-navigated-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS oldChildWindow.applicationCache.oncached is newChildWindow.applicationCache.oncached
 PASS oldChildWindow.applicationCache.onchecking is newChildWindow.applicationCache.onchecking
 PASS oldChildWindow.applicationCache.ondownloading is newChildWindow.applicationCache.ondownloading
@@ -250,4 +249,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
  
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
index e6998af8..937ced4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-and-gced-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS childWindow.closed is true
 PASS childWindow.defaultStatus is ''
 PASS childWindow.defaultstatus is ''
@@ -189,3 +188,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
index ab2e94b..ae0e541 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/property-access-on-cached-window-after-frame-removed-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS childWindow.closed is true
 PASS childWindow.defaultStatus is ''
 PASS childWindow.defaultstatus is ''
@@ -189,3 +188,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/querySelectorAll-with-pseudo-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/querySelectorAll-with-pseudo-elements-expected.txt
index 7269ff3..57366fa1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/querySelectorAll-with-pseudo-elements-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/querySelectorAll-with-pseudo-elements-expected.txt
@@ -2,15 +2,15 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS document.querySelectorAll("div::after").length is 0
 PASS document.querySelectorAll("html::before").length is 0
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 Test for Bugzilla Bug 83446: Broken handling for pseudo-elements in Selectors API.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/replaceable-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/replaceable-expected.txt
index e8fb3b2..b3aedc4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/replaceable-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/replaceable-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Object.getOwnPropertyDescriptor(window, "innerHeight").set is an instance of Function
 PASS window.innerHeight is 42
 PASS window.event is "foo"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/screen-size-in-physical-pixels-quirk-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/screen-size-in-physical-pixels-quirk-expected.txt
index f5d3c8f..d4a3ede4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/screen-size-in-physical-pixels-quirk-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/screen-size-in-physical-pixels-quirk-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS screen.width
 PASS screen.height
 PASS screen.availWidth
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-no-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-no-arguments-expected.txt
index da8e45c..88233ae4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-no-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-no-arguments-expected.txt
@@ -3,6 +3,5 @@
 
 In the case of a successful test you will see the text "Timeout was successful" otherwise you will see "Test Failed. Timeout was not called."
 
-
 Result: Timeout was successful
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-setInterval-unique-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-setInterval-unique-expected.txt
index 60bb640..e5945f2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-setInterval-unique-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/setTimeout-setInterval-unique-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Checking the results of setTimeout:
 PASS tID1 > 0 is true
 PASS tID2 > 0 is true
@@ -11,6 +10,7 @@
 PASS tID1 !== tID3 is true
 PASS tID2 !== tID3 is true
 
+
 Checking the results of setInterval:
 PASS iID1 > 0 is true
 PASS iID2 > 0 is true
@@ -19,6 +19,7 @@
 PASS iID1 !== iID3 is true
 PASS iID2 !== iID3 is true
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-closed-immediate-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-closed-immediate-expected.txt
index 3f28bcc..4aa5d339 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-closed-immediate-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-closed-immediate-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS w.closed is true
 PASS w.closed is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-collection-length-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-collection-length-no-crash-expected.txt
index c1dc01c..92d2f3d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-collection-length-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-collection-length-no-crash-expected.txt
@@ -1,4 +1,5 @@
 
- 
-This tests that window.frames.length does not crash the browser after the frame navigates away from the current page. You should see "SUCCESS" below once the test completes. 
+
+This tests that window.frames.length does not crash the browser after the frame navigates away from the current page. You should see "SUCCESS" below once the test completes.
+
 SUCCESS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-constructor-presence-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-constructor-presence-expected.txt
index 1d58e1b..8a92807 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-constructor-presence-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-constructor-presence-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS typeof Window is not "undefined"
 PASS window instanceof Window is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt
index 02aaf53..4b3902b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-custom-prototype-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS __proto__ = window; __proto__ threw exception TypeError: Immutable prototype object '#<Window>' cannot have their prototype set.
 PASS __proto__ = chainPointingBackToWindow; __proto__ threw exception TypeError: Immutable prototype object '#<Window>' cannot have their prototype set.
 PASS __proto__ = 1; __proto__ is originalWindowPrototype
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-frames-self-referential-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-frames-self-referential-expected.txt
index 5f5964ff4..a9e05ce 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-frames-self-referential-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-frames-self-referential-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.frames is window
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-legacy-event-listener-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-legacy-event-listener-expected.txt
index b26ffb4..446fc46 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-legacy-event-listener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-legacy-event-listener-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.addEventListener("foo") threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present..
 PASS window.removeEventListener("bar") threw exception TypeError: Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 1 present..
 PASS window.addEventListener() threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 0 present..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt
index b62acfd..6b843fa 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-lookup-precedence-expected.txt
@@ -4,7 +4,7 @@
 
 
 
- 
+
 
 PASS 'function alert() { [native code] }' is 'function alert() { [native code] }'
 PASS 'function alert() { [native code] }' is 'function alert() { [native code] }'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-onFocus-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-onFocus-expected.txt
index e510d59..969e720 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-onFocus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-onFocus-expected.txt
@@ -1,4 +1,5 @@
 This tests window.onFocus and window.onBlur handlers. It uses the testRunners ability to mimic bringing the window to the front and pushing it to the back.
+
 It is not intended to be run interactively: when you run it interactively, you should see 'Window was blurred' and 'Window was focused' messages as you push the window to the back and bring it to the front, respectively.
 
 Window was blurred
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-pending-url-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-pending-url-expected.txt
index f9bd3ab9e..4ae3404 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-pending-url-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-pending-url-expected.txt
@@ -1,10 +1,10 @@
 location: about:blank
 href: about:blank
 pathname: blank
-host: 
-hostname: 
-hash: 
-port: 
+host:
+hostname:
+hash:
+port:
 protocol: about:
-search: 
+search:
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-with-different-active-and-opener-windows-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-with-different-active-and-opener-windows-expected.txt
index 0ae78fe..9148c324 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-with-different-active-and-opener-windows-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-open-with-different-active-and-opener-windows-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS passed called on "this" argument of window.open
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt
index e308b47..ff0790e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt
@@ -1,6 +1,7 @@
 Test that the second argument of window.postMessage is ignored or triggers an error if it is not a message port. You should see PASS message '1' through '7', followed by 'done', with messages 4-7 received below.
 
 
+
 PASS Posting message ('1', 1): threw exception TypeError: Failed to execute 'postMessage' on 'Window': The provided value cannot be converted to a sequence.
 PASS Posting message ('2', c): threw exception TypeError: Failed to execute 'postMessage' on 'Window': The provided value cannot be converted to a sequence.
 PASS Posting message ('3', [object Object]): threw exception TypeError: Failed to execute 'postMessage' on 'Window': Iterator getter is not callable.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-frames-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-frames-expected.txt
index 13749cf..5e9f248 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-frames-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-postmessage-clone-frames-expected.txt
@@ -11,3 +11,4 @@
 PASS: (frames[0].tests[4]).eventData instanceof (frames[0]).FileList is true of type boolean
 PASS: (frames[0].tests[4]).event.data instanceof (frames[0]).FileList is true of type boolean
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-clearing-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-clearing-expected.txt
index 8c51e778..722432b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-clearing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-clearing-expected.txt
@@ -15,3 +15,4 @@
 PASS: 'name' in childWindow should be true and is.
 PASS: childWindow.name should be test and is.
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt
index 4a00d30..bb63bb4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-property-invalid-characters-ignored-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS w.innerWidth is 123
 PASS w.innerHeight is 123
 PASS w !== window is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-arguments-expected.txt
index d1367f4..259cbd9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-arguments-expected.txt
@@ -6,6 +6,7 @@
 
 window.resizeTo Tests
 
+
 Testing - resizeTo with 0 arguments
 PASS window.resizeTo() threw exception TypeError: Failed to execute 'resizeTo' on 'Window': 2 arguments required, but only 0 present..
 PASS window.outerWidth is resetWidth
@@ -18,8 +19,10 @@
 PASS window.outerWidth is width
 PASS window.outerHeight is height
 
+
 window.resizeBy Tests
 
+
 Testing - resizeBy with 0 arguments
 PASS window.resizeBy() threw exception TypeError: Failed to execute 'resizeBy' on 'Window': 2 arguments required, but only 0 present..
 PASS window.outerWidth is resetWidth
@@ -32,8 +35,10 @@
 PASS window.outerWidth is resetWidth + x
 PASS window.outerHeight is resetHeight + y
 
+
 window.moveTo Tests
 
+
 Testing - moveTo with 0 arguments
 PASS window.moveTo() threw exception TypeError: Failed to execute 'moveTo' on 'Window': 2 arguments required, but only 0 present..
 PASS window.screenX is resetX
@@ -46,8 +51,10 @@
 PASS window.screenX is Math.max(x, screen.availLeft)
 PASS window.screenY is Math.max(y, screen.availTop)
 
+
 window.moveBy Tests
 
+
 Testing - moveBy with 0 arguments
 PASS window.moveBy() threw exception TypeError: Failed to execute 'moveBy' on 'Window': 2 arguments required, but only 0 present..
 PASS window.screenX is resetX
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-sub-frame-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-sub-frame-expected.txt
index 7765cba..efb2102 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-sub-frame-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-and-move-sub-frame-expected.txt
@@ -6,24 +6,32 @@
 
 frames[0].resizeTo Tests
 
+
 PASS window.outerWidth is resetWidth
 PASS window.outerHeight is resetHeight
 
+
 frames[0].resizeBy Tests
 
+
 PASS window.outerWidth is resetWidth
 PASS window.outerHeight is resetHeight
 
+
 frames[0].moveTo Tests
 
+
 PASS window.screenX is resetX
 PASS window.screenY is resetY
 
+
 frames[0].moveBy Tests
 
+
 PASS window.screenX is resetX
 PASS window.screenY is resetY
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-expected.txt
index 25230f3..35837063 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-resize-expected.txt
@@ -6,108 +6,137 @@
 
 window.resizeTo Tests
 
+
 Testing - resizeTo: Too Big
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - resizeTo: Too Small
 PASS window.outerWidth is 100
 
+
 Testing - resizeTo: Full Screen Out of Bounds
 PASS window.screenY is screen.availTop
 PASS window.outerHeight is screen.availHeight
 PASS window.screenX is screen.availLeft
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - resizeTo: Not Full Screen Out of Bounds
 PASS window.outerHeight + window.screenY - screen.availTop is screen.availHeight
 PASS window.outerWidth + window.screenX - screen.availLeft is screen.availWidth
 
+
 window.resizeBy Tests
 
+
 Testing - resizeBy: Too Small
 PASS window.outerWidth is 100
 
+
 Testing - resizeBy: Too Big
 PASS window.outerWidth is screen.availWidth
 
+
 window.moveTo Tests
 
+
 Testing - moveTo: Top Left
 PASS window.screenY is screen.availTop
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveTo: Top
 PASS window.screenY is screen.availTop
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveTo: Top Right
 PASS window.screenY is screen.availTop
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - moveTo: Right
 PASS window.screenY is screen.availTop
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - moveTo: Bottom Right
 PASS window.outerHeight is screen.availHeight
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - moveTo: Bottom
 PASS window.outerHeight is screen.availHeight
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveTo: Bottom Left
 PASS window.outerHeight is screen.availHeight
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveTo: Left
 PASS window.screenY is screen.availTop
 PASS window.screenX is screen.availLeft
 
+
 window.moveBy Tests
 
+
 Testing - moveBy: Zero Zero
 PASS window.screenX == previousScreenX is true
 PASS window.screenY == previousScreenY is true
 
+
 Testing - moveBy: One Zero
 PASS window.screenX == previousScreenX + 1 is true
 PASS window.screenY == previousScreenY is true
 
+
 Testing - moveBy: Zero One
 PASS window.screenX == previousScreenX is true
 PASS window.screenY == previousScreenY + 1 is true
 
+
 Testing - moveBy: Top Left
 PASS window.screenY is screen.availTop
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveBy: Top
 PASS window.screenY is screen.availTop
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveBy: Top Right
 PASS window.screenY is screen.availTop
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - moveBy: Right
 PASS window.screenY is screen.availTop
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - moveBy: Bottom Right
 PASS window.outerHeight is screen.availHeight
 PASS window.outerWidth is screen.availWidth
 
+
 Testing - moveBy: Bottom
 PASS window.outerHeight is screen.availHeight
 
+
 Testing - moveBy: Bottom Left
 PASS window.outerHeight is screen.availHeight
 PASS window.screenX is screen.availLeft
 
+
 Testing - moveBy: Left
 PASS window.screenX is screen.availLeft
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt
index 5dc47585..5407f07 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-scroll-arguments-expected.txt
@@ -6,6 +6,7 @@
 
 window.scrollTo Tests
 
+
 Testing - scrollTo with 0 arguments
 PASS window.scrollTo() did not throw exception.
 Testing - scrollTo with 1 non-dictionary argument
@@ -26,8 +27,10 @@
 PASS window.scrollTo({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': The provided value 'abcd' is not a valid enum value of type ScrollBehavior..
 PASS window.scrollTo({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scrollTo' on 'Window': The provided value '200' is not a valid enum value of type ScrollBehavior..
 
+
 window.scroll Tests
 
+
 Testing - scroll with 0 arguments
 PASS window.scroll() did not throw exception.
 Testing - scroll with 1 argument
@@ -48,8 +51,10 @@
 PASS window.scroll({ left: x, top: y, behavior: "abcd" }) threw exception TypeError: Failed to execute 'scroll' on 'Window': The provided value 'abcd' is not a valid enum value of type ScrollBehavior..
 PASS window.scroll({ left: x, top: y, behavior: 200 }) threw exception TypeError: Failed to execute 'scroll' on 'Window': The provided value '200' is not a valid enum value of type ScrollBehavior..
 
+
 window.scrollBy Tests
 
+
 Testing - scrollBy with 0 arguments
 PASS window.scrollBy() did not throw exception.
 Testing - scrollBy with 1 argument
@@ -72,4 +77,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This box should force the window to have a scrollable area to test.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt
index 850e909e..d6fde35 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/Window/window-xy-properties-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS event.clientX is 50
 PASS event.clientY is 50
 PASS event.pageX is 50
diff --git a/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants-expected.txt
index 1163981..c14a25f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-constants-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test the constants on the XMLHttpRequest object itself.
 PASS new XMLHttpRequest().UNSENT is 0
 PASS new XMLHttpRequest().OPENED is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt
index 7ce3d86..1c298ec 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/XMLHttpRequest-legacy-event-listener-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS new XMLHttpRequest().addEventListener("foo") threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present..
 PASS new XMLHttpRequest().removeEventListener("bar") threw exception TypeError: Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 1 present..
 PASS new XMLHttpRequest().addEventListener() threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 0 present..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/access-key-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/access-key-iframe-expected.txt
index a8bfb71..b66af27 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/access-key-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/access-key-iframe-expected.txt
@@ -2,8 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-
 Accesskeys should work in an iframe. "iframe1" has both "inputG" and "inputH" (accesskey="c") elements.
 PASS iframe1.contentDocument.getElementById("inputG").focus(); pressAccessKey("c"); targetsOfFocusEvents is ["inputG", "inputH"]
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/adopt-attribute-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/adopt-attribute-crash-expected.txt
index 686d157..99a7940 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/adopt-attribute-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/adopt-attribute-crash-expected.txt
@@ -1,5 +1,5 @@
 This page contains the following errors:
 error on line 3 at column 66: Namespaced Attribute href in 'http://www.w3.org/1999/xlink' redefined
 error on line 18 at column 1: Extra content at the end of the document
-Below is a rendering of the page up to the first error.
 
+Below is a rendering of the page up to the first error.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/adopt-node-prevented-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/adopt-node-prevented-expected.txt
index cee3df1..6ef8133d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/adopt-node-prevented-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/adopt-node-prevented-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS target.ownerDocument.location is document.location
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/allowed-children-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/allowed-children-expected.txt
index 06bdb527..a3592d4c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/allowed-children-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/allowed-children-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS u.tagName is 'Long'
 PASS (new XMLSerializer()).serializeToString(doc) is '<Long/>'
 PASS u.tagName is 'Long'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/anchor-backslash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/anchor-backslash-expected.txt
index 1b6723ae..7c20a6a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/anchor-backslash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/anchor-backslash-expected.txt
@@ -3,9 +3,9 @@
 If it works you should see five messages below that have \ or / characters as specified.
 
 1 2 3 4 5
+
 paths like this should turn all \ characters into /: "/a/b/c/"
 query strings like this one should still have \ characters: "?path=\\a\b\c\"
 query strings like this one should still have \ characters even if the URL is only a query: "?path=\\myshare\myfolder\myfile\"
 anchor strings like this one should still have \ characters: "#path=\\a\b\c\"
 anchor strings like this one should still have \ characters even if the URL is only an anchor: "#path=\\myshare\myfolder\myfile\"
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/anchor-origin-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/anchor-origin-expected.txt
index c89e80b..f3299b35 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/anchor-origin-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/anchor-origin-expected.txt
@@ -4,6 +4,7 @@
 Link
 Link
 Link
+
 http://example.com/foo/bar => http://example.com
 http://example.com/foo/bar => http://example.com
 https://example.com/ttt?ggg => https://example.com
diff --git a/third_party/WebKit/LayoutTests/fast/dom/anchor-toString-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/anchor-toString-expected.txt
index a3f7660..486696d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/anchor-toString-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/anchor-toString-expected.txt
@@ -1,4 +1,4 @@
-A link! 
+A link!
 
 Writing just the anchor object - http://localhost/sometestfile.html
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/anchor-without-content-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/anchor-without-content-expected.txt
index 6b8041a..5e1b87fa 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/anchor-without-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/anchor-without-content-expected.txt
@@ -4,6 +4,8 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test verifies that links to anchors without content work as expected.
 
 Block 1
@@ -11,6 +13,8 @@
 Block 3
 Block 1
 Block 2
+
+
 This block has whitespace inside and after the anchor element.
 
 Block 3
diff --git a/third_party/WebKit/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt
index b45dfc3..7dd0b18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/attr-style-too-lazy-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS styleAttr.value is 'background-color: white;'
 PASS styleAttr.value is 'background-color: green;'
 PASS oldStyleAttr.value is 'background-color: red;'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/attribute-empty-value-no-children-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/attribute-empty-value-no-children-expected.txt
index 064e7b8f..3c618f1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/attribute-empty-value-no-children-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/attribute-empty-value-no-children-expected.txt
@@ -1,4 +1,5 @@
 Attr empty value tests Bug 16923
+
 In Opera, Firefox and IE, when an Attr's value is an empty string, the Attr node won't have any childNodes. The following 12 tests will see if this is true for WebKit for both parsed and dynamically-created Attr nodes. The tests use multiple methods of changing the Attr's value and even test reverting from a non-empty value to an empty one to check that all childNodes were removed. Some of the tests make use of .textContent, so this test is not compatible with IE. Opera and Firefox both completely pass this test.
 
 SubTest 1 = PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt
index 64805f5..82f6b054 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/attribute-legacy-colors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.body.bgColor='';getComputedStyle(document.body).backgroundColor; is 'rgba(0, 0, 0, 0)'
 PASS document.body.bgColor='transparent';getComputedStyle(document.body).backgroundColor; is 'rgba(0, 0, 0, 0)'
 PASS document.body.bgColor=' transparent ';getComputedStyle(document.body).backgroundColor; is 'rgba(0, 0, 0, 0)'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/base-attribute-parsing-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/base-attribute-parsing-expected.txt
index 1d92782c..ba3f108cc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/base-attribute-parsing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/base-attribute-parsing-expected.txt
@@ -1,3 +1 @@
 Test how xml:base value is parsed (bug 28858). Passed if no assertion failure.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt
index f74d535..649ce3e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/boolean-attribute-reflection-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS e = make('area'); e.removeAttribute('nohref'); e.noHref is false
 PASS e = make('area'); e.setAttribute('nohref', ''); e.noHref is true
 PASS e = make('area'); e.setAttribute('nohref', 'x'); e.noHref = false; e.getAttribute('nohref') is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt
index d91c597..a08949a2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/call-a-constructor-as-a-function-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS ArrayBuffer() threw exception TypeError: Constructor ArrayBuffer requires 'new'.
 PASS AudioContext() threw exception TypeError: Failed to construct 'AudioContext': Please use the 'new' operator, this DOM object constructor cannot be called as a function..
 PASS FormData() threw exception TypeError: Failed to construct 'FormData': Please use the 'new' operator, this DOM object constructor cannot be called as a function..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/characterdata-api-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/characterdata-api-arguments-expected.txt
index 5117dc08f..f415c99 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/characterdata-api-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/characterdata-api-arguments-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS text.data is "abcd"
 PASS text.__proto__.__proto__ is CharacterData.prototype
 PASS text.appendData('efg') did not throw exception.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/child-insertion-notify-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/child-insertion-notify-crash-expected.txt
index 84e863e..61754d4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/child-insertion-notify-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/child-insertion-notify-crash-expected.txt
@@ -1,4 +1,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS. WebKit didn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/class-all-whitespace-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/class-all-whitespace-expected.txt
index a49da4b..468b42e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/class-all-whitespace-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/class-all-whitespace-expected.txt
@@ -1,3 +1 @@
 Tests that an all-whitespace class attribute does not cause an assertion failure.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/clone-node-load-event-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/clone-node-load-event-crash-expected.txt
index c95c652..34d03a2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/clone-node-load-event-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/clone-node-load-event-crash-expected.txt
@@ -1,2 +1,2 @@
-Tests that we don't crash due to incorrect load event firing during cloneNode. 
+Tests that we don't crash due to incorrect load event firing during cloneNode.
 PASS. WebKit didn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/cloneNode-below-body-attribute-merging-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/cloneNode-below-body-attribute-merging-expected.txt
index f6c456a..d21eee0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/cloneNode-below-body-attribute-merging-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/cloneNode-below-body-attribute-merging-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/collection-idempotence-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/collection-idempotence-expected.txt
index 5832380d..52aebe4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/collection-idempotence-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/collection-idempotence-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.all is document.all
 PASS document.all === document.all is true
 PASS document.images is document.images
@@ -34,4 +33,4 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
- 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/collection-item-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/collection-item-expected.txt
index 14e43d0..3ea66cf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/collection-item-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/collection-item-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.forms.item(0) is document.getElementById('a')
 PASS document.forms.item('0') is document.getElementById('a')
 PASS document.forms.item('z') is document.getElementById('a')
diff --git a/third_party/WebKit/LayoutTests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt
index 572cd76f..272e47a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/collection-item-should-be-overridden-by-own-property-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.all.foo is document.getElementById('element0')
 PASS document.all.foo is 1
 PASS document.styleSheets.link1 is document.styleSheets[0]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/collection-length-should-not-be-overridden-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/collection-length-should-not-be-overridden-expected.txt
index 9cf751c2..b440ced1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/collection-length-should-not-be-overridden-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/collection-length-should-not-be-overridden-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS documentAllLength is 18
 PASS documentAll5 is documentAllSome
 PASS documentAll6.name is 'length'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/compare-document-position-disconnected-nodes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/compare-document-position-disconnected-nodes-expected.txt
index 4571fe1..b1354db 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/compare-document-position-disconnected-nodes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/compare-document-position-disconnected-nodes-expected.txt
@@ -56,4 +56,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 Comparing the positions of two disconnected nodes should result in DOCUMENT_POSITION_DISCONNECTED.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/console-log-stack-overflow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/console-log-stack-overflow-expected.txt
index 91477f5..96c7bb2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/console-log-stack-overflow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/console-log-stack-overflow-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
index 2b70897..624aaabd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/constructed-objects-prototypes-expected.txt
@@ -4,7 +4,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructor-proto-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/constructor-proto-expected.txt
index 34cf939..dfb1657 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/constructor-proto-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/constructor-proto-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Object.getPrototypeOf(HTMLElement) is Element
 PASS Object.getPrototypeOf(HTMLElement) is proto
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-expected.txt
index cf71f82..2c2b659e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Image is Image
 PASS Image.testProperty is "property set successfully"
 PASS Option is Option
diff --git a/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-navigate-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-navigate-expected.txt
index 8801f56..cf8aa59 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-navigate-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/constructors-cached-navigate-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS testFrame.contentWindow.Image is testFrame.contentWindow.Image
 PASS testFrame.contentWindow.Image !== window.Image is true
 PASS testFrame.contentWindow.Image.testProperty is "property set successfully"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/createDocumentType-ownerDocument-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/createDocumentType-ownerDocument-expected.txt
index e629077..736a0399 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/createDocumentType-ownerDocument-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/createDocumentType-ownerDocument-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS docType.ownerDocument is document
 PASS newDocument = document.implementation.createDocument('', null, docType) did not throw exception.
 PASS newDocument.doctype is docType
diff --git a/third_party/WebKit/LayoutTests/fast/dom/createElement-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/createElement-expected.txt
index 61046ca..9b6f396 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/createElement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/createElement-expected.txt
@@ -1,2 +1,3 @@
 namespaceURI: http://www.w3.org/1999/xhtml
+
 The above text should display the xhtml namespace uri. Bug 8007.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/createElementNS-namespace-errors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/createElementNS-namespace-errors-expected.txt
index ff9b145..250ece8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/createElementNS-namespace-errors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/createElementNS-namespace-errors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.createElementNS(null, 'foo:bar') threw exception NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('') is not valid for the qualified name provided ('foo:bar')..
 PASS document.createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:abc') did not throw exception.
 PASS document.createElementNS('http://www.w3.org/XML/1998/namespace', 'xml:abc').namespaceURI is "http://www.w3.org/XML/1998/namespace"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-2-expected.txt
index b68ae1e..d6cbbbf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-2-expected.txt
@@ -15,6 +15,7 @@
 .four {display: none; color: red;}
 I {display: block;}
 
+
 @import url("fancyfonts.css") screen;
 @media print {
   body { font-size: 10pt; } 
@@ -31,6 +32,7 @@
 .four { display: none; color: red; } 
 i { display: block; } 
 
+
 @import url("fancyfonts.css") screen;
 @media print {
   body { font-size: 10pt; }
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-expected.txt
index 16184f9..947466c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-dom-read-expected.txt
@@ -4,6 +4,7 @@
 .three { display: list-item; list-style-type: square; margin-left: 3em; }
 .four { display: none; color: red; }
 I { display: block; }
+
 Serialized style, using CSS DOM:
 .one { display: block; }
 .two { display: inline; }
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-declaration-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-declaration-crash-expected.txt
index 4c82d70..1fe3f7d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-declaration-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-declaration-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-important-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-important-expected.txt
index 8be7e1c3..3df4756 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-important-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-inline-style-important-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(e).color is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule-expected.txt
index 469042a..9576063 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-mediarule-parentRule-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS childRule.parentRule is mediaRule
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt
index aaae739c..eae623d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/cssTarget-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/cssTarget-crash-expected.txt
index 2d5735c..3b3302d0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/cssTarget-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/cssTarget-crash-expected.txt
@@ -1,2 +1 @@
 Should not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/callback-timing-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/callback-timing-expected.txt
index 0655df9..12d2db4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/callback-timing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/callback-timing-expected.txt
@@ -3,11 +3,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS eventlog[0] is 'created x-foo'
 PASS eventlog[1] is 'DOMContentLoaded event'
 PASS eventlog[2] is 'load event'
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/constructor-calls-created-synchronously-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/constructor-calls-created-synchronously-expected.txt
index ba9ecab5..32e171e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/constructor-calls-created-synchronously-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/constructor-calls-created-synchronously-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS ncallbacks is 1
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-basic-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-basic-expected.txt
index fd5ef72..9ee7e949 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-basic-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-basic-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS typeof fooConstructor is "function"
 PASS fooConstructor.prototype.__proto__ is HTMLElement.prototype
 PASS fooConstructor.prototype.thisIsPrototype is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-namespace-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-namespace-expected.txt
index d2e4502..ce285525 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-namespace-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-namespace-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS html1.namespaceURI is "http://www.w3.org/1999/xhtml"
 PASS html2.namespaceURI is "http://www.w3.org/1999/xhtml"
 PASS html3.namespaceURI is "http://www.w3.org/1999/xhtml"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-null-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-null-constructor-expected.txt
index 9aa8faee..624b6d37 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-null-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-null-constructor-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt
index 73af3e64..acf64bf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-returning-fake-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Constructor object isn't created.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-throwing-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-throwing-constructor-expected.txt
index a79fb892..7f5bdef 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-throwing-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-reentrant-throwing-constructor-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Constructor object isn't created.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-type-extensions-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-type-extensions-expected.txt
index 45f63290..f60ec14 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-type-extensions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/document-register-type-extensions-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.registerElement("x-foo", { prototype: Object.create(HTMLDivElement.prototype) }) threw exception NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-foo'. A type with that name is already registered..
 PASS fooNewed.outerHTML is "<x-foo></x-foo>"
 PASS fooNewed instanceof fooConstructor && fooNewed instanceof HTMLElement is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/element-type-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/element-type-expected.txt
index 694992e..f926991 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/element-type-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/element-type-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.testRunner is non-null.
 PASS a.getAttribute("is") is "x-y"
 PASS a instanceof X is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-expected.txt
index 295d830..9b04536 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-expected.txt
@@ -4,7 +4,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS host.firstChild instanceof A is true
 PASS element instanceof B is true
 PASS callCount is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-no-register-and-leak-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-no-register-and-leak-expected.txt
index a7d79bcd..1f89ab0b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-no-register-and-leak-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/element-upgrade-no-register-and-leak-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/exception-from-constructor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/exception-from-constructor-expected.txt
index a504237..e4b9a18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/exception-from-constructor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/exception-from-constructor-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.registerElement("x-a", {prototype: proto}) threw exception Exception thrown from getter.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/frameElement-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/frameElement-crash-expected.txt
index 7dfbd04..631bf3e4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/frameElement-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/frameElement-crash-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/html-element-type-extension-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/html-element-type-extension-assert-expected.txt
index d0cfe1d..e138de8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/html-element-type-extension-assert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/html-element-type-extension-assert-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS did not crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/isolated-world-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/isolated-world-expected.txt
index d3af1b99..fde1feee 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/isolated-world-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/isolated-world-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.testRunner is non-null.
 PASS did not crash
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-createElement-reentrancy-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-createElement-reentrancy-expected.txt
index d686e43c..3e1233e4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-createElement-reentrancy-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-createElement-reentrancy-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.callbacksCalled is []
 PASS window.callbacksCalled is ['X-FOO']
 PASS window.callbacksCalled is ['X-FOO', 'X-BAR']
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-creation-api-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-creation-api-expected.txt
index 63a4b22..38ba3c48 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-creation-api-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-creation-api-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.createElement('x-foo').callbacksCalled is true
 PASS document.createElement('div', 'x-bar').callbacksCalled is true
 PASS document.createElementNS('http://www.w3.org/1999/xhtml', 'x-foo').callbacksCalled is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-innerHTML-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-innerHTML-expected.txt
index 5a11bff..a8e8a30 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-innerHTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-innerHTML-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.callbacksCalled is ['a', 'b', 'c']
 PASS window.callbacksCalled is ['a', 'b', 'c']
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-parser-script-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-parser-script-expected.txt
index 826bec3..f7519a4cc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-parser-script-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-parser-script-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.callbacksCalled is true
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-paste-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-paste-expected.txt
index f99cea1..e8633daf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-paste-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/lifecycle-created-paste-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.callbacksCalled is ['X-FOO', 'DIV']
 PASS window.callbacksCalled is ['X-FOO', 'DIV', 'X-FOO', 'DIV']
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/prerender-insert-after-stop-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/prerender-insert-after-stop-expected.txt
index c2e6e34..56a60aa8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/prerender-insert-after-stop-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/prerender-insert-after-stop-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS customBody is defined.
 PASS customBody.toLocaleString() is "[object HTMLBodyElement]"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-expected.txt
index 5db0b58..ac91bb6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS child done
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt
index 74ab534..2bcdaae 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid."
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion-expected.txt
index 38941094..be9dc820 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-callback-recursion-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS child done
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt
index 9b7cbfe..9367175 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid."
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-created-retrieval-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-created-retrieval-expected.txt
index af1aab1..a92ec1c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-created-retrieval-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-created-retrieval-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid."
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt
index 205efa5f..f1d5ee9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "future events such as these will affect you in the future"
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-expected.txt
index 6f0a2962..37c550fd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-extends-retrieval-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid."
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt
index 368c455..bb27c4f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "future events such as these will affect you in the future"
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-expected.txt
index 1c35d12..ca01a766 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-register-prototype-retrieval-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid."
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade-expected.txt
index 7ae91cba..59bd87c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-during-upgrade-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS child done
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-then-register-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-then-register-expected.txt
index fd0dc16a..3676f79 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-then-register-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/registration-context-delete-then-register-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS destroyed context
 PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid."
 PASS child done
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/reparent-unwrapped-custom-element-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/reparent-unwrapped-custom-element-crash-expected.txt
index b9c5e09..594ce18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/reparent-unwrapped-custom-element-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/reparent-unwrapped-custom-element-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE WARNING: line 4: document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
 If this doesn't crash, it passed. 
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/type-extension-undo-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/type-extension-undo-assert-expected.txt
index 2a39240..89e1131 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/type-extension-undo-assert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/type-extension-undo-assert-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS did not crash
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Hello, world!
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/unresolved-pseudoclass-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/unresolved-pseudoclass-expected.txt
index d0fa0fe1..94d159e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/unresolved-pseudoclass-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/unresolved-pseudoclass-expected.txt
@@ -4,7 +4,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelector("x-x:unresolved") is a
 PASS window.getComputedStyle(a).color is "rgb(0, 0, 222)"
 PASS window.getComputedStyle(b).color is "rgb(0, 0, 222)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-adopt-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-adopt-crash-expected.txt
index e1404c5e..de73885 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-adopt-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-adopt-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-remove-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-remove-crash-expected.txt
index cb76ea1d..1986e256 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-remove-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/custom/upgrade-candidate-remove-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dataset-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dataset-gc-expected.txt
index 24954363..aa9a6d7e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dataset-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dataset-gc-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS d.getAttribute('data-custom-property') is '1'
 PASS d.dataset.customProperty is '1'
 PASS d.dataset.customProperty is '1'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml-expected.txt
index c7a56b56..938c8c2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dataset-xhtml-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testGet('data-foo', 'foo') is true
 PASS testGet('data-foo-bar', 'fooBar') is true
 PASS testGet('data--', '-') is true
@@ -11,9 +10,11 @@
 PASS testGet('data-', '') is true
 PASS testGet('data-à', 'à') is true
 
+
 PASS matchesNothingInDataset('dataFoo') is true
 PASS matchesNothingInDataset('data-Foo') is true
 
+
 PASS testSet('foo', 'data-foo') is true
 PASS testSet('fooBar', 'data-foo-bar') is true
 PASS testSet('-', 'data--') is true
@@ -22,10 +23,12 @@
 PASS testSet('', 'data-') is true
 PASS testSet('à', 'data-à') is true
 
+
 PASS testSet('-foo', 'dummy') threw exception SyntaxError: Failed to set the '-foo' property on 'DOMStringMap': '-foo' is not a valid property name..
 PASS testSet('foo ', 'dummy') threw exception InvalidCharacterError: Failed to set the 'foo ' property on 'DOMStringMap': 'data-foo ' is not a valid attribute name..
 FAIL testSet('foo豈', 'dummy') should throw InvalidCharacterError: Failed to set the 'foo豈' property on 'DOMStringMap': 'data-foo豈' is not a valid attribute name.. Threw exception InvalidCharacterError: Failed to set the 'foo豈' property on 'DOMStringMap': 'data-foo豈' is not a valid attribute name..
 
+
 PASS testDelete('data-foo', 'foo') is true
 PASS testDelete('data-foo-bar', 'fooBar') is true
 PASS testDelete('data--', '-') is true
@@ -34,8 +37,10 @@
 PASS testDelete('data-', '') is true
 PASS testDelete('data-à', 'à') is true
 
+
 PASS testDelete('dummy', '-foo') is false
 
+
 PASS testForIn(['data-foo', 'data-bar', 'data-baz']) is 3
 PASS testForIn(['data-foo', 'data-bar', 'dataFoo']) is 2
 PASS testForIn(['data-foo', 'data-bar', 'style']) is 2
diff --git a/third_party/WebKit/LayoutTests/fast/dom/defaultView-on-detached-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/defaultView-on-detached-document-expected.txt
index 1f6252f..d542a03 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/defaultView-on-detached-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/defaultView-on-detached-document-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testFrameUnloaded is true
 PASS cachedDocument.defaultView is null
 PASS successfullyParsed is true
 
 TEST COMPLETE
-  
+
+ 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dir-auto-insert-text-invalidation-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dir-auto-insert-text-invalidation-expected.txt
index 3fd1506..99286f0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dir-auto-insert-text-invalidation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dir-auto-insert-text-invalidation-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(outerAuto).direction is "ltr"
 PASS getComputedStyle(textInsertionPoint).direction is "ltr"
 PASS getComputedStyle(affectedByAuto).direction is "ltr"
@@ -14,6 +13,7 @@
 PASS getComputedStyle(explicitLTR).direction is "ltr"
 
 Forcing everything back to LTR with dir attribute:
+
 PASS internals.updateStyleAndReturnAffectedElementCount() is 4
 PASS getComputedStyle(outerAuto).direction is "ltr"
 PASS getComputedStyle(textInsertionPoint).direction is "ltr"
@@ -22,5 +22,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-؄ل
 
+؄ل
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dir-non-html-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dir-non-html-document-expected.txt
index ac8009d..14ac6ac 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dir-non-html-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dir-non-html-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS xmlDocument.__proto__ is XMLDocument.prototype
 PASS xmlDocument.__proto__.__proto__ is Document.prototype
 PASS xmlDocument.dir is ""
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-body-getter-setter-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-body-getter-setter-expected.txt
index 3b0b5ec..91f9f5f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-body-getter-setter-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-body-getter-setter-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS frame.contentDocument.body = document.createElement("div") threw exception HierarchyRequestError: Failed to set the 'body' property on 'Document': The new body element is of type 'DIV'. It must be either a 'BODY' or 'FRAMESET' element..
 PASS frame.contentDocument.body = document.createElement("frameset") did not throw exception.
 PASS frame.contentDocument.documentElement.childNodes.length is 2
@@ -15,4 +15,3 @@
 PASS frame.contentDocument.body is newBody
 PASS frame.contentDocument.body is newBody
 PASS frame.contentDocument.body.tagName is "BODY"
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-contentType-data-uri-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-contentType-data-uri-expected.txt
index 4703a2b..f59ec981 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-contentType-data-uri-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-contentType-data-uri-expected.txt
@@ -5,4 +5,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
    
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-dir-property-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-dir-property-expected.txt
index 5025229..fc9f73e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-dir-property-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-dir-property-expected.txt
@@ -2,65 +2,82 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Read document.dir in head
 PASS headReadDocumentDir is ""
 
+
 Write document.dir in head
 PASS headWriteDocumentDir is "rtl"
 
+
 Read document.dir in body
 PASS document.dir is "rtl"
 
+
 Read document.documentElement.dir in body
 PASS document.documentElement.dir is "rtl"
 
+
 Read document.documentElement.getAttribute('dir') in body
 PASS document.documentElement.getAttribute('dir') is "rtl"
 
+
 Read document.body.dir in body
 PASS document.body.dir is ""
 
+
 Write document.dir in body
 PASS document.dir is "ltr"
 
+
 Read document.documentElement.dir in body
 PASS document.documentElement.dir is "ltr"
 
+
 Read document.body.dir in body
 PASS document.body.dir is ""
 
+
 Read document.documentElement.getAttribute('dir') in body
 PASS document.documentElement.getAttribute('dir') is "ltr"
 
+
 Write non-canonical case document.dir in body
 PASS document.dir = 'RTL' did not throw exception.
 PASS document.dir is "rtl"
 
+
 Read document.documentElement.getAttribute('dir') in body
 PASS document.documentElement.getAttribute('dir') is "RTL"
 
+
 Write invalid document.dir in body
 PASS document.dir = 'WRONG' did not throw exception.
 PASS document.dir is ""
 
+
 Read document.documentElement.getAttribute('dir') in body
 PASS document.documentElement.getAttribute('dir') is "WRONG"
 
+
 Write non-canonical case document.body.dir in body
 PASS document.body.dir = 'RTL' did not throw exception.
 PASS document.body.dir is "rtl"
 
+
 Write invalid document.body.dir in body
 PASS document.body.dir = 'WRONG' did not throw exception.
 PASS document.body.dir is ""
 
+
 Read document.dir in body
 PASS document.dir is ""
 
+
 Read document.documentElement.getAttribute('dir') in body
 PASS document.documentElement.getAttribute('dir') is "null"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-head-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-head-expected.txt
index d0c7db2..7c77d31 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-head-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-head-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.head is document.getElementsByTagName('head')[0]
 PASS document.head !== 1 is true
 PASS document.head is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-mutations-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-mutations-expected.txt
index 2db8940..81b31c38 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-mutations-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-mutations-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutations.length is 1
 PASS mutations[0].type is "childList"
 PASS mutations[0].addedNodes.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-child-on-empty-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-child-on-empty-expected.txt
index 65d70125..5450a33e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-child-on-empty-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-child-on-empty-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.title is ""
 PASS document.title is ""
 PASS head.lastChild instanceof HTMLTitleElement is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-reuse-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-reuse-expected.txt
index d444336..461b7f0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-reuse-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-no-reuse-expected.txt
@@ -2,10 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS oldnode.textContent != "bbb" is true
 PASS oldnode != document.getElementsByTagName("title")[0].firstChild is true
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-single-DOMSubtreeModified-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-single-DOMSubtreeModified-expected.txt
index 59f4e3d..4472dc4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document-set-title-single-DOMSubtreeModified-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document-set-title-single-DOMSubtreeModified-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.title is "new"
 PASS i == 1 is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/document_write_params-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/document_write_params-expected.txt
index be39ffbe..6b816e4b4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/document_write_params-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/document_write_params-expected.txt
@@ -1,4 +1,4 @@
-Test purpose: This tests display of multiple parameters given in document.write. 
+Test purpose: This tests display of multiple parameters given in document.write.
 Expected output: AB
 
 AB
diff --git a/third_party/WebKit/LayoutTests/fast/dom/documentmarker-add-adjacent-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/documentmarker-add-adjacent-text-expected.txt
index 067d19e43..dc2a667 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/documentmarker-add-adjacent-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/documentmarker-add-adjacent-text-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.markerCountForNode(elt, "textmatch") is 2
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 text
diff --git a/third_party/WebKit/LayoutTests/fast/dom/documentmarker-set-active-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/documentmarker-set-active-expected.txt
index e6d2ab2..0221e943 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/documentmarker-set-active-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/documentmarker-set-active-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.activeMarkerCountForNode(elt) is 0
 PASS internals.activeMarkerCountForNode(elt) is 1
 PASS internals.activeMarkerCountForNode(elt) is 0
@@ -10,4 +9,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 text
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dom-add-optionelement-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dom-add-optionelement-expected.txt
index 7bcba08..715d643 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dom-add-optionelement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dom-add-optionelement-expected.txt
@@ -1,5 +1,9 @@
-Purpose: To test if the both DOM1 and DOM2 versions of the add() method add an option to a dropdown list. You should see three "TEST PASSED" lines below. 
+Purpose: To test if the both DOM1 and DOM2 versions of the add() method add an option to a dropdown list. You should see three "TEST PASSED" lines below.
 
+a
+b
+c
+d
 DOM1 TEST PASSED
 DOM2 full TEST PASSED
 DOM2 null TEST PASSED
diff --git a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
index ee72f095..2555343 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/dom-constructors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS TryAllocate('Attr') is 'exception'
 PASS TryAllocate('CharacterData') is 'exception'
 PASS TryAllocate('CDATASection') is 'exception'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration-expected.txt
index 9ff2299..430d0fce 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/domListEnumeration-expected.txt
@@ -13,6 +13,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is nodeList.item(2)
 
+
 [object HTMLCollection]
 PASS resultArray.length is 6
 PASS resultArray[0].i is '0'
@@ -22,6 +23,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is htmlCollection.item(2)
 
+
 [object NamedNodeMap]
 PASS resultArray.length is 11
 PASS resultArray[0].i is '0'
@@ -31,6 +33,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is namedNodeMap.item(2)
 
+
 [object HTMLFormElement]
 PASS resultArray[0].i is '0'
 PASS resultArray[0].item is document.getElementsByTagName('select')[0]
@@ -39,6 +42,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is document.getElementsByTagName('select')[2]
 
+
 [object HTMLSelectElement]
 PASS resultArray[0].i is '0'
 PASS resultArray[0].item is document.getElementsByTagName('option')[0]
@@ -47,6 +51,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is document.getElementsByTagName('option')[2]
 
+
 [object StyleSheetList]
 PASS resultArray.length is 6
 PASS resultArray[0].i is '0'
@@ -56,6 +61,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is styleSheetList.item(2)
 
+
 [object CSSRuleList]
 PASS resultArray.length is 5
 PASS resultArray[0].i is '0'
@@ -65,6 +71,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is cssRuleList.item(2)
 
+
 [object CSSStyleDeclaration]
 PASS resultArray[0].i is '0'
 PASS resultArray[0].item is cssStyleDeclaration.item(0)
@@ -73,6 +80,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is cssStyleDeclaration.item(2)
 
+
 [object MediaList]
 PASS resultArray.length is 9
 PASS resultArray[0].i is '0'
@@ -82,6 +90,7 @@
 PASS resultArray[2].i is '2'
 PASS resultArray[2].item is mediaList.item(2)
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
index ffd2cbd..cf14816a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt
@@ -27,6 +27,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for fieldset/@name
 Initial value:
 PASS element.name is ""
@@ -56,6 +57,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for form/@name
 Initial value:
 PASS element.name is ""
@@ -85,6 +87,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for input/@name
 Initial value:
 PASS element.name is ""
@@ -114,6 +117,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for input/@step
 Initial value:
 PASS element.step is ""
@@ -143,6 +147,7 @@
 PASS element.setAttribute("step", 456); element.step is "456"
 PASS element.getAttribute("step") is "456"
 
+
 Reflected DOMString attribute test for object/@name
 Initial value:
 PASS element.name is ""
@@ -172,6 +177,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for output/@name
 Initial value:
 PASS element.name is ""
@@ -201,6 +207,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for select/@name
 Initial value:
 PASS element.name is ""
@@ -230,6 +237,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for textarea/@name
 Initial value:
 PASS element.name is ""
@@ -259,6 +267,7 @@
 PASS element.setAttribute("name", 456); element.name is "456"
 PASS element.getAttribute("name") is "456"
 
+
 Reflected DOMString attribute test for frame/@marginheight
 Initial value:
 PASS element.marginHeight is ""
@@ -288,6 +297,7 @@
 PASS element.setAttribute("marginheight", 456); element.marginHeight is "456"
 PASS element.getAttribute("marginheight") is "456"
 
+
 Reflected DOMString attribute test for frame/@marginwidth
 Initial value:
 PASS element.marginWidth is ""
@@ -317,6 +327,7 @@
 PASS element.setAttribute("marginwidth", 456); element.marginWidth is "456"
 PASS element.getAttribute("marginwidth") is "456"
 
+
 Reflected DOMString attribute test for iframe/@marginheight
 Initial value:
 PASS element.marginHeight is ""
@@ -346,6 +357,7 @@
 PASS element.setAttribute("marginheight", 456); element.marginHeight is "456"
 PASS element.getAttribute("marginheight") is "456"
 
+
 Reflected DOMString attribute test for iframe/@marginwidth
 Initial value:
 PASS element.marginWidth is ""
@@ -375,6 +387,7 @@
 PASS element.setAttribute("marginwidth", 456); element.marginWidth is "456"
 PASS element.getAttribute("marginwidth") is "456"
 
+
 Reflected DOMString attribute test for body/@text
 Initial value:
 PASS element.text is ""
@@ -404,6 +417,7 @@
 PASS element.setAttribute("text", 456); element.text is "456"
 PASS element.getAttribute("text") is "456"
 
+
 Reflected DOMString attribute test for body/@link
 Initial value:
 PASS element.link is ""
@@ -433,6 +447,7 @@
 PASS element.setAttribute("link", 456); element.link is "456"
 PASS element.getAttribute("link") is "456"
 
+
 Reflected DOMString attribute test for body/@alink
 Initial value:
 PASS element.aLink is ""
@@ -462,6 +477,7 @@
 PASS element.setAttribute("alink", 456); element.aLink is "456"
 PASS element.getAttribute("alink") is "456"
 
+
 Reflected DOMString attribute test for body/@vlink
 Initial value:
 PASS element.vLink is ""
@@ -491,6 +507,7 @@
 PASS element.setAttribute("vlink", 456); element.vLink is "456"
 PASS element.getAttribute("vlink") is "456"
 
+
 Reflected DOMString attribute test for body/@bgcolor
 Initial value:
 PASS element.bgColor is ""
@@ -520,6 +537,7 @@
 PASS element.setAttribute("bgcolor", 456); element.bgColor is "456"
 PASS element.getAttribute("bgcolor") is "456"
 
+
 Reflected DOMString attribute test for font/@color
 Initial value:
 PASS element.color is ""
@@ -549,6 +567,7 @@
 PASS element.setAttribute("color", 456); element.color is "456"
 PASS element.getAttribute("color") is "456"
 
+
 Reflected DOMString attribute test for img/@border
 Initial value:
 PASS element.border is ""
@@ -578,6 +597,7 @@
 PASS element.setAttribute("border", 456); element.border is "456"
 PASS element.getAttribute("border") is "456"
 
+
 Reflected DOMString attribute test for object/@border
 Initial value:
 PASS element.border is ""
@@ -607,6 +627,7 @@
 PASS element.setAttribute("border", 456); element.border is "456"
 PASS element.getAttribute("border") is "456"
 
+
 Reflected DOMString attribute test for table/@bgcolor
 Initial value:
 PASS element.bgColor is ""
@@ -636,6 +657,7 @@
 PASS element.setAttribute("bgcolor", 456); element.bgColor is "456"
 PASS element.getAttribute("bgcolor") is "456"
 
+
 Reflected DOMString attribute test for table/@cellpadding
 Initial value:
 PASS element.cellPadding is ""
@@ -665,6 +687,7 @@
 PASS element.setAttribute("cellpadding", 456); element.cellPadding is "456"
 PASS element.getAttribute("cellpadding") is "456"
 
+
 Reflected DOMString attribute test for table/@cellspacing
 Initial value:
 PASS element.cellSpacing is ""
@@ -694,6 +717,7 @@
 PASS element.setAttribute("cellspacing", 456); element.cellSpacing is "456"
 PASS element.getAttribute("cellspacing") is "456"
 
+
 Reflected DOMString attribute test for td/@bgcolor
 Initial value:
 PASS element.bgColor is ""
@@ -723,6 +747,7 @@
 PASS element.setAttribute("bgcolor", 456); element.bgColor is "456"
 PASS element.getAttribute("bgcolor") is "456"
 
+
 Reflected DOMString attribute test for th/@bgcolor
 Initial value:
 PASS element.bgColor is ""
@@ -752,6 +777,7 @@
 PASS element.setAttribute("bgcolor", 456); element.bgColor is "456"
 PASS element.getAttribute("bgcolor") is "456"
 
+
 Reflected DOMString attribute test for tr/@bgcolor
 Initial value:
 PASS element.bgColor is ""
@@ -781,6 +807,7 @@
 PASS element.setAttribute("bgcolor", 456); element.bgColor is "456"
 PASS element.getAttribute("bgcolor") is "456"
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number-expected.txt
index b415a0d..ddb7981 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/domtimestamp-is-number-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS timestamp instanceof Date is false
 PASS timestamp == Number(timestamp) is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/element-bounding-client-rect-relative-to-viewport-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/element-bounding-client-rect-relative-to-viewport-expected.txt
index 1c04c6ec..e45d8bf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/element-bounding-client-rect-relative-to-viewport-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/element-bounding-client-rect-relative-to-viewport-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS rect.left is xPos
 PASS rect.top is yPos
  
@@ -22,4 +22,3 @@
 PASS rectAfterScaleAndScroll.top is expectedY
 PASS rectAfterScaleAndScroll.width is rect.width
 PASS rectAfterScaleAndScroll.height is rect.height
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/elementFromPoint-relative-to-viewport-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/elementFromPoint-relative-to-viewport-expected.txt
index 4c4b902..876862c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/elementFromPoint-relative-to-viewport-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/elementFromPoint-relative-to-viewport-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS unscrolledBoxInitial is '0'
 PASS scrolledDownBoxInitial is '5'
 PASS scrolledRightBoxInitial is '3'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt
index 220f6b0c..f1a12a5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt
@@ -1,4 +1,3 @@
- 
 PASS document.elementsFromPoint(1, 1).indexOf(iframe) is >= 0
 PASS All elements in document.elementsFromPoint(1, 1) intersect (1, 1)
 PASS document.elementsFromPoint(203, 1).indexOf(iframe) is >= 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-svg-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-svg-expected.txt
index 6a19eac..25ec0ad 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-svg-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-svg-expected.txt
@@ -1,4 +1,4 @@
- PASS nodeListToString(document.elementsFromPoint(125, 125)) is "rect#topLeftRect3, rect#topLeftRect1, svg#svg, DIV#sandbox, BODY, HTML"
+PASS nodeListToString(document.elementsFromPoint(125, 125)) is "rect#topLeftRect3, rect#topLeftRect1, svg#svg, DIV#sandbox, BODY, HTML"
 PASS nodeListToString(document.elementsFromPoint(325, 125)) is "rect#topRightRect2, rect#topRightRect1, svg#topRightSvg, svg#svg, DIV#sandbox, BODY, HTML"
 PASS nodeListToString(document.elementsFromPoint(225, 225)) is "rect#middleRect2, rect#middleRect1, g#middleG2, g#middleG1, svg#svg, DIV#sandbox, BODY, HTML"
 PASS nodeListToString(document.elementsFromPoint(125, 325)) is "image#bottomLeftImage2, image#bottomLeftImage1, g#bottomLeftG, svg#svg, DIV#sandbox, BODY, HTML"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-table-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-table-expected.txt
index 1a76eaa..bc6875c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-table-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/elementsFromPoint/elementsFromPoint-table-expected.txt
@@ -1,3 +1,7 @@
+			
+			
+			
+			
 PASS nodeListToString(document.elementsFromPoint(125, 125)) is "TD#td11, TABLE#testtable, DIV#sandbox, BODY, HTML"
 PASS nodeListToString(document.elementsFromPoint(275, 125)) is "TD#td14, TABLE#testtable, DIV#sandbox, BODY, HTML"
 PASS nodeListToString(document.elementsFromPoint(175, 175)) is "TD#td22, TABLE#testtable, DIV#sandbox, BODY, HTML"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/empty-anchor-in-overflow-scroller-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/empty-anchor-in-overflow-scroller-expected.txt
index 05db376..ab8d223a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/empty-anchor-in-overflow-scroller-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/empty-anchor-in-overflow-scroller-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 text
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/empty-hash-and-search-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/empty-hash-and-search-expected.txt
index 55028d3..1653a48b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/empty-hash-and-search-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/empty-hash-and-search-expected.txt
@@ -2,12 +2,12 @@
 
 link w/o hash link with empty hash link with hash
 
-location.hash: 
-link1.hash: 
-link2.hash: 
+location.hash:
+link1.hash:
+link2.hash:
 link3.hash: #test
-location.search: 
-link1.search: 
-link2.search: 
+location.search:
+link1.search:
+link2.search:
 link3.search: ?search
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/error-to-string-stack-overflow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/error-to-string-stack-overflow-expected.txt
index b0eb7b3..1dc3771 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/error-to-string-stack-overflow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/error-to-string-stack-overflow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability-expected.txt
index 3e4da97..1daf080a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/event-attribute-availability-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test Element
 PASS 'onabort' in element is true
 PASS 'onblur' in element is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/event-target-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/event-target-arguments-expected.txt
index 8a0a16a4..51d3290 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/event-target-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/event-target-arguments-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Signature:
 void addEventListener(DOMString type, EventListener? listener, optional boolean useCapture)
 PASS document.addEventListener() threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 0 present..
@@ -19,6 +18,7 @@
 PASS document.addEventListener("foo", undefined) did not throw exception.
 PASS document.addEventListener("zork", listener, undefined) did not throw exception.
 
+
 Signature:
 void removeEventListener(DOMString type, EventListener? listener, optional boolean useCapture)
 PASS document.removeEventListener() threw exception TypeError: Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 0 present..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/exception-in-binding-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/exception-in-binding-expected.txt
index f874df9..6cbc09f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/exception-in-binding-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/exception-in-binding-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS setName(select) threw exception Error: error.
 PASS select.name is "select"
 PASS setSelectedIndex(select) threw exception Error: error.
@@ -11,3 +10,6 @@
 
 TEST COMPLETE
 
+Value 1
+Value 2
+Value 3
diff --git a/third_party/WebKit/LayoutTests/fast/dom/firstline-fixed-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/firstline-fixed-crash-expected.txt
index 89db3a7..8f3da9d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/firstline-fixed-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/firstline-fixed-crash-expected.txt
@@ -1,2 +1,2 @@
-This text should render without crashing 
+This text should render without crashing
 ...
diff --git a/third_party/WebKit/LayoutTests/fast/dom/forced-layout-only-in-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/forced-layout-only-in-document-expected.txt
index b5b6235b..0a2da24c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/forced-layout-only-in-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/forced-layout-only-in-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS No style or layout updates.
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt
index 7f26eeb..1f9f382 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/fragment-activation-focuses-target-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Verify that the focus is on the link.
 PASS document.activeElement is link1
 Click the link and verify that focus has moved to the fragment.
@@ -30,7 +29,9 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-link1 link2 link3 link4 link5 link6 
+
+link1 link2 link3 link4 link5 link6
+
 
 fragment1
 fragment2
diff --git a/third_party/WebKit/LayoutTests/fast/dom/frame-loading-via-document-write-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/frame-loading-via-document-write-expected.txt
index 5b69cb12..ca6ee92 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/frame-loading-via-document-write-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/frame-loading-via-document-write-expected.txt
@@ -13,9 +13,7 @@
 --------
 Image loaded.
 
-
 --------
 Frame: 'bottomRow'
 --------
 Image loaded.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/frameElement-accessor-context-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/frameElement-accessor-context-expected.txt
index cfd7bd2e..4167de48 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/frameElement-accessor-context-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/frameElement-accessor-context-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS iframe instanceof HTMLIFrameElement is true
 PASS iframe instanceof iframe.contentWindow.HTMLIFrameElement is false
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-11-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-11-expected.txt
index 4d5e234..054f0e8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/gc-11-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/gc-11-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS xmlNode.ownerDocument.data is 1
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-4-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-4-expected.txt
index e2f1d193..95ccd86e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/gc-4-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/gc-4-expected.txt
@@ -2,4 +2,6 @@
 
 If the test passes, you will see the word "passed" below. Otherwise, it will crash.
 
+
+
 passed
diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt
index e2dd366..09d500c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/gc-9-expected.txt
@@ -98,4 +98,3 @@
 PASS: event.myCustomProperty should be 1 and is.
 DOM EVENT AFTER GARBAGE COLLECTION
 PASS: event.myCustomProperty should be 1 and is.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-attribute-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-attribute-node-expected.txt
index eb78389..330da40 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/gc-attribute-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/gc-attribute-node-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS a.prop is "set"
 PASS a.prop is "set"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-2-expected.txt
index b5604b55..36a726d0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-2-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 onload fired...
 onload fired...
 onload fired...
diff --git a/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-expected.txt
index 1a9d95bf..6470102 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/gc-image-element-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS: loaded
 PASS: loaded
 PASS: loaded
diff --git a/third_party/WebKit/LayoutTests/fast/dom/generic-form-element-assert-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/generic-form-element-assert-expected.txt
index 3c61ccd..4c0a808a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/generic-form-element-assert-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/generic-form-element-assert-expected.txt
@@ -1,5 +1,3 @@
 This tests for a regression against https://bugs.webkit.org/show_bug.cgi?id=5926 Assertion failure in HTMLGenericFormElementImpl::removedFromTree.
 
 Test result: PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency-expected.txt
index 18568f9d..88f8715 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.contains(document.getElementById('el')) is true
 PASS document.getElementById('el') is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt
index c153fd8c..dc73f77b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency2-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.contains(el) is true
 PASS document.getElementById('el') is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt
index c153fd8c..dc73f77b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency3-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.contains(el) is true
 PASS document.getElementById('el') is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt
index c153fd8c..dc73f77b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency4-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.contains(el) is true
 PASS document.getElementById('el') is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt
index c153fd8c..dc73f77b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementById-consistency5-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.contains(el) is true
 PASS document.getElementById('el') is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt
index f0f096ae..f4189ffb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt
@@ -1,8 +1,10 @@
 Line 1
 Line 2
+
 Line 3
 
 line 4
+
 line 5
 
 [object HTMLDivElement], [object HTMLDivElement], [object HTMLDivElement], length: 3
@@ -21,4 +23,3 @@
 length: 0
 length: 0
 length: 0
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/non-styled-elements-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/non-styled-elements-expected.txt
index 978e9102..764bfd0e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/non-styled-elements-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/non-styled-elements-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementsByClassName('target').length is 2
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getelementsbyname-invalidation-cache-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getelementsbyname-invalidation-cache-expected.txt
index 5a519b0..f3abdb3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getelementsbyname-invalidation-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getelementsbyname-invalidation-cache-expected.txt
@@ -3,39 +3,51 @@
 PASS createTwoElements('a'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('a').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('applet'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('applet').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('embed'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('embed').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('section'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('section').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('frame'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('frame').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('form'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('form').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('iframe'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('iframe').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('img'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('img').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('map'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('map').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('meta'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('meta').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('object'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('object').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS createTwoElements('param'); document.getElementsByName('fullname').length is 2
 PASS document.querySelector('param').setAttribute('name', 'changed-name'); document.getElementsByName('fullname').length is 1
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getelementsbytagnamens-mixed-namespaces-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getelementsbytagnamens-mixed-namespaces-expected.txt
index c51d6cb..e43eb31 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getelementsbytagnamens-mixed-namespaces-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getelementsbytagnamens-mixed-namespaces-expected.txt
@@ -1,4 +1,5 @@
 Test to ensure that node list caching pays attention to namespaces
+
 div 1
 Should be 1: 1
 Should be 0: 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getter-on-window-object2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getter-on-window-object2-expected.txt
index 45723a49..6a445d95 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/getter-on-window-object2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/getter-on-window-object2-expected.txt
@@ -2,23 +2,26 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.x is 1
 PASS typeof window.__lookupGetter__('x') is 'undefined'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'x').get is 'undefined'
 
+
 PASS window.x is 2
 PASS typeof window.__lookupGetter__('x') is 'undefined'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'x').get is 'undefined'
 
-PASS window.y is 'window.y __getter__'
-PASS typeof window.__lookupGetter__('y') is 'function'
-PASS typeof Object.getOwnPropertyDescriptor(window, 'y').get is 'function'
 
 PASS window.y is 'window.y __getter__'
 PASS typeof window.__lookupGetter__('y') is 'function'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'y').get is 'function'
 
+
+PASS window.y is 'window.y __getter__'
+PASS typeof window.__lookupGetter__('y') is 'function'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'y').get is 'function'
+
+
 PASS window.z is undefined.
 PASS typeof window.__lookupSetter__('z') is 'function'
 PASS typeof Object.getOwnPropertyDescriptor(window, 'z').set is 'function'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/global-constructors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/global-constructors-expected.txt
index 8a52cc4e..491eddab 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/global-constructors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/global-constructors-expected.txt
@@ -5,4 +5,3 @@
 [Set window.Node = 1]
 [Deleted window.Node]
 [Deleted window.Element]
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt
index bc53c984..b8643073 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/horizontal-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt
@@ -3,4 +3,3 @@
 This test has passed if the text "FAIL - scroll event received!" does not appear below.
 
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-child-invisible-cursor-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-child-invisible-cursor-expected.txt
index 19c4f389..2c1b4f6f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-child-invisible-cursor-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-child-invisible-cursor-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Mouse is visible, moving it over the red div.
 PASS blueText is "\"Hovered.\""
 PASS redText is "\"Hovered.\""
diff --git a/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
index 54b1d44..ab39358 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/hover-after-dom-delete-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Adding the red and blue divs.
 PASS blueDiv.offsetTop is 200
 PASS redDiv.offsetTop is 50
diff --git a/third_party/WebKit/LayoutTests/fast/dom/html-attribute-types-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/html-attribute-types-expected.txt
index b7aefb1..79f9bd9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/html-attribute-types-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/html-attribute-types-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS typeof img.border is 'string'
 PASS typeof pre.width is 'number'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-expected.txt
index b8f1b9c..725a27fb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 document.all
 PASS document.all instanceof HTMLAllCollection is true
 FAIL document.all instanceof HTMLCollection should be true. Was false.
@@ -14,6 +13,7 @@
 PASS elements[0].parentNode.removeChild(elements[0]); document.all['foo'] is elements[1]
 PASS document.all['no-such-element'] is undefined.
 
+
 form.elements
 PASS form.elements instanceof HTMLFormControlsCollection is true
 PASS form.elements instanceof HTMLCollection is true
@@ -30,6 +30,7 @@
 PASS removeTestElements(); form.elements.length is 0
 PASS form.elements['no-such-element'] is undefined.
 
+
 document.images
 PASS document.images.length is 0
 PASS elements[0] = insertElementWithId('img', 'foo'); document.images.length is 1
@@ -37,6 +38,7 @@
 PASS document.images['foo'] is elements[0]
 PASS removeTestElements(); document.images.length is 0
 
+
 document.applets
 PASS document.applets.length is 0
 PASS elements[0] = insertElementWithId('object', 'foo', {"type":"application/x-java-applet"}); document.applets.length is 1
@@ -44,6 +46,7 @@
 PASS document.applets['foo'] is elements[0]
 PASS removeTestElements(); document.applets.length is 0
 
+
 document.embeds
 PASS document.embeds.length is 0
 PASS elements[0] = insertElementWithId('embed', 'foo'); document.embeds.length is 1
@@ -51,6 +54,7 @@
 PASS document.embeds['foo'] is elements[0]
 PASS removeTestElements(); document.embeds.length is 0
 
+
 document.forms
 PASS document.forms.length is 1
 PASS elements[0] = insertElementWithId('form', 'foo'); document.forms.length is 2
@@ -58,6 +62,7 @@
 PASS document.forms['foo'] is elements[0]
 PASS removeTestElements(); document.forms.length is 1
 
+
 document.links
 PASS document.links.length is 0
 PASS elements[0] = insertElementWithId('a', 'foo', {"href":"some url"}); document.links.length is 1
@@ -66,6 +71,7 @@
 PASS document.links['foo'] is elements[0]
 PASS removeTestElements(); document.links.length is 0
 
+
 document.anchors
 PASS document.anchors.length is 0
 PASS elements[0] = insertElementWithId('a', 'foo', {"name":"some name"}); document.anchors.length is 1
@@ -73,6 +79,7 @@
 PASS document.anchors['foo'] is elements[0]
 PASS removeTestElements(); document.anchors.length is 0
 
+
 document.scripts
 PASS document.scripts.length is 2
 PASS elements[0] = insertElementWithId('script', 'foo'); document.scripts.length is 3
@@ -80,6 +87,7 @@
 PASS document.scripts['foo'] is elements[0]
 PASS removeTestElements(); document.scripts.length is 2
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg-expected.txt
index e13297d6..1885cac 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/html-collections-named-getter-mandatory-arg-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS htmlCollection.__proto__ is HTMLCollection.prototype
 PASS htmlCollection.length is 1
 PASS htmlCollection.namedItem('testLink') is testLink
diff --git a/third_party/WebKit/LayoutTests/fast/dom/htmlallcollection-call-with-index-caching-bug-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/htmlallcollection-call-with-index-caching-bug-expected.txt
index d88bdc42..9460616 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/htmlallcollection-call-with-index-caching-bug-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/htmlallcollection-call-with-index-caching-bug-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.all.item(0) is document.documentElement
 Calling document.all('foo', 0).
 PASS document.all.item(0) is document.documentElement
diff --git a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-length-after-item-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-length-after-item-expected.txt
index 623d29f..61f3bd6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-length-after-item-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-length-after-item-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS children = container.children; children.length is 0
 PASS container.appendChild(span); children[1]; children.length is 1
 PASS container.removeChild(span); children.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-non-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-non-html-expected.txt
index c20abea..dcb64cb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-non-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-non-html-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS select.options.length is 0
 PASS select.selectedOptions.length is 0
 PASS select.options.length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-protects-base-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-protects-base-expected.txt
index cfab769..bfe1367f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-protects-base-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-protects-base-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS options[0].parentNode.getAttribute('foo') is 'bar'
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-selectedOptions-namedItem-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-selectedOptions-namedItem-crash-expected.txt
index c45d7b19..20e0cb4d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-selectedOptions-namedItem-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/htmlcollection-selectedOptions-namedItem-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 This test passes if it does not crash.
 PASS options.namedItem("test") is null
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/icon-size-property-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/icon-size-property-expected.txt
index 5b680ccc..56a1828 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/icon-size-property-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/icon-size-property-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS icon.sizes.length is 2
 PASS icon.sizes.value is "23x47 19x42"
 PASS icon.sizes.length is 3
diff --git a/third_party/WebKit/LayoutTests/fast/dom/icon-url-change-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/icon-url-change-expected.txt
index 0f3e87a..db56f23 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/icon-url-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/icon-url-change-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Original iconURL is: http://test.com/oldfavicon.ico
 Setting new icon URL to: http://test.com/newfavicon.ico
 New iconURL is: http://test.com/newfavicon.ico
diff --git a/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt
index 158471c7..96966590 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-apple-touch-expected.txt
@@ -1,5 +1,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Tests that all favicons and touch icons are in document.iconURLs()
 All icons are preset and in-order in document.iconURLs()
diff --git a/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-expected.txt
index 624d36b..52ff4b3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/icon-url-list-expected.txt
@@ -1,6 +1,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Original iconURL is: http://test.com/oldfavicon.ico
 Setting new icon URL to: http://test.com/newfavicon.ico
 New iconURL is: http://test.com/newfavicon.ico
diff --git a/third_party/WebKit/LayoutTests/fast/dom/iframe-inner-size-scaling-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/iframe-inner-size-scaling-expected.txt
index 426b59a..3da1d19 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/iframe-inner-size-scaling-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/iframe-inner-size-scaling-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS frame.contentWindow.innerWidth is non-zero.
 PASS frame.contentWindow.innerHeight is non-zero.
 PASS frame.contentWindow.innerWidth is originalWidth
@@ -11,3 +10,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/implementation-api-args-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/implementation-api-args-expected.txt
index f44804f..565c2ee 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/implementation-api-args-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/implementation-api-args-expected.txt
@@ -3,7 +3,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 DocumentType createDocumentType(DOMString qualifiedName, DOMString publicId, DOMString systemId);
 PASS document.implementation.createDocumentType() threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 0 present..
 PASS document.implementation.createDocumentType("qualifiedName") threw exception TypeError: Failed to execute 'createDocumentType' on 'DOMImplementation': 3 arguments required, but only 1 present..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/importNode-unsupported-node-type-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/importNode-unsupported-node-type-expected.txt
index a0aba727..2778b18 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/importNode-unsupported-node-type-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/importNode-unsupported-node-type-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.importNode(doc) threw exception NotSupportedError: Failed to execute 'importNode' on 'Document': The node provided is a document, which may not be imported..
 PASS document.importNode(shadow) threw exception NotSupportedError: Failed to execute 'importNode' on 'Document': The node provided is a shadow root, which may not be imported..
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/incompatible-operations-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/incompatible-operations-expected.txt
index f8fac0c7..24d638f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/incompatible-operations-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/incompatible-operations-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS aNode.appendChild(aDOMImplementation) threw exception TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'..
 PASS aNode.appendChild('knort') threw exception TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'..
 PASS aNode.appendChild(void 0) threw exception TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-crash-expected.txt
index da3b7ee..893cdcc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Did not crash
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-event-param-name-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-event-param-name-expected.txt
index d678623b..6921a88 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-event-param-name-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-event-param-name-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS type is "object"
 PASS type is "undefined"
 PASS type is "undefined"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-expected.txt
index d274a409..0705e4b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS result is "test-input-a"
 PASS result is "test-form-b"
 PASS result is "document-c"
@@ -15,3 +14,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-expected.txt
index 05f31db..703300fa 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS result is "PASS"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form-expected.txt
index 05f31db..703300fa 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS result is "PASS"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-moved-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-moved-expected.txt
index e18ef99..be64efc1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-moved-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-moved-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS expected is "undefined"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-release-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-release-expected.txt
index 866f8ccef..9c0d93e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-release-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inline-event-attributes-release-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS afterCount - beforeCount is 0
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/inner-text-001-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/inner-text-001-expected.txt
index 7a22c0ff..6e0f0021 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/inner-text-001-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/inner-text-001-expected.txt
@@ -6,9 +6,10 @@
 1	2	3
 4	5	6
 
-Right here is an inline block. 
-And an  inline	table	with	one	row  is here, too. 
-And an  inline	table	with	rows  not far behind.
+Right here is an inline block.
+And an inline	table	with	one	row is here, too.
+And an inline	table
+with	rows not far behind.
 Check collapsed margins
 Collapsed margins are supposed to result in an extra line break.
 First header
@@ -16,6 +17,7 @@
 First list element
 Second list element
 This line contains  an image.
+
 The innerText of the above:
 
 Test innerText
diff --git a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-detached-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-detached-element-expected.txt
index dea1e9f6..8078578 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-detached-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-detached-element-expected.txt
@@ -1,2 +1,3 @@
 Parsed element namespace: http://www.w3.org/1999/xhtml
+
 This should be italic.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt
index 69cfc5a9..7ef22e9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-escaping-attribute-expected.txt
@@ -1,2 +1 @@
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-nbsp-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-nbsp-expected.txt
index 69cfc5a9..7ef22e9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/innerHTML-nbsp-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/innerHTML-nbsp-expected.txt
@@ -1,2 +1 @@
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt
index 08ce065..8377a7c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/insert-span-into-long-text-bug-28245-expected.txt
@@ -1,5 +1,6 @@
 This tests that inserting a span into a selection of a div with lots of non-word-broken characters doesn't crash.
 ____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
+
 <div>____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
 </div>
 <div><span></span>____________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insertBefore-refChild-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/insertBefore-refChild-crash-expected.txt
index 1042c767..0383162 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/insertBefore-refChild-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/insertBefore-refChild-crash-expected.txt
@@ -1,2 +1 @@
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt
index af65951..984ab80 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-child-expected.txt
@@ -1,2 +1 @@
 PASS 
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-no-crash-expected.txt
index 993e6973..39c13ce 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-no-crash-expected.txt
@@ -1,7 +1,7 @@
 This test must not crash.
 
 foo
- <mark>
+<mark>
 <script>f1();</script>
 <xmp>
 foo
diff --git a/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt
index ac8167d..984ab80 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/insertedIntoDocument-sibling-expected.txt
@@ -1 +1 @@
-PASS  
+PASS 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/interface-object-proto-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/interface-object-proto-expected.txt
index b4f0261..b04cf68 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/interface-object-proto-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/interface-object-proto-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Object.getPrototypeOf(HTMLBodyElement) is HTMLElement
 PASS Object.getPrototypeOf(HTMLElement) is Element
 PASS Object.getPrototypeOf(Element) is Node
diff --git a/third_party/WebKit/LayoutTests/fast/dom/isEqualNode-after-removeAttribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/isEqualNode-after-removeAttribute-expected.txt
index 17e1be0..4d375ced 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/isEqualNode-after-removeAttribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/isEqualNode-after-removeAttribute-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS e1.isEqualNode(e2) is true
 PASS e1.isEqualNode(e2) is false
 PASS e1.isEqualNode(e2) is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/javascript-backslash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/javascript-backslash-expected.txt
index bd9c0226..bc5cbc93 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/javascript-backslash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/javascript-backslash-expected.txt
@@ -3,6 +3,7 @@
 If it works you should see seven messages below that have \ or / characters as specified.
 
 1 2 3 4 5 6 7
+
 javascript: function argument containing a backslash (\) should not be converted to a slash (/): "alert('to be\\not')"
 http: base should convert a \ to a / : "http://apple.com/support"
 https: base should also convert a \ to a / : "https://login.apple.com/support/"
@@ -10,4 +11,3 @@
 any other valid base except javascript: should convert a \ to a / : "ftp://apple.com/support/"
 query strings should be left alone: "http://apple.com/support?path=\\myshare\myfolder\myfile\"
 anchors should be left alone as well: "http://apple.com/support#path=\\myshare\myfolder\myfile\"
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation-expected.txt
index a2abd23..fe11dde 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/javascript-url-exception-isolation-expected.txt
@@ -4,10 +4,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS caughtException is false
 PASS caughtException is false
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/legend-display-inline-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/legend-display-inline-expected.txt
index bcf930f..91068d7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/legend-display-inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/legend-display-inline-expected.txt
@@ -1,4 +1,5 @@
 foo
+
 Bug 23753: Assertion failure in LayoutBlockFlow::createLineBoxes() when a legend has display: inline
 
 This test PASSED if it did not crash
diff --git a/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt
index 11b9aad..2d27a0f6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/location-new-window-no-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS testWindow.location.toString() is 'about:blank'
 PASS testWindow.location.href is 'about:blank'
 PASS testWindow.location.protocol is 'about:'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/multiple-ids-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/multiple-ids-expected.txt
index ad9e485e..f10269bb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/multiple-ids-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/multiple-ids-expected.txt
@@ -1,5 +1,7 @@
-
-
+1
+2
+1
+2
 1. Found [object HTMLDivElement] (should be a div element)
 2. Found [object HTMLDivElement] (should be a div element)
 3. Found [object HTMLDivElement] (should be a div element)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/mutation-event-listener-with-dirty-inline-style-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/mutation-event-listener-with-dirty-inline-style-crash-expected.txt
index d1b3de8c..d5a3334 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/mutation-event-listener-with-dirty-inline-style-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/mutation-event-listener-with-dirty-inline-style-crash-expected.txt
@@ -1,4 +1,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS, assuming we didn't crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/navigator-maxTouchPoints-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/navigator-maxTouchPoints-expected.txt
index 4250dcf..943641a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/navigator-maxTouchPoints-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/navigator-maxTouchPoints-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS navigator.maxTouchPoints is 37
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/node-childNodes-idempotence-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/node-childNodes-idempotence-expected.txt
index ffcfc59..989a2f4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/node-childNodes-idempotence-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/node-childNodes-idempotence-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.documentElement.childNodes is document.documentElement.childNodes
 PASS document.documentElement.childNodes === document.documentElement.childNodes is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/node-filter-detached-iframe-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/node-filter-detached-iframe-crash-expected.txt
index 56108545..8e1f4563 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/node-filter-detached-iframe-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/node-filter-detached-iframe-crash-expected.txt
@@ -3,6 +3,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS Did not crash.
 PASS dummyFilterCalled is true
 PASS foundNode.toString() is "[object HTMLHtmlElement]"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/node-iterator-reference-node-removed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/node-iterator-reference-node-removed-expected.txt
index 93cbdc3..a24f839 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/node-iterator-reference-node-removed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/node-iterator-reference-node-removed-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS iter.nextNode() is testDiv
 PASS iter.nextNode() is div1
 PASS iter.nextNode() is div2
diff --git a/third_party/WebKit/LayoutTests/fast/dom/node-legacy-event-listener-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/node-legacy-event-listener-expected.txt
index 767a321..256e8a4a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/node-legacy-event-listener-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/node-legacy-event-listener-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.addEventListener("foo") threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 1 present..
 PASS document.removeEventListener("bar") threw exception TypeError: Failed to execute 'removeEventListener' on 'EventTarget': 2 arguments required, but only 1 present..
 PASS document.addEventListener() threw exception TypeError: Failed to execute 'addEventListener' on 'EventTarget': 2 arguments required, but only 0 present..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodelist-item-parameter-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodelist-item-parameter-expected.txt
index 348de54..9cfc726 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodelist-item-parameter-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodelist-item-parameter-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS nodeList.__proto__ is NodeList.prototype
 PASS nodeList.item(0).id is "a"
 PASS nodeList.item(1).id is "b"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt
index 9c1c970..f681a195 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-content-expected.txt
@@ -1,9 +1,7 @@
-
 Document::nodesFromRect : Allow child-frame content - bug 95204
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt
index b4611cc..6606383 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt
@@ -1,13 +1,14 @@
- 
+
+
 
 nodesFromRect returns correct rects when the rect is overlapping an iframe with scrolled contents
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 iframe's scroll top is 400
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt
index 52647f5..4ceb7f91 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt
@@ -1,3 +1,2 @@
 ALERT: PASS: This test did not trigger an ASSERT
- 
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak-expected.txt
index 0241aae..673777dc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inline-with-linebreak-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-bidi-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-bidi-expected.txt
index 99ba6b2..df29c218 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-bidi-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-bidi-expected.txt
@@ -2,11 +2,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 12 34 56 78
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt
index 326ae70..fedc5c98 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt
@@ -2,12 +2,12 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS successfullyParsed is true
 
 TEST COMPLETE
-HITME1 
+
+HITME1
 HITME2 HITME3
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt
index ebed247..89210a1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-embedded-frame-content-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-embedded-frame-content-expected.txt
index 8cd7618..1e79942 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-embedded-frame-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-embedded-frame-content-expected.txt
@@ -1,9 +1,7 @@
-
 REGRESSION(r143727): Clicking / selecting inside an embed is broken - bug 111217
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS Correct node found for point
 PASS Correct node found for point
 PASS Correct node found for point
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt
index 64c67df6..9ac8615 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt
@@ -1,9 +1,7 @@
- 
 Document::nodesFromRect : inline image - bug 85849
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt
index a9ba739..5b3c181 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt
@@ -1,7 +1,8 @@
-A  
+A 
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-links-and-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-links-and-text-expected.txt
index a62e1c79..afa456b9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-links-and-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-links-and-text-expected.txt
@@ -4,10 +4,10 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
 
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
+PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-rotate-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-rotate-expected.txt
index 3fc3e19..cdf0485a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-rotate-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-rotate-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Check unrotated area-testing for sanity
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
@@ -46,4 +46,3 @@
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-scale-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-scale-expected.txt
index 6739a11..55d3bcb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-scale-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-scale-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Check unscaled area-testing for sanity
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
@@ -35,4 +35,3 @@
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-svg-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-svg-expected.txt
index b79725e..a1446516 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-svg-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-svg-expected.txt
@@ -3,9 +3,9 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 Some of following tests will likely FAIL and will need to be updated once rect-based
 hit tests are supported inside SVG elements:
+
 Check area hits fully inside SVG element
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
@@ -18,7 +18,11 @@
 Check area hits across SVG elements
 PASS All correct nodes found for rect
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
+
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt
index da6ace37..fc3eea8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/nodesFromRect/nodesFromRect-table-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Check area hits fully inside table cells
 PASS All correct nodes found for rect
 PASS All correct nodes found for rect
@@ -36,3 +35,7 @@
 
 TEST COMPLETE
 
+			
+			
+			
+			
diff --git a/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
index 9696445..346e7ff 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS nonNumericPolicy('document.createTextNode("a").substringData(x, 0)') is 'any type allowed'
 PASS nonNumericPolicy('document.createTextNode("a").substringData(0, x)') is 'any type allowed (but not omitted)'
 PASS nonNumericPolicy('document.createTextNode("a").insertData(x, "b")') is 'any type allowed'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/object-plugin-hides-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/object-plugin-hides-properties-expected.txt
index f5e01c29..d6da2f5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/object-plugin-hides-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/object-plugin-hides-properties-expected.txt
@@ -1,5 +1,3 @@
 This test checks for a regression where scriptable plugins hide properties of the OBJECT element. If the test passes, you will see a "PASSED" message below.
 
 PASSED
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/offset-parent-positioned-and-inline-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/offset-parent-positioned-and-inline-expected.txt
index 2a4bcd7..7a0b947 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/offset-parent-positioned-and-inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/offset-parent-positioned-and-inline-expected.txt
@@ -1,3 +1,3 @@
-Div Anchor 
+Div Anchor
 
 Success! This test succeeded because the div is rightly recognized as the anchor's offsetParent :-)
diff --git a/third_party/WebKit/LayoutTests/fast/dom/open-and-close-by-DOM-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/open-and-close-by-DOM-expected.txt
index 4e56099..d65ccb0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/open-and-close-by-DOM-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/open-and-close-by-DOM-expected.txt
@@ -1,8 +1,9 @@
 ALERT: Middle Window Opened
 ALERT: Close Window Opened
-This test checks that a window which has been opened by the DOM can also be closed byt the DOM. The test will run automatically with popup blocking disabled. To run the test manually click the link below. 
+This test checks that a window which has been opened by the DOM can also be closed byt the DOM. The test will run automatically with popup blocking disabled. To run the test manually click the link below.
 
-Open new window that will close itself 
 
-TEST PASSED 
+Open new window that will close itself
+
+TEST PASSED
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/option-properties-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/option-properties-expected.txt
index 6e893f3..28539b4e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/option-properties-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/option-properties-expected.txt
@@ -5,4 +5,5 @@
 PASS: document.getElementById('sel').options.selectedIndex should be 1 and is.
 PASS: document.getElementById('sel').options[1].selected should be true and is.
 PASS: document.getElementById('sel').options[1].text should be PASS and is.
-
+FAIL
+PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/outerText-no-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/outerText-no-element-expected.txt
index a8069dd..443af493 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/outerText-no-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/outerText-no-element-expected.txt
@@ -1,4 +1,5 @@
 Expected behavior:
+
 This page will try to set the outerText on an element that is no longer in the DOM tree. You should see a description of an expected error.
 
 this is a big test or something
diff --git a/third_party/WebKit/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt
index c93e753..a529e7e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/ping-attribute-dom-binding-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS anchor.ping is ""
 PASS anchor.ping is "p1"
 PASS anchor.getAttribute("ping") is "p2"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
index 9a62f54..556b274 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/plugin-attributes-enumeration-expected.txt
@@ -25,5 +25,3 @@
 ----------
 EMBED also has:
 src
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-appendChild-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-appendChild-exceptions-expected.txt
index 2e2f0e9..dfbe9e5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-appendChild-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-appendChild-exceptions-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS pi.appendChild(null) threw exception TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'..
 PASS pi.appendChild(div) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method..
 PASS pi.appendChild(textNode) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': This node type does not support this method..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-inherit-characterdata-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-inherit-characterdata-expected.txt
index ed90417..d1789cd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-inherit-characterdata-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/processing-instruction-inherit-characterdata-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS ProcessingInstruction.__proto__ is CharacterData
 PASS ProcessingInstruction.prototype.__proto__ is CharacterData.prototype
 PASS processingInstruction.__proto__.__proto__ is CharacterData.prototype
diff --git a/third_party/WebKit/LayoutTests/fast/dom/prototype-chain-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/prototype-chain-expected.txt
index 985997b..ef19639e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/prototype-chain-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/prototype-chain-expected.txt
@@ -69,5 +69,3 @@
 [object UIEvent]
 
 [object KeyboardEvent]
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/prototype-property-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/prototype-property-expected.txt
index 855817e4..7652ddc8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/prototype-property-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/prototype-property-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS tryToDeletePrototype(window.HTMLElement) is false
 PASS tryToSetPrototype(window.HTMLElement, null) is false
 PASS tryToSetPrototype(window.HTMLElement, undefined) is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/prototypes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/prototypes-expected.txt
index 554ec99..9edd3cd4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/prototypes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/prototypes-expected.txt
@@ -7,4 +7,3 @@
 PASS: Object.prototype.isPrototypeOf(cssRule) should be true and is.
 PASS: Object.prototype.isPrototypeOf(nodeList) should be true and is.
 PASS: Object.prototype.isPrototypeOf(namedNodesCollection) should be true and is.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/ready-state-change-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/ready-state-change-crash-expected.txt
index c559db5..5581aa5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/ready-state-change-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/ready-state-change-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE ERROR: line 27: Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node': The node to be removed is no longer a child of this node. Perhaps it was moved in response to a mutation?
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/remove-children-notification-order-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/remove-children-notification-order-expected.txt
index aa44e7c..8033a8c4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/remove-children-notification-order-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/remove-children-notification-order-expected.txt
@@ -1,2 +1,3 @@
+PASS
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/replace-child-siblings-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/replace-child-siblings-expected.txt
index fffc90e..637cf64 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/replace-child-siblings-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/replace-child-siblings-expected.txt
@@ -1,5 +1,3 @@
 This is a test for https://bugs.webkit.org/show_bug.cgi?id=6069 Assertion failure in LayoutBlockFlow::addChildToFlow during replaceChild. It tests whether replaceChild() works correctly when the new node and the old node are siblings.
 
 Test result: PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/replaced-image-map-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/replaced-image-map-expected.txt
index a7f5d261..7b684801 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/replaced-image-map-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/replaced-image-map-expected.txt
@@ -2,4 +2,3 @@
 
 SUCCESS
 
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/root-client-size-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/root-client-size-expected.txt
index 6d78313..f452cc5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/root-client-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/root-client-size-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS [object Internals] is defined.
 PASS internals.updateStyleAndReturnAffectedElementCount() is 1
 PASS 800 is 800
diff --git a/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe-expected.txt
index a21f36b..5cb8369 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/root-client-size-iframe-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS [object Internals] is defined.
 PASS internals.updateStyleAndReturnAffectedElementCount() is 0
 PASS clientWidthBefore is 100
@@ -11,3 +10,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-add-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/script-add-expected.txt
index baf7fe1..4747c01 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/script-add-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/script-add-expected.txt
@@ -7,4 +7,3 @@
 Loaded script 3.
 Loaded script 4.
 Loaded script 5.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-element-gc-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/script-element-gc-expected.txt
index 368bf11..7381046 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/script-element-gc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/script-element-gc-expected.txt
@@ -1,3 +1,4 @@
 ALERT: Script onload handler called!
 This tests that removing the script element from the script loaded by the element itself, and then garbage collecting does not cause a crash when dispatching the onload element (because the script element was freed).
+
 SUCCESS! Didn't Crash!
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-remove-child-id-map-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/script-remove-child-id-map-expected.txt
index ce20e63..f508cd4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/script-remove-child-id-map-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/script-remove-child-id-map-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('child') is null
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/script-styled-size-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/script-styled-size-expected.txt
index 7eaaa16..e1a36b50 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/script-styled-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/script-styled-size-expected.txt
@@ -2,11 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS script.offsetWidth > 0 is true
 PASS script.offsetWidth > 0 is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-shouldBeTrue("script.offsetWidth > 0")
 
+shouldBeTrue("script.offsetWidth > 0")
diff --git a/third_party/WebKit/LayoutTests/fast/dom/serialize-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/serialize-attribute-expected.txt
index 37986431..4de3c8e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/serialize-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/serialize-attribute-expected.txt
@@ -1,4 +1,3 @@
 Test for bug 11998: Incorrect serialization of quotation marks in XML attributes.
 
 SUCCESS
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/set-outer-html-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/set-outer-html-expected.txt
index 95807150..2cc7128 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/set-outer-html-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/set-outer-html-expected.txt
@@ -1,7 +1,7 @@
 Replaced node using outerHTML.
 removing node using outerHTML.
 Testing merging text nodes.
-Testing adding 
+Testing adding
 using outerHTML.
 PASS: replace
 PASS: remove
diff --git a/third_party/WebKit/LayoutTests/fast/dom/setAttribute-using-initial-input-value-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/setAttribute-using-initial-input-value-expected.txt
index 1f84e830d..d11d82d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/setAttribute-using-initial-input-value-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/setAttribute-using-initial-input-value-expected.txt
@@ -3,17 +3,22 @@
 PASS elem.value is ''
 
 Before calling setAttribute("startval", elem.value):
+
 PASS elem.getAttribute('startval') is ''
 
 After calling setAttribute("startval", elem.value):
+
 PASS elem.getAttribute('startval') is ''
 
 Before calling setAttribute("style", elem.value):
+
 PASS elem.getAttribute('style') is ''
 
 After calling setAttribute("style", elem.value):
+
 PASS elem.getAttribute('style') is ''
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-expected.txt
index a47258d..cfbf0c29a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS elem.attributes[0].namespaceURI is null
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-namespace-errors-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-namespace-errors-expected.txt
index a1effc0a..7181532 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-namespace-errors-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/setAttributeNS-namespace-errors-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS elem.setAttributeNS(null, 'foo:bar', 'baz') threw exception NamespaceError: Failed to execute 'setAttributeNS' on 'Element': '' is an invalid namespace for attributes..
 PASS elem.setAttributeNS('http://www.w3.org/XML/1998/namespace', 'xml:abc', 'foo') did not throw exception.
 PASS elem.setAttributeNS('http://www.w3.org/not-XML/1998/namespace', 'xml:abc', 'foo') threw exception NamespaceError: Failed to execute 'setAttributeNS' on 'Element': 'http://www.w3.org/not-XML/1998/namespace' is an invalid namespace for attributes..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/setter-type-enforcement-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/setter-type-enforcement-expected.txt
index 7f1abec..59afcd0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/setter-type-enforcement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/setter-type-enforcement-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.body = nodelist; threw exception TypeError: Failed to set the 'body' property on 'Document': The provided value is not of type 'HTMLElement'..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash-expected.txt
index 43ccfd8d..998b05aa1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/access-key-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/access-key-expected.txt
index f828aeb..4741f0f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/access-key-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/access-key-expected.txt
@@ -3,8 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
-
 PASS dispatchedEvent("focus") is ["inputE"]
 PASS dispatchedEvent("focus") is ["inputE"]
 PASS dispatchedEvent("focus") is ["inputE"]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/activeelement-should-be-shadowhost-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/activeelement-should-be-shadowhost-expected.txt
index bba47c9..ee64bc0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/activeelement-should-be-shadowhost-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/activeelement-should-be-shadowhost-expected.txt
@@ -38,3 +38,4 @@
 PASS: top/iframe4/iframe4_1 document.activeElement is top/iframe4/iframe4_1/input4
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt
index 5b923f9..1910a30 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt
@@ -2,5 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS document.adoptNode(shadow) threw exception HierarchyRequestError: Failed to execute 'adoptNode' on 'Document': The node provided is a shadow root, which may not be adopted..
 
+PASS document.adoptNode(shadow) threw exception HierarchyRequestError: Failed to execute 'adoptNode' on 'Document': The node provided is a shadow root, which may not be adopted..
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/all-in-shadow-tree-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/all-in-shadow-tree-expected.txt
index c473180..283b0034 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/all-in-shadow-tree-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/all-in-shadow-tree-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(targets[0]).width is "100px"
 PASS window.getComputedStyle(targets[1]).width is "100px"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/alternate-stylesheets-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/alternate-stylesheets-expected.txt
index 1040ba6..49473cb7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/alternate-stylesheets-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/alternate-stylesheets-expected.txt
@@ -3,11 +3,11 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(root.querySelector('div')).color is "rgb(0, 128, 0)"
 PASS getComputedStyle(alternate).color is "rgb(0, 128, 0)"
 PASS host.shadowRoot.styleSheets[0].title is null
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/anchor-content-projected-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/anchor-content-projected-expected.txt
index 8d6b4e0..0e126160 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/anchor-content-projected-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/anchor-content-projected-expected.txt
@@ -3,10 +3,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Cursor Info: type=Hand hotSpot=0,0
 PASS window.location.hash is "#link-clicked"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Example link
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/apply-deep-in-document-scope-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/apply-deep-in-document-scope-expected.txt
index 948841a..faba39cd1 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/apply-deep-in-document-scope-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/apply-deep-in-document-scope-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(inner).color is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This text should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/base-in-shadow-tree-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/base-in-shadow-tree-expected.txt
index 8215caf8..b407328 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/base-in-shadow-tree-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/base-in-shadow-tree-expected.txt
@@ -5,4 +5,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 tehepero
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt
index a31d3e2..5cb62ea 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS borderColorOf(getNodeInComposedTree("target")) is "rgb(0, 128, 0)"
 PASS borderColorOf(getNodeInComposedTree("host/target")) is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-document-position-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-document-position-expected.txt
index 17b8bb6..1e2f587 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-document-position-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-document-position-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS a1.compareDocumentPosition(a2) is Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING
 PASS a2.compareDocumentPosition(a1) is Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
 PASS a2.compareDocumentPosition(a3) is Node.DOCUMENT_POSITION_FOLLOWING
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-treescope-position-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-treescope-position-expected.txt
index a9efe6d..95287967 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-treescope-position-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/compare-treescope-position-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS internals.compareTreeScopePosition(document, sr1) is Node.DOCUMENT_POSITION_CONTAINED_BY | Node.DOCUMENT_POSITION_FOLLOWING
 PASS internals.compareTreeScopePosition(sr1, document) is Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
 PASS internals.compareTreeScopePosition(sr1, sr2) is Node.DOCUMENT_POSITION_FOLLOWING
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/contains-with-shadow-dom-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/contains-with-shadow-dom-expected.txt
index d3c0cb17..ffc5f59 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/contains-with-shadow-dom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/contains-with-shadow-dom-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.contains(getNodeInComposedTree("shadowHostA/")) is false
 PASS getNodeInComposedTree("shadowHostA/").contains(document) is false
 PASS document.contains(getNodeInComposedTree("shadowHostA/divA")) is false
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-api-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-api-expected.txt
index 98202ca..80c8185 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-api-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-api-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS contentSimplest.select is ''
 PASS contentSimplest.select is 'foo'
 PASS contentSimplest.getAttribute('select') is 'bar'
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-distributed-nodes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-distributed-nodes-expected.txt
index fbc8f4d1..25facd2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-distributed-nodes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-distributed-nodes-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS nodeList.length is expectedNodes.length
 PASS nodeList.item(0) is expectedNodes[0]
 PASS nodeList.length is expectedNodes.length
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-includer-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-includer-expected.txt
index 0d966d5..73ffa88c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-includer-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-includer-expected.txt
@@ -1,6 +1,7 @@
 CONSOLE WARNING: line 32: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 This tests the correctness of includers of forwarded children.
 Note that this test needs internals object thus cannot run outside DRT.
+
 PASS includerFor(childOfElementWithoutShadow) is null
 PASS includerFor(childOfElementWithShadow) is null
 PASS includerFor(childOfElementWithShadowContent) is shadowContentOfElementWithShadowContent
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-outside-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-outside-shadow-expected.txt
index 4589954..2252205 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-outside-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-element-outside-shadow-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 <div><content></content></div>
 PASS targetLayoutTree is comparisonLayoutTree
 <div><content>Here is a text.</content></div>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-css-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-css-text-expected.txt
index b8b62cfc..f55aa51 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-css-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-css-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('style1').sheet.cssRules.item(0).cssText is ".foo::content div .bar::before { display: block; }"
 PASS document.getElementById('style1').sheet.cssRules.item(1).cssText is "::content { display: block; }"
 PASS document.getElementById('style1').sheet.cssRules.item(2).cssText is "div content::content div content::content div.green { color: green; }"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-not-last-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-not-last-expected.txt
index b18014d..78cb378 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-not-last-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-not-last-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(distributed).color is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This text should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt
index 59de53e..19e70155 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(getNodeInComposedTree("hostChild")).color is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-expected.txt
index 3fdd502..7d6f29e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-overridden-expected.txt
@@ -1,10 +1,10 @@
 CONSOLE WARNING: line 33: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 content
+
 Test for crbug.com/274059. Should be able to override ::content styles in shadow root style sheet from the document.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(document.querySelector(".contentClass")).color is "rgb(0, 0, 255)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-relative-selector-css-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-relative-selector-css-text-expected.txt
index 8817f47..ec6ec37 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-relative-selector-css-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-relative-selector-css-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('style1').sheet.cssRules.item(0).cssText is ".foo::content > div .bar::before { display: block; }"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt
index 569b6dfd..ea23bae2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt
@@ -1,10 +1,10 @@
 CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 content
+
 Test for crbug.com/274063: cannot style ::content with a rule that includes :host.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(document.querySelector("#host1 > .content")).color is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt
index 3a8b8e8..695a2a4b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt
@@ -1,10 +1,10 @@
 CONSOLE WARNING: line 34: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 content
+
 Test for crbug.com/274063, cannot style ::content with a rule that includes :host.
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(document.querySelector("#host > .content")).color is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt
index b6d7876..34cd048 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(sandbox.querySelector('#host > .special')).backgroundColor is not "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 I should not be red.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-reprojection-recalc-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-reprojection-recalc-expected.txt
index 645e68cd..67640b44 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/content-reprojection-recalc-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/content-reprojection-recalc-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.internals is defined.
 PASS internals.updateStyleAndReturnAffectedElementCount() is 1
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/css-computed-style-declarations-length-with-dirty-distribution-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/css-computed-style-declarations-length-with-dirty-distribution-crash-expected.txt
index d0ad2c5..bcd3f9d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/css-computed-style-declarations-length-with-dirty-distribution-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/css-computed-style-declarations-length-with-dirty-distribution-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE WARNING: line 7: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 Tests that CSSComputedStyleDeclaration.length with dirty distribution doesn't crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/custom-pseudo-in-selector-api-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/custom-pseudo-in-selector-api-expected.txt
index 4319531..460e255 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/custom-pseudo-in-selector-api-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/custom-pseudo-in-selector-api-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS sandbox.firstChild.webkitMatchesSelector("input[type='search']::-webkit-search-decoration") is false
 PASS sandbox.firstChild.querySelector("input[type='search']::-webkit-search-decoration") is null
 PASS sandbox.firstChild.querySelectorAll("input[type='search']::-webkit-search-decoration").length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle-expected.txt
index 0b3d020..55c891a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS content.getDistributedNodes().length is 0
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/distributed-node-focus-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/distributed-node-focus-expected.txt
index 8d58576..9095956f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/distributed-node-focus-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/distributed-node-focus-expected.txt
@@ -1,5 +1,4 @@
 CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
-
 PASS document.activeElement.id is "input1"
 PASS document.activeElement.id is "input1"
 PASS shadowRoot.activeElement is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-for-detached-subtree-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-for-detached-subtree-expected.txt
index 942e794..74f861a4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-for-detached-subtree-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-for-detached-subtree-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS nodeList.length is expectedNodes.length
 PASS nodeList.length is expectedNodes.length
 PASS nodeList.item(0) is expectedNodes[0]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-update-recalcs-style-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-update-recalcs-style-expected.txt
index 1bccea8..8814aea 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-update-recalcs-style-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/distribution-update-recalcs-style-expected.txt
@@ -9,6 +9,8 @@
     
 
 
+
+
 PASS getColorProperty("div-child") is "rgb(0, 0, 255)"
 PASS getColorProperty("span-child") is "rgb(0, 0, 0)"
 PASS getColorProperty("div-child") is "rgb(0, 0, 0)"
@@ -16,6 +18,7 @@
 
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-shadow-expected.txt
index 643abc7d..77bf3724 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-shadow-expected.txt
@@ -3,10 +3,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 dragstart event occurred twice.
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
 Host Child
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-user-agent-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-user-agent-shadow-expected.txt
index 76b16bc..1715bfb3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-user-agent-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/drag-and-drop-in-user-agent-shadow-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS dragstartCount is 1
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-for-input-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-for-input-in-shadow-expected.txt
index eefdfe9..352c231 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-for-input-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-for-input-in-shadow-expected.txt
@@ -2,4 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS: drop event is fired.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-in-shadow-expected.txt
index 0caf869..c3daf71 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/drop-event-in-shadow-expected.txt
@@ -2,4 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS: drop event is fired.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/elements-in-frameless-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/elements-in-frameless-document-expected.txt
index b6430753f..44044dc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/elements-in-frameless-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/elements-in-frameless-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Testing on the frame-less document.
 PASS window.HTMLContentElement is content.constructor
 PASS window.HTMLShadowElement is shadow.constructor
@@ -12,4 +11,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 x+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-after-deleting-tree-scope-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-after-deleting-tree-scope-crash-expected.txt
index a00344d9..311b2d5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-after-deleting-tree-scope-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-after-deleting-tree-scope-crash-expected.txt
@@ -1,3 +1 @@
 Passes if it doesn't crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-for-user-agent-shadow-tree-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-for-user-agent-shadow-tree-expected.txt
index 85e3e41..13079d8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-for-user-agent-shadow-tree-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-for-user-agent-shadow-tree-expected.txt
@@ -1,4 +1,4 @@
- 
+
 Dispaching a click event on #details-child
 
 event.path on node #details-child
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-svg-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-svg-expected.txt
index 3ff19f6..eee521a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-svg-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/event-path-svg-expected.txt
@@ -5,3 +5,4 @@
 TEST COMPLETE
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt
index 996210d..3129cc44 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 None of the events should be stopped at a Shadow boundary if created by users.
 
   abort
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/flat-tree-traversal-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/flat-tree-traversal-expected.txt
index d2c2e839..dd44aab 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/flat-tree-traversal-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/flat-tree-traversal-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 ShadowRoot should be used.
 Flat Tree:
 #a
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-controller-recursion-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-controller-recursion-crash-expected.txt
index 8e0e9a0..13af7e286 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-controller-recursion-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-controller-recursion-crash-expected.txt
@@ -2,5 +2,7 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This test passes if it does not crash.
-  
+
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-skips-non-focusable-shadow-in-iframe-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-skips-non-focusable-shadow-in-iframe-expected.txt
index 5df97a8e..b7c4c9ad 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-skips-non-focusable-shadow-in-iframe-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-skips-non-focusable-shadow-in-iframe-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.activeElement is iframe
 PASS iframeDocument.activeElement is input
 PASS document.activeElement is button2
@@ -13,4 +12,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
   
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt
index c217650..01beb9fc 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt
@@ -1,8 +1,6 @@
 CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 This tests that pressing Tab key should traverse into shadow DOM subtrees, and pressing Shift-Tab should reverse the order.
 
-
-
 Should move from input-1 to shadowhost in forward
 PASS
 Should move from shadowhost to shadowhost/input-2 in forward
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-no-keyboard-navigatable-but-focusable-shadow-host-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-no-keyboard-navigatable-but-focusable-shadow-host-crash-expected.txt
index da5821e..ccc12e9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-no-keyboard-navigatable-but-focusable-shadow-host-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-no-keyboard-navigatable-but-focusable-shadow-host-crash-expected.txt
@@ -2,5 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
-This test passes if it does not crash.
 
+This test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-shadow-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-shadow-crash-expected.txt
index 3a52d62..7e16ae9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-shadow-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/focus-shadow-crash-expected.txt
@@ -3,5 +3,5 @@
 
 TEST COMPLETE
 
-Pressing TAB key to navigate a shadow insertion point in the oldest shadow tree should not make the browser crash.
 
+Pressing TAB key to navigate a shadow insertion point in the oldest shadow tree should not make the browser crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-shadow-expected.txt
index 5409a24d..ae5966a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/gc-shadow-expected.txt
@@ -2,6 +2,7 @@
 This tests that the JavaScript wrapper objects of shadow DOM objects
 are not prematurely garbage collected.
 
+
 PASS internals.shadowRoot(ps[0]).tattoo is "I <3 WebKit"
 PASS internals.shadowRoot(ps[0]).styleSheets.tattoo is "I <3 WebKit cssom"
 PASS internals.shadowRoot(ps[1]).tattoo is "I <3 WebKit"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-mouseup-listener-update-distribution-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-mouseup-listener-update-distribution-crash-expected.txt
index 75b976d..2e73501 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-mouseup-listener-update-distribution-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-mouseup-listener-update-distribution-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE WARNING: line 11: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 crbug.com/417064 minimal reproduction case for hitting assertion check
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-remove-node-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-remove-node-crash-expected.txt
index 65a7e2c..4fa4911 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-remove-node-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/gesture-tap-remove-node-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 PASS unless crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt
index 3ffbbc9..3a3334a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS nodeList.length is expectedNodes.length
 PASS nodeList.item(0) is expectedNodes[0]
 PASS getNodeInComposedTree('host/detail-child').getDestinationInsertionPoints().length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt
index 5ae08a62..1948eec 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 getDistributedNodes() should work out of Document
 PASS nodeList.length is expectedNodes.length
 PASS nodeList.item(0) is expectedNodes[0]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-mutation-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-mutation-expected.txt
index 7d77b88..39a3e2ba 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-mutation-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/get-element-by-id-in-shadow-mutation-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS null is shadow.getElementById('foo')
 PASS e0a is shadow.getElementById('foo')
 PASS e0b is shadow.getElementById('foo')
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-flat-tree-parent-dirty-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-flat-tree-parent-dirty-expected.txt
index b2d0c5b..c19ef77 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-flat-tree-parent-dirty-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-flat-tree-parent-dirty-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(inside).color is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt
index 16499af..74d7d74 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(getNodeInComposedTree("child/bar")).color is "rgb(0, 128, 0)"
 PASS window.getComputedStyle(getNodeInComposedTree("child/bar")).color is "rgb(0, 0, 0)"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-in-orphan-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-in-orphan-expected.txt
index 756f256..e5eee1ad 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-in-orphan-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-in-orphan-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS shadowRoot.getElementById("child1") is shadowChild1
 PASS shadowRoot.getElementById("child2") is shadowChild2
 PASS shadowRoot.getElementById("child3") is null
@@ -13,10 +12,12 @@
 PASS document.getElementById("child3") is null
 PASS document.getElementById("child4") is null
 
+
 Insert elements having the same id
 PASS shadowRoot.getElementById("child2") is shadowChild2
 PASS shadowRoot.getElementById("child2") is shadowChild2_3
 
+
 Make the host in document
 PASS shadowRoot.getElementById("child1") is shadowChild1
 PASS shadowRoot.getElementById("child2") is shadowChild2_3
@@ -27,9 +28,11 @@
 PASS document.getElementById("child3") is child3
 PASS document.getElementById("child4") is child4
 
+
 Add a child and make the host not in document
 PASS shadowRoot.getElementById("child5") is shadowChild5
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-shadow-expected.txt
index 26a09b8..903ebdc3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/getelementbyid-shadow-expected.txt
@@ -3,31 +3,34 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById("A") is A
 PASS shadowRootA.getElementById() threw exception TypeError: Failed to execute 'getElementById' on 'DocumentFragment': 1 argument required, but only 0 present..
 PASS shadowRootA.getElementById("B") is B
 PASS shadowRootB.getElementById("C") is C
 PASS shadowRootC.getElementById("D") is D
 
+
 Remove C from shadowRootB
 PASS document.getElementById("A") is A
 PASS shadowRootA.getElementById("B") is B
 PASS shadowRootB.getElementById("C") is null
 PASS shadowRootC.getElementById("D") is D
 
+
 Append C to ShadowRootB, and remove A from document
 PASS document.getElementById("A") is null
 PASS shadowRootA.getElementById("B") is B
 PASS shadowRootB.getElementById("C") is C
 PASS shadowRootC.getElementById("D") is D
 
+
 Remove C from shadowRootB
 PASS document.getElementById("A") is null
 PASS shadowRootA.getElementById("B") is B
 PASS shadowRootB.getElementById("C") is null
 PASS shadowRootC.getElementById("D") is D
 
+
 Remove D from shadowRootC
 PASS document.getElementById("A") is null
 PASS shadowRootA.getElementById("B") is B
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/hit-test-inside-shadow-root-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/hit-test-inside-shadow-root-expected.txt
index ab2e105..66aecee 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/hit-test-inside-shadow-root-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/hit-test-inside-shadow-root-expected.txt
@@ -1,5 +1,6 @@
 CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 Text
+
 crbug.com/491844 Moving a node from inside a shadow-root to a detached tree should not crash when we hit-test it. Hover over 'Text' to test.
 
 Test passes if it does not crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt
index c8dd321..afb9310 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(b, null).backgroundColor is transparent
 PASS getComputedStyle(b, null).backgroundColor is green
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text-expected.txt
index ef1e16bc..6a6031d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-context-pseudo-class-css-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('style1').sheet.cssRules.item(0).cssText is ".foo:host-context(div,body.mytheme,p#myid,.bar:first-child,span:hover) > div { display: block; }"
 PASS document.getElementById('style1').sheet.cssRules.item(1).cssText is ":host-context(*) { display: block; }"
 PASS document.getElementById('style-invalid').sheet.cssRules.length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-css-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-css-text-expected.txt
index d61c4a3..6cea463a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-css-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-css-text-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('style1').sheet.cssRules.item(0).cssText is ".foo:host(div,body.mytheme,p#myid,.bar:first-child,span:hover) > div { display: block; }"
 PASS document.getElementById('style1').sheet.cssRules.item(1).cssText is ":host { display: block; }"
 PASS document.getElementById('style1').sheet.cssRules.item(2).cssText is ":host(*) { display: block; }"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-expected.txt
index 4f2287f..4a85b68 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-pseudo-class-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 :host out of shadow tree should not match any shadow hosts.
 PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)"
 :host with * should not match any shadow hosts.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-wrapper-reclaimed-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-wrapper-reclaimed-expected.txt
index 815556fb..16a75d6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/host-wrapper-reclaimed-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/host-wrapper-reclaimed-expected.txt
@@ -2,4 +2,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS unless crash.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-first-child-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-first-child-expected.txt
index 2422234..d738b90f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-first-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-first-child-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(first.firstChild, null).backgroundColor is red
 PASS getComputedStyle(first.firstChild, null).backgroundColor is not red
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-pseudo-class-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-pseudo-class-expected.txt
index 8cf1fe9..9c2600f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-pseudo-class-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/hostcontext-pseudo-class-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 :host-context out of shadow tree should not match any shadow hosts.
 PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)"
 :host-context with * should not match any shadow hosts.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/hovered-detached-with-dirty-distribution-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/hovered-detached-with-dirty-distribution-crash-expected.txt
index bf2627d..d49b1296 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/hovered-detached-with-dirty-distribution-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/hovered-detached-with-dirty-distribution-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE WARNING: line 18: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 Tests that detaching a hovered node with dirty distributuion doesn't crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/iframe-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/iframe-shadow-expected.txt
index cce1107..3587fd8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/iframe-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/iframe-shadow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.length is 4
 PASS i0byname.length is 1
 PASS i0 is i0byname[0].contentWindow
@@ -20,5 +19,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
   
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/inner-scope-important-wins-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/inner-scope-important-wins-expected.txt
index e2e4365f..66a9ac0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/inner-scope-important-wins-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/inner-scope-important-wins-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(target).color is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/input-color-in-content-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/input-color-in-content-expected.txt
index 01e2a97..46c5aa8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/input-color-in-content-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/input-color-in-content-expected.txt
@@ -15,3 +15,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt
index 2bc5dbf..f721bd5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/layout-tests-can-access-shadow-expected.txt
@@ -1,7 +1,7 @@
 CONSOLE WARNING: line 28: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
-
 This tests that layout tests can access shadow DOM.
 
+
 PASS shadow.nodeName is "#document-fragment"
 PASS internals.shadowRoot(shadow) threw exception TypeError: Failed to execute 'shadowRoot' on 'Internals': parameter 1 is not of type 'Element'..
 PASS internals.shadowRoot(p) is null
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/mouse-click-mouseup-listener-update-distribution-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/mouse-click-mouseup-listener-update-distribution-crash-expected.txt
index 75b976d..2e73501 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/mouse-click-mouseup-listener-update-distribution-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/mouse-click-mouseup-listener-update-distribution-crash-expected.txt
@@ -1,3 +1,2 @@
 CONSOLE WARNING: line 11: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 crbug.com/417064 minimal reproduction case for hitting assertion check
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/multiple-host-pseudos-in-compound-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/multiple-host-pseudos-in-compound-expected.txt
index 835c9f6c..c3acbdf 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/multiple-host-pseudos-in-compound-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/multiple-host-pseudos-in-compound-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(host).color is "rgb(0, 128, 0)"
 PASS getComputedStyle(host, '::before').color is "rgb(0, 128, 0)"
 PASS getComputedStyle(host).color is "rgb(0, 128, 0)"
@@ -17,4 +16,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt
index 55fc104..28014e7 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/nodetype-expected.txt
@@ -1,5 +1,5 @@
-
 This tests the shadow host's and shadow root's nodeType.
+
 PASS progress.nodeType is Node.ELEMENT_NODE
 PASS shadow.nodeType is Node.DOCUMENT_FRAGMENT_NODE
 PASS shadowChild is non-null.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/normalize-progress-element-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/normalize-progress-element-crash-expected.txt
index 2b7dda05..9913324 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/normalize-progress-element-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/normalize-progress-element-crash-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt
index de1360e..6092d56 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/offset-parent-does-not-leak-ua-shadow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS child.offsetParent is shadow.positionedElement
 PASS child.offsetParent is container
 PASS child.offsetParent is container
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/offsetWidth-host-style-change-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/offsetWidth-host-style-change-expected.txt
index 0247bb1..1bf08859 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/offsetWidth-host-style-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/offsetWidth-host-style-change-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS div.offsetWidth is 100
 PASS div.offsetWidth is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt
index cf3ff58..c97eb45 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(target).color is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-host-parameter-matches-shadow-host-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-host-parameter-matches-shadow-host-expected.txt
index 39825d1..fead0f9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-host-parameter-matches-shadow-host-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-host-parameter-matches-shadow-host-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS borderColorOf(getNodeInComposedTree("host")) is "rgb(0, 128, 0)"
 PASS borderColorOf(getNodeInComposedTree("host")) is "rgb(0, 128, 0)"
 PASS borderColorOf(getNodeInComposedTree("host")) is "rgb(0, 128, 0)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-not-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-not-expected.txt
index e6a7e66a..fa358f4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-not-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/pseudo-not-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS content.getDistributedNodes().length is 1
 PASS content.getDistributedNodes()[0].className is "second"
 PASS content.getDistributedNodes().length is 1
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt
index b4f96f2..e24c78a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt
@@ -1,10 +1,9 @@
+ 
 
-  
 crbug.com/337616: test for querySelectorAll with ::shadow and /deep/
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelectorAll("form /deep/ *").length is 1
 PASS document.querySelectorAll("form /deep/ *")[0].id is "input"
 PASS document.querySelectorAll("form::shadow *").length is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt
index dacd1c5..37e78f8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id is "bar"
 PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0] is undefined
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-distribution-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-distribution-expected.txt
index dacd1c5..37e78f8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-distribution-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-distribution-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id is "bar"
 PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0] is undefined
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt
index dc9a008..e980751 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.querySelectorAll("#foo-host::shadow span").length is 3
 PASS document.querySelectorAll("#foo-host::shadow span")[0].id is "not-top"
 PASS document.querySelectorAll("#foo-host::shadow span")[1].id is "top"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/reinsert-insertion-point-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/reinsert-insertion-point-expected.txt
index 0f08dd4..f8380d6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/reinsert-insertion-point-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/reinsert-insertion-point-expected.txt
@@ -4,4 +4,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Should be visible
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt
index 66e6574a..ff23fc0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-and-insert-style-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS backgroundColor is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-styles-in-shadow-crash-3-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-styles-in-shadow-crash-3-expected.txt
index 0266ea9..b756e97b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-styles-in-shadow-crash-3-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-styles-in-shadow-crash-3-expected.txt
@@ -1,4 +1,2 @@
 CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 PASS if no crash
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-stylesheet-from-shadow-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-stylesheet-from-shadow-crash-expected.txt
index b20ecd0..f5b6fb4 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-stylesheet-from-shadow-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/remove-stylesheet-from-shadow-crash-expected.txt
@@ -1,4 +1,2 @@
 CONSOLE WARNING: line 9: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 This test should not crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/select-in-shadowdom-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/select-in-shadowdom-expected.txt
index 034bd29..c7672b5e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/select-in-shadowdom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/select-in-shadowdom-expected.txt
@@ -4,9 +4,11 @@
 Selecting from a node to another node in ShadowDOM. This should not start page navigation.
 PASS lastClickTarget is null
 
+
 Clicking a node in ShadowDOM.
 PASS lastClickTarget is host
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/selections-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/selections-in-shadow-expected.txt
index d868fdd4..da9a4b5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/selections-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/selections-in-shadow-expected.txt
@@ -1,6 +1,7 @@
 CONSOLE WARNING: line 40: Element.createShadowRoot is deprecated and will be removed in M73, around March 2019. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 for more details.
 
 
+
 CONTAINER1 --> CONTAINER1
 PASS internals.treeScopeRootNode(window.getSelection().anchorNode) is internals.treeScopeRootNode(window.getSelection().focusNode)
 CONTAINER1 --> CONTAINER2
@@ -117,6 +118,7 @@
 
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/set-attribute-in-shadow-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/set-attribute-in-shadow-crash-expected.txt
index 8c9f63b6..23ae00b 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/set-attribute-in-shadow-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/set-attribute-in-shadow-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-added-display-none-host-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-added-display-none-host-expected.txt
index 0fb3c7f..77d0999 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-added-display-none-host-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-added-display-none-host-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(inside).borderWidth is "0px"
 PASS getComputedStyle(inside).borderWidth is "10px"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt
index 1f5b8ab..e739b1f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-boundary-events-expected.txt
@@ -4,7 +4,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 Move mouse from a node to its sibling node. All nodes are outside of shadow boundary.
 Moving mouse from divB to divC
 PASS dispatchedEvent("mouseover") is ["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"]
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-contents-event-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-contents-event-expected.txt
index a916437..be639bb 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-contents-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-contents-event-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 summary
 details
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt
index 429336d..3de705f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-disable-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 DIV
 PASS element.createShadowRoot() is not null
 SPAN
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-dom-mouse-event-adjust-offset-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-dom-mouse-event-adjust-offset-expected.txt
index bb38b5d..f6595dd 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-dom-mouse-event-adjust-offset-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-dom-mouse-event-adjust-offset-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS eventRecords['parent']['offsetY'] is 5
 PASS eventRecords['shadow-host']['offsetY'] is 5 + 20
 PASS eventRecords['top']['offsetY'] is 5 + 20
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt
index b460b62..250a9f01 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt
@@ -4,7 +4,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 getDistributedNodes() for "shadow" should return []
 PASS distributedNodes.length is expectedDistributedNodes.length
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-expected.txt
index 87115df..becdf5a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-element-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS shadow.nodeName is 'SHADOW'
 PASS 0 <= shadow.constructor.toString().indexOf('HTMLShadowElement') is true
 PASS window.HTMLShadowElement is shadow.constructor
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-hierarchy-exception-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-hierarchy-exception-expected.txt
index 8ee5dc1..4458003 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-hierarchy-exception-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-hierarchy-exception-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS shadowDiv.appendChild(container) threw exception HierarchyRequestError: Failed to execute 'appendChild' on 'Node': The new child element contains the parent..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event-expected.txt
index e033b60..31e9afe 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-removechild-and-blur-event-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS logs.toString() is "start-removeChild,blur,end-removeChild"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-activeElement-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-activeElement-expected.txt
index dc9dc3e..9e20cab 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-activeElement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-activeElement-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS shadowRoot1.activeElement is defined.
 PASS shadowRoot2.activeElement is defined.
 PASS nodeInDocument.focus(); document.activeElement is nodeInDocument
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-append-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-append-expected.txt
index ca1d1a4..71596e8 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-append-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-append-expected.txt
@@ -9,4 +9,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-blur-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-blur-expected.txt
index c9d6379..58d6b93e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-blur-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-blur-expected.txt
@@ -4,7 +4,6 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-
 getNodeInComposedTree('shadowHostA/childInTreeOne').focus()
 PASS document.activeElement.id is "shadowHostA"
 getNodeInComposedTree('shadowHostA').blur();
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-direction-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-direction-expected.txt
index d5569525..40f7a9d 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-direction-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-direction-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(shadowRoot.getElementById("target2")).direction is "rtl"
 PASS getComputedStyle(root).direction is "rtl"
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt
index 52bbb2a..120b2490 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-root-js-api-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.ShadowRoot is defined.
 PASS new window.ShadowRoot(document.createElement('div')) threw exception TypeError: Illegal constructor.
 PASS shadowRoot instanceof window.ShadowRoot is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash-expected.txt
index 844e4160..ef49afe5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-selection-detach-crash-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS No crash, including on shutdown..?
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-listener-clearance-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-listener-clearance-expected.txt
index 7f1eccb..4dc90544 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-listener-clearance-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-listener-clearance-expected.txt
@@ -5,3 +5,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host-expected.txt
index d022a22..1c3c253 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadow-tree-styles-select-host-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Test that tag selectors in a shadow tree cannot match without :host.
 PASS borderColorOf('host') is "rgb(0, 0, 0)"
 PASS borderColorOf('host-child') is "rgb(0, 0, 0)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowdom-dynamic-styling-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowdom-dynamic-styling-expected.txt
index 795ff590..1f9dc99 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowdom-dynamic-styling-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowdom-dynamic-styling-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS window.getComputedStyle(target).backgroundColor is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowhost-keyframes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowhost-keyframes-expected.txt
index 187e1cf3..37ec5081 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowhost-keyframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowhost-keyframes-expected.txt
@@ -3,9 +3,8 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS getColor(document.getElementById('host')) is "rgb(0, 128, 0)"
 
+PASS getColor(document.getElementById('host')) is "rgb(0, 128, 0)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-clonenode-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-clonenode-expected.txt
index 7867432..b01a675 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-clonenode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-clonenode-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS shadowRoot.cloneNode() threw exception NotSupportedError: Failed to execute 'cloneNode' on 'Node': ShadowRoot nodes are not clonable..
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-keyframes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-keyframes-expected.txt
index 46da255..b4a67a15 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-keyframes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-keyframes-expected.txt
@@ -2,6 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS getBackgroundColor(shadowRootWithKeyframe.getElementById('box')) is "rgb(0, 0, 255)"
 PASS getBackgroundColor(shadowRootWithoutKeyframe.getElementById('box')) is "rgb(255, 0, 0)"
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-type-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-type-expected.txt
index 9daf07e..3f7fa3e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-type-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/shadowroot-type-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS "V0ShadowRoot" is internals.shadowRootType(shadowRootForDiv)
 PASS "UserAgentShadowRoot" is internals.shadowRootType(shadowRootForInput)
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-dynamic-changes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-dynamic-changes-expected.txt
index 60b7531..a79a830 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-dynamic-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-dynamic-changes-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Dynamically change the :first-child
 PASS getComputedStyle(first).color is "rgb(255, 0, 0)"
 PASS getComputedStyle(second).color is "rgb(0, 0, 0)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-under-shadow-root-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-under-shadow-root-expected.txt
index 8d2d8271..a694612 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-under-shadow-root-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/sibling-rules-under-shadow-root-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS colorOf(getNodeInComposedTree("host/child2")) is "rgb(0, 128, 0)"
 PASS colorOf(getNodeInComposedTree("host/child2")) is "rgb(0, 128, 0)"
 PASS colorOf(getNodeInComposedTree("host/child3")) is "rgb(0, 128, 0)"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt
index 3ee57b7..ab2b2ae 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/style-of-distributed-node-expected.txt
@@ -6,11 +6,13 @@
 
 
 
+
 PASS getColorProperty("child-a") is "rgb(255, 0, 0)"
 PASS getColorProperty("child-b") is "rgb(0, 0, 255)"
 
 
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-host-attribute-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-host-attribute-expected.txt
index d95a8f1..a69b5ab62 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-host-attribute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-host-attribute-expected.txt
@@ -3,9 +3,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(roots[1]).color is 'rgb(0, 128, 0)'
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This text should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-sibling-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-sibling-shadow-expected.txt
index cd453821..2bb66cf5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-sibling-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/style-sharing-sibling-shadow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(host).backgroundColor is "rgb(255, 0, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-characterdata-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-characterdata-expected.txt
index ec2ba68..e369ff9e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-characterdata-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-characterdata-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS fired is false
 PASS div.innerHTML is 'Hello, World!'
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-expected.txt
index 78f8e39b..31d701e 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/suppress-mutation-events-in-shadow-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS mutationEventTriggered is false
 PASS successfullyParsed is true
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt
index 0d42611..e0bd742 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt
@@ -61,3 +61,4 @@
 
 
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/title-element-in-shadow-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/title-element-in-shadow-expected.txt
index d1311f8..a8ad16d7c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/title-element-in-shadow-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/title-element-in-shadow-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 create a title element and insert it to document.
 PASS document.title is "document title"
 remove title element from document.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/tree-scope-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/tree-scope-crash-expected.txt
index 32fdac9..d5e70672a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/tree-scope-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/tree-scope-crash-expected.txt
@@ -1,3 +1,2 @@
 PASS unless crash
 
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/update-text-of-style-in-shadow-dom-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/update-text-of-style-in-shadow-dom-expected.txt
index 4d8f31b..47265f9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/update-text-of-style-in-shadow-dom-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/update-text-of-style-in-shadow-dom-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS borderColor is "rgb(0, 128, 0)"
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt
index 5f013fb..1d5df21 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/user-modify-inheritance-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null)) is "read-only"
 PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false")) is "read-only"
 PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true")) is "read-write"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shared-inline-style-after-node-removal-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/shared-inline-style-after-node-removal-expected.txt
index 99081450..77819f5 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/shared-inline-style-after-node-removal-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/shared-inline-style-after-node-removal-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS computedStyle.color is 'rgb(0, 128, 0)'
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/styled-clone-inline-style-decl-parent-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/styled-clone-inline-style-decl-parent-crash-expected.txt
index 48bdc14..69154eb2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/styled-clone-inline-style-decl-parent-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/styled-clone-inline-style-decl-parent-crash-expected.txt
@@ -3,3 +3,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/styled-not-in-document-clone-inline-style-decl-parent-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/styled-not-in-document-clone-inline-style-decl-parent-crash-expected.txt
index 48bdc14..69154eb2 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/styled-not-in-document-clone-inline-style-decl-parent-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/styled-not-in-document-clone-inline-style-decl-parent-crash-expected.txt
@@ -3,3 +3,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/subtree-modified-attributes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/subtree-modified-attributes-expected.txt
index 8c17db16..9b1ed8f 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/subtree-modified-attributes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/subtree-modified-attributes-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS expected is true
 PASS expected is true
 PASS expected is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/tabindex-defaults-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/tabindex-defaults-expected.txt
index 6ba0a69..aca5e44 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/tabindex-defaults-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/tabindex-defaults-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS anchor.tabIndex is 0
 PASS button.tabIndex is 0
 PASS input.tabIndex is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/text-api-arguments-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/text-api-arguments-expected.txt
index 6a4f694..e878a28 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/text-api-arguments-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/text-api-arguments-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS text.data is "abcdefg"
 PASS text.__proto__ is Text.prototype
 PASS text.splitText(4).data is "efg"
@@ -18,4 +17,5 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 !DOCTYPE html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-background-page-near-alignment-interval-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-background-page-near-alignment-interval-expected.txt
index 946d85f..4f76b11 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-background-page-near-alignment-interval-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/timer-throttling-background-page-near-alignment-interval-expected.txt
@@ -2,9 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS numFires is within 1 of 4
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
+
 This test ensures that intervals on background pages whose duration is close to the timer alignment interval don't miss every other firing.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/timers-maintain-order-while-throttled-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/timers-maintain-order-while-throttled-expected.txt
index 924a6090..8594bcf9 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/timers-maintain-order-while-throttled-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/timers-maintain-order-while-throttled-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99
 PASS areArraysEqual(expectedIndices, indices) is true
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/title-content-set-innerText-get-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/title-content-set-innerText-get-expected.txt
index bc07b13..22004a6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/title-content-set-innerText-get-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/title-content-set-innerText-get-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS document.getElementById('t').innerText is 'This is the new title'
 PASS successfullyParsed is true
 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/vertical-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/vertical-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt
index bc53c984..b8643073 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/vertical-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/vertical-scrollbar-in-rtl-doesnt-fire-onscroll-expected.txt
@@ -3,4 +3,3 @@
 This test has passed if the text "FAIL - scroll event received!" does not appear below.
 
 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open-expected.txt
index b5b7c894..140999a 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/webtiming-document-open-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS timing.connectEnd is originalTiming.connectEnd
 PASS timing.connectStart is originalTiming.connectStart
 PASS timing.domComplete is originalTiming.domComplete
diff --git a/third_party/WebKit/LayoutTests/fast/dom/webtiming-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/webtiming-expected.txt
index 9c71157..606e9b0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/webtiming-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/webtiming-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS timing.navigationStart is >= oneHourAgoUTC
 PASS timing.redirectStart is 0
 PASS timing.redirectEnd is 0
diff --git a/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document-expected.txt
index fa43056..3eff443 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/webtiming-navigate-within-document-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS connectEnd is unchanged.
 PASS connectStart is unchanged.
 PASS domComplete is unchanged.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/window-load-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/window-load-crash-expected.txt
index 07d41c3..d7b424b0 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/window-load-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/window-load-crash-expected.txt
@@ -1,2 +1,2 @@
 Blocked access to external URL http://blocked/does-not-exist.html
-Test passes if it does not crash.  
+Test passes if it does not crash. 
diff --git a/third_party/WebKit/LayoutTests/fast/dom/window-scroll-scaling-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/window-scroll-scaling-expected.txt
index d7a5083..85b9db3 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/window-scroll-scaling-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/window-scroll-scaling-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS body.scrollWidth is originalScrollWidth
 PASS body.scrollHeight is originalScrollHeight
 PASS successfullyParsed is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt
index 7ec0c4c2..e41b7c6 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-classes-expected.txt
@@ -2,12 +2,13 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Basics
 
+
 PASS classString(document.createAttribute('x')) is "Attr"
 FAIL classString(document.createAttribute('x').__proto__) should be AttrPrototype. Was Attr.
 PASS classString(document.createAttribute('x').constructor) is "Function"
@@ -49,8 +50,10 @@
 PASS classString(document.createTreeWalker(root, 0, null, false).constructor) is "Function"
 PASS document.createTreeWalker(root, 0, null, false).constructor.name is "TreeWalker"
 
+
 XML
 
+
 PASS classString(xmlDocument) is "XMLDocument"
 FAIL classString(xmlDocument.__proto__) should be XMLDocumentPrototype. Was XMLDocument.
 PASS classString(xmlDocument.constructor) is "Function"
@@ -68,8 +71,10 @@
 PASS classString(xmlDocument.createProcessingInstruction('x', '').constructor) is "Function"
 PASS xmlDocument.createProcessingInstruction('x', '').constructor.name is "ProcessingInstruction"
 
+
 Events
 
+
 PASS classString(document.createEvent('Event')) is "Event"
 FAIL classString(document.createEvent('Event').__proto__) should be EventPrototype. Was Event.
 PASS classString(document.createEvent('Event').constructor) is "Function"
@@ -99,8 +104,10 @@
 PASS classString(document.createEvent('WheelEvent').constructor) is "Function"
 PASS document.createEvent('WheelEvent').constructor.name is "WheelEvent"
 
+
 CSS DOM
 
+
 PASS classString(document.styleSheets) is "StyleSheetList"
 FAIL classString(document.styleSheets.__proto__) should be StyleSheetListPrototype. Was StyleSheetList.
 PASS classString(document.styleSheets.constructor) is "Function"
@@ -126,8 +133,10 @@
 PASS classString(stylesheet.media.constructor) is "Function"
 PASS stylesheet.media.constructor.name is "MediaList"
 
+
 XPath
 
+
 PASS classString(document.createExpression('//*', document.createNSResolver(document))) is "XPathExpression"
 FAIL classString(document.createExpression('//*', document.createNSResolver(document)).__proto__) should be XPathExpressionPrototype. Was XPathExpression.
 PASS classString(document.createExpression('//*', document.createNSResolver(document)).constructor) is "Function"
@@ -137,15 +146,19 @@
 PASS classString(document.evaluate('//*', document, document.createNSResolver(document), 0, null).constructor) is "Function"
 PASS document.evaluate('//*', document, document.createNSResolver(document), 0, null).constructor.name is "XPathResult"
 
+
 Other
 
+
 PASS classString(window) is "Window"
 FAIL classString(window.__proto__) should be WindowPrototype. Was Window.
 PASS classString(window.constructor) is "Function"
 PASS window.constructor.name is "Window"
 
+
 HTML DOM
 
+
 PASS classString(root.children) is "HTMLCollection"
 FAIL classString(root.children.__proto__) should be HTMLCollectionPrototype. Was HTMLCollection.
 PASS classString(root.children.constructor) is "Function"
@@ -159,8 +172,10 @@
 PASS classString(document.createElement('select').options.constructor) is "Function"
 PASS document.createElement('select').options.constructor.name is "HTMLOptionsCollection"
 
+
 HTML Elements
 
+
 PASS tagClassString('a') is "HTMLAnchorElement"
 FAIL tagPrototypeClassString('a') should be HTMLAnchorElementPrototype. Was HTMLAnchorElement.
 PASS tagConstructorClassString('a') is "Function"
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-context-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/wrapper-context-expected.txt
index 7723cae..2d516279 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-context-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-context-expected.txt
@@ -1,4 +1,6 @@
-Tests that node wrappers are created in the context to which they belong. You should see PASS below. 
+Tests that node wrappers are created in the context to which they belong. You should see PASS below.
+
+
 Running...
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt
index dbf1b907..489118c 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-identity-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS var object = [ ]; isEqualJS(object, object); is true
 PASS var object = { }; isEqualJS(object, object); is true
 PASS var object = new Array(); isEqualJS(object, object); is true
diff --git a/third_party/WebKit/LayoutTests/fast/dom/wrapper-scope-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/wrapper-scope-expected.txt
index 57e6a0b..8473672 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/wrapper-scope-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/wrapper-scope-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS inner.HTMLElement.isInner is true
 PASS inner.HTMLElement.constructor.isInner is true
 PASS inner.HTMLElement.constructor.prototype.isInner is true
@@ -47,3 +46,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/xhtml-fragment-parsing-exceptions-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/xhtml-fragment-parsing-exceptions-expected.txt
index 0ee2a0d..585a7e585 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/xhtml-fragment-parsing-exceptions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/xhtml-fragment-parsing-exceptions-expected.txt
@@ -7,5 +7,3 @@
 innerHTML: PASS - SyntaxError
 
 outerHTML: PASS - SyntaxError
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/xml-parser-error-message-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/xml-parser-error-message-crash-expected.txt
index accf9b2..20e3af21 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/xml-parser-error-message-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/xml-parser-error-message-crash-expected.txt
@@ -1,4 +1,4 @@
 This page contains the following errors:
 error on line 14 at column 1: Extra content at the end of the document
-Below is a rendering of the page up to the first error.
 
+Below is a rendering of the page up to the first error.
diff --git a/third_party/WebKit/LayoutTests/fast/dom/zoom-scroll-page-test-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/zoom-scroll-page-test-expected.txt
index 1db31a94..3eab950 100644
--- a/third_party/WebKit/LayoutTests/fast/dom/zoom-scroll-page-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dom/zoom-scroll-page-test-expected.txt
@@ -2,10 +2,10 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 Testing at zoom -1 and scale 1.2
 PASS window.pageYOffset is within 4 of 231
 Testing at zoom -3 and scale 0.75
diff --git a/third_party/WebKit/LayoutTests/fast/domurl/check-instanceof-domurl-functions-expected.txt b/third_party/WebKit/LayoutTests/fast/domurl/check-instanceof-domurl-functions-expected.txt
index 64cda45..98d48a3 100644
--- a/third_party/WebKit/LayoutTests/fast/domurl/check-instanceof-domurl-functions-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/domurl/check-instanceof-domurl-functions-expected.txt
@@ -3,7 +3,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS 'createObjectURL' in URL is true
 PASS 'revokeObjectURL' in URL is true
 PASS url.createObjectURL is undefined.
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/ancestor-to-absolute-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/ancestor-to-absolute-expected.txt
index f11e33b..a153012 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/ancestor-to-absolute-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/ancestor-to-absolute-expected.txt
@@ -1,2 +1 @@
 Test that dynamically making element absolute positioned does not corrupt it's childrens layout dirty state. This passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/block-flow-split-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/block-flow-split-crash-expected.txt
index c843f01..3a588f2c 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/block-flow-split-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/block-flow-split-crash-expected.txt
@@ -1,2 +1 @@
 Tests layer structure integrity when block flow is splitted and restructured dynamically. Should not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/continuation-detach-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/continuation-detach-crash-expected.txt
index 7d43ac2..4ce5461 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/continuation-detach-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/continuation-detach-crash-expected.txt
@@ -1,5 +1,3 @@
 Bug 107189: Regression(r131539): Heap-use-after-free in WebCore::LayoutBlockFlow::willBeDestroyed
 
 This test has PASSED if it didn't CRASH.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-counter-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-counter-expected.txt
index 8c88d57f..4f49af26 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-counter-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-counter-expected.txt
@@ -1,3 +1,2 @@
 Test for bug 61411: ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout() with generated content
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-image-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-image-expected.txt
index 8c88d57f..4f49af26 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-image-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-image-expected.txt
@@ -1,3 +1,2 @@
 Test for bug 61411: ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout() with generated content
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-quote-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-quote-expected.txt
index 8c88d57f..4f49af26 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-quote-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-quote-expected.txt
@@ -1,3 +1,2 @@
 Test for bug 61411: ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout() with generated content
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-text-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-text-expected.txt
index 8c88d57f..4f49af26 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/crash-generated-text-expected.txt
@@ -1,3 +1,2 @@
 Test for bug 61411: ASSERTION FAILED: !m_layoutRoot->container() || !m_layoutRoot->container()->needsLayout() with generated content
 Test passes if it does not crash.
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/first-child-descendant-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/first-child-descendant-expected.txt
index 5a5792a..d3b01be1 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/first-child-descendant-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/first-child-descendant-expected.txt
@@ -2,9 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(b).color is green
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 This text should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change-expected.txt
index 66bc3a7..d4d9cc8 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change-expected.txt
@@ -1,4 +1,3 @@
 Test for https://bugs.webkit.org/show_bug.cgi?id=56401 Hover the mouse over the "Inline" text. The test passes if "Inline" is not placed on a new line.
 
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change2-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change2-expected.txt
index 5a2b016c..bab7f9f5 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change2-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/hover-before-position-after-style-change2-expected.txt
@@ -1,4 +1,3 @@
 Test for https://bugs.webkit.org/show_bug.cgi?id=56401 Hover the mouse over the "Block" text. The test passes if the "Block" text is not moved above ">". This test ensures that the "before" element after hover is inserted in the same position.
 
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/hover-sibling-reattach-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/hover-sibling-reattach-expected.txt
index 0ab9b956..f380617 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/hover-sibling-reattach-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/hover-sibling-reattach-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(test, '').backgroundColor is transparent
 PASS getComputedStyle(test, '').backgroundColor is black
 PASS getComputedStyle(test, '').backgroundColor is transparent
@@ -11,3 +10,4 @@
 
 TEST COMPLETE
 
+
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/hover-style-recalc-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/hover-style-recalc-crash-expected.txt
index d35e72de..1cba93c 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/hover-style-recalc-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/hover-style-recalc-crash-expected.txt
@@ -1,5 +1,3 @@
 Test for rdar://problem/7873647 Crash when updating hover state.
 
 Hover over the light blue square, then move down into the blue square. The browser should not crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/hovered-detach-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/hovered-detach-expected.txt
index a384477..598776e 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/hovered-detach-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/hovered-detach-expected.txt
@@ -1,4 +1,5 @@
 This should not be red.
+
 This tests for a regression against https://bugs.webkit.org/show_bug.cgi?id=5983 REGRESSION: onmouseover-powered navbar at MacNN renders incorrectly.
 
 Test result: PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt
index 718f43c..e5b436b 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentElement-expected.txt
@@ -2,6 +2,7 @@
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentElement' on 'Element': parameter 2 is not of type 'Element'.
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentElement' on 'Element': 2 arguments required, but only 1 present.
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentElement' on 'Element': 2 arguments required, but only 0 present.
-1 (black) 2 (green) 3 (green) 4 (black) 
+
+1 (black) 2 (green) 3 (green) 4 (black)
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-expected.txt
index c61714a5..c689360 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentHTML-expected.txt
@@ -2,6 +2,7 @@
 Caught expected exception: NoModificationAllowedError: Failed to execute 'insertAdjacentHTML' on 'Element': The element has no parent.
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentHTML' on 'Element': 2 arguments required, but only 0 present.
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentHTML' on 'Element': 2 arguments required, but only 1 present.
-1 (black) 2 (green) 3 (green) 4 (black) 
+
+1 (black) 2 (green) 3 (green) 4 (black)
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentText-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentText-expected.txt
index bb7476d0..d547aea 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentText-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/insertAdjacentText-expected.txt
@@ -1,6 +1,7 @@
 Caught expected exception: SyntaxError: Failed to execute 'insertAdjacentText' on 'Element': The value provided ('blah') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentText' on 'Element': 2 arguments required, but only 0 present.
 Caught expected exception: TypeError: Failed to execute 'insertAdjacentText' on 'Element': 2 arguments required, but only 1 present.
-1 (black) 2 (green) 3 (green) 4 (black) 
+
+1 (black) 2 (green) 3 (green) 4 (black)
 
 PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/jQuery-animation-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/jQuery-animation-crash-expected.txt
index 679b873..3f49ac6 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/jQuery-animation-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/jQuery-animation-crash-expected.txt
@@ -1,5 +1,3 @@
 Test for bug 25381: jQuery animation crashing Safari.
 
 PASS if didn't crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/last-child-descendant-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/last-child-descendant-expected.txt
index 181ef0c..7bbaac0c 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/last-child-descendant-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/last-child-descendant-expected.txt
@@ -2,10 +2,9 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 PASS getComputedStyle(b).color is green
 PASS successfullyParsed is true
 
 TEST COMPLETE
-This text should be green
 
+This text should be green
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt
index d148394..eab23cf 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/layer-no-longer-paginated-expected.txt
@@ -1,5 +1,3 @@
 Test for <rdar://problem/10098679> Assertion failure in Layer::paintPaginatedChildLayer().
 
 The test passes if it does not cause an assertion failure or a crash.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/position-absolute-to-fixed-crash-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/position-absolute-to-fixed-crash-expected.txt
index 4ab1abb3..74b2c7b6 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/position-absolute-to-fixed-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/position-absolute-to-fixed-crash-expected.txt
@@ -1,5 +1,3 @@
 Test for rdar://problem/7094146 Reproducible crash at LayoutObject::localToAbsolute().
 
 This crash occurred after an object’s position changed directly from absolute to fixed, and it was not added to the LayoutView’s positioned objects list nor removed from its old container’s list.
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/recursive-layout-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/recursive-layout-expected.txt
index 56a95f2..553d271 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/recursive-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/recursive-layout-expected.txt
@@ -3,4 +3,3 @@
 No assertion failure here means SUCCESS.
 
 This is something to select
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/style-access-late-stylesheet-load-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/style-access-late-stylesheet-load-expected.txt
index ac86f99a..967c53c0 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/style-access-late-stylesheet-load-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/style-access-late-stylesheet-load-expected.txt
@@ -1,3 +1,2 @@
 Test that offsetWidth and similar get up to date style information even if a new stylesheet load is started at late stage of document rendering
 PASS
-
diff --git a/third_party/WebKit/LayoutTests/fast/dynamic/subtree-unrooted-expected.txt b/third_party/WebKit/LayoutTests/fast/dynamic/subtree-unrooted-expected.txt
index ccf915a..a035fef 100644
--- a/third_party/WebKit/LayoutTests/fast/dynamic/subtree-unrooted-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/dynamic/subtree-unrooted-expected.txt
@@ -1,5 +1,3 @@
 Test for <rdar://problem/10156263> ASSERT in WebCore::FrameView::scheduleRelayoutOfSubtree at developer.gnome.org.
 
 The test passes if, in a debug build, it does not cause an assertion failure.
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
deleted file mode 100644
index c940e02..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/deprecated-flexbox/intrinsic-min-width-applies-with-fixed-width-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Check that min-width intrinsic size still applies if a fixed width is set.
-
-PASS
-PASS
-PASS
-PASS
-PASS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt
deleted file mode 100644
index c5d1e7eb..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/offsetLeft-offsetTop-body-quirk-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-static: body: (0, 0) child: (27, 27)
-relative: body: (0, 0) child: (17, 17)
-fixed: body: (0, 0) child: (17, 17)
-absolute: body: (0, 0) child: (17, 17)
-
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt
deleted file mode 100644
index b49c0b2..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Element/offsetLeft-offsetTop-html-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-control: (0, 0)
-static: (10, 10)
-absolute: (20, 10)
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLAreaElement/area-cursor-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLAreaElement/area-cursor-expected.txt
deleted file mode 100644
index be28024..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLAreaElement/area-cursor-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-Test for crbug.com/455253: cursor pointer on image-link
-
-Result: pointer
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLDocument/activeElement-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLDocument/activeElement-expected.txt
deleted file mode 100644
index 1563bb4..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLDocument/activeElement-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-[object HTMLBodyElement]
-[object HTMLInputElement] id: one
-[object HTMLInputElement] id: two
-[object HTMLBodyElement]
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-1x-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-1x-expected.txt
deleted file mode 100644
index 0f4a0d9b..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-1x-expected.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS document.getElementById("canary").clientWidth is 75
-PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
-PASS document.getElementById("simple").clientWidth is 800
-PASS currentSrcFileName("simple") is "image-set-2x.png?2"
-PASS document.getElementById("multiple").clientWidth is 800
-PASS currentSrcFileName("multiple") is "image-set-2x.png?2"
-PASS document.getElementById("other_children").clientWidth is 800
-PASS currentSrcFileName("other_children") is "image-set-2x.png?2"
-PASS document.getElementById("img_before_source").clientWidth is 75
-PASS currentSrcFileName("img_before_source") is "blue_rect.jpg?1"
-PASS document.getElementById("unknown_type").clientWidth is 1600
-PASS currentSrcFileName("unknown_type") is "image-set-4x.png?3"
-PASS document.getElementById("svg_type").clientWidth is 800
-PASS currentSrcFileName("svg_type") is "image-set-2x.png?2"
-PASS document.getElementById("empty_type").clientWidth is 800
-PASS currentSrcFileName("empty_type") is "image-set-2x.png?2"
-PASS document.getElementById("whitespace_type").clientWidth is 800
-PASS currentSrcFileName("whitespace_type") is "image-set-2x.png?2"
-PASS document.getElementById("parameter_type").clientWidth is 800
-PASS currentSrcFileName("parameter_type") is "image-set-2x.png?2"
-PASS document.getElementById("empty_srcset").clientWidth is 1600
-PASS currentSrcFileName("empty_srcset") is "image-set-4x.png?3"
-PASS document.getElementById("no_srcset").clientWidth is 1600
-PASS currentSrcFileName("no_srcset") is "image-set-4x.png?3"
-   
-some text
-        
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt
deleted file mode 100644
index 00882e5..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-PASS document.getElementById("canary").clientWidth is 75
-PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
-PASS document.querySelector("#clone img").currentSrc.indexOf("image-set-2x") is not -1
-PASS document.querySelector("#clone img").currentSrc.indexOf("blue_rect") is -1
-PASS document.querySelector("#import img").currentSrc.indexOf("image-set-2x") is not -1
-PASS document.querySelector("#import img").currentSrc.indexOf("blue_rect") is -1
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt
deleted file mode 100644
index 7f3ca21d..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS document.getElementById("canary").clientWidth is 75
-PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
-PASS document.getElementById("div_end_picture").clientWidth is 800
-PASS currentSrcFileName("div_end_picture") is "image-set-2x.png?2"
-PASS document.getElementById("div_multiple_end").clientWidth is 800
-PASS currentSrcFileName("div_multiple_end") is "image-set-2x.png?2"
-PASS document.getElementById("source_in_div").clientWidth is 75
-PASS currentSrcFileName("source_in_div") is "blue_rect.jpg"
-PASS document.getElementById("not_in_picture").clientWidth is 75
-PASS currentSrcFileName("not_in_picture") is "blue_rect.jpg"
-
-
-
-
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-nested-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-nested-expected.txt
deleted file mode 100644
index 789cd28..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-nested-expected.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS document.getElementById("canary").clientWidth is 75
-PASS currentSrcFileName("canary") is "blue_rect.jpg?0"
-PASS document.getElementById("picture_in_picture").clientWidth is 800
-PASS currentSrcFileName("picture_in_picture") is "image-set-2x.png?2"
-PASS document.getElementById("picture_in_div_in_picture").clientWidth is 800
-PASS currentSrcFileName("picture_in_div_in_picture") is "image-set-2x.png?2"
-PASS document.getElementById("picture_in_div_with_source_above").clientWidth is 800
-PASS currentSrcFileName("picture_in_div_with_source_above") is "image-set-2x.png?2"
-PASS document.getElementById("picture_in_the_way").clientWidth is 800
-PASS currentSrcFileName("picture_in_the_way") is "image-set-2x.png?2"
-PASS document.getElementById("picture_in_picture_1").clientWidth is 800
-PASS currentSrcFileName("picture_in_picture_1") is "image-set-2x.png?2"
-PASS document.getElementById("picture_in_picture_2").clientWidth is 800
-PASS currentSrcFileName("picture_in_picture_2") is "image-set-2x.png?2"
-PASS document.getElementById("picture_at_end").clientWidth is 75
-PASS currentSrcFileName("picture_at_end") is "blue_rect.jpg?52"
-PASS document.getElementById("picture_no_source").clientWidth is 75
-PASS currentSrcFileName("picture_no_source") is "blue_rect.jpg?6"
- 
-
-
-    
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt
deleted file mode 100644
index 609961df..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-PASS document.getElementById("simple").clientWidth is 400
-PASS currentSrcFileName("simple") is "image-set-1x.png?1"
-PASS document.getElementById("simple").clientWidth is 1600
-PASS currentSrcFileName("simple") is "image-set-4x.png"
-PASS document.getElementById("simple").clientWidth is 75
-PASS currentSrcFileName("simple") is "blue_rect.jpg?1"
-PASS document.getElementById("simple").clientWidth is 400
-PASS currentSrcFileName("simple") is "image-set-1x.png?2"
-PASS currentSrcFileName("simple") is "image-set-1x.png?2"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Window/window-collection-length-no-crash-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Window/window-collection-length-no-crash-expected.txt
deleted file mode 100644
index c2f2527..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Window/window-collection-length-no-crash-expected.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-This tests that window.frames.length does not crash the browser after the frame navigates away from the current page. You should see "SUCCESS" below once the test completes.
-SUCCESS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/collection-idempotence-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/collection-idempotence-expected.txt
deleted file mode 100644
index f18cce8..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/collection-idempotence-expected.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-This test verifies that collection getters return the same collection when called repeatedly.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.all is document.all
-PASS document.all === document.all is true
-PASS document.images is document.images
-PASS document.images === document.images is true
-PASS document.embeds is document.embeds
-PASS document.embeds === document.embeds is true
-PASS document.applets is document.applets
-PASS document.applets === document.applets is true
-PASS document.links is document.links
-PASS document.links === document.links is true
-PASS document.forms is document.forms
-PASS document.forms === document.forms is true
-PASS document.anchors is document.anchors
-PASS document.anchors === document.anchors is true
-PASS document.scripts is document.scripts
-PASS document.scripts === document.scripts is true
-PASS document.getElementsByTagName('table')[0].rows[0].cells is document.getElementsByTagName('table')[0].rows[0].cells
-PASS document.getElementsByTagName('table')[0].rows[0].cells === document.getElementsByTagName('table')[0].rows[0].cells is true
-PASS document.getElementsByTagName('table')[0].tBodies is document.getElementsByTagName('table')[0].tBodies
-PASS document.getElementsByTagName('table')[0].tBodies === document.getElementsByTagName('table')[0].tBodies is true
-PASS document.getElementsByTagName('table')[0].tBodies[0].rows is document.getElementsByTagName('table')[0].tBodies[0].rows
-PASS document.getElementsByTagName('table')[0].tBodies[0].rows === document.getElementsByTagName('table')[0].tBodies[0].rows is true
-PASS document.body.children is document.body.children
-PASS document.body.children === document.body.children is true
-PASS document.getElementsByTagName('map')[0].areas is document.getElementsByTagName('map')[0].areas
-PASS document.getElementsByTagName('map')[0].areas === document.getElementsByTagName('map')[0].areas is true
-PASS document.getElementsByTagName('select')[0].options is document.getElementsByTagName('select')[0].options
-PASS document.getElementsByTagName('select')[0].options === document.getElementsByTagName('select')[0].options is true
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/defaultView-on-detached-document-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/defaultView-on-detached-document-expected.txt
deleted file mode 100644
index ba3cfd4..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/defaultView-on-detached-document-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-Tests that document.defaultView on a detached document doesn't crash.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS testFrameUnloaded is true
-PASS cachedDocument.defaultView is null
-PASS successfullyParsed is true
-
-TEST COMPLETE
- 
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/dom-add-optionelement-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/dom-add-optionelement-expected.txt
deleted file mode 100644
index ed9d98ac..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/dom-add-optionelement-expected.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Purpose: To test if the both DOM1 and DOM2 versions of the add() method add an option to a dropdown list. You should see three "TEST PASSED" lines below.
-
-DOM1 TEST PASSED
-DOM2 full TEST PASSED
-DOM2 null TEST PASSED
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt
deleted file mode 100644
index d37701e..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/elementsFromPoint/elementsFromPoint-iframes-expected.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-
-PASS document.elementsFromPoint(1, 1).indexOf(iframe) is >= 0
-PASS All elements in document.elementsFromPoint(1, 1) intersect (1, 1)
-PASS document.elementsFromPoint(203, 1).indexOf(iframe) is >= 0
-PASS All elements in document.elementsFromPoint(203, 1) intersect (203, 1)
-PASS document.elementsFromPoint(1, 203).indexOf(iframe) is >= 0
-PASS All elements in document.elementsFromPoint(1, 203) intersect (1, 203)
-PASS document.elementsFromPoint(203, 203).indexOf(iframe) is >= 0
-PASS All elements in document.elementsFromPoint(203, 203) intersect (203, 203)
-PASS document.getElementById('iframe').contentDocument.elementsFromPoint(9, 9).indexOf(document.getElementById('iframe').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframe').contentDocument.elementsFromPoint(9, 9) intersect (9, 9)
-PASS document.getElementById('iframe').contentDocument.elementsFromPoint(107, 9).indexOf(document.getElementById('iframe').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframe').contentDocument.elementsFromPoint(107, 9) intersect (107, 9)
-PASS document.getElementById('iframe').contentDocument.elementsFromPoint(9, 107).indexOf(document.getElementById('iframe').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframe').contentDocument.elementsFromPoint(9, 107) intersect (9, 107)
-PASS document.getElementById('iframe').contentDocument.elementsFromPoint(107, 107).indexOf(document.getElementById('iframe').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframe').contentDocument.elementsFromPoint(107, 107) intersect (107, 107)
-PASS document.elementsFromPoint(51, 51).indexOf(iframeScrollbars) is >= 0
-PASS All elements in document.elementsFromPoint(51, 51) intersect (51, 51)
-PASS document.elementsFromPoint(203, 51).indexOf(iframeScrollbars) is >= 0
-PASS All elements in document.elementsFromPoint(203, 51) intersect (203, 51)
-PASS document.elementsFromPoint(51, 203).indexOf(iframeScrollbars) is >= 0
-PASS All elements in document.elementsFromPoint(51, 203) intersect (51, 203)
-PASS document.elementsFromPoint(203, 203).indexOf(iframeScrollbars) is >= 0
-PASS All elements in document.elementsFromPoint(203, 203) intersect (203, 203)
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(1, 1).indexOf(document.getElementById('iframeScrollbars').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(1, 1) intersect (1, 1)
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(99, 1).indexOf(document.getElementById('iframeScrollbars').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(99, 1) intersect (99, 1)
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(1, 99).indexOf(document.getElementById('iframeScrollbars').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(1, 99) intersect (1, 99)
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(99, 99).indexOf(document.getElementById('iframeScrollbars').contentDocument.getElementById('div')) is >= 0
-PASS All elements in document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(99, 99) intersect (99, 99)
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(-1, -1).length is 0
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(1, 1).length is 2
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(500, 500).length is 0
-PASS document.getElementById('iframeScrollbars').contentDocument.elementsFromPoint(140, 140).length is 0
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/fragment-activation-focuses-target-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/fragment-activation-focuses-target-expected.txt
deleted file mode 100644
index 4790060..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/fragment-activation-focuses-target-expected.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-This tests that if an in-page link is activated, focus control is transferred to the fragment if possible.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-Verify that the focus is on the link.
-PASS document.activeElement is link1
-Click the link and verify that focus has moved to the fragment.
-PASS document.activeElement is document.getElementById('fragment1')
-Move focus back to the link and verify.
-PASS document.activeElement is link1
-Send an enter key event which should also trigger focus to move to the fragment.
-PASS document.activeElement is document.getElementById('fragment1')
-Activate a link that does not have a focusable fragment and verify that the currently focused element is unfocused.
-PASS document.activeElement is link2
-PASS document.activeElement is document.body
-Activate a link that does not refer to an existing fragment and verify that the currently focused element remains focused.
-PASS document.activeElement is link3
-PASS document.activeElement is link3
-Activate a link to #top and verify that the link remains focused
-PASS document.activeElement is link4
-PASS document.activeElement is link4
-Activate a link to # and verify that the link remains focused
-PASS document.activeElement is link5
-PASS document.activeElement is link5
-Activate a link to an INPUT elemnt, verify that the INPUT is editable
-PASS document.activeElement is link6
-PASS document.activeElement is input1
-PASS input1.value is "abcXdef"
-PASS successfullyParsed is true
-
-TEST COMPLETE
-link1 link2 link3 link4 link5 link6
-
-fragment1
-fragment2
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt
deleted file mode 100644
index c8ef71e0..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-child-frame-scrolled-content-expected.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-nodesFromRect returns correct rects when the rect is overlapping an iframe with scrolled contents
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS successfullyParsed is true
-
-TEST COMPLETE
-iframe's scroll top is 400
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt
deleted file mode 100644
index f3b04e0f..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-ALERT: PASS: This test did not trigger an ASSERT
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt
deleted file mode 100644
index 298d79c..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-culled-inlines-between-silblings-expected.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-Test to get the node as a result of hit-tests from culled inlines between siblings
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS successfullyParsed is true
-
-TEST COMPLETE
-HITME1
-HITME2 HITME3
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt
deleted file mode 100644
index d6040b42..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-inline-image-expected.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-
-Document::nodesFromRect : inline image - bug 85849
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt
deleted file mode 100644
index 0e2a6093..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-inner-documents-expected.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-A 
-PASS successfullyParsed is true
-
-TEST COMPLETE
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
-PASS All correct nodes found for rect
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/open-and-close-by-DOM-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/open-and-close-by-DOM-expected.txt
deleted file mode 100644
index e442e46..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/open-and-close-by-DOM-expected.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-ALERT: Middle Window Opened
-ALERT: Close Window Opened
-This test checks that a window which has been opened by the DOM can also be closed byt the DOM. The test will run automatically with popup blocking disabled. To run the test manually click the link below.
-
-Open new window that will close itself
-
-TEST PASSED
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt
deleted file mode 100644
index 53dd120..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/shadow/querySelector-for-useragent-shadowroot-expected.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-
- 
-crbug.com/337616: test for querySelectorAll with ::shadow and /deep/
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS document.querySelectorAll("form /deep/ *").length is 1
-PASS document.querySelectorAll("form /deep/ *")[0].id is "input"
-PASS document.querySelectorAll("form::shadow *").length is 0
-PASS document.querySelectorAll("input /deep/ *").length is 0
-PASS document.querySelectorAll("input::shadow *").length is 0
-PASS document.querySelectorAll("details /deep/ *").length is 2
-PASS document.querySelectorAll("details /deep/ *")[0].id is "summary"
-PASS document.querySelectorAll("details /deep/ *")[1].id is "p"
-PASS document.querySelectorAll("details::shadow *").length is 0
-PASS document.querySelectorAll("summary /deep/ *").length is 0
-PASS document.querySelectorAll("summary::shadow *").length is 0
-PASS document.querySelectorAll("meter /deep/ *").length is 0
-PASS document.querySelectorAll("meter::shadow *").length is 0
-PASS document.querySelectorAll("progress /deep/ *").length is 0
-PASS document.querySelectorAll("progress::shadow *").length is 0
-PASS successfullyParsed is true
-
-TEST COMPLETE
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/wrapper-context-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/wrapper-context-expected.txt
deleted file mode 100644
index 0260f32..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/wrapper-context-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Tests that node wrappers are created in the context to which they belong. You should see PASS below.
-Running...
-
-PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentElement-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentElement-expected.txt
deleted file mode 100644
index 9dae61d..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentElement-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Caught expected exception: SyntaxError: Failed to execute 'insertAdjacentElement' on 'Element': The value provided ('blah') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentElement' on 'Element': parameter 2 is not of type 'Element'.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentElement' on 'Element': 2 arguments required, but only 1 present.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentElement' on 'Element': 2 arguments required, but only 0 present.
-1 (black) 2 (green) 3 (green) 4 (black)
-
-PASS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentHTML-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentHTML-expected.txt
deleted file mode 100644
index 37d050c5..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentHTML-expected.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-Caught expected exception: SyntaxError: Failed to execute 'insertAdjacentHTML' on 'Element': The value provided ('blah') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.
-Caught expected exception: NoModificationAllowedError: Failed to execute 'insertAdjacentHTML' on 'Element': The element has no parent.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentHTML' on 'Element': 2 arguments required, but only 0 present.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentHTML' on 'Element': 2 arguments required, but only 1 present.
-1 (black) 2 (green) 3 (green) 4 (black)
-
-PASS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentText-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentText-expected.txt
deleted file mode 100644
index 38eec1f..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dynamic/insertAdjacentText-expected.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Caught expected exception: SyntaxError: Failed to execute 'insertAdjacentText' on 'Element': The value provided ('blah') is not one of 'beforeBegin', 'afterBegin', 'beforeEnd', or 'afterEnd'.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentText' on 'Element': 2 arguments required, but only 0 present.
-Caught expected exception: TypeError: Failed to execute 'insertAdjacentText' on 'Element': 2 arguments required, but only 1 present.
-1 (black) 2 (green) 3 (green) 4 (black)
-
-PASS
diff --git a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/outline/focus-layers-expected.txt b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/outline/focus-layers-expected.txt
deleted file mode 100644
index f28261e..0000000
--- a/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/outline/focus-layers-expected.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-layer at (0,0) size 800x600
-  LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  LayoutNGBlockFlow {HTML} at (0,0) size 800x600
-    LayoutNGBlockFlow {BODY} at (8,8) size 784x584
-      LayoutNGBlockFlow {DIV} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 35x19
-          text run at (0,0) width 35: "Both "
-        LayoutText {#text} at (0,0) size 0x0
-layer at (8,8) size 348x23
-  LayoutInline (relative positioned) {A} at (0,0) size 348x23 [color=#0000EE] [border: (2px solid #FF0000)]
-    LayoutText {#text} at (37,0) size 53x19
-      text run at (37,0) width 53: "this and "
-    LayoutText {#text} at (373,0) size 4x19
-      text run at (373,0) width 4: " "
-    LayoutText {#text} at (377,0) size 4x19
-      text run at (377,0) width 4: "."
-layer at (8,168) size 283x23
-  LayoutInline (relative positioned) {SPAN} at (0,0) size 283x23 [border: (2px solid #0000FF)]
-    LayoutText {#text} at (92,0) size 279x19
-      text run at (92,0) width 279: "this should have correctly placed focus rings"
-layer at (385,200) size 74x24
-  LayoutNGBlockFlow (positioned) {SPAN} at (377,192) size 74x24 [border: (2px solid #008000)]
-    LayoutText {#text} at (2,2) size 70x19
-      text run at (2,2) width 70: "but not this"
diff --git a/third_party/WebKit/LayoutTests/http/tests/devtools/service-workers/service-worker-v8-cache-expected.txt b/third_party/WebKit/LayoutTests/http/tests/devtools/service-workers/service-worker-v8-cache-expected.txt
index e1600da8..411e588 100644
--- a/third_party/WebKit/LayoutTests/http/tests/devtools/service-workers/service-worker-v8-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/http/tests/devtools/service-workers/service-worker-v8-cache-expected.txt
@@ -58,7 +58,7 @@
         columnNumber : 0
         consumedCacheSize : <number>
         lineNumber : 0
-        notStreamedReason : "already used streamed data"
+        notStreamedReason : "resource no longer alive"
         streamed : <boolean>
         url : .../devtools/resources/v8-cache-script.js
     }
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
index b8eb2b4..4c364c0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'https://www.otherdomain.com:8080/path/'
 Extra slashes before hostname
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
index ea1ca715..f84485f7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'http-foo://www.mydomain.com/path/'
 Set a protocol that contains ':'
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
index 01cc9d5..e22dcbd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Set search without '?'
 PASS a.href is 'https://www.mydomain.com/path/?value=key'
 Set search that starts with '?' and contains spaces
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/deleting/merge-whitespace-pre-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/deleting/merge-whitespace-pre-expected.png
deleted file mode 100644
index 17c7b0f..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/editing/deleting/merge-whitespace-pre-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/5272440-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/5272440-expected.png
deleted file mode 100644
index ce0aac3..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/5272440-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/merge-whitespace-pre-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/merge-whitespace-pre-expected.png
deleted file mode 100644
index 01b6c8ce..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/merge-whitespace-pre-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/type-delete-after-quote-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/type-delete-after-quote-expected.png
deleted file mode 100644
index 2c08bca9..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/editing/deleting/type-delete-after-quote-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/execCommand/5138441-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/execCommand/5138441-expected.png
deleted file mode 100644
index b793b41..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/editing/execCommand/5138441-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4875189-1-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4875189-1-expected.png
deleted file mode 100644
index 94d0723f..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4875189-1-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4959067-expected.png b/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4959067-expected.png
deleted file mode 100644
index 9e9fa2a..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac/editing/inserting/4959067-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt
index be276e6c7..ba78cf3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Document/CaretRangeFromPoint/caretRangeFromPoint-in-zoom-and-scroll-expected.txt
@@ -2,5 +2,6 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 FAIL check zoom offset actual: 0; expected: 29
 FAIL check zoom and scroll offset actual: 0; expected: 29
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
index 01cc9d5..e22dcbd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Set search without '?'
 PASS a.href is 'https://www.mydomain.com/path/?value=key'
 Set search that starts with '?' and contains spaces
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Window/new-window-opener-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Window/new-window-opener-expected.txt
index d5858a6..10957438 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Window/new-window-opener-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/dom/Window/new-window-opener-expected.txt
@@ -10,28 +10,33 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS newWin.scrollbars.visible is false
 PASS newWin.scrollbars.visible is true
 PASS newWin.scrollbars.visible is false
 
+
 Toolbar
 PASS newWin.toolbar.visible is true
 PASS newWin.toolbar.visible is false
 PASS newWin.toolbar.visible is true
 PASS newWin.toolbar.visible is false
 
+
 Statusbar
 PASS newWin.statusbar.visible is true
 PASS newWin.statusbar.visible is false
 PASS newWin.statusbar.visible is true
 PASS newWin.statusbar.visible is false
 
+
 Menubar
 PASS newWin.menubar.visible is true
 FAIL newWin.menubar.visible should be true. Was false.
 PASS newWin.menubar.visible is true
 FAIL newWin.menubar.visible should be true. Was false.
 
+
 Locationbar
 PASS newWin.locationbar.visible is true
 PASS newWin.locationbar.visible is false
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/Element/getClientRects-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dom/Element/getClientRects-expected.txt
index ac7bb18..45c6cd4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/Element/getClientRects-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/Element/getClientRects-expected.txt
@@ -1,48 +1,63 @@
 Client bounding rects for #1
 PASS testRects.length is 1
 
+
 Client bounding rects for #2
 PASS testRects.length is 1
 
+
 Client bounding rects for #3
 PASS testRects.length is 1
 
+
 Client bounding rects for #4
 PASS testRects.length is 1
 
+
 Client bounding rects for #5
 PASS testRects.length is 1
 
+
 Client bounding rects for #6
 Known failure. Skipping.
 
+
 Client bounding rects for #7
 PASS testRects.length is 10
 
+
 Client bounding rects for #8
 PASS testRects.length is 1
 
+
 Client bounding rects for #9
 FAIL testRects.length should be 2. Was 1.
 
+
 Client bounding rects for #10
 PASS testRects.length is 1
 
+
 Client bounding rects for #11
 PASS testRects.length is 1
 
+
 Client bounding rects for #12
 PASS testRects.length is 1
 
+
 Client bounding rects for #13
 PASS testRects.length is 1
 
+
 Client bounding rects for #14
 PASS testRects.length is 3
 
+
 Client bounding rects for #15
 PASS testRects.length is 1
 
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
index b8ffd3b..08d187a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-hostname-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'https://www.otherdomain.com:8080/path/'
 Extra slashes before hostname
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
index bb42c5e..d1da469 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-protocol-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Basic test
 PASS a.href is 'http-foo://www.mydomain.com/path/'
 Set a protocol that contains ':'
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
index 052cbea..00dfa3f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/HTMLAnchorElement/set-href-attribute-search-expected.txt
@@ -2,7 +2,6 @@
 
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
-
 Set search without '?'
 PASS a.href is 'https://www.mydomain.com/path/?value=key'
 Set search that starts with '?' and contains spaces
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/dom/Window/new-window-opener-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/dom/Window/new-window-opener-expected.txt
index a3aa6858..3e070e7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/dom/Window/new-window-opener-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/dom/Window/new-window-opener-expected.txt
@@ -10,28 +10,33 @@
 PASS successfullyParsed is true
 
 TEST COMPLETE
+
 PASS newWin.scrollbars.visible is false
 PASS newWin.scrollbars.visible is true
 PASS newWin.scrollbars.visible is false
 
+
 Toolbar
 PASS newWin.toolbar.visible is true
 PASS newWin.toolbar.visible is false
 PASS newWin.toolbar.visible is true
 PASS newWin.toolbar.visible is false
 
+
 Statusbar
 PASS newWin.statusbar.visible is true
 PASS newWin.statusbar.visible is false
 PASS newWin.statusbar.visible is true
 PASS newWin.statusbar.visible is false
 
+
 Menubar
 PASS newWin.menubar.visible is true
 PASS newWin.menubar.visible is isMenubarAlwaysExpected
 PASS newWin.menubar.visible is true
 PASS newWin.menubar.visible is isMenubarAlwaysExpected
 
+
 Locationbar
 PASS newWin.locationbar.visible is true
 PASS newWin.locationbar.visible is false
diff --git a/third_party/WebKit/LayoutTests/platform/win7/http/tests/incremental/split-hex-entities-expected.png b/third_party/WebKit/LayoutTests/platform/win7/http/tests/incremental/split-hex-entities-expected.png
deleted file mode 100644
index 6cd0504..0000000
--- a/third_party/WebKit/LayoutTests/platform/win7/http/tests/incremental/split-hex-entities-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
index 3eeda40..d34ef54 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation.html
@@ -28,7 +28,7 @@
       // reference file, use the task 'generate-reference' below.
       audit.define('load-reference', (task, should) => {
         let loader = new BufferLoader(
-            context, ['audiobuffersource-detune-modulation-expected.wav'],
+            context, ['resources/audiobuffersource-detune-modulation-expected.wav'],
             function(bufferList) {
               referenceBuffer = bufferList[0];
               task.done();
@@ -63,7 +63,7 @@
                 bitDepth: 16
               });
 
-              let filename = 'audiobuffersource-detune-modulation-actual.wav';
+              let filename = 'resources/audiobuffersource-detune-modulation-actual.wav';
               if (downloadAudioBuffer(renderedBuffer, filename))
                 should(true, 'Saved reference file').message(filename, '');
             })
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-loop-points.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-loop-points.html
index 2c23649a..d50c6fc6a 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-loop-points.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-loop-points.html
@@ -99,7 +99,7 @@
             should(
                 Audit
                     .loadFileFromUrl(
-                        'audiobuffersource-loop-points-expected.wav')
+                        'resources/audiobuffersource-loop-points-expected.wav')
                     .then(arrayBuffer => {
                       context.decodeAudioData(arrayBuffer).then(audioBuffer => {
                         expectedAudio = audioBuffer;
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
index 87ac19e0..0310d9b 100644
--- a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
+++ b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation.html
@@ -27,7 +27,7 @@
       // reference file, use the task 'generate-reference' below.
       audit.define('load-reference', (task, should) => {
         let loader = new BufferLoader(
-            context, ['audiobuffersource-playbackrate-modulation-expected.wav'],
+            context, ['resources/audiobuffersource-playbackrate-modulation-expected.wav'],
             function(bufferList) {
               referenceBuffer = bufferList[0];
               should(true, 'Loaded reference file').beTrue();
@@ -63,7 +63,7 @@
               });
 
               let filename =
-                  'audiobuffersource-playbackrate-modulation-actual.wav';
+                  'resources/audiobuffersource-playbackrate-modulation-actual.wav';
               if (downloadAudioBuffer(renderedBuffer, filename))
                 should(true, 'Saved reference file').message(filename, '');
             })
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation-expected.wav b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/resources/audiobuffersource-detune-modulation-expected.wav
similarity index 100%
rename from third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-detune-modulation-expected.wav
rename to third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/resources/audiobuffersource-detune-modulation-expected.wav
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-loop-points-expected.wav b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/resources/audiobuffersource-loop-points-expected.wav
similarity index 100%
rename from third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-loop-points-expected.wav
rename to third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/resources/audiobuffersource-loop-points-expected.wav
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation-expected.wav b/third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/resources/audiobuffersource-playbackrate-modulation-expected.wav
similarity index 100%
rename from third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/audiobuffersource-playbackrate-modulation-expected.wav
rename to third_party/WebKit/LayoutTests/webaudio/AudioBufferSource/resources/audiobuffersource-playbackrate-modulation-expected.wav
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode-expected.wav b/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/resources/webm-decode-expected.wav
similarity index 100%
rename from third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode-expected.wav
rename to third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/resources/webm-decode-expected.wav
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html b/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html
index e3da5e38..be139a9 100644
--- a/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html
+++ b/third_party/WebKit/LayoutTests/webaudio/codec-tests/webm/webm-decode.html
@@ -24,7 +24,7 @@
             let context = new AudioContext();
 
             let bufferLoader = new BufferLoader(
-                context, ['webm-decode-expected.wav', 'test-webm.webm'],
+                context, ['resources/webm-decode-expected.wav', 'test-webm.webm'],
                 function(bufferList) {
                   expectedAudio = bufferList[0];
                   decodedAudio = bufferList[1];
@@ -51,7 +51,7 @@
                             expectedAudio.getChannelData(c),
                             {absoluteThreshold: 4.0234e-5});
                   }
-                  let filename = 'webm-decode-actual.wav';
+                  let filename = 'resources/webm-decode-actual.wav';
                   if (downloadAudioBuffer(decodedAudio, filename))
                     should(true, 'Saved reference file').message(filename, '');
                   task.done();
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_elf_hash_table_test_data.h b/third_party/android_crazy_linker/src/src/crazy_linker_elf_hash_table_test_data.h
index da1b9c01..54629bd 100644
--- a/third_party/android_crazy_linker/src/src/crazy_linker_elf_hash_table_test_data.h
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_elf_hash_table_test_data.h
@@ -13,7 +13,7 @@
 namespace testing {
 
 // SysV ELF hash table: num_buckets=4 num_chain=16
-// 
+//
 // idx symbol               hash      bucket  chain
 //   0 <STN_UNDEF>
 //   1 isnan                0070a47e  2       5
@@ -31,19 +31,19 @@
 //  13 gettyen              0dcbbfde  2       14
 //  14 uselib               07c9c2f2  2       0
 //  15 cfsetispeed          0b63b274  0       0
-// 
+//
 // Buckets: 2, 8, 1, 3
-// 
+//
 static const char kTestElfStringTable[145] = {
-    '\0','i','s','n','a','n','\0','f','r','e','e','l','o','c','a','l','\0',
-    'h','c','r','e','a','t','e','_','\0','g','e','t','o','p','t','_','l','o',
-    'n','g','_','o','n','l','\0','e','n','d','r','p','c','e','n','\0','p',
-    't','h','r','e','a','d','_','m','u','t','e','x','_','l','o','c','k','\0',
-    'i','s','i','n','f','\0','s','e','t','r','l','i','m','i','\0','g','e',
-    't','s','p','e','n','\0','u','m','o','u','n','\0','s','t','r','s','i',
-    'g','n','a','\0','l','i','s','t','x','a','t','t','\0','g','e','t','t',
-    'y','e','n','\0','u','s','e','l','i','b','\0','c','f','s','e','t','i',
-    's','p','e','e','d','\0','\0'};
+    '\0','i','s','n','a','n','\0','f','r','e','e','l','o','c','a','l','\0','h',
+    'c','r','e','a','t','e','_','\0','g','e','t','o','p','t','_','l','o','n',
+    'g','_','o','n','l','\0','e','n','d','r','p','c','e','n','\0','p','t','h',
+    'r','e','a','d','_','m','u','t','e','x','_','l','o','c','k','\0','i','s',
+    'i','n','f','\0','s','e','t','r','l','i','m','i','\0','g','e','t','s','p',
+    'e','n','\0','u','m','o','u','n','\0','s','t','r','s','i','g','n','a','\0',
+    'l','i','s','t','x','a','t','t','\0','g','e','t','t','y','e','n','\0','u',
+    's','e','l','i','b','\0','c','f','s','e','t','i','s','p','e','e','d','\0',
+    '\0'};
 
 // Auto-generated macro used to list all symbols
 // XX must be a macro that takes the following parameters:
diff --git a/third_party/android_crazy_linker/src/src/crazy_linker_gnu_hash_table_test_data.h b/third_party/android_crazy_linker/src/src/crazy_linker_gnu_hash_table_test_data.h
index 122f5af5..f1fbf0b 100644
--- a/third_party/android_crazy_linker/src/src/crazy_linker_gnu_hash_table_test_data.h
+++ b/third_party/android_crazy_linker/src/src/crazy_linker_gnu_hash_table_test_data.h
@@ -13,9 +13,9 @@
 namespace testing {
 
 // GNU hash table: num_buckets=4 bloom_size=2 bloom_shift=5
-// 
+//
 // idx symbol               hash      bucket  bloom32  bloom64  chain
-// 
+//
 //   0 ST_UNDEF
 //   1 cfsetispeed          830acc54  0       0:20:02  1:20:34  830acc54
 //   2 strsigna             90f1e4b0  0       1:16:05  0:48:37  90f1e4b0
@@ -32,33 +32,33 @@
 //  13 getspen              f07b2a7b  3       1:27:19  1:59:19  f07b2a7a
 //  14 pthread_mutex_lock   4f152227  3       1:07:17  0:39:17  4f152226
 //  15 getopt_long_onl      57b1584f  3       0:15:02  1:15:02  57b1584f
-// 
+//
 // Buckets: 1, 5, 8, 13
-// 
+//
 // Bloom filter (32 bits):
 // bit#       24       16        8        0
 //      .x....xx ...x.x.. xx...... .....x.x
 //      xxx.x... ....xxxx .x..x.x. x.x.xx..
-// 
+//
 //   also as:  0x4314c005 0xe80f4aac
-// 
+//
 // Bloom filter (64 bits):
 // bit#       56       48       40       32       24       16        8        0
 //      .......x .......x .x....x. x.x..... ..x...x. ...x..x. ........ .......x
 //      .x..x... .....x.. ....x.x. .....x.. xx..x... ...xxx.. xx...... ....xx.x
-// 
+//
 //   also as:  0x010142a022120001 0x48040a04c81cc00d
-// 
+//
 static const char kTestGnuStringTable[145] = {
-    '\0','c','f','s','e','t','i','s','p','e','e','d','\0','s','t','r','s',
-    'i','g','n','a','\0','h','c','r','e','a','t','e','_','\0','e','n','d',
-    'r','p','c','e','n','\0','u','s','e','l','i','b','\0','g','e','t','t',
-    'y','e','n','\0','u','m','o','u','n','\0','f','r','e','e','l','o','c',
-    'a','l','\0','l','i','s','t','x','a','t','t','\0','i','s','n','a','n',
-    '\0','i','s','i','n','f','\0','s','e','t','r','l','i','m','i','\0','g',
-    'e','t','s','p','e','n','\0','p','t','h','r','e','a','d','_','m','u','t',
-    'e','x','_','l','o','c','k','\0','g','e','t','o','p','t','_','l','o','n',
-    'g','_','o','n','l','\0','\0'};
+    '\0','c','f','s','e','t','i','s','p','e','e','d','\0','s','t','r','s','i',
+    'g','n','a','\0','h','c','r','e','a','t','e','_','\0','e','n','d','r','p',
+    'c','e','n','\0','u','s','e','l','i','b','\0','g','e','t','t','y','e','n',
+    '\0','u','m','o','u','n','\0','f','r','e','e','l','o','c','a','l','\0','l',
+    'i','s','t','x','a','t','t','\0','i','s','n','a','n','\0','i','s','i','n',
+    'f','\0','s','e','t','r','l','i','m','i','\0','g','e','t','s','p','e','n',
+    '\0','p','t','h','r','e','a','d','_','m','u','t','e','x','_','l','o','c',
+    'k','\0','g','e','t','o','p','t','_','l','o','n','g','_','o','n','l','\0',
+    '\0'};
 
 // Auto-generated macro used to list all symbols
 // XX must be a macro that takes the following parameters:
diff --git a/third_party/android_crazy_linker/src/tests/pylib/source_utils.py b/third_party/android_crazy_linker/src/tests/pylib/source_utils.py
index 5f2e6d1a..74263632 100644
--- a/third_party/android_crazy_linker/src/tests/pylib/source_utils.py
+++ b/third_party/android_crazy_linker/src/tests/pylib/source_utils.py
@@ -32,6 +32,43 @@
 #endif  // {guard_macro_name}'''
 )
 
+def CSourceForArrayData(values, formatter, margin=4, width=80):
+  """Turn an array of values into a C source array data definition.
+
+  Args:
+    values: Array of input values.
+    formatter: Formatting function, applied to each input value to get a
+      C-source description of the value.
+    margin: Left-side margin / indentation level.
+    width: Maximum line width.
+  Returns:
+    A string containing the data definition as a C source fragment.
+  """
+  read_pos = 0
+  read_len = len(values)
+  write_pos = margin
+  line_start = ' ' * margin
+  # Account for the margin + one final comma.
+  max_width = width - margin - 1
+  out = ''
+  while read_pos < read_len:
+    out += line_start
+    write_pos = 0
+    comma = ''
+    while read_pos < read_len:
+      item = comma + formatter(values[read_pos])
+      if write_pos + len(item) > max_width:
+        break  # Too long, break line before this item.
+      out += item
+      read_pos += 1
+      write_pos += len(item)
+      comma = ','
+    if read_pos == read_len:
+      break
+    out += ',\n'
+  return out
+
+
 def CSourceForIntegerHexArray(values, num_bits, margin=4, width=80):
   """Turn an array of integers into a C source array data definition.
 
@@ -44,23 +81,22 @@
     A string containing the data definition as a C source fragment.
   """
   chars_per_word = num_bits / 4
-  # Account for 0x prefix + one space + one comma
-  max_items_per_line = (width - margin - 2) / (4 + chars_per_word)
-  line_start = ' ' * (margin - 1)
-  slen = len(values)
-  n = 0
-  format_str = ' 0x%%0%dx,' % chars_per_word
-  out = ''
-  while n < slen:
-    out += line_start
-    n2 = min(n + max_items_per_line, slen)
-    while n < n2:
-      out += format_str % values[n]
-      n += 1
-    out += '\n';
+  format_str = ' 0x%%0%dx' % chars_per_word
+  out = CSourceForArrayData(values, lambda x: format_str % x,
+                            margin - 1, width)
+  out += ',\n'
   return out
 
 
+def _FormatChar(ch):
+  """Convert a character into its C source description."""
+  code = ord(ch)
+  if code < 32 or code > 127:
+    return "'\\%d'" % code
+  else:
+    return "'%s'" % ch
+
+
 def CSourceForConstCharArray(chars, variable_name, margin=4, width=80):
   """Return C source fragment for static const char C array.
 
@@ -70,35 +106,8 @@
   Returns:
     A new string holding a C source fragment for the array definition.
   """
-  slen = len(chars)
-  out = 'static const char %s[%d] = {\n' % (variable_name, slen)
-  line_start = ' ' * margin
-  # Allow for margin + 4 spaces on the right.
-  max_width = width - margin - 4
-  rpos = 0
-  wpos = margin + 1
-  while rpos < slen:
-    out += line_start
-    wpos = 0
-    comma = ''
-    while rpos < slen and wpos < max_width:
-      ch = chars[rpos]
-      code = ord(ch)
-      if code < 32 or code > 127:
-        ch = "'\\%d'" % code
-      else:
-        ch = "'%s'" % ch
-      ch = comma + ch
-      if wpos + len(ch) > max_width: # Too long, break line before this char.
-        break
-      out += ch
-      rpos += 1
-      wpos += len(ch)
-      comma = ','
-    if rpos == slen:
-      break
-    out += ',\n'
-
+  out = 'static const char %s[%d] = {\n' % (variable_name, len(chars))
+  out += CSourceForArrayData(chars, _FormatChar, margin, width)
   out += '};\n'
   return out
 
@@ -107,7 +116,12 @@
   """Wrap the content of |lines| instead into C++ comments."""
   out = ''
   for line in lines.split('\n'):
-    out += '// %s\n' % line
+    line = line.rstrip()
+    if line:
+      out += '// %s\n' % line
+    else:
+      out += '//\n'
+
   return out
 
 
@@ -116,6 +130,7 @@
       script_name=script_name,
       guard_macro_name=guard_macro_name)
 
+
 def CSourceEndAutoGeneratedHeader(script_name, guard_macro_name):
   return _AUTO_GENERATED_HEADER_END_TEMPLATE.format(
       script_name=script_name,
diff --git a/third_party/blink/public/platform/web_feature.mojom b/third_party/blink/public/platform/web_feature.mojom
index 1ad5eea7..b665e89a 100644
--- a/third_party/blink/public/platform/web_feature.mojom
+++ b/third_party/blink/public/platform/web_feature.mojom
@@ -1884,7 +1884,7 @@
   kShapeOutsideMarginBox = 2428,
   kPerformanceTimeline = 2429,
   kUserTiming = 2430,
-  kCSSSelectorPseudoIS = 2431,
+  kCSSSelectorPseudoWhere = 2431,
   kKeyboardApiGetLayoutMap = 2432,
   kPerformanceResourceTimingInitiatorType = 2434,
   kV8ArraySortNoElementsProtector = 2436,
diff --git a/third_party/blink/public/platform/web_runtime_features.h b/third_party/blink/public/platform/web_runtime_features.h
index d009289..0c7e2ca3 100644
--- a/third_party/blink/public/platform/web_runtime_features.h
+++ b/third_party/blink/public/platform/web_runtime_features.h
@@ -199,6 +199,7 @@
       bool);
   BLINK_PLATFORM_EXPORT static void EnableV8ContextSnapshot(bool);
   BLINK_PLATFORM_EXPORT static void EnableAutomationControlled(bool);
+  BLINK_PLATFORM_EXPORT static void EnableWorkStealingInScriptRunner(bool);
   BLINK_PLATFORM_EXPORT static void EnableScheduledScriptStreaming(bool);
   BLINK_PLATFORM_EXPORT static void EnableExperimentalProductivityFeatures(
       bool);
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
index 6b66609..486ef25 100644
--- a/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
+++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.cc
@@ -14,7 +14,7 @@
 #include "third_party/blink/renderer/core/frame/settings.h"
 #include "third_party/blink/renderer/core/html/parser/text_resource_decoder.h"
 #include "third_party/blink/renderer/core/inspector/inspector_trace_events.h"
-#include "third_party/blink/renderer/core/loader/resource/script_resource.h"
+#include "third_party/blink/renderer/core/script/classic_pending_script.h"
 #include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h"
 #include "third_party/blink/renderer/platform/cross_thread_functional.h"
 #include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
@@ -343,7 +343,7 @@
   return resource_buffer_size >= small_script_threshold_;
 }
 
-void ScriptStreamer::NotifyAppendData() {
+void ScriptStreamer::NotifyAppendData(ScriptResource* resource) {
   DCHECK(IsMainThread());
   if (streaming_suppressed_)
     return;
@@ -351,8 +351,8 @@
     // Even if the first data chunk is small, the script can still be big
     // enough - wait until the next data chunk comes before deciding whether
     // to start the streaming.
-    DCHECK(script_resource_->ResourceBuffer());
-    if (!HasEnoughDataForStreaming(script_resource_->ResourceBuffer()->size()))
+    DCHECK(resource->ResourceBuffer());
+    if (!HasEnoughDataForStreaming(resource->ResourceBuffer()->size()))
       return;
     have_enough_data_for_streaming_ = true;
 
@@ -360,8 +360,8 @@
       // Check for BOM (byte order marks), because that might change our
       // understanding of the data encoding.
       char maybe_bom[kMaximumLengthOfBOM] = {};
-      if (!script_resource_->ResourceBuffer()->GetBytes(maybe_bom,
-                                                        kMaximumLengthOfBOM)) {
+      if (!resource->ResourceBuffer()->GetBytes(maybe_bom,
+                                                kMaximumLengthOfBOM)) {
         NOTREACHED();
         return;
       }
@@ -369,7 +369,7 @@
       std::unique_ptr<TextResourceDecoder> decoder(
           TextResourceDecoder::Create(TextResourceDecoderOptions(
               TextResourceDecoderOptions::kPlainTextContent,
-              WTF::TextEncoding(script_resource_->Encoding()))));
+              WTF::TextEncoding(resource->Encoding()))));
       decoder->CheckForBOM(maybe_bom, kMaximumLengthOfBOM);
 
       // The encoding may change when we see the BOM. Check for BOM now
@@ -441,7 +441,7 @@
 
   }
   if (stream_)
-    stream_->DidReceiveData(script_resource_, this);
+    stream_->DidReceiveData(resource, this);
 }
 
 void ScriptStreamer::NotifyFinished() {
@@ -489,10 +489,10 @@
 }
 
 ScriptStreamer::ScriptStreamer(
-    ScriptResource* script_resource,
+    ClassicPendingScript* script,
     v8::ScriptCompiler::CompileOptions compile_options,
     scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner)
-    : script_resource_(script_resource),
+    : pending_script_(script),
       detached_(false),
       stream_(nullptr),
       loading_finished_(false),
@@ -501,8 +501,8 @@
       streaming_suppressed_(false),
       suppressed_reason_(kInvalid),
       compile_options_(compile_options),
-      script_url_string_(script_resource->Url().Copy().GetString()),
-      script_resource_identifier_(script_resource->Identifier()),
+      script_url_string_(script->GetResource()->Url().Copy().GetString()),
+      script_resource_identifier_(script->GetResource()->Identifier()),
       // Unfortunately there's no dummy encoding value in the enum; let's use
       // one we don't stream.
       encoding_(v8::ScriptCompiler::StreamedSource::TWO_BYTE),
@@ -516,7 +516,7 @@
 }
 
 void ScriptStreamer::Trace(blink::Visitor* visitor) {
-  visitor->Trace(script_resource_);
+  visitor->Trace(pending_script_);
 }
 
 void ScriptStreamer::StreamingComplete() {
@@ -549,32 +549,64 @@
   if (!IsFinished())
     return;
 
-  script_resource_->StreamingFinished();
+  pending_script_->StreamingFinished();
 }
 
-ScriptStreamer* ScriptStreamer::Create(
-    ScriptResource* resource,
+void ScriptStreamer::StartStreaming(
+    ClassicPendingScript* script,
     scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner,
     NotStreamingReason* not_streaming_reason) {
   DCHECK(IsMainThread());
   *not_streaming_reason = kInvalid;
+  ScriptResource* resource = ToScriptResource(script->GetResource());
   if (!resource->Url().ProtocolIsInHTTPFamily()) {
     *not_streaming_reason = kNotHTTP;
-    return nullptr;
+    return;
+  }
+  if (resource->IsCacheValidator()) {
+    // This happens e.g., during reloads. We're actually not going to load
+    // the current Resource of the ClassicPendingScript but switch to another
+    // Resource -> don't stream.
+    *not_streaming_reason = kReload;
+    return;
   }
   if (resource->IsLoaded() && !resource->ResourceBuffer()) {
     // This happens for already loaded resources, e.g. if resource
     // validation fails. In that case, the loading subsystem will discard
     // the resource buffer.
     *not_streaming_reason = kNoResourceBuffer;
-    return nullptr;
+    return;
   }
   // We cannot filter out short scripts, even if we wait for the HTTP headers
   // to arrive: the Content-Length HTTP header is not sent for chunked
   // downloads.
 
-  return new ScriptStreamer(resource, v8::ScriptCompiler::kNoCompileOptions,
-                            std::move(loading_task_runner));
+  ScriptStreamer* streamer =
+      new ScriptStreamer(script, v8::ScriptCompiler::kNoCompileOptions,
+                         std::move(loading_task_runner));
+
+  // If this script was ready when streaming began, no callbacks will be
+  // received to populate the data for the ScriptStreamer, so send them now.
+  // Note that this script may be processing an asynchronous cache hit, in
+  // which case ScriptResource::IsLoaded() will be true, but ready_state_ will
+  // not be kReadyStreaming. In that case, ScriptStreamer can listen to the
+  // async callbacks generated by the cache hit.
+  if (script->IsReady()) {
+    DCHECK(resource->IsLoaded());
+    streamer->NotifyAppendData(resource);
+    if (streamer->StreamingSuppressed()) {
+      *not_streaming_reason = streamer->StreamingSuppressedReason();
+      return;
+    }
+  }
+
+  // The Resource might go out of scope if the script is no longer needed.
+  // This makes ClassicPendingScript notify the ScriptStreamer when it is
+  // destroyed.
+  script->SetStreamer(streamer);
+
+  if (script->IsReady())
+    streamer->NotifyFinished();
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer.h b/third_party/blink/renderer/bindings/core/v8/script_streamer.h
index ce753cc..7088e5c 100644
--- a/third_party/blink/renderer/bindings/core/v8/script_streamer.h
+++ b/third_party/blink/renderer/bindings/core/v8/script_streamer.h
@@ -17,11 +17,12 @@
 
 namespace blink {
 
+class ClassicPendingScript;
 class ScriptResource;
 class SourceStream;
 
 // ScriptStreamer streams incomplete script data to V8 so that it can be parsed
-// while it's loaded. ScriptResource holds a reference to ScriptStreamer.
+// while it's loaded. ClassicPendingScript holds a reference to ScriptStreamer.
 // At the moment, ScriptStreamer is only used for parser blocking scripts; this
 // means that the Document stays stable and no other scripts are executing
 // while we're streaming. It is possible, though, that Document and the
@@ -39,21 +40,18 @@
   enum NotStreamingReason {
     kAlreadyLoaded,  // DEPRECATED
     kNotHTTP,
-    kRevalidate,
+    kReload,
     kContextNotValid,  // DEPRECATED
     kEncodingNotSupported,
-    // TODO(leszeks): Deprecate once scheduled streaming is on by default
     kThreadBusy,
     kV8CannotStream,
     kScriptTooSmall,
     kNoResourceBuffer,
     kHasCodeCache,
-    kStreamerNotReadyOnGetSource,  // DEPRECATED
+    kStreamerNotReadyOnGetSource,
     kInlineScript,
     kDidntTryToStartStreaming,
     kErrorOccurred,
-    kStreamingDisabled,
-    kSecondScriptResourceUse,
     kWorkerTopLevelScript,
 
     // Pseudo values that should never be seen in reported metrics
@@ -64,11 +62,11 @@
   ~ScriptStreamer();
   void Trace(blink::Visitor*);
 
-  // Create a script streamer which will stream the given ScriptResource into V8
-  // as it loads.
-  static ScriptStreamer* Create(ScriptResource*,
-                                scoped_refptr<base::SingleThreadTaskRunner>,
-                                NotStreamingReason* not_streaming_reason);
+  // Launches a task (on a background thread) which will stream the given
+  // ClassicPendingScript into V8 as it loads.
+  static void StartStreaming(ClassicPendingScript*,
+                             scoped_refptr<base::SingleThreadTaskRunner>,
+                             NotStreamingReason* not_streaming_reason);
 
   // Returns false if we cannot stream the given encoding.
   static bool ConvertEncoding(const char* encoding_name,
@@ -101,12 +99,8 @@
     return suppressed_reason_;
   }
 
-  // Called by ScriptResource when data arrives from the network.
-  void NotifyAppendData();
-  // Called by ScriptResource when loading has completed.
-  //
-  // Should not be called synchronously, as it can trigger script resource
-  // client callbacks.
+  // Called by ClassicPendingScript when data arrives from the network.
+  void NotifyAppendData(ScriptResource*);
   void NotifyFinished();
 
   // Called by ScriptStreamingTask when it has streamed all data to V8 and V8
@@ -129,21 +123,17 @@
   // Maximum size of the BOM marker.
   static constexpr size_t kMaximumLengthOfBOM = 4;
 
-  ScriptStreamer(ScriptResource*,
+  ScriptStreamer(ClassicPendingScript*,
                  v8::ScriptCompiler::CompileOptions,
                  scoped_refptr<base::SingleThreadTaskRunner>);
 
   void Prefinalize();
 
-  // Should not be called synchronously, as it can trigger script resource
-  // client callbacks.
   void StreamingComplete();
-  // Should not be called synchronously, as it can trigger script resource
-  // client callbacks.
   void NotifyFinishedToClient();
   bool HasEnoughDataForStreaming(size_t resource_buffer_size);
 
-  Member<ScriptResource> script_resource_;
+  Member<ClassicPendingScript> pending_script_;
   // Whether ScriptStreamer is detached from the Resource. In those cases, the
   // script data is not needed any more, and the client won't get notified
   // when the loading and streaming are done.
diff --git a/third_party/blink/renderer/bindings/core/v8/script_streamer_test.cc b/third_party/blink/renderer/bindings/core/v8/script_streamer_test.cc
index 7995a6e..7d033b09 100644
--- a/third_party/blink/renderer/bindings/core/v8/script_streamer_test.cc
+++ b/third_party/blink/renderer/bindings/core/v8/script_streamer_test.cc
@@ -159,7 +159,10 @@
 TEST_F(ScriptStreamingTest, CompilingStreamedScript) {
   // Test that we can successfully compile a streamed script.
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -196,7 +199,10 @@
   // the V8 side typically finished before loading finishes: make sure we
   // handle it gracefully.
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
   AppendData("function foo() {");
@@ -234,7 +240,10 @@
   // Test that the upper layers (PendingScript and up) can be ramped down
   // while streaming is ongoing, and ScriptStreamer handles it gracefully.
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
   AppendData("function foo() {");
@@ -255,11 +264,14 @@
   EXPECT_FALSE(client->Finished());
 }
 
-TEST_F(ScriptStreamingTest, DataAfterDisposingPendingScript) {
+TEST_F(ScriptStreamingTest, DataAfterCancellingStreaming) {
   // Test that the upper layers (PendingScript and up) can be ramped down
   // before streaming is started, and ScriptStreamer handles it gracefully.
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -279,7 +291,6 @@
                               // holding on to it here.
 
   // Make sure the streaming starts.
-  AppendData(resource, "function foo() {");
   AppendPadding(resource);
   resource.Clear();
 
@@ -295,7 +306,10 @@
   // upper layer (ScriptResourceClient) should get a notification when the
   // script is loaded.
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
   AppendData("function foo() {");
@@ -324,7 +338,10 @@
   // (ScriptResourceClient) should be notified when an empty script has been
   // loaded.
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -343,7 +360,10 @@
   V8TestingScope scope;
   ScriptStreamer::SetSmallScriptThresholdForTesting(100);
 
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -365,7 +385,10 @@
   V8TestingScope scope;
   ScriptStreamer::SetSmallScriptThresholdForTesting(100);
 
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -401,7 +424,10 @@
   V8TestingScope scope;
   GetResource()->SetEncodingForTest("windows-1252");
 
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -439,7 +465,10 @@
   // This encoding is wrong on purpose.
   GetResource()->SetEncodingForTest("windows-1252");
 
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
 
@@ -471,7 +500,10 @@
 // A test for crbug.com/711703. Should not crash.
 TEST_F(ScriptStreamingTest, GarbageCollectDuringStreaming) {
   V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
+  ScriptStreamer::NotStreamingReason reason;
+  ScriptStreamer::StartStreaming(GetPendingScript(), loading_task_runner_,
+                                 &reason);
+  GetPendingScript()->SetNotStreamingReasonForTest(reason);
 
   TestPendingScriptClient* client = new TestPendingScriptClient;
   GetPendingScript()->WatchForLoad(client);
@@ -483,34 +515,6 @@
       BlinkGC::kEagerSweeping, BlinkGC::GCReason::kForcedGC);
 }
 
-TEST_F(ScriptStreamingTest, ResourceSetRevalidatingRequest) {
-  V8TestingScope scope;
-  GetResource()->StartStreaming(loading_task_runner_);
-
-  TestPendingScriptClient* client = new TestPendingScriptClient;
-  GetPendingScript()->WatchForLoad(client);
-
-  // Kick the streaming off.
-  AppendData("function foo() {");
-  AppendPadding();
-  AppendData("}");
-  Finish();
-  ProcessTasksUntilStreamingComplete();
-
-  // Second start streaming should fail.
-  GetResource()->StartStreaming(loading_task_runner_);
-  EXPECT_FALSE(GetResource()->HasRunningStreamer());
-
-  ResourceRequest request(GetResource()->Url());
-  GetResource()->SetRevalidatingRequest(request);
-
-  // The next streaming should still fail, but the reason should be
-  // "kRevalidate".
-  GetResource()->StartStreaming(loading_task_runner_);
-  EXPECT_FALSE(GetResource()->HasRunningStreamer());
-  EXPECT_EQ(GetResource()->NoStreamerReason(), ScriptStreamer::kRevalidate);
-}
-
 }  // namespace
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/bindings/core/v8/v8_script_runner_test.cc b/third_party/blink/renderer/bindings/core/v8/v8_script_runner_test.cc
index f3a4ce2..edbdba2 100644
--- a/third_party/blink/renderer/bindings/core/v8/v8_script_runner_test.cc
+++ b/third_party/blink/renderer/bindings/core/v8/v8_script_runner_test.cc
@@ -93,15 +93,11 @@
   }
 
   ScriptResource* CreateEmptyResource() {
-    ScriptResource* resource =
-        ScriptResource::CreateForTest(NullURL(), UTF8Encoding());
-    resource->SetClientIsWaitingForFinished();
-    return resource;
+    return ScriptResource::CreateForTest(NullURL(), UTF8Encoding());
   }
 
   ScriptResource* CreateResource(const WTF::TextEncoding& encoding) {
     ScriptResource* resource = ScriptResource::CreateForTest(Url(), encoding);
-    resource->SetClientIsWaitingForFinished();
     String code = Code();
     ResourceResponse response(Url());
     response.SetHTTPStatusCode(200);
diff --git a/third_party/blink/renderer/bindings/scripts/v8_attributes.py b/third_party/blink/renderer/bindings/scripts/v8_attributes.py
index d58a5d9..eefe480 100644
--- a/third_party/blink/renderer/bindings/scripts/v8_attributes.py
+++ b/third_party/blink/renderer/bindings/scripts/v8_attributes.py
@@ -434,9 +434,13 @@
         return
 
     if ('Replaceable' in attribute.extended_attributes):
+        # Create the property, and early-return if an exception is thrown.
+        # Subsequent cleanup code may not be prepared to handle a pending
+        # exception.
         context['cpp_setter'] = (
-            'V8CallBoolean(info.Holder()->CreateDataProperty(' +
-            'info.GetIsolate()->GetCurrentContext(), propertyName, v8Value))')
+            'if (info.Holder()->CreateDataProperty(' +
+            'info.GetIsolate()->GetCurrentContext(), propertyName, v8Value).IsNothing())' +
+            '\n  return')
         return
 
     extended_attributes = attribute.extended_attributes
diff --git a/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl b/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl
index 52602ea..eb1b6eb3 100644
--- a/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl
+++ b/third_party/blink/renderer/bindings/templates/attributes.cc.tmpl
@@ -440,7 +440,7 @@
   {% if attribute.is_explicit_nullable %}
   bool isNull = IsUndefinedOrNull(v8Value);
   {% endif %}
-  {{attribute.cpp_setter}};
+  {{attribute.cpp_setter | indent(2)}};
 
   {% if attribute.cached_attribute_validation_method %}
   // [CachedAttribute]
diff --git a/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc b/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc
index 1b2ce8b..2d048e2 100644
--- a/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc
+++ b/third_party/blink/renderer/bindings/tests/results/core/v8_test_object.cc
@@ -3686,7 +3686,8 @@
   // Prepare the value to be set.
 
   v8::Local<v8::String> propertyName = V8AtomicString(isolate, "replaceableReadonlyLongAttribute");
-  V8CallBoolean(info.Holder()->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), propertyName, v8Value));
+  if (info.Holder()->CreateDataProperty(info.GetIsolate()->GetCurrentContext(), propertyName, v8Value).IsNothing())
+    return;
 }
 
 static void locationPutForwardsAttributeGetter(const v8::FunctionCallbackInfo<v8::Value>& info) {
diff --git a/third_party/blink/renderer/core/OWNERS b/third_party/blink/renderer/core/OWNERS
index 995cd607f..50bd98e 100644
--- a/third_party/blink/renderer/core/OWNERS
+++ b/third_party/blink/renderer/core/OWNERS
@@ -26,6 +26,7 @@
 # foolip reviews <video>, <track>, WebVTT and Fullscreen.
 foolip@chromium.org
 fs@opera.com
+fserb@chromium.org
 futhark@chromium.org
 haraken@chromium.org
 hayato@chromium.org
@@ -37,7 +38,6 @@
 jfernandez@igalia.com
 jianli@chromium.org
 jochen@chromium.org
-junov@chromium.org
 kbr@chromium.org
 keishi@chromium.org
 kenneth.r.christiansen@intel.com
diff --git a/third_party/blink/renderer/core/css/css_selector.cc b/third_party/blink/renderer/core/css/css_selector.cc
index 58b9234b..37b1d60b 100644
--- a/third_party/blink/renderer/core/css/css_selector.cc
+++ b/third_party/blink/renderer/core/css/css_selector.cc
@@ -218,7 +218,7 @@
     case kPseudoVisited:
     case kPseudoAny:
     case kPseudoMatches:
-    case kPseudoIS:
+    case kPseudoWhere:
     case kPseudoAnyLink:
     case kPseudoWebkitAnyLink:
     case kPseudoAutofill:
@@ -399,7 +399,6 @@
     {"cue", CSSSelector::kPseudoCue},
     {"host", CSSSelector::kPseudoHost},
     {"host-context", CSSSelector::kPseudoHostContext},
-    {"is", CSSSelector::kPseudoIS},
     {"lang", CSSSelector::kPseudoLang},
     {"matches", CSSSelector::kPseudoMatches},
     {"not", CSSSelector::kPseudoNot},
@@ -409,6 +408,7 @@
     {"nth-of-type", CSSSelector::kPseudoNthOfType},
     {"part", CSSSelector::kPseudoPart},
     {"slotted", CSSSelector::kPseudoSlotted},
+    {"where", CSSSelector::kPseudoWhere},
 };
 
 class NameToPseudoCompare {
@@ -619,7 +619,7 @@
     case kPseudoIncrement:
     case kPseudoIndeterminate:
     case kPseudoInvalid:
-    case kPseudoIS:
+    case kPseudoWhere:
     case kPseudoLang:
     case kPseudoLastChild:
     case kPseudoLastOfType:
@@ -771,7 +771,7 @@
         case kPseudoHostContext:
         case kPseudoAny:
         case kPseudoMatches:
-        case kPseudoIS:
+        case kPseudoWhere:
           break;
         default:
           break;
@@ -1110,9 +1110,9 @@
   return false;
 }
 
-bool CSSSelector::HasPseudoIS() const {
+bool CSSSelector::HasPseudoWhere() const {
   for (const CSSSelector* s = this; s; s = s->TagHistory()) {
-    if (s->GetPseudoType() == CSSSelector::kPseudoIS)
+    if (s->GetPseudoType() == CSSSelector::kPseudoWhere)
       return true;
   }
   return false;
diff --git a/third_party/blink/renderer/core/css/css_selector.h b/third_party/blink/renderer/core/css/css_selector.h
index b32eb9e..f3df983 100644
--- a/third_party/blink/renderer/core/css/css_selector.h
+++ b/third_party/blink/renderer/core/css/css_selector.h
@@ -164,7 +164,7 @@
     kPseudoVisited,
     kPseudoAny,
     kPseudoMatches,
-    kPseudoIS,
+    kPseudoWhere,
     kPseudoAnyLink,
     kPseudoWebkitAnyLink,
     kPseudoAutofill,
@@ -386,7 +386,7 @@
   bool HasDeepCombinatorOrShadowPseudo() const;
   bool NeedsUpdatedDistribution() const;
   bool HasPseudoMatches() const;
-  bool HasPseudoIS() const;
+  bool HasPseudoWhere() const;
 
  private:
   unsigned relation_ : 4;     // enum RelationType
diff --git a/third_party/blink/renderer/core/css/css_selector_list.cc b/third_party/blink/renderer/core/css/css_selector_list.cc
index ac9ac12e..53c3da9 100644
--- a/third_party/blink/renderer/core/css/css_selector_list.cc
+++ b/third_party/blink/renderer/core/css/css_selector_list.cc
@@ -122,7 +122,7 @@
       if (!selector_to_expand->IsLastInTagHistory())
         destination->SetLastInTagHistory(false);
     }
-    if (selector_to_expand->GetPseudoType() == CSSSelector::kPseudoIS ||
+    if (selector_to_expand->GetPseudoType() == CSSSelector::kPseudoWhere ||
         selector_to_expand->IgnoreSpecificity())
       destination->SetIgnoreSpecificity(true);
     destination->SetLastInSelectorList(false);
@@ -140,7 +140,7 @@
   size_t i = 0;
   CSSSelectorList transformed = this->Copy();
   while (!selector_boundaries[i]->HasPseudoMatches() &&
-         !selector_boundaries[i]->HasPseudoIS())
+         !selector_boundaries[i]->HasPseudoWhere())
     ++i;
 
   const CSSSelector* selector_to_expand_begin = selector_boundaries[i];
@@ -150,7 +150,7 @@
 
   const CSSSelector* simple_selector = selector_to_expand_begin;
   while (simple_selector->GetPseudoType() != CSSSelector::kPseudoMatches &&
-         simple_selector->GetPseudoType() != CSSSelector::kPseudoIS) {
+         simple_selector->GetPseudoType() != CSSSelector::kPseudoWhere) {
     simple_selector = simple_selector->TagHistory();
   }
 
@@ -225,9 +225,9 @@
   return false;
 }
 
-bool CSSSelectorList::HasPseudoIS() const {
+bool CSSSelectorList::HasPseudoWhere() const {
   for (const CSSSelector* s = FirstForCSSOM(); s; s = Next(*s)) {
-    if (s->HasPseudoIS())
+    if (s->HasPseudoWhere())
       return true;
   }
   return false;
@@ -235,7 +235,7 @@
 
 bool CSSSelectorList::RequiresExpansion() const {
   for (const CSSSelector* s = FirstForCSSOM(); s; s = Next(*s)) {
-    if (s->HasPseudoMatches() || s->HasPseudoIS())
+    if (s->HasPseudoMatches() || s->HasPseudoWhere())
       return true;
   }
   return false;
diff --git a/third_party/blink/renderer/core/css/css_selector_list.h b/third_party/blink/renderer/core/css/css_selector_list.h
index db3b8b8..d777199 100644
--- a/third_party/blink/renderer/core/css/css_selector_list.h
+++ b/third_party/blink/renderer/core/css/css_selector_list.h
@@ -78,7 +78,7 @@
   CSSSelectorList ExpandedFirstPseudoClass() const;
   CSSSelectorList TransformForListExpansion();
   bool HasPseudoMatches() const;
-  bool HasPseudoIS() const;
+  bool HasPseudoWhere() const;
   bool RequiresExpansion() const;
 
   CSSSelectorList& operator=(CSSSelectorList&& o) {
diff --git a/third_party/blink/renderer/core/css/parser/css_selector_parser.cc b/third_party/blink/renderer/core/css/parser/css_selector_parser.cc
index 5431ec0..573efb3 100644
--- a/third_party/blink/renderer/core/css/parser/css_selector_parser.cc
+++ b/third_party/blink/renderer/core/css/parser/css_selector_parser.cc
@@ -549,8 +549,8 @@
       selector->SetSelectorList(std::move(selector_list));
       return selector;
     }
-    case CSSSelector::kPseudoIS: {
-      if (!RuntimeEnabledFeatures::CSSPseudoISEnabled())
+    case CSSSelector::kPseudoWhere: {
+      if (!RuntimeEnabledFeatures::CSSPseudoWhereEnabled())
         break;
 
       DisallowPseudoElementsScope scope(this);
@@ -573,7 +573,7 @@
           std::make_unique<CSSSelectorList>();
       *selector_list = ConsumeCompoundSelectorList(block);
       if (!selector_list->IsValid() || !block.AtEnd() ||
-          selector_list->HasPseudoMatches() || selector_list->HasPseudoIS())
+          selector_list->HasPseudoMatches() || selector_list->HasPseudoWhere())
         return nullptr;
       selector->SetSelectorList(std::move(selector_list));
       return selector;
@@ -606,7 +606,7 @@
       block.ConsumeWhitespace();
       if (!inner_selector || !block.AtEnd() ||
           inner_selector->GetPseudoType() == CSSSelector::kPseudoMatches ||
-          inner_selector->GetPseudoType() == CSSSelector::kPseudoIS)
+          inner_selector->GetPseudoType() == CSSSelector::kPseudoWhere)
         return nullptr;
       Vector<std::unique_ptr<CSSParserSelector>> selector_vector;
       selector_vector.push_back(std::move(inner_selector));
@@ -958,9 +958,9 @@
         case CSSSelector::kPseudoWebkitAnyLink:
           feature = WebFeature::kCSSSelectorPseudoWebkitAnyLink;
           break;
-        case CSSSelector::kPseudoIS:
-          DCHECK(RuntimeEnabledFeatures::CSSPseudoISEnabled());
-          feature = WebFeature::kCSSSelectorPseudoIS;
+        case CSSSelector::kPseudoWhere:
+          DCHECK(RuntimeEnabledFeatures::CSSPseudoWhereEnabled());
+          feature = WebFeature::kCSSSelectorPseudoWhere;
           break;
         case CSSSelector::kPseudoUnresolved:
           feature = WebFeature::kCSSSelectorPseudoUnresolved;
diff --git a/third_party/blink/renderer/core/css/parser/css_selector_parser_test.cc b/third_party/blink/renderer/core/css/parser/css_selector_parser_test.cc
index c67ee0f9..60ee5199 100644
--- a/third_party/blink/renderer/core/css/parser/css_selector_parser_test.cc
+++ b/third_party/blink/renderer/core/css/parser/css_selector_parser_test.cc
@@ -438,24 +438,24 @@
   }
 }
 
-TEST(CSSSelectorParserTest, InvalidNestingPseudoIS) {
-  // :is() is currently not supported within these pseudo classes as they
-  // currently do not support complex selector arguments (:is() does support
-  // this and the expansion of :is() may provide complex selector arguments to
-  // these pseudo classes). Most of these test cases should eventually be
+TEST(CSSSelectorParserTest, InvalidNestingPseudoWhere) {
+  // :where() is currently not supported within these pseudo classes as they
+  // currently do not support complex selector arguments (:where() does support
+  // this and the expansion of :where() may provide complex selector arguments
+  // to these pseudo classes). Most of these test cases should eventually be
   // removed once they support complex selector arguments.
-  const char* test_cases[] = {":-webkit-any(:is(.a))",
-                              "::cue(:is(.a))",
-                              ":cue(:is(.a))",
-                              ":host(:is(.a))",
-                              ":host-context(:is(.a))",
-                              ":lang(:is(.a))",
-                              ":not(:is(.a))",
-                              ":nth-child(:is(.a))",
-                              ":nth-last-child(:is(.a))",
-                              ":nth-last-of-type(:is(.a))",
-                              ":nth-of-type(:is(.a))",
-                              "::slotted(:is(.a))"};
+  const char* test_cases[] = {":-webkit-any(:where(.a))",
+                              "::cue(:where(.a))",
+                              ":cue(:where(.a))",
+                              ":host(:where(.a))",
+                              ":host-context(:where(.a))",
+                              ":lang(:where(.a))",
+                              ":not(:where(.a))",
+                              ":nth-child(:where(.a))",
+                              ":nth-last-child(:where(.a))",
+                              ":nth-last-of-type(:where(.a))",
+                              ":nth-of-type(:where(.a))",
+                              "::slotted(:where(.a))"};
 
   CSSParserContext* context = CSSParserContext::Create(
       kHTMLStandardMode, SecureContextMode::kInsecureContext);
diff --git a/third_party/blink/renderer/core/css/rule_feature_set.cc b/third_party/blink/renderer/core/css/rule_feature_set.cc
index 36229029f..2803e28 100644
--- a/third_party/blink/renderer/core/css/rule_feature_set.cc
+++ b/third_party/blink/renderer/core/css/rule_feature_set.cc
@@ -168,7 +168,7 @@
     case CSSSelector::kPseudoVideoPersistentAncestor:
       return true;
     case CSSSelector::kPseudoMatches:
-    case CSSSelector::kPseudoIS:
+    case CSSSelector::kPseudoWhere:
     case CSSSelector::kPseudoUnknown:
     case CSSSelector::kPseudoLeftPage:
     case CSSSelector::kPseudoRightPage:
diff --git a/third_party/blink/renderer/core/css/rule_feature_set_test.cc b/third_party/blink/renderer/core/css/rule_feature_set_test.cc
index b3e32f31..1d77034 100644
--- a/third_party/blink/renderer/core/css/rule_feature_set_test.cc
+++ b/third_party/blink/renderer/core/css/rule_feature_set_test.cc
@@ -1100,8 +1100,9 @@
   ExpectNoInvalidation(invalidation_lists.siblings);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoIS) {
-  EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch, CollectFeatures(":is(.w, .x)"));
+TEST_F(RuleFeatureSetTest, pseudoWhere) {
+  EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
+            CollectFeatures(":where(.w, .x)"));
 
   {
     InvalidationLists invalidation_lists;
@@ -1117,9 +1118,9 @@
   }
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISSibling) {
+TEST_F(RuleFeatureSetTest, pseudoWhereSibling) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(":is(.q, .r) ~ .s .t"));
+            CollectFeatures(":where(.q, .r) ~ .s .t"));
   {
     InvalidationLists invalidation_lists;
     CollectInvalidationSetsForClass(invalidation_lists, "q");
@@ -1136,27 +1137,27 @@
   }
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISIdDescendant) {
+TEST_F(RuleFeatureSetTest, pseudoWhereIdDescendant) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(".a :is(#b, #c)"));
+            CollectFeatures(".a :where(#b, #c)"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "a");
   ExpectIdInvalidation("b", "c", invalidation_lists.descendants);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISTagDescendant) {
+TEST_F(RuleFeatureSetTest, pseudoWhereTagDescendant) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(".a :is(span, div)"));
+            CollectFeatures(".a :where(span, div)"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "a");
   ExpectTagNameInvalidation("span", "div", invalidation_lists.descendants);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISAnySibling) {
+TEST_F(RuleFeatureSetTest, pseudoWhereAnySibling) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(".v ~ :is(.w, .x)"));
+            CollectFeatures(".v ~ :where(.w, .x)"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "v");
@@ -1164,9 +1165,9 @@
   ExpectClassInvalidation("w", "x", invalidation_lists.siblings);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISDescendantSibling) {
+TEST_F(RuleFeatureSetTest, pseudoWhereDescendantSibling) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(".u .v ~ :is(.w, .x)"));
+            CollectFeatures(".u .v ~ :where(.w, .x)"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "u");
@@ -1174,9 +1175,9 @@
   ExpectNoInvalidation(invalidation_lists.siblings);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISWithComplexSelectors) {
+TEST_F(RuleFeatureSetTest, pseudoWhereWithComplexSelectors) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(".a :is(.w+.b, .x>#c)"));
+            CollectFeatures(".a :where(.w+.b, .x>#c)"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "a");
@@ -1185,9 +1186,9 @@
   ExpectNoInvalidation(invalidation_lists.siblings);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISNested) {
+TEST_F(RuleFeatureSetTest, pseudoWhereNested) {
   EXPECT_EQ(RuleFeatureSet::kSelectorMayMatch,
-            CollectFeatures(".a :is(.w+.b, .e+:is(.c, #d))"));
+            CollectFeatures(".a :where(.w+.b, .e+:where(.c, #d))"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "a");
@@ -1196,16 +1197,16 @@
   ExpectNoInvalidation(invalidation_lists.siblings);
 }
 
-TEST_F(RuleFeatureSetTest, pseudoISTooLarge) {
+TEST_F(RuleFeatureSetTest, pseudoWhereTooLarge) {
   // RuleData cannot support selectors at index 8192 or beyond so the expansion
   // is limited to this size
   EXPECT_EQ(RuleFeatureSet::kSelectorNeverMatches,
-            CollectFeatures(":is(.a#a, .b#b, .c#c, .d#d) + "
-                            ":is(.e#e, .f#f, .g#g, .h#h) + "
-                            ":is(.i#i, .j#j, .k#k, .l#l) + "
-                            ":is(.m#m, .n#n, .o#o, .p#p) + "
-                            ":is(.q#q, .r#r, .s#s, .t#t) + "
-                            ":is(.u#u, .v#v, .w#w, .x#x)"));
+            CollectFeatures(":where(.a#a, .b#b, .c#c, .d#d) + "
+                            ":where(.e#e, .f#f, .g#g, .h#h) + "
+                            ":where(.i#i, .j#j, .k#k, .l#l) + "
+                            ":where(.m#m, .n#n, .o#o, .p#p) + "
+                            ":where(.q#q, .r#r, .s#s, .t#t) + "
+                            ":where(.u#u, .v#v, .w#w, .x#x)"));
 
   InvalidationLists invalidation_lists;
   CollectInvalidationSetsForClass(invalidation_lists, "a");
diff --git a/third_party/blink/renderer/core/css/rule_set_test.cc b/third_party/blink/renderer/core/css/rule_set_test.cc
index 7208578..511e351 100644
--- a/third_party/blink/renderer/core/css/rule_set_test.cc
+++ b/third_party/blink/renderer/core/css/rule_set_test.cc
@@ -269,10 +269,10 @@
   }
 }
 
-TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoIS) {
+TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoWhere) {
   CSSTestHelper helper;
 
-  helper.AddCSSRules(".a :is(.b+.c, .d>:is(.e, .f)) { }");
+  helper.AddCSSRules(".a :where(.b+.c, .d>:where(.e, .f)) { }");
   RuleSet& rule_set = helper.GetRuleSet();
   {
     AtomicString str("c");
@@ -312,15 +312,15 @@
   ASSERT_EQ(0u, rule_set.RuleCount());
 }
 
-TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoISTooLarge) {
+TEST(RuleSetTest, findBestRuleSetAndAdd_PseudoWhereTooLarge) {
   // RuleData cannot support selectors at index 8192 or beyond so the expansion
   // is limited to this size
   CSSTestHelper helper;
 
   helper.AddCSSRules(
-      ":is(.a#a, .b#b, .c#c, .d#d) + :is(.e#e, .f#f, .g#g, .h#h) + "
-      ":is(.i#i, .j#j, .k#k, .l#l) + :is(.m#m, .n#n, .o#o, .p#p) + "
-      ":is(.q#q, .r#r, .s#s, .t#t) + :is(.u#u, .v#v, .w#w, .x#x) { }",
+      ":where(.a#a, .b#b, .c#c, .d#d) + :where(.e#e, .f#f, .g#g, .h#h) + "
+      ":where(.i#i, .j#j, .k#k, .l#l) + :where(.m#m, .n#n, .o#o, .p#p) + "
+      ":where(.q#q, .r#r, .s#s, .t#t) + :where(.u#u, .v#v, .w#w, .x#x) { }",
       true);
 
   RuleSet& rule_set = helper.GetRuleSet();
diff --git a/third_party/blink/renderer/core/css/selector_checker.cc b/third_party/blink/renderer/core/css/selector_checker.cc
index 5e0b242..0eb74ca9 100644
--- a/third_party/blink/renderer/core/css/selector_checker.cc
+++ b/third_party/blink/renderer/core/css/selector_checker.cc
@@ -1100,7 +1100,7 @@
       return false;
     case CSSSelector::kPseudoUnknown:
     case CSSSelector::kPseudoMatches:
-    case CSSSelector::kPseudoIS:
+    case CSSSelector::kPseudoWhere:
     default:
       NOTREACHED();
       break;
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc
index fcd79d71..9062818 100644
--- a/third_party/blink/renderer/core/dom/element.cc
+++ b/third_party/blink/renderer/core/dom/element.cc
@@ -133,12 +133,7 @@
 #include "third_party/blink/renderer/core/page/page.h"
 #include "third_party/blink/renderer/core/page/pointer_lock_controller.h"
 #include "third_party/blink/renderer/core/page/scrolling/root_scroller_controller.h"
-#include "third_party/blink/renderer/core/page/scrolling/root_scroller_util.h"
-#include "third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h"
-#include "third_party/blink/renderer/core/page/scrolling/scroll_state.h"
-#include "third_party/blink/renderer/core/page/scrolling/scroll_state_callback.h"
 #include "third_party/blink/renderer/core/page/scrolling/snap_coordinator.h"
-#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h"
 #include "third_party/blink/renderer/core/page/spatial_navigation.h"
 #include "third_party/blink/renderer/core/paint/paint_layer.h"
 #include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
@@ -166,24 +161,6 @@
 
 namespace blink {
 
-namespace {
-
-// We need to retain the scroll customization callbacks until the element
-// they're associated with is destroyed. It would be simplest if the callbacks
-// could be stored in ElementRareData, but we can't afford the space increase.
-// Instead, keep the scroll customization callbacks here. The other option would
-// be to store these callbacks on the Page or document, but that necessitates a
-// bunch more logic for transferring the callbacks between Pages when elements
-// are moved around.
-ScrollCustomizationCallbacks& GetScrollCustomizationCallbacks() {
-  DEFINE_STATIC_LOCAL(Persistent<ScrollCustomizationCallbacks>,
-                      scroll_customization_callbacks,
-                      (new ScrollCustomizationCallbacks));
-  return *scroll_customization_callbacks;
-}
-
-}  // namespace
-
 using namespace HTMLNames;
 
 enum class ClassStringContent { kEmpty, kWhiteSpaceOnly, kHasClasses };
@@ -586,182 +563,6 @@
   }
 }
 
-void Element::setDistributeScroll(V8ScrollStateCallback* scroll_state_callback,
-                                  const String& native_scroll_behavior) {
-  GetScrollCustomizationCallbacks().SetDistributeScroll(
-      this, ScrollStateCallbackV8Impl::Create(scroll_state_callback,
-                                              native_scroll_behavior));
-}
-
-void Element::setApplyScroll(V8ScrollStateCallback* scroll_state_callback,
-                             const String& native_scroll_behavior) {
-  SetApplyScroll(ScrollStateCallbackV8Impl::Create(scroll_state_callback,
-                                                   native_scroll_behavior));
-}
-
-void Element::SetApplyScroll(ScrollStateCallback* scroll_state_callback) {
-  GetScrollCustomizationCallbacks().SetApplyScroll(this, scroll_state_callback);
-}
-
-void Element::RemoveApplyScroll() {
-  GetScrollCustomizationCallbacks().RemoveApplyScroll(this);
-}
-
-ScrollStateCallback* Element::GetApplyScroll() {
-  return GetScrollCustomizationCallbacks().GetApplyScroll(this);
-}
-
-void Element::NativeDistributeScroll(ScrollState& scroll_state) {
-  if (scroll_state.FullyConsumed())
-    return;
-
-  scroll_state.distributeToScrollChainDescendant();
-
-  // The scroll doesn't propagate, and we're currently scrolling an element
-  // other than this one, prevent the scroll from propagating to this element.
-  if (scroll_state.DeltaConsumedForScrollSequence() &&
-      scroll_state.CurrentNativeScrollingElement() != this) {
-    return;
-  }
-
-  const double delta_x = scroll_state.deltaX();
-  const double delta_y = scroll_state.deltaY();
-
-  CallApplyScroll(scroll_state);
-
-  if (delta_x != scroll_state.deltaX() || delta_y != scroll_state.deltaY())
-    scroll_state.SetCurrentNativeScrollingElement(this);
-}
-
-void Element::CallDistributeScroll(ScrollState& scroll_state) {
-  TRACE_EVENT0("input", "Element::CallDistributeScroll");
-  ScrollStateCallback* callback =
-      GetScrollCustomizationCallbacks().GetDistributeScroll(this);
-
-  // TODO(bokan): Need to add tests before we allow calling custom callbacks
-  // for non-touch modalities. For now, just call into the native callback but
-  // allow the viewport scroll callback so we don't disable overscroll.
-  // crbug.com/623079.
-  bool disable_custom_callbacks = !scroll_state.isDirectManipulation() &&
-                                  !GetDocument()
-                                       .GetPage()
-                                       ->GlobalRootScrollerController()
-                                       .IsViewportScrollCallback(callback);
-
-  disable_custom_callbacks |=
-      !RootScrollerUtil::IsGlobal(this) &&
-      RuntimeEnabledFeatures::ScrollCustomizationEnabled() &&
-      !GetScrollCustomizationCallbacks().InScrollPhase(this);
-
-  if (!callback || disable_custom_callbacks) {
-    NativeDistributeScroll(scroll_state);
-    return;
-  }
-  if (callback->NativeScrollBehavior() !=
-      WebNativeScrollBehavior::kPerformAfterNativeScroll)
-    callback->Invoke(&scroll_state);
-  if (callback->NativeScrollBehavior() !=
-      WebNativeScrollBehavior::kDisableNativeScroll)
-    NativeDistributeScroll(scroll_state);
-  if (callback->NativeScrollBehavior() ==
-      WebNativeScrollBehavior::kPerformAfterNativeScroll)
-    callback->Invoke(&scroll_state);
-}
-
-void Element::NativeApplyScroll(ScrollState& scroll_state) {
-  // All elements in the scroll chain should be boxes.
-  DCHECK(!GetLayoutObject() || GetLayoutObject()->IsBox());
-
-  if (scroll_state.FullyConsumed())
-    return;
-
-  FloatSize delta(scroll_state.deltaX(), scroll_state.deltaY());
-
-  if (delta.IsZero())
-    return;
-
-  // TODO(esprehn): This should use
-  // updateStyleAndLayoutIgnorePendingStylesheetsForNode.
-  GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
-
-  LayoutBox* box_to_scroll = nullptr;
-
-  if (this == GetDocument().documentElement())
-    box_to_scroll = GetDocument().GetLayoutView();
-  else if (GetLayoutObject())
-    box_to_scroll = ToLayoutBox(GetLayoutObject());
-
-  if (!box_to_scroll)
-    return;
-
-  ScrollableArea* scrollable_area =
-      box_to_scroll->EnclosingBox()->GetScrollableArea();
-
-  if (!scrollable_area)
-    return;
-
-  ScrollResult result = scrollable_area->UserScroll(
-      ScrollGranularity(static_cast<int>(scroll_state.deltaGranularity())),
-      delta);
-
-  if (!result.DidScroll())
-    return;
-
-  // FIXME: Native scrollers should only consume the scroll they
-  // apply. See crbug.com/457765.
-  scroll_state.ConsumeDeltaNative(delta.Width(), delta.Height());
-
-  // We need to setCurrentNativeScrollingElement in both the
-  // distributeScroll and applyScroll default implementations so
-  // that if JS overrides one of these methods, but not the
-  // other, this bookkeeping remains accurate.
-  scroll_state.SetCurrentNativeScrollingElement(this);
-};
-
-void Element::CallApplyScroll(ScrollState& scroll_state) {
-  TRACE_EVENT0("input", "Element::CallApplyScroll");
-  // Hits ASSERTs when trying to determine whether we need to scroll on main
-  // or CC. http://crbug.com/625676.
-  DisableCompositingQueryAsserts disabler;
-
-  if (!GetDocument().GetPage()) {
-    // We should always have a Page if we're scrolling. See
-    // crbug.com/689074 for details.
-    return;
-  }
-
-  ScrollStateCallback* callback =
-      GetScrollCustomizationCallbacks().GetApplyScroll(this);
-
-  // TODO(bokan): Need to add tests before we allow calling custom callbacks
-  // for non-touch modalities. For now, just call into the native callback but
-  // allow the viewport scroll callback so we don't disable overscroll.
-  // crbug.com/623079.
-  bool disable_custom_callbacks = !scroll_state.isDirectManipulation() &&
-                                  !GetDocument()
-                                       .GetPage()
-                                       ->GlobalRootScrollerController()
-                                       .IsViewportScrollCallback(callback);
-  disable_custom_callbacks |=
-      !RootScrollerUtil::IsGlobal(this) &&
-      RuntimeEnabledFeatures::ScrollCustomizationEnabled() &&
-      !GetScrollCustomizationCallbacks().InScrollPhase(this);
-
-  if (!callback || disable_custom_callbacks) {
-    NativeApplyScroll(scroll_state);
-    return;
-  }
-  if (callback->NativeScrollBehavior() !=
-      WebNativeScrollBehavior::kPerformAfterNativeScroll)
-    callback->Invoke(&scroll_state);
-  if (callback->NativeScrollBehavior() !=
-      WebNativeScrollBehavior::kDisableNativeScroll)
-    NativeApplyScroll(scroll_state);
-  if (callback->NativeScrollBehavior() ==
-      WebNativeScrollBehavior::kPerformAfterNativeScroll)
-    callback->Invoke(&scroll_state);
-}
-
 int Element::OffsetLeft() {
   GetDocument().EnsurePaintLocationDataValidForNode(this);
   if (LayoutBoxModelObject* layout_object = GetLayoutBoxModelObject())
@@ -3702,24 +3503,6 @@
   }
 }
 
-void Element::WillBeginCustomizedScrollPhase(
-    ScrollCustomization::ScrollDirection direction) {
-  DCHECK(!GetScrollCustomizationCallbacks().InScrollPhase(this));
-  LayoutBox* box = GetLayoutBox();
-  if (!box)
-    return;
-
-  ScrollCustomization::ScrollDirection scroll_customization =
-      box->Style()->ScrollCustomization();
-
-  GetScrollCustomizationCallbacks().SetInScrollPhase(
-      this, direction & scroll_customization);
-}
-
-void Element::DidEndCustomizedScrollPhase() {
-  GetScrollCustomizationCallbacks().SetInScrollPhase(this, false);
-}
-
 ScriptPromise Element::acquireDisplayLock(ScriptState* script_state,
                                           V8DisplayLockCallback* callback) {
   auto* context =
diff --git a/third_party/blink/renderer/core/dom/element.h b/third_party/blink/renderer/core/dom/element.h
index 36d8ccd..2f99cf9 100644
--- a/third_party/blink/renderer/core/dom/element.h
+++ b/third_party/blink/renderer/core/dom/element.h
@@ -38,7 +38,6 @@
 #include "third_party/blink/renderer/core/html/focus_options.h"
 #include "third_party/blink/renderer/core/html_names.h"
 #include "third_party/blink/renderer/core/resize_observer/resize_observer.h"
-#include "third_party/blink/renderer/core/scroll/scroll_customization.h"
 #include "third_party/blink/renderer/platform/bindings/trace_wrapper_member.h"
 #include "third_party/blink/renderer/platform/heap/handle.h"
 #include "third_party/blink/renderer/platform/scroll/scroll_types.h"
@@ -74,8 +73,6 @@
 class ResizeObservation;
 class ScrollIntoViewOptions;
 class ScrollIntoViewOptionsOrBoolean;
-class ScrollState;
-class ScrollStateCallback;
 class ScrollToOptions;
 class ShadowRoot;
 class ShadowRootInit;
@@ -89,7 +86,6 @@
 class USVStringOrTrustedURL;
 class V0CustomElementDefinition;
 class V8DisplayLockCallback;
-class V8ScrollStateCallback;
 
 enum SpellcheckAttributeState {
   kSpellcheckAttributeTrue,
@@ -638,20 +634,6 @@
                                                 const FocusOptions&);
   virtual void blur();
 
-  void setDistributeScroll(V8ScrollStateCallback*,
-                           const String& native_scroll_behavior);
-  void NativeDistributeScroll(ScrollState&);
-  void setApplyScroll(V8ScrollStateCallback*,
-                      const String& native_scroll_behavior);
-  void SetApplyScroll(ScrollStateCallback*);
-  void RemoveApplyScroll();
-  void NativeApplyScroll(ScrollState&);
-
-  void CallDistributeScroll(ScrollState&);
-  void CallApplyScroll(ScrollState&);
-
-  ScrollStateCallback* GetApplyScroll();
-
   // Whether this element can receive focus at all. Most elements are not
   // focusable but some elements, such as form controls and links, are. Unlike
   // layoutObjectIsFocusable(), this method may be called when layout is not up
@@ -905,9 +887,6 @@
   EnsureResizeObserverData();
   void SetNeedsResizeObserverUpdate();
 
-  void WillBeginCustomizedScrollPhase(ScrollCustomization::ScrollDirection);
-  void DidEndCustomizedScrollPhase();
-
   ScriptPromise acquireDisplayLock(ScriptState*, V8DisplayLockCallback*);
 
  protected:
diff --git a/third_party/blink/renderer/core/dom/element.idl b/third_party/blink/renderer/core/dom/element.idl
index a1e311a..b05939dd 100644
--- a/third_party/blink/renderer/core/dom/element.idl
+++ b/third_party/blink/renderer/core/dom/element.idl
@@ -115,10 +115,6 @@
     [Affects=Nothing] readonly attribute long clientWidth;
     [Affects=Nothing] readonly attribute long clientHeight;
 
-    // Scroll Customization API. See crbug.com/410974 for details.
-    [RuntimeEnabled=ScrollCustomization] void setApplyScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
-    [RuntimeEnabled=ScrollCustomization] void setDistributeScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
-
     // Typed OM
     // https://drafts.css-houdini.org/css-typed-om/#inline-stylepropertymap-objects
     [SameObject, MeasureAs=CSSTypedOMStylePropertyMap] readonly attribute StylePropertyMap attributeStyleMap;
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc
index b72b933..f5b9733 100644
--- a/third_party/blink/renderer/core/dom/node.cc
+++ b/third_party/blink/renderer/core/dom/node.cc
@@ -95,9 +95,17 @@
 #include "third_party/blink/renderer/core/input/input_device_capabilities.h"
 #include "third_party/blink/renderer/core/layout/layout_box.h"
 #include "third_party/blink/renderer/core/layout/layout_embedded_content.h"
+#include "third_party/blink/renderer/core/layout/layout_view.h"
 #include "third_party/blink/renderer/core/mathml_names.h"
 #include "third_party/blink/renderer/core/page/context_menu_controller.h"
 #include "third_party/blink/renderer/core/page/page.h"
+#include "third_party/blink/renderer/core/page/scrolling/root_scroller_util.h"
+#include "third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h"
+#include "third_party/blink/renderer/core/page/scrolling/scroll_state.h"
+#include "third_party/blink/renderer/core/page/scrolling/scroll_state_callback.h"
+#include "third_party/blink/renderer/core/page/scrolling/top_document_root_scroller_controller.h"
+#include "third_party/blink/renderer/core/paint/paint_layer.h"
+#include "third_party/blink/renderer/core/paint/paint_layer_scrollable_area.h"
 #include "third_party/blink/renderer/core/svg/graphics/svg_image.h"
 #include "third_party/blink/renderer/core/svg/svg_element.h"
 #include "third_party/blink/renderer/platform/bindings/dom_data_store.h"
@@ -119,6 +127,20 @@
 
 namespace {
 
+// We need to retain the scroll customization callbacks until the element
+// they're associated with is destroyed. It would be simplest if the callbacks
+// could be stored in ElementRareData, but we can't afford the space increase.
+// Instead, keep the scroll customization callbacks here. The other option would
+// be to store these callbacks on the Page or document, but that necessitates a
+// bunch more logic for transferring the callbacks between Pages when elements
+// are moved around.
+ScrollCustomizationCallbacks& GetScrollCustomizationCallbacks() {
+  DEFINE_STATIC_LOCAL(Persistent<ScrollCustomizationCallbacks>,
+                      scroll_customization_callbacks,
+                      (new ScrollCustomizationCallbacks));
+  return *scroll_customization_callbacks;
+}
+
 // TODO(crbug.com/545926): Unsafe hack to avoid triggering the
 // ThreadRestrictionVerifier on StringImpl. This should be fixed completely, and
 // we should always avoid accessing these strings from the impl thread.
@@ -441,6 +463,212 @@
                                                        : &TreeRoot();
 }
 
+void Node::setDistributeScroll(V8ScrollStateCallback* scroll_state_callback,
+                               const String& native_scroll_behavior) {
+  DCHECK(IsElementNode());
+  GetScrollCustomizationCallbacks().SetDistributeScroll(
+      this, ScrollStateCallbackV8Impl::Create(scroll_state_callback,
+                                              native_scroll_behavior));
+}
+
+void Node::setApplyScroll(V8ScrollStateCallback* scroll_state_callback,
+                          const String& native_scroll_behavior) {
+  DCHECK(IsElementNode());
+  SetApplyScroll(ScrollStateCallbackV8Impl::Create(scroll_state_callback,
+                                                   native_scroll_behavior));
+}
+
+void Node::SetApplyScroll(ScrollStateCallback* scroll_state_callback) {
+  DCHECK(IsElementNode());
+  GetScrollCustomizationCallbacks().SetApplyScroll(this, scroll_state_callback);
+}
+
+void Node::RemoveApplyScroll() {
+  DCHECK(IsElementNode());
+  GetScrollCustomizationCallbacks().RemoveApplyScroll(this);
+}
+
+ScrollStateCallback* Node::GetApplyScroll() {
+  DCHECK(IsElementNode());
+  return GetScrollCustomizationCallbacks().GetApplyScroll(this);
+}
+
+void Node::NativeDistributeScroll(ScrollState& scroll_state) {
+  DCHECK(IsElementNode());
+  if (scroll_state.FullyConsumed())
+    return;
+
+  scroll_state.distributeToScrollChainDescendant();
+
+  // The scroll doesn't propagate, and we're currently scrolling an element
+  // other than this one, prevent the scroll from propagating to this element.
+  if (scroll_state.DeltaConsumedForScrollSequence() &&
+      scroll_state.CurrentNativeScrollingNode() != this) {
+    return;
+  }
+
+  const double delta_x = scroll_state.deltaX();
+  const double delta_y = scroll_state.deltaY();
+
+  CallApplyScroll(scroll_state);
+
+  if (delta_x != scroll_state.deltaX() || delta_y != scroll_state.deltaY())
+    scroll_state.SetCurrentNativeScrollingNode(this);
+}
+
+void Node::NativeApplyScroll(ScrollState& scroll_state) {
+  DCHECK(IsElementNode());
+
+  // All elements in the scroll chain should be boxes.
+  DCHECK(!GetLayoutObject() || GetLayoutObject()->IsBox());
+
+  if (scroll_state.FullyConsumed())
+    return;
+
+  FloatSize delta(scroll_state.deltaX(), scroll_state.deltaY());
+
+  if (delta.IsZero())
+    return;
+
+  // TODO(esprehn): This should use
+  // updateStyleAndLayoutIgnorePendingStylesheetsForNode.
+  GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
+
+  LayoutBox* box_to_scroll = nullptr;
+
+  if (this == GetDocument().documentElement())
+    box_to_scroll = GetDocument().GetLayoutView();
+  else if (GetLayoutObject())
+    box_to_scroll = ToLayoutBox(GetLayoutObject());
+
+  if (!box_to_scroll)
+    return;
+
+  ScrollableArea* scrollable_area =
+      box_to_scroll->EnclosingBox()->GetScrollableArea();
+
+  if (!scrollable_area)
+    return;
+
+  ScrollResult result = scrollable_area->UserScroll(
+      ScrollGranularity(static_cast<int>(scroll_state.deltaGranularity())),
+      delta);
+
+  if (!result.DidScroll())
+    return;
+
+  // FIXME: Native scrollers should only consume the scroll they
+  // apply. See crbug.com/457765.
+  scroll_state.ConsumeDeltaNative(delta.Width(), delta.Height());
+
+  // We need to setCurrentNativeScrollingElement in both the
+  // distributeScroll and applyScroll default implementations so
+  // that if JS overrides one of these methods, but not the
+  // other, this bookkeeping remains accurate.
+  scroll_state.SetCurrentNativeScrollingNode(this);
+}
+
+void Node::CallDistributeScroll(ScrollState& scroll_state) {
+  TRACE_EVENT0("input", "Node::CallDistributeScroll");
+  DCHECK(IsElementNode());
+  ScrollStateCallback* callback =
+      GetScrollCustomizationCallbacks().GetDistributeScroll(this);
+
+  // TODO(bokan): Need to add tests before we allow calling custom callbacks
+  // for non-touch modalities. For now, just call into the native callback but
+  // allow the viewport scroll callback so we don't disable overscroll.
+  // crbug.com/623079.
+  bool disable_custom_callbacks = !scroll_state.isDirectManipulation() &&
+                                  !GetDocument()
+                                       .GetPage()
+                                       ->GlobalRootScrollerController()
+                                       .IsViewportScrollCallback(callback);
+
+  disable_custom_callbacks |=
+      !RootScrollerUtil::IsGlobal(this) &&
+      RuntimeEnabledFeatures::ScrollCustomizationEnabled() &&
+      !GetScrollCustomizationCallbacks().InScrollPhase(this);
+
+  if (!callback || disable_custom_callbacks) {
+    NativeDistributeScroll(scroll_state);
+    return;
+  }
+  if (callback->NativeScrollBehavior() !=
+      WebNativeScrollBehavior::kPerformAfterNativeScroll)
+    callback->Invoke(&scroll_state);
+  if (callback->NativeScrollBehavior() !=
+      WebNativeScrollBehavior::kDisableNativeScroll)
+    NativeDistributeScroll(scroll_state);
+  if (callback->NativeScrollBehavior() ==
+      WebNativeScrollBehavior::kPerformAfterNativeScroll)
+    callback->Invoke(&scroll_state);
+}
+
+void Node::CallApplyScroll(ScrollState& scroll_state) {
+  TRACE_EVENT0("input", "Node::CallApplyScroll");
+  DCHECK(IsElementNode());
+  // Hits ASSERTs when trying to determine whether we need to scroll on main
+  // or CC. http://crbug.com/625676.
+  DisableCompositingQueryAsserts disabler;
+
+  if (!GetDocument().GetPage()) {
+    // We should always have a Page if we're scrolling. See
+    // crbug.com/689074 for details.
+    return;
+  }
+
+  ScrollStateCallback* callback =
+      GetScrollCustomizationCallbacks().GetApplyScroll(this);
+
+  // TODO(bokan): Need to add tests before we allow calling custom callbacks
+  // for non-touch modalities. For now, just call into the native callback but
+  // allow the viewport scroll callback so we don't disable overscroll.
+  // crbug.com/623079.
+  bool disable_custom_callbacks = !scroll_state.isDirectManipulation() &&
+                                  !GetDocument()
+                                       .GetPage()
+                                       ->GlobalRootScrollerController()
+                                       .IsViewportScrollCallback(callback);
+  disable_custom_callbacks |=
+      !RootScrollerUtil::IsGlobal(this) &&
+      RuntimeEnabledFeatures::ScrollCustomizationEnabled() &&
+      !GetScrollCustomizationCallbacks().InScrollPhase(this);
+
+  if (!callback || disable_custom_callbacks) {
+    NativeApplyScroll(scroll_state);
+    return;
+  }
+  if (callback->NativeScrollBehavior() !=
+      WebNativeScrollBehavior::kPerformAfterNativeScroll)
+    callback->Invoke(&scroll_state);
+  if (callback->NativeScrollBehavior() !=
+      WebNativeScrollBehavior::kDisableNativeScroll)
+    NativeApplyScroll(scroll_state);
+  if (callback->NativeScrollBehavior() ==
+      WebNativeScrollBehavior::kPerformAfterNativeScroll)
+    callback->Invoke(&scroll_state);
+}
+
+void Node::WillBeginCustomizedScrollPhase(
+    ScrollCustomization::ScrollDirection direction) {
+  DCHECK(IsElementNode());
+  DCHECK(!GetScrollCustomizationCallbacks().InScrollPhase(this));
+  LayoutBox* box = GetLayoutBox();
+  if (!box)
+    return;
+
+  ScrollCustomization::ScrollDirection scroll_customization =
+      box->Style()->ScrollCustomization();
+
+  GetScrollCustomizationCallbacks().SetInScrollPhase(
+      this, direction & scroll_customization);
+}
+
+void Node::DidEndCustomizedScrollPhase() {
+  DCHECK(IsElementNode());
+  GetScrollCustomizationCallbacks().SetInScrollPhase(this, false);
+}
+
 Node* Node::insertBefore(Node* new_child,
                          Node* ref_child,
                          ExceptionState& exception_state) {
diff --git a/third_party/blink/renderer/core/dom/node.h b/third_party/blink/renderer/core/dom/node.h
index e4097a0..acd0c8c0 100644
--- a/third_party/blink/renderer/core/dom/node.h
+++ b/third_party/blink/renderer/core/dom/node.h
@@ -34,6 +34,7 @@
 #include "third_party/blink/renderer/core/dom/mutation_observer_options.h"
 #include "third_party/blink/renderer/core/dom/node_rare_data.h"
 #include "third_party/blink/renderer/core/dom/tree_scope.h"
+#include "third_party/blink/renderer/core/scroll/scroll_customization.h"
 #include "third_party/blink/renderer/core/style/computed_style_constants.h"
 #include "third_party/blink/renderer/platform/bindings/trace_wrapper_member.h"
 #include "third_party/blink/renderer/platform/geometry/layout_rect.h"
@@ -67,11 +68,14 @@
 class QualifiedName;
 class RegisteredEventListener;
 class SVGQualifiedName;
+class ScrollState;
+class ScrollStateCallback;
 class ShadowRoot;
 template <typename NodeType>
 class StaticNodeTypeList;
 using StaticNodeList = StaticNodeTypeList<Node>;
 class StyleChangeReasonForTracing;
+class V8ScrollStateCallback;
 class WebPluginContainerImpl;
 
 const int kNodeStyleChangeShift = 18;
@@ -190,6 +194,22 @@
   Node* firstChild() const;
   Node* lastChild() const;
   Node* getRootNode(const GetRootNodeOptions&) const;
+
+  // Scroll Customization API. See crbug.com/410974 for details.
+  void setDistributeScroll(V8ScrollStateCallback*,
+                           const String& native_scroll_behavior);
+  void setApplyScroll(V8ScrollStateCallback*,
+                      const String& native_scroll_behavior);
+  void SetApplyScroll(ScrollStateCallback*);
+  void RemoveApplyScroll();
+  ScrollStateCallback* GetApplyScroll();
+  void NativeDistributeScroll(ScrollState&);
+  void NativeApplyScroll(ScrollState&);
+  void CallDistributeScroll(ScrollState&);
+  void CallApplyScroll(ScrollState&);
+  void WillBeginCustomizedScrollPhase(ScrollCustomization::ScrollDirection);
+  void DidEndCustomizedScrollPhase();
+
   Node& TreeRoot() const;
   Node& ShadowIncludingRoot() const;
   // closed-shadow-hidden is defined at
diff --git a/third_party/blink/renderer/core/dom/node.idl b/third_party/blink/renderer/core/dom/node.idl
index bc32770..8755420 100644
--- a/third_party/blink/renderer/core/dom/node.idl
+++ b/third_party/blink/renderer/core/dom/node.idl
@@ -38,6 +38,10 @@
 
     readonly attribute USVString baseURI;
 
+    // Scroll Customization API. See crbug.com/410974 for details.
+    [RuntimeEnabled=ScrollCustomization] void setApplyScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
+    [RuntimeEnabled=ScrollCustomization] void setDistributeScroll(ScrollStateCallback scrollStateCallback, NativeScrollBehavior nativeScrollBehavior);
+
     [Affects=Nothing, Measure] readonly attribute boolean isConnected;
     [Affects=Nothing, PerWorldBindings] readonly attribute Document? ownerDocument;
     [Affects=Nothing, PerWorldBindings, ImplementedAs=ParentNodeWithCounting] readonly attribute Node? parentNode;
diff --git a/third_party/blink/renderer/core/editing/drag_caret.cc b/third_party/blink/renderer/core/editing/drag_caret.cc
index 7860c2ec..c89904f 100644
--- a/third_party/blink/renderer/core/editing/drag_caret.cc
+++ b/third_party/blink/renderer/core/editing/drag_caret.cc
@@ -66,7 +66,7 @@
 }
 
 void DragCaret::SetCaretPosition(const PositionWithAffinity& position) {
-  position_ = CreateVisiblePosition(position).ToPositionWithAffinity();
+  position_ = position;
   Document* document = nullptr;
   if (Node* node = position_.AnchorNode()) {
     document = &node->GetDocument();
diff --git a/third_party/blink/renderer/core/editing/frame_caret.cc b/third_party/blink/renderer/core/editing/frame_caret.cc
index 0c6d9fb8..95cce00 100644
--- a/third_party/blink/renderer/core/editing/frame_caret.cc
+++ b/third_party/blink/renderer/core/editing/frame_caret.cc
@@ -181,9 +181,7 @@
   if (!IsActive())
     return AbsoluteBoundsForLocalRect(caret_node, LayoutRect());
   return AbsoluteBoundsForLocalRect(
-      caret_node,
-      CaretDisplayItemClient::ComputeCaretRect(
-          CreateVisiblePosition(CaretPosition()).ToPositionWithAffinity()));
+      caret_node, CaretDisplayItemClient::ComputeCaretRect(CaretPosition()));
 }
 
 void FrameCaret::SetShouldShowBlockCursor(bool should_show_block_cursor) {
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 012520c..4746e138 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -332,8 +332,7 @@
       should_dispatch_first_layout_after_finished_loading_(false),
       display_mode_(kWebDisplayModeBrowser),
       elastic_overscroll_(FloatSize()),
-      mutator_dispatcher_(nullptr),
-      override_compositor_visibility_(false) {
+      mutator_dispatcher_(nullptr) {
   DCHECK_EQ(!!client_, !!widget_client_);
   Page::PageClients page_clients;
   page_clients.chrome_client = chrome_client_.Get();
@@ -3363,21 +3362,27 @@
     mojom::PageVisibilityState visibility_state,
     bool is_initial_state) {
   DCHECK(GetPage());
+  const bool visible = visibility_state == mojom::PageVisibilityState::kVisible;
+
   GetPage()->SetVisibilityState(visibility_state, is_initial_state);
 
-  bool visible = visibility_state == mojom::PageVisibilityState::kVisible;
-  if (layer_tree_view_ && !override_compositor_visibility_)
-    layer_tree_view_->SetVisible(visible);
-  GetPage()->GetPageScheduler()->SetPageVisible(visible);
-}
+  // There is no frame yet during creation, but we set visibility on the page.
+  // The creator of the LayerTreeView is responsible for setting up its
+  // visibility.
+  if (GetPage()->MainFrame()) {
+    // The compositor for the main frame should be marked as visible or not only
+    // when the main frame is local. A remote main frame is not composited from
+    // this WebView, it would never be visible even if the Page is.
+    if (GetPage()->MainFrame()->IsLocalFrame()) {
+      // TODO(danakj): We shouldn't be changing visibility after closing, so why
+      // do we need to null check here - only for the DoDeferredClose case which
+      // does close out of order, starting with blink before IPCs are closed.
+      if (layer_tree_view_)
+        layer_tree_view_->SetVisible(visible);
+    }
+  }
 
-void WebViewImpl::SetCompositorVisibility(bool is_visible) {
-  if (!is_visible)
-    override_compositor_visibility_ = true;
-  else
-    override_compositor_visibility_ = false;
-  if (layer_tree_view_)
-    layer_tree_view_->SetVisible(is_visible);
+  GetPage()->GetPageScheduler()->SetPageVisible(visible);
 }
 
 void WebViewImpl::ForceNextWebGLContextCreationToFail() {
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index 8b0bde13..d44411ea 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -467,10 +467,6 @@
                                float bottom_controls_height,
                                bool browser_controls_shrink_layout);
 
-  // Overrides the compositor visibility. See the description of
-  // m_overrideCompositorVisibility for more details.
-  void SetCompositorVisibility(bool);
-
   // TODO(lfg): Remove once WebViewFrameWidget is deleted.
   void ScheduleAnimationForWidget();
 
@@ -667,12 +663,6 @@
 
   WebPageImportanceSignals page_importance_signals_;
 
-  // TODO(lfg): This is used in order to disable compositor visibility while
-  // the page is still visible. This is needed until the WebView and WebWidget
-  // split is complete, since in out-of-process iframes the page can be
-  // visible, but the WebView should not be used as a widget.
-  bool override_compositor_visibility_;
-
   // We defer commits when transitioning to a new page. ChromeClientImpl calls
   // StopDeferringCommits() to release this when a new page is loaded.
   std::unique_ptr<cc::ScopedDeferCommits> scoped_defer_commits_;
diff --git a/third_party/blink/renderer/core/frame/frame_test.cc b/third_party/blink/renderer/core/frame/frame_test.cc
index c3afdf2..da0c1e3 100644
--- a/third_party/blink/renderer/core/frame/frame_test.cc
+++ b/third_party/blink/renderer/core/frame/frame_test.cc
@@ -4,6 +4,7 @@
 
 #include "third_party/blink/renderer/core/frame/frame.h"
 
+#include "base/test/metrics/histogram_tester.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/blink/renderer/core/dom/user_gesture_indicator.h"
 #include "third_party/blink/renderer/core/loader/document_loader.h"
@@ -189,4 +190,33 @@
       LocalFrame::ConsumeTransientUserActivation(GetDocument().GetFrame()));
 }
 
+TEST_F(FrameTest, UserActivationHistograms) {
+  RuntimeEnabledFeatures::SetUserActivationV2Enabled(true);
+  base::HistogramTester histograms;
+
+  LocalFrame::HasTransientUserActivation(GetDocument().GetFrame());
+  histograms.ExpectBucketCount("UserActivation.AvailabilityCheck.FrameResult",
+                               0, 1);
+
+  LocalFrame::ConsumeTransientUserActivation(GetDocument().GetFrame());
+  histograms.ExpectBucketCount("UserActivation.Consumption.FrameResult", 0, 1);
+
+  LocalFrame::NotifyUserActivation(GetDocument().GetFrame());
+
+  LocalFrame::HasTransientUserActivation(GetDocument().GetFrame());
+  LocalFrame::HasTransientUserActivation(GetDocument().GetFrame());
+  histograms.ExpectBucketCount("UserActivation.AvailabilityCheck.FrameResult",
+                               3, 2);
+
+  LocalFrame::ConsumeTransientUserActivation(GetDocument().GetFrame());
+  histograms.ExpectBucketCount("UserActivation.Consumption.FrameResult", 3, 1);
+
+  LocalFrame::ConsumeTransientUserActivation(GetDocument().GetFrame());
+  histograms.ExpectBucketCount("UserActivation.Consumption.FrameResult", 0, 2);
+
+  histograms.ExpectTotalCount("UserActivation.AvailabilityCheck.FrameResult",
+                              3);
+  histograms.ExpectTotalCount("UserActivation.Consumption.FrameResult", 3);
+}
+
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
index 65c604f4..7e2d796 100644
--- a/third_party/blink/renderer/core/frame/local_frame.cc
+++ b/third_party/blink/renderer/core/frame/local_frame.cc
@@ -1463,10 +1463,45 @@
   GetSecurityContext()->ReportFeaturePolicyViolation(feature);
 }
 
+namespace {
+
+LocalFrame* user_activation_notifier_frame_ = nullptr;
+
+enum UserActivationFrameResultEnum {
+  kNullFailure = 0,
+  kNullSuccess = 1,
+  kSelfFailure = 2,
+  kSelfSuccess = 3,
+  kAncestorFailure = 4,
+  kAncestorSuccess = 5,
+  kDescendantFailure = 6,
+  kDescendantSuccess = 7,
+  kOtherFailure = 8,
+  kOtherSuccess = 9,
+  kMaxValue = kOtherSuccess
+};
+
+UserActivationFrameResultEnum determineFrameResultEnum(
+    const LocalFrame* const caller_frame,
+    const bool call_succeeded) {
+  if (!caller_frame || !user_activation_notifier_frame_)
+    return call_succeeded ? kNullSuccess : kNullFailure;
+  if (caller_frame == user_activation_notifier_frame_)
+    return call_succeeded ? kSelfSuccess : kSelfFailure;
+  if (user_activation_notifier_frame_->Tree().IsDescendantOf(caller_frame))
+    return call_succeeded ? kAncestorSuccess : kAncestorFailure;
+  if (caller_frame->Tree().IsDescendantOf(user_activation_notifier_frame_))
+    return call_succeeded ? kDescendantSuccess : kDescendantFailure;
+  return call_succeeded ? kOtherSuccess : kOtherFailure;
+}
+
+}  // namespace
+
 // static
 std::unique_ptr<UserGestureIndicator> LocalFrame::NotifyUserActivation(
     LocalFrame* frame,
     UserGestureToken::Status status) {
+  user_activation_notifier_frame_ = frame;
   if (frame)
     frame->NotifyUserActivation();
   return std::make_unique<UserGestureIndicator>(status);
@@ -1477,6 +1512,7 @@
     LocalFrame* frame,
     UserGestureToken* token) {
   DCHECK(!RuntimeEnabledFeatures::UserActivationV2Enabled());
+  user_activation_notifier_frame_ = frame;
   if (frame)
     frame->NotifyUserActivation();
   return std::make_unique<UserGestureIndicator>(token);
@@ -1485,13 +1521,19 @@
 // static
 bool LocalFrame::HasTransientUserActivation(LocalFrame* frame,
                                             bool check_if_main_thread) {
+  bool available;
+
   if (RuntimeEnabledFeatures::UserActivationV2Enabled()) {
-    return frame ? frame->HasTransientUserActivation() : false;
+    available = frame ? frame->HasTransientUserActivation() : false;
+  } else {
+    available = check_if_main_thread
+                    ? UserGestureIndicator::ProcessingUserGestureThreadSafe()
+                    : UserGestureIndicator::ProcessingUserGesture();
   }
 
-  return check_if_main_thread
-             ? UserGestureIndicator::ProcessingUserGestureThreadSafe()
-             : UserGestureIndicator::ProcessingUserGesture();
+  UMA_HISTOGRAM_ENUMERATION("UserActivation.AvailabilityCheck.FrameResult",
+                            determineFrameResultEnum(frame, available));
+  return available;
 }
 
 // static
@@ -1499,13 +1541,21 @@
     LocalFrame* frame,
     bool check_if_main_thread,
     UserActivationUpdateSource update_source) {
+  bool consumed;
+
   if (RuntimeEnabledFeatures::UserActivationV2Enabled()) {
-    return frame ? frame->ConsumeTransientUserActivation(update_source) : false;
+    consumed =
+        frame ? frame->ConsumeTransientUserActivation(update_source) : false;
+  } else {
+    consumed = check_if_main_thread
+                   ? UserGestureIndicator::ConsumeUserGestureThreadSafe()
+                   : UserGestureIndicator::ConsumeUserGesture();
   }
 
-  return check_if_main_thread
-             ? UserGestureIndicator::ConsumeUserGestureThreadSafe()
-             : UserGestureIndicator::ConsumeUserGesture();
+  UMA_HISTOGRAM_ENUMERATION("UserActivation.Consumption.FrameResult",
+                            determineFrameResultEnum(frame, consumed));
+  user_activation_notifier_frame_ = nullptr;
+  return consumed;
 }
 
 void LocalFrame::NotifyUserActivation() {
diff --git a/third_party/blink/renderer/core/frame/use_counter_test.cc b/third_party/blink/renderer/core/frame/use_counter_test.cc
index 48e57c8b..1a71851 100644
--- a/third_party/blink/renderer/core/frame/use_counter_test.cc
+++ b/third_party/blink/renderer/core/frame/use_counter_test.cc
@@ -150,15 +150,15 @@
       kSvgUrl, UseCounter::kSVGImageContext);
 }
 
-TEST_F(UseCounterTest, CSSSelectorPseudoIS) {
+TEST_F(UseCounterTest, CSSSelectorPseudoWhere) {
   std::unique_ptr<DummyPageHolder> dummy_page_holder =
       DummyPageHolder::Create(IntSize(800, 600));
   Page::InsertOrdinaryPageForTesting(&dummy_page_holder->GetPage());
   Document& document = dummy_page_holder->GetDocument();
-  WebFeature feature = WebFeature::kCSSSelectorPseudoIS;
+  WebFeature feature = WebFeature::kCSSSelectorPseudoWhere;
   EXPECT_FALSE(UseCounter::IsCounted(document, feature));
   document.documentElement()->SetInnerHTMLFromString(
-      "<style>.a+:is(.b, .c+.d) { color: red; }</style>");
+      "<style>.a+:where(.b, .c+.d) { color: red; }</style>");
   EXPECT_TRUE(UseCounter::IsCounted(document, feature));
 }
 
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index 7f2980a7..0b5eabba6 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -1457,12 +1457,6 @@
   GetFrame()->Selection().SetCaretVisible(visible);
 }
 
-VisiblePosition WebLocalFrameImpl::VisiblePositionForViewportPoint(
-    const WebPoint& point_in_viewport) {
-  return VisiblePositionForContentsPoint(
-      GetFrame()->View()->ViewportToFrame(point_in_viewport), GetFrame());
-}
-
 WebPlugin* WebLocalFrameImpl::FocusedPluginIfInputMethodSupported() {
   WebPluginContainerImpl* container = GetFrame()->GetWebPluginContainer();
   if (container && container->SupportsInputMethod())
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
index 3ab5e76..df8df74 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
@@ -424,9 +424,6 @@
   // Otherwise creates it and then returns.
   TextFinder& EnsureTextFinder();
 
-  // Returns a hit-tested VisiblePosition for the given point
-  VisiblePosition VisiblePositionForViewportPoint(const WebPoint&);
-
   void SetFrameWidget(WebFrameWidgetBase*);
 
   // TODO(dcheng): Remove this and make |FrameWidget()| always return something
diff --git a/third_party/blink/renderer/core/frame/web_view_frame_widget.cc b/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
index 41899703..9d41326 100644
--- a/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
+++ b/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
@@ -19,13 +19,7 @@
 WebViewFrameWidget::~WebViewFrameWidget() = default;
 
 void WebViewFrameWidget::Close() {
-  // Note: it's important to use the captured main frame pointer here. During
-  // a frame swap, the swapped frame is detached *after* the frame tree is
-  // updated. If the main frame is being swapped, then
-  // m_webView()->mainFrameImpl() will no longer point to the original frame.
-  web_view_->SetCompositorVisibility(false);
   web_view_ = nullptr;
-
   WebFrameWidgetBase::Close();
 
   // Note: this intentionally does not forward to WebView::close(), to make it
@@ -181,9 +175,7 @@
   return web_view_->ScrollFocusedEditableElementIntoView();
 }
 
-void WebViewFrameWidget::Initialize() {
-  web_view_->SetCompositorVisibility(true);
-}
+void WebViewFrameWidget::Initialize() {}
 
 void WebViewFrameWidget::SetLayerTreeView(WebLayerTreeView*) {
   // The WebViewImpl already has its LayerTreeView, the WebWidgetClient
diff --git a/third_party/blink/renderer/core/html/canvas/OWNERS b/third_party/blink/renderer/core/html/canvas/OWNERS
index ce5984275..5ef87b1aa 100644
--- a/third_party/blink/renderer/core/html/canvas/OWNERS
+++ b/third_party/blink/renderer/core/html/canvas/OWNERS
@@ -1,6 +1,4 @@
 fserb@chromium.org
-junov@chromium.org
-xlai@chromium.org
 
 # TEAM: paint-dev@chromium.org
 # COMPONENT: Blink>Canvas
diff --git a/third_party/blink/renderer/core/imagebitmap/OWNERS b/third_party/blink/renderer/core/imagebitmap/OWNERS
index 5bbede46..c10da38 100644
--- a/third_party/blink/renderer/core/imagebitmap/OWNERS
+++ b/third_party/blink/renderer/core/imagebitmap/OWNERS
@@ -1,4 +1,4 @@
-junov@chromium.org
+fserb@chromium.org
 zakerinasab@chromium.org
 
 # TEAM: paint-dev@chromium.org
diff --git a/third_party/blink/renderer/core/input/scroll_manager.cc b/third_party/blink/renderer/core/input/scroll_manager.cc
index 2d3358d..e254f06 100644
--- a/third_party/blink/renderer/core/input/scroll_manager.cc
+++ b/third_party/blink/renderer/core/input/scroll_manager.cc
@@ -562,13 +562,13 @@
     // native scrolling element is, so that for an
     // inertial scroll that shouldn't propagate, only the
     // currently scrolling element responds.
-    scroll_state->SetCurrentNativeScrollingElement(
+    scroll_state->SetCurrentNativeScrollingNode(
         previous_gesture_scrolled_element_);
   }
 
   CustomizedScroll(*scroll_state);
   previous_gesture_scrolled_element_ =
-      scroll_state->CurrentNativeScrollingElement();
+      ToElement(scroll_state->CurrentNativeScrollingNode());
   delta_consumed_for_scroll_sequence_ =
       scroll_state->DeltaConsumedForScrollSequence();
 
@@ -681,7 +681,7 @@
   scroll_state_data->delta_consumed_for_scroll_sequence =
       delta_consumed_for_scroll_sequence_;
   ScrollState* scroll_state = ScrollState::Create(std::move(scroll_state_data));
-  scroll_state->SetCurrentNativeScrollingElement(
+  scroll_state->SetCurrentNativeScrollingNode(
       previous_gesture_scrolled_element_);
 
   CustomizedScroll(*scroll_state);
diff --git a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
index 7ab1d326..7e258b3 100644
--- a/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
+++ b/third_party/blink/renderer/core/inspector/inspector_trace_events.cc
@@ -258,7 +258,7 @@
     DEFINE_STRING_MAPPING(PseudoVisited)
     DEFINE_STRING_MAPPING(PseudoAny)
     DEFINE_STRING_MAPPING(PseudoMatches)
-    DEFINE_STRING_MAPPING(PseudoIS)
+    DEFINE_STRING_MAPPING(PseudoWhere)
     DEFINE_STRING_MAPPING(PseudoWebkitAnyLink)
     DEFINE_STRING_MAPPING(PseudoAnyLink)
     DEFINE_STRING_MAPPING(PseudoAutofill)
@@ -371,8 +371,8 @@
   switch (reason) {
     case ScriptStreamer::kNotHTTP:
       return "not http/https protocol";
-    case ScriptStreamer::kRevalidate:
-      return "revalidation event";
+    case ScriptStreamer::kReload:
+      return "reload event";
     case ScriptStreamer::kContextNotValid:
       return "script context not valid";
     case ScriptStreamer::kEncodingNotSupported:
@@ -395,10 +395,6 @@
       return "start streaming not called";
     case ScriptStreamer::kErrorOccurred:
       return "an error occurred";
-    case ScriptStreamer::kStreamingDisabled:
-      return "already disabled streaming";
-    case ScriptStreamer::kSecondScriptResourceUse:
-      return "already used streamed data";
     case ScriptStreamer::kWorkerTopLevelScript:
       return "worker top-level scripts are not streamable";
     case ScriptStreamer::kAlreadyLoaded:
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h
index cbacb32..ff301ee8 100644
--- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h
+++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_break_token.h
@@ -12,7 +12,7 @@
 namespace blink {
 
 // Represents a break token for an inline node.
-class CORE_EXPORT NGInlineBreakToken : public NGBreakToken {
+class CORE_EXPORT NGInlineBreakToken final : public NGBreakToken {
  public:
   enum NGInlineBreakTokenFlags {
     kDefault = 0,
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_break_token.cc b/third_party/blink/renderer/core/layout/ng/ng_block_break_token.cc
index 5b81b529f..69eee90 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_break_token.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_break_token.cc
@@ -11,12 +11,16 @@
 NGBlockBreakToken::NGBlockBreakToken(
     NGLayoutInputNode node,
     LayoutUnit used_block_size,
-    Vector<scoped_refptr<NGBreakToken>>& child_break_tokens,
+    const NGBreakTokenVector& child_break_tokens,
     bool has_last_resort_break)
     : NGBreakToken(kBlockBreakToken, kUnfinished, node),
       used_block_size_(used_block_size),
-      has_last_resort_break_(has_last_resort_break) {
-  child_break_tokens_.swap(child_break_tokens);
+      has_last_resort_break_(has_last_resort_break),
+      num_children_(child_break_tokens.size()) {
+  for (wtf_size_t i = 0; i < child_break_tokens.size(); ++i) {
+    child_break_tokens_[i] = child_break_tokens[i].get();
+    child_break_tokens_[i]->AddRef();
+  }
 }
 
 NGBlockBreakToken::NGBlockBreakToken(NGLayoutInputNode node,
@@ -24,10 +28,11 @@
                                      bool has_last_resort_break)
     : NGBreakToken(kBlockBreakToken, kFinished, node),
       used_block_size_(used_block_size),
-      has_last_resort_break_(has_last_resort_break) {}
+      has_last_resort_break_(has_last_resort_break),
+      num_children_(0) {}
 
 NGBlockBreakToken::NGBlockBreakToken(NGLayoutInputNode node)
-    : NGBreakToken(kBlockBreakToken, kUnfinished, node) {}
+    : NGBreakToken(kBlockBreakToken, kUnfinished, node), num_children_(0) {}
 
 #ifndef NDEBUG
 
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_break_token.h b/third_party/blink/renderer/core/layout/ng/ng_block_break_token.h
index d87475d..143d8ef 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_break_token.h
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_break_token.h
@@ -14,23 +14,44 @@
 namespace blink {
 
 // Represents a break token for a block node.
-class CORE_EXPORT NGBlockBreakToken : public NGBreakToken {
+class CORE_EXPORT NGBlockBreakToken final : public NGBreakToken {
  public:
+  class ChildTokenList {
+   public:
+    ChildTokenList(wtf_size_t count, const NGBreakToken* const* buffer)
+        : count_(count), buffer_(buffer) {}
+
+    wtf_size_t size() const { return count_; }
+    const NGBreakToken* operator[](wtf_size_t idx) const {
+      return buffer_[idx];
+    }
+
+    const NGBreakToken* const* begin() const { return buffer_; }
+    const NGBreakToken* const* end() const { return begin() + count_; }
+
+   private:
+    wtf_size_t count_;
+    const NGBreakToken* const* buffer_;
+  };
+
   // Creates a break token for a node which did fragment, and can potentially
   // produce more fragments.
   //
-  // The NGBlockBreakToken takes ownership of child_break_tokens, leaving it
-  // empty for the caller.
-  //
   // The node is NGBlockNode, or any other NGLayoutInputNode that produces
   // anonymous box.
   static scoped_refptr<NGBlockBreakToken> Create(
       NGLayoutInputNode node,
       LayoutUnit used_block_size,
-      Vector<scoped_refptr<NGBreakToken>>& child_break_tokens,
+      const NGBreakTokenVector& child_break_tokens,
       bool has_last_resort_break = false) {
-    return base::AdoptRef(new NGBlockBreakToken(
-        node, used_block_size, child_break_tokens, has_last_resort_break));
+    NGBlockBreakToken* token =
+        static_cast<NGBlockBreakToken*>(::WTF::Partitions::FastMalloc(
+            sizeof(NGBlockBreakToken) +
+                child_break_tokens.size() * sizeof(NGBreakToken*),
+            ::WTF::GetStringWithTypeName<NGBlockBreakToken>()));
+    new (token) NGBlockBreakToken(node, used_block_size, child_break_tokens,
+                                  has_last_resort_break);
+    return base::AdoptRef(token);
   }
 
   // Creates a break token for a node which cannot produce any more fragments.
@@ -52,6 +73,11 @@
     return base::AdoptRef(token);
   }
 
+  ~NGBlockBreakToken() override {
+    for (const NGBreakToken* token : ChildBreakTokens())
+      token->Release();
+  }
+
   // Represents the amount of block size used in previous fragments.
   //
   // E.g. if the layout block specifies a block size of 200px, and the previous
@@ -75,8 +101,8 @@
   // this child).
   //
   // A child which we haven't visited yet doesn't have a break token here.
-  const Vector<scoped_refptr<NGBreakToken>>& ChildBreakTokens() const {
-    return child_break_tokens_;
+  const ChildTokenList ChildBreakTokens() const {
+    return ChildTokenList(num_children_, &child_break_tokens_[0]);
   }
 
 #ifndef NDEBUG
@@ -84,9 +110,11 @@
 #endif
 
  private:
+  // Must only be called from Create(), because it assumes that enough space
+  // has been allocated in the flexible array to store the children.
   NGBlockBreakToken(NGLayoutInputNode node,
                     LayoutUnit used_block_size,
-                    Vector<scoped_refptr<NGBreakToken>>& child_break_tokens,
+                    const NGBreakTokenVector& child_break_tokens,
                     bool has_last_resort_break);
 
   NGBlockBreakToken(NGLayoutInputNode node,
@@ -95,7 +123,6 @@
 
   explicit NGBlockBreakToken(NGLayoutInputNode node);
 
-  Vector<scoped_refptr<NGBreakToken>> child_break_tokens_;
   LayoutUnit used_block_size_;
 
   bool is_break_before_ = false;
@@ -104,6 +131,10 @@
   // unavoidable, but we should only break here if we cannot find a better break
   // point further up in the ancestry.
   bool has_last_resort_break_ = false;
+
+  wtf_size_t num_children_;
+  // This must be the last member, because it is a flexible array.
+  NGBreakToken* child_break_tokens_[];
 };
 
 DEFINE_TYPE_CASTS(NGBlockBreakToken,
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc
index e3b8336..00309e85 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator.cc
@@ -62,10 +62,10 @@
       // structure will not be of any help at all, since the break tokens will
       // be associated with nodes that are not siblings.
       while (child_token_idx_ < child_break_tokens.size()) {
-        const auto& token = child_break_tokens[child_token_idx_];
+        const auto* token = child_break_tokens[child_token_idx_];
         child_token_idx_++;
         if (!token->IsFinished())
-          return Entry(token->InputNode(), token.get());
+          return Entry(token->InputNode(), token);
       }
       return Entry(nullptr, nullptr);
     }
@@ -78,7 +78,7 @@
       // This child break token candidate doesn't match the current node, this
       // node must be unfinished.
       const NGBreakToken* child_break_token_candidate =
-          child_break_tokens[child_token_idx_].get();
+          child_break_tokens[child_token_idx_];
       if (child_break_token_candidate->InputNode() != child_)
         break;
 
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc
index 5b315e8..ecee6ef6 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_child_iterator_test.cc
@@ -54,7 +54,7 @@
   NGLayoutInputNode node2 = node1.NextSibling();
   NGLayoutInputNode node3 = node2.NextSibling();
 
-  Vector<scoped_refptr<NGBreakToken>> child_break_tokens;
+  NGBreakTokenVector child_break_tokens;
   child_break_tokens.push_back(NGBlockBreakToken::Create(node1, LayoutUnit()));
   scoped_refptr<NGBlockBreakToken> parent_token =
       NGBlockBreakToken::Create(container, LayoutUnit(50), child_break_tokens);
@@ -93,12 +93,14 @@
   NGLayoutInputNode node2 = node1.NextSibling();
   NGLayoutInputNode node3 = node2.NextSibling();
 
-  Vector<scoped_refptr<NGBreakToken>> child_break_tokens;
+  NGBreakTokenVector child_break_tokens;
   scoped_refptr<NGBreakToken> child_token =
       NGBlockBreakToken::Create(node1, LayoutUnit(), child_break_tokens);
+  child_break_tokens.clear();
   child_break_tokens.push_back(child_token);
   scoped_refptr<NGBlockBreakToken> parent_token =
       NGBlockBreakToken::Create(container, LayoutUnit(50), child_break_tokens);
+  child_break_tokens.clear();
 
   // The iterator should loop through three children, one with a break token.
   NGBlockChildIterator iterator(node1, parent_token.get());
@@ -111,9 +113,11 @@
 
   child_token =
       NGBlockBreakToken::Create(node2, LayoutUnit(), child_break_tokens);
+  child_break_tokens.clear();
   child_break_tokens.push_back(child_token);
   parent_token =
       NGBlockBreakToken::Create(container, LayoutUnit(50), child_break_tokens);
+  child_break_tokens.clear();
 
   // The first break token is for the #child2. That means that everything
   // preceding it (i.e. #child1) has already been finished. The break token for
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
index d0262149..7b6ccdd 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
@@ -404,6 +404,8 @@
       ComputeIntrinsicPadding(ConstraintSpace(), Node());
   border_scrollbar_padding_ += intrinsic_padding;
 
+  if (ConstraintSpace().HasBlockFragmentation())
+    container_builder_.SetNeedsFinishedBreakToken();
   container_builder_.SetInlineSize(border_box_size.inline_size);
   container_builder_.SetBfcLineOffset(
       ConstraintSpace().BfcOffset().line_offset);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc
index ae17cc1..a5d521b 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm_test.cc
@@ -2026,7 +2026,7 @@
   scoped_refptr<const NGPhysicalFragment> fragment =
       NGBlockLayoutAlgorithm(node, space).Layout()->PhysicalFragment();
   EXPECT_EQ(NGPhysicalSize(LayoutUnit(150), LayoutUnit(60)), fragment->Size());
-  ASSERT_TRUE(fragment->BreakToken()->IsFinished());
+  ASSERT_TRUE(!fragment->BreakToken() || fragment->BreakToken()->IsFinished());
 
   // float2 should only have one fragment.
   FragmentChildIterator iterator(ToNGPhysicalBoxFragment(fragment.get()));
@@ -2035,7 +2035,7 @@
   child = iterator.NextChild(&offset);
   EXPECT_EQ(NGPhysicalSize(LayoutUnit(60), LayoutUnit(200)), child->Size());
   EXPECT_EQ(NGPhysicalOffset(LayoutUnit(90), LayoutUnit(50)), offset);
-  ASSERT_TRUE(child->BreakToken()->IsFinished());
+  ASSERT_TRUE(!child->BreakToken() || child->BreakToken()->IsFinished());
 }
 
 // Tests that a float child inside a zero height block fragments correctly.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc
index 8030ff4..dd04b8ec 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc
@@ -220,7 +220,7 @@
     if (did_break_) {
       break_token_ = NGBlockBreakToken::Create(
           node_, used_block_size_, child_break_tokens_, has_last_resort_break_);
-    } else {
+    } else if (needs_finished_break_token_) {
       break_token_ = NGBlockBreakToken::Create(node_, used_block_size_,
                                                has_last_resort_break_);
     }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h
index 9d65926..0fb54f2c 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h
+++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.h
@@ -105,6 +105,11 @@
     return *this;
   }
 
+  NGBoxFragmentBuilder& SetNeedsFinishedBreakToken() {
+    needs_finished_break_token_ = true;
+    return *this;
+  }
+
   // Specify that we broke.
   //
   // This will result in a fragment which has an unfinished break token.
@@ -238,6 +243,7 @@
   NGPhysicalFragment::NGBoxType box_type_;
   bool is_fieldset_container_ = false;
   bool is_old_layout_root_;
+  bool needs_finished_break_token_ = false;
   bool did_break_;
   bool has_forced_break_ = false;
   LayoutUnit used_block_size_;
@@ -251,8 +257,8 @@
   // The break-after value of the previous in-flow sibling.
   EBreakBetween previous_break_after_ = EBreakBetween::kAuto;
 
-  Vector<scoped_refptr<NGBreakToken>> child_break_tokens_;
-  Vector<scoped_refptr<NGBreakToken>> inline_break_tokens_;
+  NGBreakTokenVector child_break_tokens_;
+  NGBreakTokenVector inline_break_tokens_;
 
   Vector<NGBaseline> baselines_;
 
diff --git a/third_party/blink/renderer/core/layout/ng/ng_break_token.cc b/third_party/blink/renderer/core/layout/ng/ng_break_token.cc
index 4ba888d..75bcf1f 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_break_token.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_break_token.cc
@@ -27,8 +27,8 @@
 
   if (token->Type() == NGBreakToken::kBlockBreakToken) {
     const auto children = ToNGBlockBreakToken(token)->ChildBreakTokens();
-    for (const auto& child : children)
-      AppendBreakTokenToString(child.get(), string_builder, indent + 2);
+    for (const auto* child : children)
+      AppendBreakTokenToString(child, string_builder, indent + 2);
   }
 }
 }  // namespace
diff --git a/third_party/blink/renderer/core/layout/ng/ng_break_token.h b/third_party/blink/renderer/core/layout/ng/ng_break_token.h
index 605ad81..1411147 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_break_token.h
+++ b/third_party/blink/renderer/core/layout/ng/ng_break_token.h
@@ -67,6 +67,8 @@
   NGLayoutInputNode node_;
 };
 
+typedef Vector<scoped_refptr<NGBreakToken>, 16> NGBreakTokenVector;
+
 }  // namespace blink
 
 #endif  // NGBreakToken_h
diff --git a/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc
index 49df543..d77e254 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc
@@ -216,7 +216,7 @@
 
   const auto& fragment = unpositioned_float->layout_result->PhysicalFragment();
   DCHECK(fragment);
-  DCHECK(fragment->BreakToken()->IsFinished());
+  DCHECK(!fragment->BreakToken() || fragment->BreakToken()->IsFinished());
 
   return (NGFragment(parent_space.GetWritingMode(), *fragment).InlineSize() +
           unpositioned_float->margins.InlineSum())
@@ -266,8 +266,11 @@
     if (ShouldIgnoreBlockStartMargin(parent_space, unpositioned_float->node,
                                      unpositioned_float->token.get()))
       fragment_margins.block_start = LayoutUnit();
-    if (!layout_result->PhysicalFragment()->BreakToken()->IsFinished())
-      fragment_margins.block_end = LayoutUnit();
+    if (const NGBreakToken* break_token =
+            layout_result->PhysicalFragment()->BreakToken()) {
+      if (!break_token->IsFinished())
+        fragment_margins.block_end = LayoutUnit();
+    }
   }
 
   DCHECK(layout_result->PhysicalFragment());
diff --git a/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc
index 7884717..26d6ab1 100644
--- a/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc
+++ b/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc
@@ -100,14 +100,10 @@
   if (NGBaseline::ShouldPropagateBaselines(Node()))
     space_builder.AddBaselineRequests(ConstraintSpace().BaselineRequests());
 
-  // TODO(mstensho): Handle auto block size. For now just disable fragmentation
-  // if block size is auto. With the current approach, we'll just end up with
-  // one tall page. This is only correct if there are no explicit page breaks.
-  if (page_size.block_size != NGSizeIndefinite) {
-    space_builder.SetFragmentationType(kFragmentPage);
-    space_builder.SetFragmentainerBlockSize(page_size.block_size);
-    space_builder.SetFragmentainerSpaceAtBfcStart(page_size.block_size);
-  }
+  // TODO(mstensho): Handle auto block size.
+  space_builder.SetFragmentationType(kFragmentPage);
+  space_builder.SetFragmentainerBlockSize(page_size.block_size);
+  space_builder.SetFragmentainerSpaceAtBfcStart(page_size.block_size);
   space_builder.SetIsNewFormattingContext(true);
   space_builder.SetIsAnonymous(true);
 
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
index a0911d6d..510e197 100644
--- a/third_party/blink/renderer/core/loader/document_loader.cc
+++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -266,8 +266,7 @@
       break;
     case ResourceType::kScript:
       params.SetRequestContext(mojom::RequestContextType::SCRIPT);
-      resource = ScriptResource::Fetch(params, Fetcher(), nullptr,
-                                       ScriptResource::kAllowStreaming);
+      resource = ScriptResource::Fetch(params, Fetcher(), nullptr);
       break;
     case ResourceType::kCSSStyleSheet:
       resource = CSSStyleSheetResource::Fetch(params, Fetcher(), nullptr);
diff --git a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
index 1c808c33..da5a8736 100644
--- a/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
+++ b/third_party/blink/renderer/core/loader/modulescript/document_module_script_fetcher.cc
@@ -27,8 +27,7 @@
   if (FetchIfLayeredAPI(fetch_params))
     return;
 
-  ScriptResource::Fetch(fetch_params, fetcher_, this,
-                        ScriptResource::kNoStreaming);
+  ScriptResource::Fetch(fetch_params, fetcher_, this);
 }
 
 void DocumentModuleScriptFetcher::NotifyFinished(Resource* resource) {
diff --git a/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc b/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc
index d2b1e4ad..e11bb7a9 100644
--- a/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc
+++ b/third_party/blink/renderer/core/loader/modulescript/module_script_loader_test.cc
@@ -217,10 +217,8 @@
   TestModuleScriptLoaderClient* client = new TestModuleScriptLoaderClient;
   TestFetchDataURL(ModuleScriptCustomFetchType::kNone, client);
 
-  // TODO(leszeks): This should finish synchronously, but currently due
-  // to the script resource/script streamer interaction, it does not.
-  RunUntilIdle();
-  EXPECT_TRUE(client->WasNotifyFinished());
+  EXPECT_TRUE(client->WasNotifyFinished())
+      << "ModuleScriptLoader should finish synchronously.";
   ASSERT_TRUE(client->GetModuleScript());
   EXPECT_FALSE(client->GetModuleScript()->HasEmptyRecord());
   EXPECT_FALSE(client->GetModuleScript()->HasParseError());
@@ -274,11 +272,8 @@
   TestModuleScriptLoaderClient* client = new TestModuleScriptLoaderClient;
   TestInvalidSpecifier(ModuleScriptCustomFetchType::kNone, client);
 
-  // TODO(leszeks): This should finish synchronously, but currently due
-  // to the script resource/script streamer interaction, it does not.
-  RunUntilIdle();
-  EXPECT_TRUE(client->WasNotifyFinished());
-
+  EXPECT_TRUE(client->WasNotifyFinished())
+      << "ModuleScriptLoader should finish synchronously.";
   ASSERT_TRUE(client->GetModuleScript());
   EXPECT_TRUE(client->GetModuleScript()->HasEmptyRecord());
   EXPECT_TRUE(client->GetModuleScript()->HasParseError());
@@ -318,10 +313,8 @@
   TestModuleScriptLoaderClient* client = new TestModuleScriptLoaderClient;
   TestFetchInvalidURL(ModuleScriptCustomFetchType::kNone, client);
 
-  // TODO(leszeks): This should finish synchronously, but currently due
-  // to the script resource/script streamer interaction, it does not.
-  RunUntilIdle();
-  EXPECT_TRUE(client->WasNotifyFinished());
+  EXPECT_TRUE(client->WasNotifyFinished())
+      << "ModuleScriptLoader should finish synchronously.";
   EXPECT_FALSE(client->GetModuleScript());
 }
 
@@ -362,9 +355,6 @@
   EXPECT_FALSE(client->WasNotifyFinished())
       << "ModuleScriptLoader unexpectedly finished synchronously.";
   platform_->GetURLLoaderMockFactory()->ServeAsynchronousRequests();
-  // TODO(leszeks): This should finish synchronously, but currently due
-  // to the script resource/script streamer interaction, it does not.
-  RunUntilIdle();
 
   EXPECT_TRUE(client->WasNotifyFinished());
   EXPECT_TRUE(client->GetModuleScript());
diff --git a/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc
index 205564c8..092915a99 100644
--- a/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc
+++ b/third_party/blink/renderer/core/loader/modulescript/worker_module_script_fetcher.cc
@@ -33,8 +33,7 @@
   // Step 13.2. "Fetch request, and asynchronously wait to run the remaining
   // steps as part of fetch's process response for the response response." [spec
   // text]
-  ScriptResource::Fetch(fetch_params, global_scope_->EnsureFetcher(), this,
-                        ScriptResource::kNoStreaming);
+  ScriptResource::Fetch(fetch_params, global_scope_->EnsureFetcher(), this);
 }
 
 void WorkerModuleScriptFetcher::Trace(blink::Visitor* visitor) {
diff --git a/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc b/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc
index 8f3811c..b14d8929 100644
--- a/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc
+++ b/third_party/blink/renderer/core/loader/modulescript/worklet_module_script_fetcher.cc
@@ -38,8 +38,7 @@
   // need to handle that case, maybe by having a way to restart fetches in a
   // different global scope?
   url_ = fetch_params.Url();
-  ScriptResource::Fetch(fetch_params, fetcher_.Get(), this,
-                        ScriptResource::kNoStreaming);
+  ScriptResource::Fetch(fetch_params, fetcher_.Get(), this);
 }
 
 void WorkletModuleScriptFetcher::NotifyFinished(Resource* resource) {
diff --git a/third_party/blink/renderer/core/loader/resource/script_resource.cc b/third_party/blink/renderer/core/loader/resource/script_resource.cc
index ef17169a..3662eb4 100644
--- a/third_party/blink/renderer/core/loader/resource/script_resource.cc
+++ b/third_party/blink/renderer/core/loader/resource/script_resource.cc
@@ -71,33 +71,13 @@
 
 ScriptResource* ScriptResource::Fetch(FetchParameters& params,
                                       ResourceFetcher* fetcher,
-                                      ResourceClient* client,
-                                      StreamingAllowed streaming_allowed) {
+                                      ResourceClient* client) {
   DCHECK_EQ(params.GetResourceRequest().GetFrameType(),
             network::mojom::RequestContextFrameType::kNone);
   DCHECK(IsRequestContextSupported(
       params.GetResourceRequest().GetRequestContext()));
-  ScriptResource* resource = ToScriptResource(
+  return ToScriptResource(
       fetcher->RequestResource(params, ScriptResourceFactory(), client));
-
-  if (streaming_allowed != kAllowStreaming) {
-    // Advance the |streaming_state_| to kStreamingNotAllowed by calling
-    // SetClientIsWaitingForFinished unless it is explicitly allowed.'
-    //
-    // Do this in a task rather than directly to make sure that we don't call
-    // the finished callbacks of other clients synchronously.
-
-    // TODO(leszeks): Previous behaviour, without script streaming, was to
-    // synchronously notify the given client, with the assumption that other
-    // clients were already finished. If this behaviour becomes necessary, we
-    // would have to either check that streaming wasn't started (if that would
-    // be a logic error), or cancel any existing streaming.
-    fetcher->Context().GetLoadingTaskRunner()->PostTask(
-        FROM_HERE, WTF::Bind(&ScriptResource::SetClientIsWaitingForFinished,
-                             WrapWeakPersistent(resource)));
-  }
-
-  return resource;
 }
 
 ScriptResource::ScriptResource(
@@ -111,11 +91,6 @@
 
 ScriptResource::~ScriptResource() = default;
 
-void ScriptResource::Trace(blink::Visitor* visitor) {
-  visitor->Trace(streamer_);
-  TextResource::Trace(visitor);
-}
-
 void ScriptResource::OnMemoryDump(WebMemoryDumpLevelOfDetail level_of_detail,
                                   WebProcessMemoryDump* memory_dump) const {
   Resource::OnMemoryDump(level_of_detail, memory_dump);
@@ -127,7 +102,7 @@
 }
 
 const ParkableString& ScriptResource::SourceText() {
-  CHECK(IsFinishedInternal());
+  DCHECK(IsLoaded());
 
   if (source_text_.IsNull() && Data()) {
     String source_text = DecodedText();
@@ -160,27 +135,9 @@
 
 void ScriptResource::DestroyDecodedDataForFailedRevalidation() {
   source_text_ = ParkableString();
-  // Make sure there's no streaming.
-  DCHECK(!streamer_);
-  DCHECK_EQ(streaming_state_, StreamingState::kStreamingNotAllowed);
   SetDecodedSize(0);
 }
 
-void ScriptResource::SetRevalidatingRequest(const ResourceRequest& request) {
-  CHECK_EQ(streaming_state_, StreamingState::kFinishedNotificationSent);
-  if (streamer_) {
-    CHECK(streamer_->IsStreamingFinished());
-    streamer_ = nullptr;
-  }
-  // Revalidation requests don't actually load the current Resource, so disable
-  // streaming.
-  not_streaming_reason_ = ScriptStreamer::kRevalidate;
-  streaming_state_ = StreamingState::kStreamingNotAllowed;
-  CheckStreamingState();
-
-  TextResource::SetRevalidatingRequest(request);
-}
-
 AccessControlStatus ScriptResource::CalculateAccessControlStatus() const {
   DCHECK_NE(GetResponse().GetType(), network::mojom::FetchResponseType::kError);
   return GetResponse().IsCORSSameOrigin() ? kSharableCrossOrigin
@@ -194,197 +151,7 @@
   if (HasClientsOrObservers())
     return false;
 
-  // Do not revalidate until streaming is complete.
-  if (!IsFinishedInternal())
-    return false;
-
   return Resource::CanUseCacheValidator();
 }
 
-void ScriptResource::NotifyDataReceived(const char* data, size_t size) {
-  CheckStreamingState();
-  if (streamer_) {
-    DCHECK_EQ(streaming_state_, StreamingState::kStreaming);
-    streamer_->NotifyAppendData();
-  }
-  TextResource::NotifyDataReceived(data, size);
-}
-
-void ScriptResource::NotifyFinished() {
-  DCHECK(IsLoaded());
-  switch (streaming_state_) {
-    case StreamingState::kCanStartStreaming:
-      // Do nothing, expect either a StartStreaming() call to transition us to
-      // kStreaming, or an SetClientIsWaitingForFinished() call to transition us
-      // into kStreamingNotAllowed. These will then transition again since
-      // IsLoaded will be true.
-      break;
-    case StreamingState::kStreaming:
-      AdvanceStreamingState(StreamingState::kWaitingForStreamingToEnd);
-      DCHECK(streamer_);
-      streamer_->NotifyFinished();
-      // Don't call the base NotifyFinished until streaming finishes too (which
-      // might happen immediately in the above ScriptStreamer::NotifyFinished
-      // call)
-      break;
-    case StreamingState::kStreamingNotAllowed:
-      AdvanceStreamingState(StreamingState::kFinishedNotificationSent);
-      TextResource::NotifyFinished();
-      break;
-    case StreamingState::kWaitingForStreamingToEnd:
-    case StreamingState::kFinishedNotificationSent:
-      // Not possible.
-      CHECK(false);
-      break;
-  }
-}
-
-bool ScriptResource::IsFinishedInternal() const {
-  CheckStreamingState();
-  return streaming_state_ == StreamingState::kFinishedNotificationSent;
-}
-
-void ScriptResource::StreamingFinished() {
-  CHECK(streamer_);
-  CHECK_EQ(streaming_state_, StreamingState::kWaitingForStreamingToEnd);
-  AdvanceStreamingState(StreamingState::kFinishedNotificationSent);
-  TextResource::NotifyFinished();
-}
-
-void ScriptResource::StartStreaming(
-    scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner) {
-  CheckStreamingState();
-
-  if (streamer_) {
-    return;
-  }
-
-  if (streaming_state_ != StreamingState::kCanStartStreaming) {
-    return;
-  }
-
-  // Don't bother streaming if there was an error, it won't work anyway.
-  if (ErrorOccurred()) {
-    return;
-  }
-
-  CHECK(!IsCacheValidator());
-
-  streamer_ =
-      ScriptStreamer::Create(this, loading_task_runner, &not_streaming_reason_);
-  if (streamer_) {
-    AdvanceStreamingState(StreamingState::kStreaming);
-
-    // If there is any data already, send it to the streamer.
-    if (Data()) {
-      // Note that we don't need to iterate through the segments of the data, as
-      // the streamer will do that itself.
-      CHECK_GT(Data()->size(), 0u);
-      streamer_->NotifyAppendData();
-    }
-    // If the we're is already loaded, notify the streamer about that too.
-    if (IsLoaded()) {
-      AdvanceStreamingState(StreamingState::kWaitingForStreamingToEnd);
-
-      // Do this in a task rather than directly to make sure that we don't call
-      // the finished callback in the same stack as starting streaming -- this
-      // can cause issues with the client expecting to be not finished when
-      // starting streaming (e.g. ClassicPendingScript::IsReady == false), but
-      // ending up finished by the end of this method.
-      loading_task_runner->PostTask(FROM_HERE,
-                                    WTF::Bind(&ScriptStreamer::NotifyFinished,
-                                              WrapPersistent(streamer_.Get())));
-    }
-  }
-
-  CheckStreamingState();
-  return;
-}
-
-void ScriptResource::SetClientIsWaitingForFinished() {
-  // No-op if streaming already started or finished.
-  CheckStreamingState();
-  if (streaming_state_ != StreamingState::kCanStartStreaming)
-    return;
-
-  AdvanceStreamingState(StreamingState::kStreamingNotAllowed);
-  not_streaming_reason_ = ScriptStreamer::kStreamingDisabled;
-  // Trigger the finished notification if needed.
-  if (IsLoaded()) {
-    AdvanceStreamingState(StreamingState::kFinishedNotificationSent);
-    TextResource::NotifyFinished();
-  }
-}
-
-ScriptStreamer* ScriptResource::TakeStreamer() {
-  CHECK(IsFinishedInternal());
-  if (!streamer_)
-    return nullptr;
-
-  ScriptStreamer* streamer = streamer_;
-  streamer_ = nullptr;
-  not_streaming_reason_ = ScriptStreamer::kSecondScriptResourceUse;
-  return streamer;
-}
-
-void ScriptResource::AdvanceStreamingState(StreamingState new_state) {
-  switch (streaming_state_) {
-    case StreamingState::kCanStartStreaming:
-      CHECK(new_state == StreamingState::kStreaming ||
-            new_state == StreamingState::kStreamingNotAllowed);
-      break;
-    case StreamingState::kStreaming:
-      CHECK(streamer_);
-      CHECK_EQ(new_state, StreamingState::kWaitingForStreamingToEnd);
-      break;
-    case StreamingState::kWaitingForStreamingToEnd:
-      CHECK(streamer_);
-      CHECK_EQ(new_state, StreamingState::kFinishedNotificationSent);
-      break;
-    case StreamingState::kStreamingNotAllowed:
-      CHECK_EQ(new_state, StreamingState::kFinishedNotificationSent);
-      break;
-    case StreamingState::kFinishedNotificationSent:
-      CHECK(false);
-      break;
-  }
-
-  streaming_state_ = new_state;
-  CheckStreamingState();
-}
-
-void ScriptResource::CheckStreamingState() const {
-  // TODO(leszeks): Eventually convert these CHECKs into DCHECKs once the logic
-  // is a bit more baked in.
-  switch (streaming_state_) {
-    case StreamingState::kCanStartStreaming:
-      CHECK(!streamer_);
-      break;
-    case StreamingState::kStreaming:
-      CHECK(streamer_);
-      CHECK(!streamer_->IsFinished());
-      // kStreaming can be entered both when loading (if streaming is started
-      // before load completes) or when loaded (if streaming is started after
-      // load completes). In the latter case, the state will almost immediately
-      // advance to kWaitingForStreamingToEnd.
-      CHECK(IsLoaded() || IsLoading());
-      break;
-    case StreamingState::kWaitingForStreamingToEnd:
-      CHECK(streamer_);
-      CHECK(!streamer_->IsFinished());
-      CHECK(IsLoaded());
-      break;
-    case StreamingState::kStreamingNotAllowed:
-      CHECK(!streamer_);
-      // TODO(leszeks): We could CHECK(!IsLoaded()) if not for the immediate
-      // kCanStartStreaming -> kStreamingNotAllowed -> kFinishedNotificationSent
-      // transition in SetClientIsWaitingForFinished when IsLoaded.
-      break;
-    case StreamingState::kFinishedNotificationSent:
-      CHECK(!streamer_ || streamer_->IsFinished());
-      CHECK(IsLoaded());
-      break;
-  }
-}
-
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/loader/resource/script_resource.h b/third_party/blink/renderer/core/loader/resource/script_resource.h
index 2e7b30bc..0c4d7ef 100644
--- a/third_party/blink/renderer/core/loader/resource/script_resource.h
+++ b/third_party/blink/renderer/core/loader/resource/script_resource.h
@@ -28,7 +28,6 @@
 
 #include <memory>
 
-#include "third_party/blink/renderer/bindings/core/v8/script_streamer.h"
 #include "third_party/blink/renderer/core/core_export.h"
 #include "third_party/blink/renderer/core/loader/resource/text_resource.h"
 #include "third_party/blink/renderer/platform/bindings/parkable_string.h"
@@ -44,34 +43,11 @@
 class KURL;
 class ResourceFetcher;
 
-// ScriptResource is a resource representing a JavaScript script. It is only
-// used for "classic" scripts, i.e. not modules.
-//
-// In addition to loading the script, a ScriptResource can optionally stream the
-// script to the JavaScript parser/compiler, using a ScriptStreamer. In this
-// case, clients of the ScriptResource will not receive the finished
-// notification until the streaming completes.
-//
-// See also:
-// https://docs.google.com/document/d/143GOPl_XVgLPFfO-31b_MdBcnjklLEX2OIg_6eN6fQ4
 class CORE_EXPORT ScriptResource final : public TextResource {
  public:
-  // For scripts fetched with kAllowStreaming, the ScriptResource expects users
-  // to call StartStreaming to start streaming the loaded data, and
-  // SetClientIsWaitingForFinished when they actually want the data to be
-  // available for execute. Note that StartStreaming can fail, so the client of
-  // an unfinished resource has to call SetClientIsWaitingForFinished to
-  // guarantee that it receives a finished callback.
-  //
-  // Scripts fetched with kNoStreaming will (asynchronously) call
-  // SetClientIsWaitingForFinished on the resource, so the user does not have to
-  // call it again. This is effectively the "legacy" behaviour.
-  enum StreamingAllowed { kNoStreaming, kAllowStreaming };
-
   static ScriptResource* Fetch(FetchParameters&,
                                ResourceFetcher*,
-                               ResourceClient*,
-                               StreamingAllowed);
+                               ResourceClient*);
 
   // Public for testing
   static ScriptResource* CreateForTest(const KURL& url,
@@ -87,92 +63,24 @@
 
   ~ScriptResource() override;
 
-  void Trace(blink::Visitor*) override;
-
   void OnMemoryDump(WebMemoryDumpLevelOfDetail,
                     WebProcessMemoryDump*) const override;
 
+  void DestroyDecodedDataForFailedRevalidation() override;
+
   void SetSerializedCachedMetadata(const char*, size_t) override;
 
-  void StartStreaming(
-      scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner);
-
-  // State that a client of the script resource will no longer try to start
-  // streaming, and is now waiting for the resource to call the client's finish
-  // callback (regardless of whether the resource is finished loading or
-  // finished streaming). Specifically, it causes the kCanStartStreaming to
-  // kStreamingNotAllowed transition. Streaming cannot be started after this is
-  // called.
-  //
-  // If the resource is already streaming, this will be a no-op, and the client
-  // will still only get the finished notification when the streaming completes.
-  //
-  // This function should never be called synchronously (except by
-  // NotifyFinished) as it can trigger all clients' finished callbacks, which in
-  // turn can invoke JavaScript execution.
-  //
-  // TODO(leszeks): Eventually Fetch (with streaming allowed) will be the only
-  // way of starting streaming, and SetClientIsWaitingForFinished will not be
-  // part of the public interface.
-  void SetClientIsWaitingForFinished();
-
-  // Called (only) by ScriptStreamer when streaming completes.
-  //
-  // This function should never be called synchronously as it can trigger all
-  // clients' finished callbacks, which in turn can invoke JavaScript execution.
-  void StreamingFinished();
-
   const ParkableString& SourceText();
 
   AccessControlStatus CalculateAccessControlStatus() const;
 
   SingleCachedMetadataHandler* CacheHandler();
 
-  // Gets the script streamer from the ScriptResource, clearing the resource's
-  // streamer so that it cannot be used twice.
-  ScriptStreamer* TakeStreamer();
-
-  ScriptStreamer::NotStreamingReason NoStreamerReason() const {
-    return not_streaming_reason_;
-  }
-
-  // Used in DCHECKs
-  bool HasStreamer() { return !!streamer_; }
-  bool HasRunningStreamer() { return streamer_ && !streamer_->IsFinished(); }
-  bool HasFinishedStreamer() { return streamer_ && streamer_->IsFinished(); }
-
-  // Visible for tests.
-  void SetRevalidatingRequest(const ResourceRequest&) override;
-
  protected:
   CachedMetadataHandler* CreateCachedMetadataHandler(
       std::unique_ptr<CachedMetadataSender> send_callback) override;
 
-  void DestroyDecodedDataForFailedRevalidation() override;
-
-  void NotifyDataReceived(const char* data, size_t size) override;
-
-  // ScriptResources are considered finished when either:
-  //   1. Loading + streaming completes, or
-  //   2. Loading completes + streaming was never started + someone called
-  //      "SetClientIsWaitingForFinished" to block streaming from ever starting.
-  void NotifyFinished() override;
-  bool IsFinishedInternal() const override;
-
  private:
-  // Valid state transitions:
-  //
-  // kCanStartStreaming -> kStreaming -> kWaitingForStreamingToEnd
-  //                                                -> kFinishedNotificationSent
-  // kCanStartStreaming -> kStreamingNotAllowed -> kFinishedNotificationSent
-  enum class StreamingState {
-    kCanStartStreaming,         // Streaming can be started.
-    kStreamingNotAllowed,       // Streaming can no longer be started.
-    kStreaming,                 // Both loading the resource and streaming.
-    kWaitingForStreamingToEnd,  // Resource loaded but streaming not complete.
-    kFinishedNotificationSent   // Everything complete and finish sent.
-  };
-
   class ScriptResourceFactory : public ResourceFactory {
    public:
     ScriptResourceFactory()
@@ -193,16 +101,7 @@
 
   bool CanUseCacheValidator() const override;
 
-  void AdvanceStreamingState(StreamingState new_state);
-
-  // Check that invariants for the state hold.
-  void CheckStreamingState() const;
-
   ParkableString source_text_;
-  Member<ScriptStreamer> streamer_;
-  ScriptStreamer::NotStreamingReason not_streaming_reason_ =
-      ScriptStreamer::kDidntTryToStartStreaming;
-  StreamingState streaming_state_ = StreamingState::kCanStartStreaming;
 };
 
 DEFINE_RESOURCE_TYPE_CASTS(Script);
diff --git a/third_party/blink/renderer/core/mojo/README.md b/third_party/blink/renderer/core/mojo/README.md
index f3b5998..c6fe75b 100644
--- a/third_party/blink/renderer/core/mojo/README.md
+++ b/third_party/blink/renderer/core/mojo/README.md
@@ -3,7 +3,7 @@
 
 The JavaScript system API exposes the capabilities to create message pipes, data
 pipes, shared buffers and watchers. The API is defined using Web IDL. You could
-find the IDL files [here](https://cs.chromium.org/chromium/src/third_party/blink/Source/core/mojo/).
+find the IDL files [here](https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/mojo/)
 
 Please refer to the low-level [C system API](/mojo/public/c/system/README.md)
 for more detailed documentation of equivalent methods.
diff --git a/third_party/blink/renderer/core/page/scrolling/root_scroller_util.cc b/third_party/blink/renderer/core/page/scrolling/root_scroller_util.cc
index 9b77a62..c2111cc2 100644
--- a/third_party/blink/renderer/core/page/scrolling/root_scroller_util.cc
+++ b/third_party/blink/renderer/core/page/scrolling/root_scroller_util.cc
@@ -90,11 +90,11 @@
   return &layer == root_scroller_layer;
 }
 
-bool IsGlobal(const Element* element) {
-  return element->GetDocument()
+bool IsGlobal(const Node* node) {
+  return node->GetDocument()
              .GetPage()
              ->GlobalRootScrollerController()
-             .GlobalRootScroller() == element;
+             .GlobalRootScroller() == node;
 }
 
 }  // namespace RootScrollerUtil
diff --git a/third_party/blink/renderer/core/page/scrolling/root_scroller_util.h b/third_party/blink/renderer/core/page/scrolling/root_scroller_util.h
index e614ed73..8e6796b83 100644
--- a/third_party/blink/renderer/core/page/scrolling/root_scroller_util.h
+++ b/third_party/blink/renderer/core/page/scrolling/root_scroller_util.h
@@ -7,7 +7,6 @@
 
 namespace blink {
 
-class Element;
 class LayoutBox;
 class Node;
 class PaintLayer;
@@ -27,7 +26,7 @@
 
 bool IsGlobal(const LayoutBox&);
 bool IsGlobal(const PaintLayer&);
-bool IsGlobal(const Element*);
+bool IsGlobal(const Node*);
 
 }  // namespace RootScrollerUtil
 
diff --git a/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.cc b/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.cc
index e47d0740..c3101a9 100644
--- a/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.cc
+++ b/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.cc
@@ -4,51 +4,49 @@
 
 #include "third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h"
 
+#include "third_party/blink/renderer/core/dom/node.h"
 #include "third_party/blink/renderer/core/page/scrolling/scroll_state_callback.h"
 
 namespace blink {
 
 void ScrollCustomizationCallbacks::SetDistributeScroll(
-    Element* element,
+    Node* node,
     ScrollStateCallback* scroll_state_callback) {
-  distribute_scroll_callbacks_.Set(element, scroll_state_callback);
+  distribute_scroll_callbacks_.Set(node, scroll_state_callback);
 }
 
 ScrollStateCallback* ScrollCustomizationCallbacks::GetDistributeScroll(
-    Element* element) {
-  auto it = distribute_scroll_callbacks_.find(element);
+    Node* node) {
+  auto it = distribute_scroll_callbacks_.find(node);
   if (it == distribute_scroll_callbacks_.end())
     return nullptr;
   return it->value.Get();
 }
 
 void ScrollCustomizationCallbacks::SetApplyScroll(
-    Element* element,
+    Node* node,
     ScrollStateCallback* scroll_state_callback) {
-  apply_scroll_callbacks_.Set(element, scroll_state_callback);
+  apply_scroll_callbacks_.Set(node, scroll_state_callback);
 }
 
-void ScrollCustomizationCallbacks::RemoveApplyScroll(Element* element) {
-  apply_scroll_callbacks_.erase(element);
+void ScrollCustomizationCallbacks::RemoveApplyScroll(Node* node) {
+  apply_scroll_callbacks_.erase(node);
 }
 
-ScrollStateCallback* ScrollCustomizationCallbacks::GetApplyScroll(
-    Element* element) {
-  auto it = apply_scroll_callbacks_.find(element);
+ScrollStateCallback* ScrollCustomizationCallbacks::GetApplyScroll(Node* node) {
+  auto it = apply_scroll_callbacks_.find(node);
   if (it == apply_scroll_callbacks_.end())
     return nullptr;
   return it->value.Get();
 }
 
-bool ScrollCustomizationCallbacks::InScrollPhase(Element* element) const {
-  return in_scrolling_phase_.Contains(element) &&
-         in_scrolling_phase_.at(element);
+bool ScrollCustomizationCallbacks::InScrollPhase(Node* node) const {
+  return in_scrolling_phase_.Contains(node) && in_scrolling_phase_.at(node);
 }
 
-void ScrollCustomizationCallbacks::SetInScrollPhase(Element* element,
-                                                    bool value) {
-  DCHECK(element);
-  in_scrolling_phase_.Set(element, value);
+void ScrollCustomizationCallbacks::SetInScrollPhase(Node* node, bool value) {
+  DCHECK(node);
+  in_scrolling_phase_.Set(node, value);
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h b/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h
index 73c90ae9..f5ce11a 100644
--- a/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h
+++ b/third_party/blink/renderer/core/page/scrolling/scroll_customization_callbacks.h
@@ -7,25 +7,25 @@
 
 #include "base/macros.h"
 #include "third_party/blink/renderer/core/core_export.h"
-#include "third_party/blink/renderer/core/dom/element.h"
 #include "third_party/blink/renderer/platform/heap/handle.h"
 #include "third_party/blink/renderer/platform/wtf/hash_map.h"
 
 namespace blink {
 
+class Node;
 class ScrollStateCallback;
 
 class CORE_EXPORT ScrollCustomizationCallbacks
     : public GarbageCollected<ScrollCustomizationCallbacks> {
  public:
   ScrollCustomizationCallbacks() = default;
-  void SetDistributeScroll(Element*, ScrollStateCallback*);
-  ScrollStateCallback* GetDistributeScroll(Element*);
-  void SetApplyScroll(Element*, ScrollStateCallback*);
-  void RemoveApplyScroll(Element*);
-  ScrollStateCallback* GetApplyScroll(Element*);
-  bool InScrollPhase(Element*) const;
-  void SetInScrollPhase(Element*, bool);
+  void SetDistributeScroll(Node*, ScrollStateCallback*);
+  ScrollStateCallback* GetDistributeScroll(Node*);
+  void SetApplyScroll(Node*, ScrollStateCallback*);
+  void RemoveApplyScroll(Node*);
+  ScrollStateCallback* GetApplyScroll(Node*);
+  bool InScrollPhase(Node*) const;
+  void SetInScrollPhase(Node*, bool);
 
   void Trace(blink::Visitor* visitor) {
     visitor->Trace(apply_scroll_callbacks_);
@@ -35,10 +35,10 @@
 
  private:
   using ScrollStateCallbackList =
-      HeapHashMap<WeakMember<Element>, Member<ScrollStateCallback>>;
+      HeapHashMap<WeakMember<Node>, Member<ScrollStateCallback>>;
   ScrollStateCallbackList apply_scroll_callbacks_;
   ScrollStateCallbackList distribute_scroll_callbacks_;
-  HeapHashMap<WeakMember<Element>, bool> in_scrolling_phase_;
+  HeapHashMap<WeakMember<Node>, bool> in_scrolling_phase_;
 
   DISALLOW_COPY_AND_ASSIGN(ScrollCustomizationCallbacks);
 };
diff --git a/third_party/blink/renderer/core/page/scrolling/scroll_state.cc b/third_party/blink/renderer/core/page/scrolling/scroll_state.cc
index 593cc999..f83af45 100644
--- a/third_party/blink/renderer/core/page/scrolling/scroll_state.cc
+++ b/third_party/blink/renderer/core/page/scrolling/scroll_state.cc
@@ -13,15 +13,13 @@
 namespace blink {
 
 namespace {
-Element* ElementForId(DOMNodeId element_id) {
-  Node* node = DOMNodeIds::NodeForId(element_id);
+Node* NodeForId(DOMNodeId node_id) {
+  Node* node = DOMNodeIds::NodeForId(node_id);
   DCHECK(node);
   if (!node)
     return nullptr;
   DCHECK(node->IsElementNode());
-  if (!node->IsElementNode())
-    return nullptr;
-  return static_cast<Element*>(node);
+  return node;
 }
 }  // namespace
 
@@ -77,7 +75,7 @@
   if (!scroll_chain_.empty()) {
     DOMNodeId descendant_id = scroll_chain_.front();
     scroll_chain_.pop_front();
-    ElementForId(descendant_id)->CallDistributeScroll(*this);
+    NodeForId(descendant_id)->CallDistributeScroll(*this);
   }
 }
 
@@ -93,18 +91,18 @@
     data_->delta_consumed_for_scroll_sequence = true;
 }
 
-Element* ScrollState::CurrentNativeScrollingElement() {
+Node* ScrollState::CurrentNativeScrollingNode() {
   if (data_->current_native_scrolling_element() == CompositorElementId()) {
-    element_.Clear();
+    node_.Clear();
     return nullptr;
   }
-  return element_;
+  return node_;
 }
 
-void ScrollState::SetCurrentNativeScrollingElement(Element* element) {
-  element_ = element;
+void ScrollState::SetCurrentNativeScrollingNode(Node* node) {
+  node_ = node;
   data_->set_current_native_scrolling_element(
-      CompositorElementIdFromDOMNodeId(DOMNodeIds::IdForNode(element)));
+      CompositorElementIdFromDOMNodeId(DOMNodeIds::IdForNode(node)));
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/page/scrolling/scroll_state.h b/third_party/blink/renderer/core/page/scrolling/scroll_state.h
index d677b04e..4104b56 100644
--- a/third_party/blink/renderer/core/page/scrolling/scroll_state.h
+++ b/third_party/blink/renderer/core/page/scrolling/scroll_state.h
@@ -9,7 +9,7 @@
 #include <memory>
 #include "third_party/blink/renderer/core/core_export.h"
 #include "third_party/blink/renderer/core/dom/dom_node_ids.h"
-#include "third_party/blink/renderer/core/dom/element.h"
+#include "third_party/blink/renderer/core/dom/node.h"
 #include "third_party/blink/renderer/core/page/scrolling/scroll_state_init.h"
 #include "third_party/blink/renderer/core/scroll/scroll_state_data.h"
 #include "third_party/blink/renderer/platform/bindings/exception_state.h"
@@ -18,8 +18,6 @@
 
 namespace blink {
 
-class Element;
-
 class CORE_EXPORT ScrollState final : public ScriptWrappable {
   DEFINE_WRAPPERTYPEINFO();
 
@@ -73,8 +71,8 @@
     scroll_chain_ = scroll_chain;
   }
 
-  Element* CurrentNativeScrollingElement();
-  void SetCurrentNativeScrollingElement(Element*);
+  Node* CurrentNativeScrollingNode();
+  void SetCurrentNativeScrollingNode(Node*);
 
   bool DeltaConsumedForScrollSequence() const {
     return data_->delta_consumed_for_scroll_sequence;
@@ -90,7 +88,7 @@
   ScrollStateData* Data() const { return data_.get(); }
 
   void Trace(blink::Visitor* visitor) override {
-    visitor->Trace(element_);
+    visitor->Trace(node_);
     ScriptWrappable::Trace(visitor);
   }
 
@@ -100,7 +98,7 @@
 
   std::unique_ptr<ScrollStateData> data_;
   std::deque<DOMNodeId> scroll_chain_;
-  Member<Element> element_;
+  Member<Node> node_;
 };
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/page/scrolling/scroll_state_test.cc b/third_party/blink/renderer/core/page/scrolling/scroll_state_test.cc
index a829fa5..1132a16 100644
--- a/third_party/blink/renderer/core/page/scrolling/scroll_state_test.cc
+++ b/third_party/blink/renderer/core/page/scrolling/scroll_state_test.cc
@@ -69,9 +69,9 @@
   ScrollState* scroll_state = CreateScrollState(0, 0, false, false);
   Element* element =
       Element::Create(QualifiedName::Null(), Document::CreateForTest());
-  scroll_state->SetCurrentNativeScrollingElement(element);
+  scroll_state->SetCurrentNativeScrollingNode(element);
 
-  EXPECT_EQ(element, scroll_state->CurrentNativeScrollingElement());
+  EXPECT_EQ(element, scroll_state->CurrentNativeScrollingNode());
 }
 
 TEST_F(ScrollStateTest, FullyConsumed) {
diff --git a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
index d1a0855..3be04493 100644
--- a/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
+++ b/third_party/blink/renderer/core/paint/paint_property_tree_builder_test.cc
@@ -4389,12 +4389,6 @@
 }
 
 TEST_P(PaintPropertyTreeBuilderTest, CompositedUnderMultiColumn) {
-  // TODO(crbug.com/796768): Currently this test crashes for SPv2 when mapping
-  // layer clip rects from one fragment to another. May need to adjust fragment
-  // clip hierarchy to fix the crash.
-  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
-    return;
-
   SetBodyInnerHTML(R"HTML(
     <style>body { margin: 0; }</style>
     <div id='multicol' style='columns:3; column-fill:auto; column-gap: 0;
@@ -4433,31 +4427,32 @@
     EXPECT_EQ(LayoutPoint(100, 100), FragmentAt(composited, 0).PaintOffset());
     EXPECT_EQ(LayoutPoint(100, -200),
               FragmentAt(composited, 0).PaginationOffset());
-    EXPECT_EQ(LayoutUnit(), FragmentAt(composited, 0).LogicalTopInFlowThread());
+    EXPECT_EQ(LayoutUnit(200),
+              FragmentAt(composited, 0).LogicalTopInFlowThread());
     EXPECT_EQ(LayoutPoint(200, -100), FragmentAt(composited, 1).PaintOffset());
     EXPECT_EQ(LayoutPoint(200, -400),
               FragmentAt(composited, 1).PaginationOffset());
-    EXPECT_EQ(LayoutUnit(200),
+    EXPECT_EQ(LayoutUnit(400),
               FragmentAt(composited, 1).LogicalTopInFlowThread());
     EXPECT_EQ(2u, NumFragments(non_composited_child));
     EXPECT_EQ(LayoutPoint(100, 100),
               FragmentAt(non_composited_child, 0).PaintOffset());
     EXPECT_EQ(LayoutPoint(100, -200),
               FragmentAt(non_composited_child, 0).PaginationOffset());
-    EXPECT_EQ(LayoutUnit(),
+    EXPECT_EQ(LayoutUnit(200),
               FragmentAt(non_composited_child, 0).LogicalTopInFlowThread());
     EXPECT_EQ(LayoutPoint(200, -100),
               FragmentAt(non_composited_child, 1).PaintOffset());
     EXPECT_EQ(LayoutPoint(200, -400),
               FragmentAt(non_composited_child, 1).PaginationOffset());
-    EXPECT_EQ(LayoutUnit(200),
+    EXPECT_EQ(LayoutUnit(400),
               FragmentAt(non_composited_child, 1).LogicalTopInFlowThread());
     EXPECT_EQ(1u, NumFragments(composited_child));
     EXPECT_EQ(LayoutPoint(200, 50),
               FragmentAt(composited_child, 0).PaintOffset());
     EXPECT_EQ(LayoutPoint(200, -400),
               FragmentAt(composited_child, 0).PaginationOffset());
-    EXPECT_EQ(LayoutUnit(),
+    EXPECT_EQ(LayoutUnit(400),
               FragmentAt(composited_child, 0).LogicalTopInFlowThread());
   } else {
     // SPv1 forces single fragment for composited layers.
@@ -4485,12 +4480,6 @@
 }
 
 TEST_P(PaintPropertyTreeBuilderTest, FragmentsInPagedY) {
-  // TODO(crbug.com/796768): Currently this test crashes for SPv2 when mapping
-  // layer clip rects from one fragment to another. May need to adjust fragment
-  // clip hierarchy to fix the crash.
-  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
-    return;
-
   SetBodyInnerHTML(R"HTML(
     <div id='paged' style='overflow: -webkit-paged-y; column-gap: 0;
         width: 100px; height: 100px'>
@@ -4512,12 +4501,6 @@
 }
 
 TEST_P(PaintPropertyTreeBuilderTest, FragmentsInPagedYWithGap) {
-  // TODO(crbug.com/796768): Currently this test crashes for SPv2 when mapping
-  // layer clip rects from one fragment to another. May need to adjust fragment
-  // clip hierarchy to fix the crash.
-  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
-    return;
-
   SetBodyInnerHTML(R"HTML(
     <div id='paged' style='overflow: -webkit-paged-y; column-gap: 10px;
         width: 100px; height: 100px'>
@@ -4539,12 +4522,6 @@
 }
 
 TEST_P(PaintPropertyTreeBuilderTest, FragmentsInPagedX) {
-  // TODO(crbug.com/796768): Currently this test crashes for SPv2 when mapping
-  // layer clip rects from one fragment to another. May need to adjust fragment
-  // clip hierarchy to fix the crash.
-  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
-    return;
-
   SetBodyInnerHTML(R"HTML(
     <div id='paged' style='overflow: -webkit-paged-x; column-gap: 0;
         width: 100px; height: 100px'>
@@ -4566,12 +4543,6 @@
 }
 
 TEST_P(PaintPropertyTreeBuilderTest, FragmentsInPagedYVerticalRL) {
-  // TODO(crbug.com/796768): Currently this test crashes for SPv2 when mapping
-  // layer clip rects from one fragment to another. May need to adjust fragment
-  // clip hierarchy to fix the crash.
-  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
-    return;
-
   SetBodyInnerHTML(R"HTML(
     <div id='paged' style='overflow: -webkit-paged-y; column-gap: 0;
         width: 100px; height: 100px; writing-mode: vertical-rl'>
@@ -4645,12 +4616,6 @@
 }
 
 TEST_P(PaintPropertyTreeBuilderTest, CompositedMulticolFrameUnderMulticol) {
-  // TODO(crbug.com/796768): Currently this test crashes for SPv2 when mapping
-  // layer clip rects from one fragment to another. May need to adjust fragment
-  // clip hierarchy to fix the crash.
-  if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled())
-    return;
-
   SetBodyInnerHTML(R"HTML(
     <style>body { margin: 0 }</style>
     <div style='columns: 3; column-gap: 0; column-fill: auto;
diff --git a/third_party/blink/renderer/core/script/classic_pending_script.cc b/third_party/blink/renderer/core/script/classic_pending_script.cc
index 5faf81ad..68d4925 100644
--- a/third_party/blink/renderer/core/script/classic_pending_script.cc
+++ b/third_party/blink/renderer/core/script/classic_pending_script.cc
@@ -55,12 +55,7 @@
   // <spec step="2">Set request's client to settings object.</spec>
   //
   // Note: |element_document| corresponds to the settings object.
-  //
-  // We allow streaming, as WatchForLoad() is always called when the script
-  // needs to execute and the ScriptResource is not finished, so
-  // SetClientIsWaitingForFinished is always set on the resource.
-  ScriptResource::Fetch(params, element_document.Fetcher(), pending_script,
-                        ScriptResource::kAllowStreaming);
+  ScriptResource::Fetch(params, element_document.Fetcher(), pending_script);
   pending_script->CheckState();
   return pending_script;
 }
@@ -92,7 +87,11 @@
       source_location_type_(source_location_type),
       is_external_(is_external),
       ready_state_(is_external ? kWaitingForResource : kReady),
-      integrity_failure_(false) {
+      integrity_failure_(false),
+      is_currently_streaming_(false),
+      not_streamed_reason_(is_external
+                               ? ScriptStreamer::kDidntTryToStartStreaming
+                               : ScriptStreamer::kInlineScript) {
   CHECK(GetElement());
   MemoryCoordinator::Instance().RegisterClient(this);
 }
@@ -103,6 +102,7 @@
   // TODO(hiroshige): Turn these CHECK()s into DCHECK() before going to beta.
   CHECK(GetElement());
   CHECK_EQ(is_external_, !!GetResource());
+  CHECK(GetResource() || !streamer_);
 }
 
 namespace {
@@ -190,25 +190,50 @@
   MemoryCoordinator::Instance().UnregisterClient(this);
   ClearResource();
   integrity_failure_ = false;
+  CancelStreaming();
 }
 
-void ClassicPendingScript::WatchForLoad(PendingScriptClient* client) {
-  if (is_external_) {
-    // Once we are watching the ClassicPendingScript for load, we won't ever
-    // try to start streaming this resource via this ClassicPendingScript, so
-    // we mark the resource to instead get a finished notification when loading
-    // (rather than streaming) completes.
-    //
-    // Do this in a task rather than directly to make sure the IsReady state
-    // of PendingScript does not change during this call.
-    GetElement()
-        ->GetDocument()
-        .GetTaskRunner(TaskType::kNetworking)
-        ->PostTask(FROM_HERE,
-                   WTF::Bind(&ScriptResource::SetClientIsWaitingForFinished,
-                             WrapPersistent(ToScriptResource(GetResource()))));
+void ClassicPendingScript::StreamingFinished() {
+  CheckState();
+  DCHECK(streamer_);  // Should only be called by ScriptStreamer.
+  DCHECK(IsCurrentlyStreaming());
+
+  if (ready_state_ == kWaitingForStreaming) {
+    FinishWaitingForStreaming();
+  } else if (ready_state_ == kReadyStreaming) {
+    FinishReadyStreaming();
+  } else {
+    NOTREACHED();
   }
-  PendingScript::WatchForLoad(client);
+
+  DCHECK(!IsCurrentlyStreaming());
+}
+
+void ClassicPendingScript::FinishWaitingForStreaming() {
+  CheckState();
+  DCHECK(GetResource());
+  DCHECK_EQ(ready_state_, kWaitingForStreaming);
+
+  bool error_occurred = GetResource()->ErrorOccurred() || integrity_failure_;
+  AdvanceReadyState(error_occurred ? kErrorOccurred : kReady);
+}
+
+void ClassicPendingScript::FinishReadyStreaming() {
+  CheckState();
+  DCHECK(GetResource());
+  DCHECK_EQ(ready_state_, kReadyStreaming);
+  AdvanceReadyState(kReady);
+}
+
+void ClassicPendingScript::CancelStreaming() {
+  if (!streamer_)
+    return;
+
+  streamer_->Cancel();
+  streamer_ = nullptr;
+  streamer_done_.Reset();
+  is_currently_streaming_ = false;
+  DCHECK(!IsCurrentlyStreaming());
 }
 
 void ClassicPendingScript::NotifyFinished(Resource* resource) {
@@ -235,7 +260,6 @@
   //
   // See https://crbug.com/500701 for more information.
   CheckState();
-  DCHECK(GetResource());
   ScriptElementBase* element = GetElement();
   if (element) {
     SubresourceIntegrityHelper::DoReport(element->GetDocument(),
@@ -259,11 +283,24 @@
                                        options_, cross_origin);
   }
 
-  bool error_occurred = GetResource()->ErrorOccurred() || integrity_failure_;
-  AdvanceReadyState(error_occurred ? kErrorOccurred : kReady);
+  // We are now waiting for script streaming to finish.
+  // If there is no script streamer, this step completes immediately.
+  AdvanceReadyState(kWaitingForStreaming);
+  if (streamer_)
+    streamer_->NotifyFinished();
+  else
+    FinishWaitingForStreaming();
+}
+
+void ClassicPendingScript::DataReceived(Resource* resource,
+                                        const char*,
+                                        size_t) {
+  if (streamer_)
+    streamer_->NotifyAppendData(ToScriptResource(resource));
 }
 
 void ClassicPendingScript::Trace(blink::Visitor* visitor) {
+  visitor->Trace(streamer_);
   ResourceClient::Trace(visitor);
   MemoryCoordinatorClient::Trace(visitor);
   PendingScript::Trace(visitor);
@@ -310,9 +347,9 @@
                                             GetElement()->GetDocument());
     }
 
-    DCHECK(!GetResource());
-    RecordStreamingHistogram(GetSchedulingType(), false,
-                             ScriptStreamer::kInlineScript);
+    DCHECK(!streamer_);
+    DCHECK_EQ(not_streamed_reason_, ScriptStreamer::kInlineScript);
+    RecordStreamingHistogram(GetSchedulingType(), false, not_streamed_reason_);
 
     ScriptSourceCode source_code(source_text_for_inline_script_,
                                  source_location_type_, cache_handler,
@@ -333,26 +370,25 @@
 
   // Check if we can use the script streamer.
   bool streamer_ready = false;
-  ScriptStreamer::NotStreamingReason not_streamed_reason =
-      resource->NoStreamerReason();
-  ScriptStreamer* streamer = resource->TakeStreamer();
-  if (streamer) {
+  ScriptStreamer::NotStreamingReason not_streamed_reason = not_streamed_reason_;
+  if (streamer_) {
     DCHECK_EQ(not_streamed_reason, ScriptStreamer::kInvalid);
-    if (streamer->StreamingSuppressed()) {
-      not_streamed_reason = streamer->StreamingSuppressedReason();
+    if (streamer_->StreamingSuppressed()) {
+      not_streamed_reason = streamer_->StreamingSuppressedReason();
     } else if (ready_state_ == kErrorOccurred) {
       not_streamed_reason = ScriptStreamer::kErrorOccurred;
+    } else if (ready_state_ == kReadyStreaming) {
+      not_streamed_reason = ScriptStreamer::kStreamerNotReadyOnGetSource;
     } else {
       // Streamer can be used to compile script.
-      CHECK_EQ(ready_state_, kReady);
-      not_streamed_reason = ScriptStreamer::kInvalid;
+      DCHECK_EQ(ready_state_, kReady);
       streamer_ready = true;
     }
   }
   RecordStreamingHistogram(GetSchedulingType(), streamer_ready,
                            not_streamed_reason);
 
-  ScriptSourceCode source_code(streamer_ready ? streamer : nullptr, resource,
+  ScriptSourceCode source_code(streamer_ready ? streamer_ : nullptr, resource,
                                not_streamed_reason);
   // The base URL for external classic script is
   //
@@ -363,6 +399,21 @@
                                resource->CalculateAccessControlStatus());
 }
 
+void ClassicPendingScript::SetStreamer(ScriptStreamer* streamer) {
+  DCHECK(streamer);
+  DCHECK(!streamer_);
+  DCHECK(!IsWatchingForLoad() || ready_state_ != kWaitingForResource);
+  DCHECK(!streamer->IsFinished());
+  DCHECK(ready_state_ == kWaitingForResource || ready_state_ == kReady);
+
+  streamer_ = streamer;
+  is_currently_streaming_ = true;
+  if (streamer && ready_state_ == kReady)
+    AdvanceReadyState(kReadyStreaming);
+
+  CheckState();
+}
+
 bool ClassicPendingScript::IsReady() const {
   CheckState();
   return ready_state_ >= kReady;
@@ -371,12 +422,21 @@
 void ClassicPendingScript::AdvanceReadyState(ReadyState new_ready_state) {
   // We will allow exactly these state transitions:
   //
-  // kWaitingForResource -> [kReady, kErrorOccurred]
+  // kWaitingForResource -> kWaitingForStreaming -> [kReady, kErrorOccurred]
+  // kReady -> kReadyStreaming -> kReady
   switch (ready_state_) {
     case kWaitingForResource:
+      CHECK_EQ(new_ready_state, kWaitingForStreaming);
+      break;
+    case kWaitingForStreaming:
       CHECK(new_ready_state == kReady || new_ready_state == kErrorOccurred);
       break;
     case kReady:
+      CHECK_EQ(new_ready_state, kReadyStreaming);
+      break;
+    case kReadyStreaming:
+      CHECK_EQ(new_ready_state, kReady);
+      break;
     case kErrorOccurred:
       NOTREACHED();
       break;
@@ -388,6 +448,38 @@
   // Did we transition into a 'ready' state?
   if (IsReady() && !old_is_ready && IsWatchingForLoad())
     PendingScriptFinished();
+
+  // Did we finish streaming?
+  if (IsCurrentlyStreaming()) {
+    if (ready_state_ == kReady || ready_state_ == kErrorOccurred) {
+      // Call the streamer_done_ callback. Ensure that is_currently_streaming_
+      // is reset only after the callback returns, to prevent accidentally
+      // start streaming by work done within the callback. (crbug.com/754360)
+      base::OnceClosure done = std::move(streamer_done_);
+      if (done)
+        std::move(done).Run();
+      is_currently_streaming_ = false;
+    }
+  }
+
+  // Streaming-related post conditions:
+
+  // To help diagnose crbug.com/78426, we'll temporarily add some DCHECKs
+  // that are a subset of the DCHECKs below:
+  if (IsCurrentlyStreaming()) {
+    DCHECK(streamer_);
+    DCHECK(!streamer_->IsFinished());
+  }
+
+  // IsCurrentlyStreaming should match what streamer_ thinks.
+  DCHECK_EQ(IsCurrentlyStreaming(), streamer_ && !streamer_->IsFinished());
+  // IsCurrentlyStreaming should match the ready_state_.
+  DCHECK_EQ(IsCurrentlyStreaming(),
+            ready_state_ == kReadyStreaming ||
+                (streamer_ && (ready_state_ == kWaitingForResource ||
+                               ready_state_ == kWaitingForStreaming)));
+  // We can only have a streamer_done_ callback if we are actually streaming.
+  DCHECK(IsCurrentlyStreaming() || !streamer_done_);
 }
 
 void ClassicPendingScript::OnPurgeMemory() {
@@ -397,15 +489,40 @@
   // here.
 }
 
-void ClassicPendingScript::StartStreamingIfPossible() {
+bool ClassicPendingScript::StartStreamingIfPossible(
+    base::OnceClosure done) {
+  if (IsCurrentlyStreaming())
+    return false;
+
   // We can start streaming in two states: While still loading
   // (kWaitingForResource), or after having loaded (kReady).
   if (ready_state_ != kWaitingForResource && ready_state_ != kReady)
-    return;
+    return false;
 
   Document* document = &GetElement()->GetDocument();
   if (!document || !document->GetFrame())
-    return;
+    return false;
+
+  ScriptState* script_state = ToScriptStateForMainWorld(document->GetFrame());
+  if (!script_state)
+    return false;
+
+  // To support streaming re-try, we'll clear the existing streamer if
+  // it exists; it claims to be finished; but it's finished because streaming
+  // has been suppressed.
+  if (streamer_ && streamer_->StreamingSuppressed() &&
+      streamer_->IsFinished()) {
+    DCHECK_EQ(ready_state_, kReady);
+    DCHECK(!streamer_done_);
+    DCHECK(!IsCurrentlyStreaming());
+    streamer_.Clear();
+  }
+
+  if (streamer_)
+    return false;
+
+  // The two checks above should imply that we're not presently streaming.
+  DCHECK(!IsCurrentlyStreaming());
 
   // Parser blocking scripts tend to do a lot of work in the 'finished'
   // callbacks, while async + in-order scripts all do control-like activities
@@ -415,14 +532,24 @@
                        ? TaskType::kNetworking
                        : TaskType::kNetworkingControl;
 
-  ReadyState ready_state_before_stream = ready_state_;
-  ToScriptResource(GetResource())
-      ->StartStreaming(document->GetTaskRunner(task_type));
-  // We have to make sure that the ready state is not changed by starting
-  // streaming, just in case we're relying on IsReady being false.
-  CHECK_EQ(ready_state_before_stream, ready_state_);
+  DCHECK(!streamer_);
+  DCHECK(!IsCurrentlyStreaming());
+  DCHECK(!streamer_done_);
+  ScriptStreamer::StartStreaming(this, document->GetTaskRunner(task_type),
+                                 &not_streamed_reason_);
+  DCHECK(streamer_ || not_streamed_reason_ != ScriptStreamer::kInvalid);
+  bool success = streamer_ && !streamer_->IsStreamingFinished();
 
-  return;
+  // If we have successfully started streaming, we are required to call the
+  // callback.
+  DCHECK_EQ(success, IsCurrentlyStreaming());
+  if (success)
+    streamer_done_ = std::move(done);
+  return success;
+}
+
+bool ClassicPendingScript::IsCurrentlyStreaming() const {
+  return is_currently_streaming_;
 }
 
 bool ClassicPendingScript::WasCanceled() const {
diff --git a/third_party/blink/renderer/core/script/classic_pending_script.h b/third_party/blink/renderer/core/script/classic_pending_script.h
index 9b62203..98777d1 100644
--- a/third_party/blink/renderer/core/script/classic_pending_script.h
+++ b/third_party/blink/renderer/core/script/classic_pending_script.h
@@ -59,13 +59,12 @@
     return blink::ScriptType::kClassic;
   }
 
-  void WatchForLoad(PendingScriptClient*) override;
-
   ClassicScript* GetSource(const KURL& document_url) const override;
   bool IsReady() const override;
   bool IsExternal() const override { return is_external_; }
   bool WasCanceled() const override;
-  void StartStreamingIfPossible() override;
+  bool StartStreamingIfPossible(base::OnceClosure) override;
+  bool IsCurrentlyStreaming() const override;
   KURL UrlForTracing() const override;
   void DisposeInternal() override;
 
@@ -76,10 +75,12 @@
  private:
   // See AdvanceReadyState implementation for valid state transitions.
   enum ReadyState {
-    // This state is considered "not ready".
+    // These states are considered "not ready".
     kWaitingForResource,
+    kWaitingForStreaming,
     // These states are considered "ready".
     kReady,
+    kReadyStreaming,
     kErrorOccurred,
   };
 
@@ -94,11 +95,16 @@
   // appropriate.
   void AdvanceReadyState(ReadyState);
 
+  // Handle the end of streaming.
+  void FinishWaitingForStreaming();
+  void FinishReadyStreaming();
+  void CancelStreaming();
   void CheckState() const override;
 
   // ResourceClient
   void NotifyFinished(Resource*) override;
   String DebugName() const override { return "PendingScript"; }
+  void DataReceived(Resource*, const char*, size_t) override;
 
   static void RecordStreamingHistogram(
       ScriptSchedulingType type,
@@ -128,6 +134,23 @@
   // The request is intervened by document.write() intervention.
   bool intervened_ = false;
 
+  Member<ScriptStreamer> streamer_;
+  base::OnceClosure streamer_done_;
+
+  // This flag tracks whether streamer_ is currently streaming. It is used
+  // mainly to prevent re-streaming a script while it is being streamed.
+  //
+  // ReadyState unfortunately doesn't contain this information, because
+  // 1, the WaitingFor* states can occur with or without streaming, and
+  // 2, during the state transition, we need to first transition ready_state_,
+  //    then run callbacks, and only then consider the streaming done. So
+  //    during AdvanceReadyState and callback processing, the ready state
+  //    and is_currently_streaming_ are temporarily different. (They must
+  //    be consistent before and after AdvanceReadyState.)
+  //
+  // (See also: crbug.com/754360)
+  bool is_currently_streaming_;
+
   // Specifies the reason that script was never streamed.
   ScriptStreamer::NotStreamingReason not_streamed_reason_;
 };
diff --git a/third_party/blink/renderer/core/script/document_write_intervention.cc b/third_party/blink/renderer/core/script/document_write_intervention.cc
index ed287c4..9e9553c 100644
--- a/third_party/blink/renderer/core/script/document_write_intervention.cc
+++ b/third_party/blink/renderer/core/script/document_write_intervention.cc
@@ -219,8 +219,7 @@
       resource->Url(), element_document.GetSecurityOrigin(), cross_origin,
       resource->Encoding(), FetchParameters::kIdleLoad);
   AddHeader(&params);
-  ScriptResource::Fetch(params, element_document.Fetcher(), nullptr,
-                        ScriptResource::kNoStreaming);
+  ScriptResource::Fetch(params, element_document.Fetcher(), nullptr);
 }
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/script/html_parser_script_runner.cc b/third_party/blink/renderer/core/script/html_parser_script_runner.cc
index f57cdd1..6ac9cbc1 100644
--- a/third_party/blink/renderer/core/script/html_parser_script_runner.cc
+++ b/third_party/blink/renderer/core/script/html_parser_script_runner.cc
@@ -480,7 +480,7 @@
   // Callers will attempt to run the m_parserBlockingScript if possible before
   // returning control to the parser.
   if (!ParserBlockingScript()->IsReady()) {
-    parser_blocking_script_->StartStreamingIfPossible();
+    parser_blocking_script_->StartStreamingIfPossible(base::OnceClosure());
     parser_blocking_script_->WatchForLoad(this);
   }
 }
@@ -493,7 +493,7 @@
     return;
 
   if (!pending_script->IsReady()) {
-    pending_script->StartStreamingIfPossible();
+    pending_script->StartStreamingIfPossible(base::OnceClosure());
   }
 
   DCHECK(pending_script->IsExternalOrModule());
diff --git a/third_party/blink/renderer/core/script/module_pending_script.h b/third_party/blink/renderer/core/script/module_pending_script.h
index 574168b..916b0737 100644
--- a/third_party/blink/renderer/core/script/module_pending_script.h
+++ b/third_party/blink/renderer/core/script/module_pending_script.h
@@ -77,7 +77,8 @@
   bool IsExternal() const override { return is_external_; }
   bool WasCanceled() const override { return false; }
 
-  void StartStreamingIfPossible() override {}
+  bool StartStreamingIfPossible(base::OnceClosure) override { return false; }
+  bool IsCurrentlyStreaming() const override { return false; }
 
   KURL UrlForTracing() const override { return NullURL(); }
 
diff --git a/third_party/blink/renderer/core/script/pending_script.h b/third_party/blink/renderer/core/script/pending_script.h
index 52205a29..d031cc7 100644
--- a/third_party/blink/renderer/core/script/pending_script.h
+++ b/third_party/blink/renderer/core/script/pending_script.h
@@ -76,7 +76,7 @@
     return parser_blocking_load_start_time_;
   }
 
-  virtual void WatchForLoad(PendingScriptClient*);
+  void WatchForLoad(PendingScriptClient*);
   void StopWatchingForLoad();
   void PendingScriptFinished();
 
@@ -96,7 +96,8 @@
   virtual bool WasCanceled() const = 0;
 
   // Support for script streaming.
-  virtual void StartStreamingIfPossible() = 0;
+  virtual bool StartStreamingIfPossible(base::OnceClosure) = 0;
+  virtual bool IsCurrentlyStreaming() const = 0;
 
   // Used only for tracing, and can return a null URL.
   // TODO(hiroshige): It's preferable to return the base URL consistently
diff --git a/third_party/blink/renderer/core/script/script_runner.cc b/third_party/blink/renderer/core/script/script_runner.cc
index 59ab899..9f5f0b8 100644
--- a/third_party/blink/renderer/core/script/script_runner.cc
+++ b/third_party/blink/renderer/core/script/script_runner.cc
@@ -49,9 +49,7 @@
   switch (pending_script->GetSchedulingType()) {
     case ScriptSchedulingType::kAsync:
       pending_async_scripts_.insert(pending_script);
-      if (!is_suspended_) {
-        pending_script->StartStreamingIfPossible();
-      }
+      TryStream(pending_script);
       break;
 
     case ScriptSchedulingType::kInOrder:
@@ -118,6 +116,7 @@
       async_scripts_to_execute_soon_.push_back(pending_script);
 
       PostTask(FROM_HERE);
+      TryStreamAny();
       break;
 
     case ScriptSchedulingType::kInOrder:
@@ -145,6 +144,11 @@
   return true;
 }
 
+void ScriptRunner::NotifyScriptStreamerFinished() {
+  PostTask(FROM_HERE);
+  TryStreamAny();
+}
+
 void ScriptRunner::MovePendingScript(Document& old_document,
                                      Document& new_document,
                                      ScriptLoader* script_loader) {
@@ -217,11 +221,20 @@
 }
 
 bool ScriptRunner::ExecuteAsyncTask() {
-  if (async_scripts_to_execute_soon_.IsEmpty())
+  // Find an async script loader which is not currently streaming.
+  auto it = std::find_if(async_scripts_to_execute_soon_.begin(),
+                         async_scripts_to_execute_soon_.end(),
+                         [](PendingScript* pending_script) {
+                           DCHECK(pending_script);
+                           return !pending_script->IsCurrentlyStreaming();
+                         });
+  if (it == async_scripts_to_execute_soon_.end()) {
     return false;
+  }
 
   // Remove the async script loader from the ready-to-exec set and execute.
-  PendingScript* pending_script = async_scripts_to_execute_soon_.TakeFirst();
+  PendingScript* pending_script = *it;
+  async_scripts_to_execute_soon_.erase(it);
 
   DCHECK_EQ(pending_script->GetSchedulingType(), ScriptSchedulingType::kAsync)
       << "Async scripts queue should not contain any in-order script.";
@@ -243,12 +256,70 @@
     return;
 
 #ifndef NDEBUG
-  // Extra tasks should be posted only when we resume after suspending. These
-  // should all be accounted for in number_of_extra_tasks_.
+  // Extra tasks should be posted only when we resume after suspending,
+  // or when we stream a script. These should all be accounted for in
+  // number_of_extra_tasks_.
   DCHECK_GT(number_of_extra_tasks_--, 0);
 #endif
 }
 
+void ScriptRunner::TryStreamAny() {
+  if (is_suspended_)
+    return;
+
+  if (!RuntimeEnabledFeatures::WorkStealingInScriptRunnerEnabled())
+    return;
+
+  // Look through async_scripts_to_execute_soon_, and stream any one of them.
+  for (auto pending_script : async_scripts_to_execute_soon_) {
+    if (DoTryStream(pending_script))
+      return;
+  }
+}
+
+void ScriptRunner::TryStream(PendingScript* pending_script) {
+  if (!is_suspended_)
+    DoTryStream(pending_script);
+}
+
+bool ScriptRunner::DoTryStream(PendingScript* pending_script) {
+  // Checks that all callers should have already done.
+  DCHECK(!is_suspended_);
+  DCHECK(pending_script);
+
+  // Currently, we stream only async scripts in this function.
+  // Note: HTMLParserScriptRunner kicks streaming for deferred or blocking
+  // scripts.
+  DCHECK(pending_async_scripts_.find(pending_script) !=
+             pending_async_scripts_.end() ||
+         std::find(async_scripts_to_execute_soon_.begin(),
+                   async_scripts_to_execute_soon_.end(),
+                   pending_script) != async_scripts_to_execute_soon_.end());
+
+  if (!pending_script)
+    return false;
+
+  DCHECK_EQ(pending_script->GetSchedulingType(), ScriptSchedulingType::kAsync);
+
+#ifndef NDEBUG
+  bool was_already_streaming = pending_script->IsCurrentlyStreaming();
+#endif
+
+  bool success = pending_script->StartStreamingIfPossible(
+      WTF::Bind(&ScriptRunner::NotifyScriptStreamerFinished,
+                WrapWeakPersistent(this)));
+#ifndef NDEBUG
+  if (was_already_streaming) {
+    DCHECK(!success);
+  } else {
+    DCHECK_EQ(success, pending_script->IsCurrentlyStreaming());
+  }
+  if (success)
+    number_of_extra_tasks_++;
+#endif
+  return success;
+}
+
 void ScriptRunner::Trace(blink::Visitor* visitor) {
   visitor->Trace(document_);
   visitor->Trace(pending_in_order_scripts_);
diff --git a/third_party/blink/renderer/core/script/script_runner.h b/third_party/blink/renderer/core/script/script_runner.h
index 95e1ae1..e64c99b4 100644
--- a/third_party/blink/renderer/core/script/script_runner.h
+++ b/third_party/blink/renderer/core/script/script_runner.h
@@ -58,6 +58,7 @@
   void Suspend();
   void Resume();
   void NotifyScriptReady(PendingScript*);
+  void NotifyScriptStreamerFinished();
 
   static void MovePendingScript(Document&, Document&, ScriptLoader*);
 
@@ -85,6 +86,11 @@
 
   void ExecuteTask();
 
+  // Try to start streaming a specific script or any available script.
+  void TryStream(PendingScript*);
+  void TryStreamAny();
+  bool DoTryStream(PendingScript*);  // Implementation for both Try* methods.
+
   Member<Document> document_;
 
   HeapDeque<TraceWrapperMember<PendingScript>> pending_in_order_scripts_;
@@ -104,8 +110,9 @@
 #ifndef NDEBUG
   // We expect to have one posted task in flight for each script in either
   // .._to_be_executed_soon_ queue. This invariant will be temporarily violated
-  // when the ScriptRunner is suspended. We'll use this variable to account &
-  // check this invariant for debugging.
+  // when the ScriptRunner is suspended, or when we take a Script out the
+  // async_scripts_to_be_executed_soon_ queue for streaming. We'll use this
+  // variable to account & check this invariant for debugging.
   int number_of_extra_tasks_ = 0;
 #endif
   DISALLOW_COPY_AND_ASSIGN(ScriptRunner);
diff --git a/third_party/blink/renderer/core/script/script_runner_test.cc b/third_party/blink/renderer/core/script/script_runner_test.cc
index 8a881e9b3..e25af54 100644
--- a/third_party/blink/renderer/core/script/script_runner_test.cc
+++ b/third_party/blink/renderer/core/script/script_runner_test.cc
@@ -44,9 +44,40 @@
   MOCK_METHOD0(RemoveFromMemoryCache, void());
   MOCK_METHOD1(ExecuteScriptBlock, void(const KURL&));
 
-  void StartStreamingIfPossible() override {}
+  enum class State {
+    kStreamingNotReady,
+    kReadyToBeStreamed,
+    kStreaming,
+    kStreamingFinished,
+  };
 
-  bool IsReady() const override { return is_ready_; }
+  bool IsCurrentlyStreaming() const override {
+    return state_ == State::kStreaming;
+  }
+
+  void PrepareForStreaming() {
+    DCHECK_EQ(state_, State::kStreamingNotReady);
+    state_ = State::kReadyToBeStreamed;
+  }
+
+  bool StartStreamingIfPossible(base::OnceClosure closure) override {
+    if (state_ != State::kReadyToBeStreamed)
+      return false;
+
+    state_ = State::kStreaming;
+    streaming_finished_callback_ = std::move(closure);
+    return true;
+  }
+
+  void SimulateStreamingEnd() {
+    DCHECK_EQ(state_, State::kStreaming);
+    state_ = State::kStreamingFinished;
+    std::move(streaming_finished_callback_).Run();
+  }
+
+  State state() const { return state_; }
+
+  bool IsReady() const { return is_ready_; }
   void SetIsReady(bool is_ready) { is_ready_ = is_ready; }
 
  protected:
@@ -71,6 +102,7 @@
     return pending_script;
   }
 
+  State state_ = State::kStreamingNotReady;
   bool is_ready_ = false;
   base::OnceClosure streaming_finished_callback_;
 };
@@ -418,4 +450,30 @@
   QueueScriptForExecution(pending_script1);
 }
 
+TEST_F(ScriptRunnerTest, DontExecuteWhileStreaming) {
+  auto* pending_script = MockPendingScript::CreateAsync(document_);
+
+  // Enqueue script.
+  QueueScriptForExecution(pending_script);
+
+  // Simulate script load and mark the pending script as streaming ready.
+  pending_script->SetIsReady(true);
+  pending_script->PrepareForStreaming();
+  NotifyScriptReady(pending_script);
+
+  // ScriptLoader should have started streaming by now.
+  EXPECT_EQ(pending_script->state(), MockPendingScript::State::kStreaming);
+
+  // Note that there is no expectation for ScriptLoader::Execute() yet,
+  // so the mock will fail if it's called anyway.
+  platform_->RunUntilIdle();
+
+  // Finish streaming.
+  pending_script->SimulateStreamingEnd();
+
+  // Now that streaming is finished, expect Execute() to be called.
+  EXPECT_CALL(*pending_script, ExecuteScriptBlock(_)).Times(1);
+  platform_->RunUntilIdle();
+}
+
 }  // namespace blink
diff --git a/third_party/blink/renderer/core/timing/event_timing.cc b/third_party/blink/renderer/core/timing/event_timing.cc
index 589c2fa..8d8816c 100644
--- a/third_party/blink/renderer/core/timing/event_timing.cc
+++ b/third_party/blink/renderer/core/timing/event_timing.cc
@@ -37,7 +37,8 @@
   // dispatched.
   if ((performance_->ShouldBufferEventTiming() &&
        !performance_->IsEventTimingBufferFull()) ||
-      performance_->HasObserverFor(PerformanceEntry::kEvent)) {
+      performance_->HasObserverFor(PerformanceEntry::kEvent)
+      || performance_->HasObserverFor(PerformanceEntry::kFirstInput)) {
     processing_start_ = CurrentTimeTicks();
     finished_will_dispatch_event_ = true;
   }
diff --git a/third_party/blink/renderer/modules/canvas/OWNERS b/third_party/blink/renderer/modules/canvas/OWNERS
index 0a9e139..0513b2b 100644
--- a/third_party/blink/renderer/modules/canvas/OWNERS
+++ b/third_party/blink/renderer/modules/canvas/OWNERS
@@ -1,5 +1,4 @@
 fserb@chromium.org
-junov@chromium.org
 # canvas, imagebitmap
 senorblanco@chromium.org
 # lowLatency
diff --git a/third_party/blink/renderer/platform/OWNERS b/third_party/blink/renderer/platform/OWNERS
index a6ca217c..bd19319 100644
--- a/third_party/blink/renderer/platform/OWNERS
+++ b/third_party/blink/renderer/platform/OWNERS
@@ -7,7 +7,6 @@
 haraken@chromium.org
 jbroman@chromium.org
 jochen@chromium.org
-junov@chromium.org
 kbr@chromium.org
 kinuko@chromium.org
 mkwst@chromium.org
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string.cc b/third_party/blink/renderer/platform/bindings/parkable_string.cc
index a7c8124f..94855c7 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string.cc
+++ b/third_party/blink/renderer/platform/bindings/parkable_string.cc
@@ -4,9 +4,13 @@
 
 #include "third_party/blink/renderer/platform/bindings/parkable_string.h"
 
+#include "base/bind.h"
 #include "base/logging.h"
 #include "base/metrics/histogram_macros.h"
+#include "base/single_thread_task_runner.h"
+#include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/renderer/platform/bindings/parkable_string_manager.h"
+#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
 #include "third_party/blink/renderer/platform/wtf/address_sanitizer.h"
 #include "third_party/blink/renderer/platform/wtf/thread_specific.h"
 
@@ -18,31 +22,55 @@
   UMA_HISTOGRAM_ENUMERATION("Memory.MovableStringParkingAction", action);
 }
 
-#if defined(ADDRESS_SANITIZER)
 void AsanPoisonString(const String& string) {
+#if defined(ADDRESS_SANITIZER)
+  // Since |string| is not deallocated, it remains in the per-thread
+  // AtomicStringTable, where its content can be accessed for equality
+  // comparison for instance, triggering a poisoned memory access.
+  // See crbug.com/883344 for an example.
+  if (string.Impl()->IsAtomic())
+    return;
+
   const void* start = string.Is8Bit()
                           ? static_cast<const void*>(string.Characters8())
                           : static_cast<const void*>(string.Characters16());
   ASAN_POISON_MEMORY_REGION(start, string.CharactersSizeInBytes());
+#endif  // defined(ADDRESS_SANITIZER)
 }
 
 void AsanUnpoisonString(const String& string) {
+#if defined(ADDRESS_SANITIZER)
   const void* start = string.Is8Bit()
                           ? static_cast<const void*>(string.Characters8())
                           : static_cast<const void*>(string.Characters16());
   ASAN_UNPOISON_MEMORY_REGION(start, string.CharactersSizeInBytes());
-}
 #endif  // defined(ADDRESS_SANITIZER)
+}
 
 }  // namespace
 
+// Valid transitions are:
+// 1. kUnparked -> kParkingInProgress: Parking started asynchronously
+// 2. kParkingInProgress -> kUnparked: Parking did not complete
+// 3. kParkingInProgress -> kParked: Parking completed normally
+// 4. kParked -> kUnparked: String has been unparked.
+//
+// See |Park()| for (1), |OnParkingCompleteOnMainThread()| for 2-3, and
+// |Unpark()| for (4).
+enum class ParkableStringImpl::State { kUnparked, kParkingInProgress, kParked };
+
 ParkableStringImpl::ParkableStringImpl(scoped_refptr<StringImpl>&& impl,
                                        ParkableState parkable)
     : mutex_(),
       lock_depth_(0),
+      state_(State::kUnparked),
       string_(std::move(impl)),
-      is_parked_(false),
-      is_parkable_(parkable == ParkableState::kParkable)
+#if DCHECK_IS_ON()
+      parked_string_(),
+#endif
+      may_be_parked_(parkable == ParkableState::kParkable),
+      is_8bit_(string_.Is8Bit()),
+      length_(string_.length())
 #if DCHECK_IS_ON()
       ,
       owning_thread_(CurrentThread())
@@ -53,11 +81,17 @@
 
 ParkableStringImpl::~ParkableStringImpl() {
   AssertOnValidThread();
-#if defined(ADDRESS_SANITIZER)
-  AsanUnpoisonString(string_);
+#if DCHECK_IS_ON()
+  {
+    MutexLocker locker(mutex_);
+    DCHECK_EQ(0, lock_depth_);
+  }
 #endif
-  if (is_parkable_)
-    ParkableStringManager::Instance().Remove(string_.Impl());
+  AsanUnpoisonString(string_);
+  DCHECK(state_ == State::kParked || state_ == State::kUnparked);
+
+  if (may_be_parked_)
+    ParkableStringManager::Instance().Remove(this, string_.Impl());
 }
 
 void ParkableStringImpl::Lock() {
@@ -78,36 +112,16 @@
   // the owning thread may concurrently call |ToString()|. It is then allowed
   // to use the string until the end of the current owning thread task.
   // Requires DCHECK_IS_ON() for the |owning_thread_| check.
-  if (lock_depth_ == 0 && is_parkable_ && string_.Impl()->HasOneRef() &&
-      owning_thread_ == CurrentThread()) {
-    // Since |string_| is not deallocated, it remains in the per-thread
-    // AtomicStringTable, where its content can be accessed for equality
-    // comparison for instance, triggering a poisoned memory access.
-    // See crbug.com/883344 for an example.
-    // TODO(lizeb): park the string in |Unlock()| when ASAN is enabled, removing
-    // this check.
-    if (!string_.Impl()->IsAtomic())
-      AsanPoisonString(string_);
+  if (CanParkNow() && owning_thread_ == CurrentThread()) {
+    AsanPoisonString(string_);
   }
 #endif  // defined(ADDRESS_SANITIZER) && DCHECK_IS_ON()
 }
 
-bool ParkableStringImpl::Is8Bit() const {
-  AssertOnValidThread();
-  return string_.Is8Bit();
-}
-
-bool ParkableStringImpl::IsNull() const {
-  AssertOnValidThread();
-  return string_.IsNull();
-}
-
 const String& ParkableStringImpl::ToString() {
   AssertOnValidThread();
   MutexLocker locker(mutex_);
-#if defined(ADDRESS_SANITIZER)
   AsanUnpoisonString(string_);
-#endif
 
   Unpark();
   return string_;
@@ -115,41 +129,92 @@
 
 unsigned ParkableStringImpl::CharactersSizeInBytes() const {
   AssertOnValidThread();
-  return string_.CharactersSizeInBytes();
+  return length_ * (is_8bit() ? sizeof(LChar) : sizeof(UChar));
 }
 
 bool ParkableStringImpl::Park() {
   AssertOnValidThread();
   MutexLocker locker(mutex_);
-  DCHECK(is_parkable_);
-
-  if (lock_depth_ != 0)
-    return false;
-
-  // Cannot park strings with several references.
-  if (string_.Impl()->HasOneRef()) {
-#if defined(ADDRESS_SANITIZER)
-    // See comment in |Unlock()| for this restriction.
-    if (!string_.Impl()->IsAtomic())
-      AsanPoisonString(string_);
-#endif
-    RecordParkingAction(ParkingAction::kParkedInBackground);
-    is_parked_ = true;
+  DCHECK(may_be_parked_);
+  if (state_ == State::kUnparked && CanParkNow()) {
+    AsanPoisonString(string_);
+    auto task_runner = Platform::Current()->CurrentThread()->GetTaskRunner();
+    task_runner->PostTask(
+        FROM_HERE,
+        base::BindOnce(&ParkableStringImpl::OnParkingCompleteOnMainThread,
+                       this));
+    state_ = State::kParkingInProgress;
   }
-  return is_parked_;
+
+  return state_ == State::kParked || state_ == State::kParkingInProgress;
+}
+
+bool ParkableStringImpl::is_parked() const {
+  return state_ == State::kParked;
+}
+
+bool ParkableStringImpl::CanParkNow() const {
+  mutex_.AssertAcquired();
+  // Can park iff:
+  // - the string is eligible to parking
+  // - There are no external reference to |string_|. Since |this| holds a
+  //   reference to it, then we are the only one.
+  // - |this| is not locked.
+  return may_be_parked_ && string_.Impl()->HasOneRef() && lock_depth_ == 0;
 }
 
 void ParkableStringImpl::Unpark() {
   AssertOnValidThread();
   mutex_.AssertAcquired();
-  if (!is_parked_)
+  if (state_ != State::kParked)
     return;
 
+#if DCHECK_IS_ON()
+  string_ = parked_string_;
+  parked_string_ = String();
+#endif
+  state_ = State::kUnparked;
+
   bool backgrounded =
       ParkableStringManager::Instance().IsRendererBackgrounded();
   RecordParkingAction(backgrounded ? ParkingAction::kUnparkedInBackground
                                    : ParkingAction::kUnparkedInForeground);
-  is_parked_ = false;
+  auto& manager = ParkableStringManager::Instance();
+  manager.OnUnparked(this, string_.Impl());
+}
+
+void ParkableStringImpl::OnParkingCompleteOnMainThread() {
+  MutexLocker locker(mutex_);
+  DCHECK_EQ(State::kParkingInProgress, state_);
+  // Between |Park()| and now, things may have happened:
+  // 1. |ToString()| or
+  // 2. |Lock()| may have been called.
+  //
+  // We only care about "surviving" calls, that is iff the string returned by
+  // |ToString()| is still alive, or whether we are still locked. Since this
+  // function is protected by the lock, no concurrent modifications can occur.
+  //
+  // Finally, since this is a distinct task from any one that can call
+  // |ToString()|, the invariant that the pointer stays valid until the next
+  // task is preserved.
+  if (CanParkNow()) {
+    RecordParkingAction(ParkingAction::kParkedInBackground);
+    state_ = State::kParked;
+    ParkableStringManager::Instance().OnParked(this, string_.Impl());
+#if DCHECK_IS_ON()
+    AsanUnpoisonString(string_);  // Will touch the string below.
+    parked_string_ = string_.IsolatedCopy();
+    // Poison the previous allocation.
+    // |string_| is kept to make sure the memory is not reused.
+    const void* data = is_8bit()
+                           ? static_cast<const void*>(string_.Characters8())
+                           : static_cast<const void*>(string_.Characters16());
+    memset(const_cast<void*>(data), 0xcc, string_.CharactersSizeInBytes());
+#endif  // DCHECK_IS_ON()
+    AsanPoisonString(string_);
+  } else {
+    state_ = State::kUnparked;
+  }
 }
 
 ParkableString::ParkableString(scoped_refptr<StringImpl>&& impl) {
@@ -180,7 +245,7 @@
 }
 
 bool ParkableString::Is8Bit() const {
-  return impl_->Is8Bit();
+  return impl_->is_8bit();
 }
 
 String ParkableString::ToString() const {
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string.h b/third_party/blink/renderer/platform/bindings/parkable_string.h
index ced4437..24713b93 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string.h
+++ b/third_party/blink/renderer/platform/bindings/parkable_string.h
@@ -64,28 +64,42 @@
   const String& ToString();
 
   // See the matching String methods.
-  bool Is8Bit() const;
-  bool IsNull() const;
-  unsigned length() const { return string_.length(); }
+  bool is_8bit() const { return is_8bit_; }
+  unsigned length() const { return length_; }
   unsigned CharactersSizeInBytes() const;
 
   // A parked string cannot be accessed until it has been |Unpark()|-ed.
   // Returns true iff the string has been parked.
   bool Park();
-  // Returns true iff the string can be parked.
-  bool is_parkable() const { return is_parkable_; }
+  // Returns true iff the string can be parked. This does not mean that the
+  // string can be parked now, merely that it is eligible to be parked at some
+  // point.
+  bool may_be_parked() const { return may_be_parked_; }
+  // Returns true if the string is parked.
+  bool is_parked() const;
 
  private:
+  enum class State;
+
+  // Whether the string can be parked now. Must be called with |mutex_| held,
+  // and the return value is valid as long as the mutex is held.
+  bool CanParkNow() const;
   void Unpark();
-  // Returns true if the string is parked.
-  bool is_parked() const { return is_parked_; }
+  void OnParkingCompleteOnMainThread();
 
-  Mutex mutex_;  // protects the variables below.
+  Mutex mutex_;  // protects lock_depth_.
   int lock_depth_;
-  String string_;
-  bool is_parked_;
 
-  const bool is_parkable_;
+  // Main thread only.
+  State state_;
+  String string_;
+#if DCHECK_IS_ON()
+  String parked_string_;
+#endif
+
+  const bool may_be_parked_;
+  const bool is_8bit_;
+  const unsigned length_;
 
 #if DCHECK_IS_ON()
   const ThreadIdentifier owning_thread_;
@@ -98,11 +112,13 @@
   }
 
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, Park);
+  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, AbortParking);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, Unpark);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, LockUnlock);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, LockParkedString);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, TableSimple);
   FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, TableMultiple);
+  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, AsanPoisoning);
   DISALLOW_COPY_AND_ASSIGN(ParkableStringImpl);
 };
 
@@ -126,7 +142,7 @@
   bool Is8Bit() const;
   bool IsNull() const { return !impl_; }
   unsigned length() const { return impl_ ? impl_->length() : 0; }
-  bool is_parkable() const { return impl_ && impl_->is_parkable(); }
+  bool may_be_parked() const { return impl_ && impl_->may_be_parked(); }
 
   ParkableStringImpl* Impl() const { return impl_ ? impl_.get() : nullptr; }
   // Returns an unparked version of the string.
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string_manager.cc b/third_party/blink/renderer/platform/bindings/parkable_string_manager.cc
index 2d173c0d..bf4c607 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string_manager.cc
+++ b/third_party/blink/renderer/platform/bindings/parkable_string_manager.cc
@@ -9,6 +9,7 @@
 #include "base/bind.h"
 #include "base/macros.h"
 #include "base/metrics/histogram_macros.h"
+#include "base/single_thread_task_runner.h"
 #include "third_party/blink/public/platform/platform.h"
 #include "third_party/blink/renderer/platform/bindings/parkable_string.h"
 #include "third_party/blink/renderer/platform/scheduler/public/thread.h"
@@ -32,6 +33,7 @@
   if (backgrounded_) {
     scoped_refptr<base::SingleThreadTaskRunner> task_runner =
         Platform::Current()->CurrentThread()->GetTaskRunner();
+    DCHECK(task_runner);
     task_runner->PostDelayedTask(
         FROM_HERE,
         base::BindOnce(&ParkableStringManager::ParkAllIfRendererBackgrounded,
@@ -55,22 +57,49 @@
 scoped_refptr<ParkableStringImpl> ParkableStringManager::Add(
     scoped_refptr<StringImpl>&& string) {
   StringImpl* raw_ptr = string.get();
-  auto it = table_.find(raw_ptr);
-  if (it != table_.end())
+  auto it = unparked_strings_.find(raw_ptr);
+  if (it != unparked_strings_.end())
     return it->value;
 
   auto new_parkable_string = base::MakeRefCounted<ParkableStringImpl>(
       std::move(string), ParkableStringImpl::ParkableState::kParkable);
-  table_.insert(raw_ptr, new_parkable_string.get());
+  unparked_strings_.insert(raw_ptr, new_parkable_string.get());
   return new_parkable_string;
 }
 
-void ParkableStringManager::Remove(StringImpl* string) {
-  DCHECK(string);
-  DCHECK(ShouldPark(*string));
-  auto it = table_.find(string);
-  DCHECK(it != table_.end());
-  table_.erase(it);
+void ParkableStringManager::Remove(ParkableStringImpl* string,
+                                   StringImpl* maybe_unparked_string) {
+  DCHECK(IsMainThread());
+  if (string->is_parked()) {
+    auto it = parked_strings_.find(string);
+    DCHECK(it != parked_strings_.end());
+    parked_strings_.erase(it);
+  } else {
+    DCHECK(maybe_unparked_string);
+    auto it = unparked_strings_.find(maybe_unparked_string);
+    DCHECK(it != unparked_strings_.end());
+    unparked_strings_.erase(it);
+  }
+}
+
+void ParkableStringManager::OnParked(ParkableStringImpl* newly_parked_string,
+                                     StringImpl* previous_unparked_string) {
+  DCHECK(IsMainThread());
+  DCHECK(newly_parked_string->is_parked());
+  auto it = unparked_strings_.find(previous_unparked_string);
+  DCHECK(it != unparked_strings_.end());
+  unparked_strings_.erase(it);
+  parked_strings_.insert(newly_parked_string);
+}
+
+void ParkableStringManager::OnUnparked(ParkableStringImpl* was_parked_string,
+                                       StringImpl* new_unparked_string) {
+  DCHECK(IsMainThread());
+  DCHECK(!was_parked_string->is_parked());
+  auto it = parked_strings_.find(was_parked_string);
+  DCHECK(it != parked_strings_.end());
+  parked_strings_.erase(it);
+  unparked_strings_.insert(new_unparked_string, was_parked_string);
 }
 
 void ParkableStringManager::ParkAllIfRendererBackgrounded() {
@@ -81,20 +110,26 @@
   if (!base::FeatureList::IsEnabled(kCompressParkableStringsInBackground))
     return;
 
-  size_t total_size = 0, count = 0;
-  for (ParkableStringImpl* str : table_.Values()) {
-    str->Park();
+  size_t total_size = 0;
+  for (ParkableStringImpl* str : parked_strings_)
     total_size += str->CharactersSizeInBytes();
-    count += 1;
+
+  for (ParkableStringImpl* str : unparked_strings_.Values()) {
+    str->Park();  // Parking is asynchronous.
+    total_size += str->CharactersSizeInBytes();
   }
 
   size_t total_size_kb = total_size / 1000;
   UMA_HISTOGRAM_COUNTS_100000("Memory.MovableStringsTotalSizeKb",
                               total_size_kb);
-  UMA_HISTOGRAM_COUNTS_1000("Memory.MovableStringsCount", table_.size());
+  UMA_HISTOGRAM_COUNTS_1000("Memory.MovableStringsCount", Size());
+}
+
+size_t ParkableStringManager::Size() const {
+  return parked_strings_.size() + unparked_strings_.size();
 }
 
 ParkableStringManager::ParkableStringManager()
-    : backgrounded_(false), table_() {}
+    : backgrounded_(false), unparked_strings_(), parked_strings_() {}
 
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string_manager.h b/third_party/blink/renderer/platform/bindings/parkable_string_manager.h
index 54b79a9..5c73fb0 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string_manager.h
+++ b/third_party/blink/renderer/platform/bindings/parkable_string_manager.h
@@ -8,11 +8,11 @@
 #include "base/feature_list.h"
 #include "base/macros.h"
 #include "base/memory/scoped_refptr.h"
-#include "base/single_thread_task_runner.h"
 #include "third_party/blink/renderer/platform/platform_export.h"
 #include "third_party/blink/renderer/platform/wtf/allocator.h"
 #include "third_party/blink/renderer/platform/wtf/hash_functions.h"
 #include "third_party/blink/renderer/platform/wtf/hash_map.h"
+#include "third_party/blink/renderer/platform/wtf/hash_set.h"
 #include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
 
 namespace blink {
@@ -44,17 +44,23 @@
   friend class ParkableStringImpl;
 
   scoped_refptr<ParkableStringImpl> Add(scoped_refptr<StringImpl>&&);
-  void Remove(StringImpl*);
+  void Remove(ParkableStringImpl*, StringImpl*);
+
+  void OnParked(ParkableStringImpl*, StringImpl*);
+  void OnUnparked(ParkableStringImpl*, StringImpl*);
 
   void ParkAllIfRendererBackgrounded();
+  size_t Size() const;
 
   ParkableStringManager();
 
   bool backgrounded_;
-  HashMap<StringImpl*, ParkableStringImpl*, PtrHash<StringImpl>> table_;
+  HashMap<StringImpl*, ParkableStringImpl*, PtrHash<StringImpl>>
+      unparked_strings_;
+  HashSet<ParkableStringImpl*, PtrHash<ParkableStringImpl>> parked_strings_;
 
-  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, TableSimple);
-  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, TableMultiple);
+  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, ManagerSimple);
+  FRIEND_TEST_ALL_PREFIXES(ParkableStringTest, ManagerMultipleStrings);
   DISALLOW_COPY_AND_ASSIGN(ParkableStringManager);
 };
 
diff --git a/third_party/blink/renderer/platform/bindings/parkable_string_test.cc b/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
index 9412308b..58671ad 100644
--- a/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
+++ b/third_party/blink/renderer/platform/bindings/parkable_string_test.cc
@@ -3,11 +3,13 @@
 // found in the LICENSE file.
 
 #include "third_party/blink/renderer/platform/bindings/parkable_string.h"
+#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
 #include "third_party/blink/renderer/platform/bindings/parkable_string_manager.h"
 
 #include <thread>
 #include <vector>
 
+#include "base/run_loop.h"
 #include "base/test/metrics/histogram_tester.h"
 #include "base/test/scoped_feature_list.h"
 #include "base/test/scoped_task_environment.h"
@@ -17,11 +19,26 @@
 
 namespace {
 
+constexpr size_t kSizeKb = 20;
+
 String MakeLargeString() {
-  std::vector<char> data(20000, 'a');
+  std::vector<char> data(kSizeKb * 1000, 'a');
   return String(String(data.data(), data.size()).ReleaseImpl());
 }
 
+void RunPostedTasks() {
+  base::RunLoop run_loop;
+  blink::scheduler::GetSingleThreadTaskRunnerForTesting()->PostTask(
+      FROM_HERE, run_loop.QuitClosure());
+  run_loop.Run();
+}
+
+bool ParkAndWait(const ParkableString& string) {
+  bool return_value = string.Impl()->Park();
+  RunPostedTasks();
+  return return_value;
+}
+
 }  // namespace
 
 class ParkableStringTest : public ::testing::Test {
@@ -44,7 +61,8 @@
   EXPECT_TRUE(parkable_abc.Is8Bit());
   EXPECT_EQ(3u, parkable_abc.length());
   EXPECT_EQ(3u, parkable_abc.CharactersSizeInBytes());
-  EXPECT_FALSE(parkable_abc.is_parkable());  // Small strings are not parkable.
+  EXPECT_FALSE(
+      parkable_abc.may_be_parked());  // Small strings are not parkable.
 
   EXPECT_EQ(String("abc"), parkable_abc.ToString());
   ParkableString copy = parkable_abc;
@@ -56,24 +74,69 @@
 
   {
     ParkableString parkable(MakeLargeString().ReleaseImpl());
-    EXPECT_TRUE(parkable.is_parkable());
+    EXPECT_TRUE(parkable.may_be_parked());
     EXPECT_FALSE(parkable.Impl()->is_parked());
-    EXPECT_TRUE(parkable.Impl()->Park());
+    EXPECT_TRUE(ParkAndWait(parkable));
     EXPECT_TRUE(parkable.Impl()->is_parked());
   }
 
   String large_string = MakeLargeString();
   ParkableString parkable(large_string.Impl());
-  EXPECT_TRUE(parkable.is_parkable());
+  EXPECT_TRUE(parkable.may_be_parked());
   // Not the only one to have a reference to the string.
-  EXPECT_FALSE(parkable.Impl()->Park());
+  EXPECT_FALSE(ParkAndWait(parkable));
   large_string = String();
-  EXPECT_TRUE(parkable.Impl()->Park());
+  EXPECT_TRUE(ParkAndWait(parkable));
 
   histogram_tester.ExpectBucketCount(
       "Memory.MovableStringParkingAction",
       ParkableStringImpl::ParkingAction::kParkedInBackground, 2);
   histogram_tester.ExpectTotalCount("Memory.MovableStringParkingAction", 2);
+
+  {
+    ParkableString parkable(MakeLargeString().ReleaseImpl());
+    EXPECT_TRUE(parkable.may_be_parked());
+    EXPECT_FALSE(parkable.Impl()->is_parked());
+    EXPECT_TRUE(parkable.Impl()->Park());
+    parkable = ParkableString();  // release the reference.
+    RunPostedTasks();             // Should not crash.
+  }
+}
+
+TEST_F(ParkableStringTest, AbortParking) {
+  ParkableString parkable(MakeLargeString().ReleaseImpl());
+  ParkableStringImpl* impl = parkable.Impl();
+
+  EXPECT_TRUE(parkable.may_be_parked());
+  EXPECT_FALSE(impl->is_parked());
+
+  // The string is locked at the end of parking, should cancel it.
+  EXPECT_TRUE(impl->Park());
+  impl->Lock();
+  RunPostedTasks();
+  EXPECT_FALSE(impl->is_parked());
+
+  // Unlock, OK to park.
+  impl->Unlock();
+  EXPECT_TRUE(ParkAndWait(parkable));
+  impl->ToString();
+
+  // |ToString()| cancels unparking as |content| is kept alive.
+  EXPECT_TRUE(impl->Park());
+  String content = impl->ToString();
+  RunPostedTasks();
+  EXPECT_FALSE(impl->is_parked());
+  content = String();
+  EXPECT_TRUE(ParkAndWait(parkable));
+  impl->ToString();
+
+  // Transient |Lock()| or |ToString()| doesn't cancel parking.
+  EXPECT_TRUE(impl->Park());
+  impl->Lock();
+  impl->ToString();
+  impl->Unlock();
+  RunPostedTasks();
+  EXPECT_TRUE(impl->is_parked());
 }
 
 TEST_F(ParkableStringTest, Unpark) {
@@ -81,9 +144,9 @@
 
   ParkableString parkable(MakeLargeString().Impl());
   String unparked_copy = parkable.ToString().IsolatedCopy();
-  EXPECT_TRUE(parkable.is_parkable());
+  EXPECT_TRUE(parkable.may_be_parked());
   EXPECT_FALSE(parkable.Impl()->is_parked());
-  EXPECT_TRUE(parkable.Impl()->Park());
+  EXPECT_TRUE(ParkAndWait(parkable));
   EXPECT_TRUE(parkable.Impl()->is_parked());
 
   String unparked = parkable.ToString();
@@ -113,22 +176,23 @@
   EXPECT_EQ(0, impl->lock_depth_);
 
   parkable.Lock();
-  EXPECT_FALSE(impl->Park());
+  EXPECT_FALSE(ParkAndWait(parkable));
   parkable.Unlock();
-  EXPECT_TRUE(impl->Park());
+  EXPECT_TRUE(ParkAndWait(parkable));
 
+  parkable.ToString();
   std::thread t([&]() { parkable.Lock(); });
   t.join();
-  EXPECT_FALSE(impl->Park());
+  EXPECT_FALSE(ParkAndWait(parkable));
   parkable.Unlock();
-  EXPECT_TRUE(impl->Park());
+  EXPECT_TRUE(ParkAndWait(parkable));
 }
 
 TEST_F(ParkableStringTest, LockParkedString) {
   ParkableString parkable(MakeLargeString().Impl());
   ParkableStringImpl* impl = parkable.Impl();
   EXPECT_EQ(0, impl->lock_depth_);
-  EXPECT_TRUE(impl->Park());
+  EXPECT_TRUE(ParkAndWait(parkable));
 
   parkable.Lock();  // Locking doesn't unpark.
   EXPECT_TRUE(impl->is_parked());
@@ -136,37 +200,39 @@
   EXPECT_FALSE(impl->is_parked());
   EXPECT_EQ(1, impl->lock_depth_);
 
-  EXPECT_FALSE(impl->Park());
+  EXPECT_FALSE(ParkAndWait(parkable));
+
   parkable.Unlock();
   EXPECT_EQ(0, impl->lock_depth_);
-  EXPECT_TRUE(impl->Park());
+  EXPECT_TRUE(ParkAndWait(parkable));
   EXPECT_TRUE(impl->is_parked());
 }
 
-TEST_F(ParkableStringTest, TableSimple) {
+TEST_F(ParkableStringTest, ManagerSimple) {
   base::HistogramTester histogram_tester;
 
-  std::vector<char> data(20000, 'a');
-  ParkableString parkable(String(data.data(), data.size()).ReleaseImpl());
+  ParkableString parkable(MakeLargeString().Impl());
   ASSERT_FALSE(parkable.Impl()->is_parked());
 
   auto& manager = ParkableStringManager::Instance();
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
 
-  // Small strings are not in the table.
+  // Small strings are not tracked.
   ParkableString small(String("abc").ReleaseImpl());
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
 
   // No parking as the current state is not "backgrounded".
   manager.SetRendererBackgrounded(false);
   ASSERT_FALSE(manager.IsRendererBackgrounded());
   manager.ParkAllIfRendererBackgrounded();
+  RunPostedTasks();
   EXPECT_FALSE(parkable.Impl()->is_parked());
   histogram_tester.ExpectTotalCount("Memory.MovableStringsCount", 0);
 
   manager.SetRendererBackgrounded(true);
   ASSERT_TRUE(manager.IsRendererBackgrounded());
   manager.ParkAllIfRendererBackgrounded();
+  RunPostedTasks();
   EXPECT_TRUE(parkable.Impl()->is_parked());
   histogram_tester.ExpectUniqueSample("Memory.MovableStringsCount", 1, 1);
 
@@ -174,6 +240,7 @@
   parkable.ToString();
   EXPECT_FALSE(parkable.Impl()->is_parked());
   manager.ParkAllIfRendererBackgrounded();
+  RunPostedTasks();
   EXPECT_TRUE(parkable.Impl()->is_parked());
   histogram_tester.ExpectUniqueSample("Memory.MovableStringsCount", 1, 2);
 
@@ -182,11 +249,13 @@
   String alive_unparked = parkable.ToString();  // Unparked in foreground.
   manager.SetRendererBackgrounded(true);
   manager.ParkAllIfRendererBackgrounded();
+  RunPostedTasks();
   EXPECT_FALSE(parkable.Impl()->is_parked());
 
   // Other reference is dropped, OK to park.
   alive_unparked = String();
   manager.ParkAllIfRendererBackgrounded();
+  RunPostedTasks();
   EXPECT_TRUE(parkable.Impl()->is_parked());
 
   histogram_tester.ExpectTotalCount("Memory.MovableStringParkingAction", 5);
@@ -201,50 +270,60 @@
       ParkableStringImpl::ParkingAction::kUnparkedInForeground, 1);
 }
 
-TEST_F(ParkableStringTest, TableMultiple) {
+TEST_F(ParkableStringTest, ManagerMultipleStrings) {
   base::HistogramTester histogram_tester;
 
-  size_t size_kb = 20;
-  std::vector<char> data(size_kb * 1000, 'a');
-  ParkableString parkable(String(data.data(), data.size()).ReleaseImpl());
-  ParkableString parkable2(String(data.data(), data.size()).ReleaseImpl());
+  ParkableString parkable(MakeLargeString().Impl());
+  ParkableString parkable2(MakeLargeString().Impl());
 
   auto& manager = ParkableStringManager::Instance();
-  EXPECT_EQ(2u, manager.table_.size());
+  EXPECT_EQ(2u, manager.Size());
 
   parkable2 = ParkableString();
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
 
   ParkableString copy = parkable;
   parkable = ParkableString();
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
   copy = ParkableString();
-  EXPECT_EQ(0u, manager.table_.size());
+  EXPECT_EQ(0u, manager.Size());
 
-  String str(data.data(), data.size());
+  String str = MakeLargeString();
   ParkableString parkable3(str.Impl());
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
   // De-duplicated.
   ParkableString other_parkable3(str.Impl());
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
   EXPECT_EQ(parkable3.Impl(), other_parkable3.Impl());
 
-  // If all the references to a string are in the table, park it.
+  // If all the references to a string are internal, park it.
   str = String();
+  // This string is not parkable, bur should still be in size and count
+  // histograms.
+  ParkableString parkable4(MakeLargeString().Impl());
+  String parkable4_content = parkable4.ToString();
+
   manager.SetRendererBackgrounded(true);
   ASSERT_TRUE(manager.IsRendererBackgrounded());
-  manager.ParkAllIfRendererBackgrounded();
+  manager.ParkAllIfRendererBackgrounded();  // Records count and size histograms
+  RunPostedTasks();
   EXPECT_TRUE(parkable3.Impl()->is_parked());
+  manager.ParkAllIfRendererBackgrounded();  // Records count and size histograms
+  RunPostedTasks();
 
-  // Only drop it from the table when the last one is gone.
+  // Only drop it from the managed strings when the last one is gone.
   parkable3 = ParkableString();
-  EXPECT_EQ(1u, manager.table_.size());
+  EXPECT_EQ(2u, manager.Size());
   other_parkable3 = ParkableString();
-  EXPECT_EQ(0u, manager.table_.size());
+  EXPECT_EQ(1u, manager.Size());
+  parkable4 = ParkableString();
+  EXPECT_EQ(0u, manager.Size());
 
-  histogram_tester.ExpectUniqueSample("Memory.MovableStringsCount", 1, 1);
+  // 1 parked, 1 unparked. Bucket count is 2 as we collected stats twice.
+  histogram_tester.ExpectUniqueSample("Memory.MovableStringsCount", 2, 2);
   histogram_tester.ExpectUniqueSample("Memory.MovableStringsTotalSizeKb",
-                                      size_kb, 1);
+                                      2 * kSizeKb, 2);
+
   histogram_tester.ExpectTotalCount("Memory.MovableStringParkingAction", 1);
   histogram_tester.ExpectBucketCount(
       "Memory.MovableStringParkingAction",
@@ -267,4 +346,13 @@
   t.join();
 }
 
+#if defined(ADDRESS_SANITIZER)
+TEST_F(ParkableStringTest, AsanPoisoningTest) {
+  ParkableString parkable(MakeLargeString().ReleaseImpl());
+  const LChar* data = parkable.ToString().Characters8();
+  EXPECT_TRUE(ParkAndWait(parkable));
+  EXPECT_DEATH(EXPECT_NE(0, data[10]), "");
+}
+#endif  // defined(ADDRESS_SANITIZER)
+
 }  // namespace blink
diff --git a/third_party/blink/renderer/platform/bindings/string_resource.h b/third_party/blink/renderer/platform/bindings/string_resource.h
index 3207d25..d6f50c1 100644
--- a/third_party/blink/renderer/platform/bindings/string_resource.h
+++ b/third_party/blink/renderer/platform/bindings/string_resource.h
@@ -164,7 +164,9 @@
     DCHECK(!parkable_string_.Is8Bit());
   }
 
-  bool IsCacheable() const override { return !parkable_string_.is_parkable(); }
+  bool IsCacheable() const override {
+    return !parkable_string_.may_be_parked();
+  }
 
   void Lock() const override { parkable_string_.Lock(); }
 
@@ -188,7 +190,9 @@
     DCHECK(parkable_string_.Is8Bit());
   }
 
-  bool IsCacheable() const override { return !parkable_string_.is_parkable(); }
+  bool IsCacheable() const override {
+    return !parkable_string_.may_be_parked();
+  }
 
   void Lock() const override { parkable_string_.Lock(); }
 
diff --git a/third_party/blink/renderer/platform/exported/web_runtime_features.cc b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
index 5c7882f..0a72335 100644
--- a/third_party/blink/renderer/platform/exported/web_runtime_features.cc
+++ b/third_party/blink/renderer/platform/exported/web_runtime_features.cc
@@ -540,6 +540,10 @@
   RuntimeEnabledFeatures::SetAutomationControlledEnabled(enable);
 }
 
+void WebRuntimeFeatures::EnableWorkStealingInScriptRunner(bool enable) {
+  RuntimeEnabledFeatures::SetWorkStealingInScriptRunnerEnabled(enable);
+}
+
 void WebRuntimeFeatures::EnableScheduledScriptStreaming(bool enable) {
   RuntimeEnabledFeatures::SetScheduledScriptStreamingEnabled(enable);
 }
diff --git a/third_party/blink/renderer/platform/graphics/OWNERS b/third_party/blink/renderer/platform/graphics/OWNERS
index fa782ad..aef11af 100644
--- a/third_party/blink/renderer/platform/graphics/OWNERS
+++ b/third_party/blink/renderer/platform/graphics/OWNERS
@@ -5,7 +5,6 @@
 fmalita@chromium.org
 fserb@chromium.org
 jbroman@chromium.org
-junov@chromium.org
 kbr@chromium.org
 pdr@chromium.org
 schenney@chromium.org
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource.cc b/third_party/blink/renderer/platform/loader/fetch/resource.cc
index 0c4ae35..062c3c78 100644
--- a/third_party/blink/renderer/platform/loader/fetch/resource.cc
+++ b/third_party/blink/renderer/platform/loader/fetch/resource.cc
@@ -272,7 +272,7 @@
 }
 
 void Resource::NotifyFinished() {
-  CHECK(IsFinishedInternal());
+  DCHECK(IsLoaded());
 
   ResourceClientWalker<ResourceClient> w(clients_);
   while (ResourceClient* c = w.Next()) {
@@ -299,10 +299,6 @@
       data_ = SharedBuffer::Create(data, length);
     SetEncodedSize(data_->size());
   }
-  NotifyDataReceived(data, length);
-}
-
-void Resource::NotifyDataReceived(const char* data, size_t length) {
   ResourceClientWalker<ResourceClient> w(Clients());
   while (ResourceClient* c = w.Next())
     c->DataReceived(this, data, length);
@@ -621,7 +617,7 @@
   }
   if (!HasClient(c))
     return;
-  if (IsFinishedInternal()) {
+  if (IsLoaded()) {
     c->NotifyFinished(this);
     if (clients_.Contains(c)) {
       finished_clients_.insert(c);
@@ -693,12 +689,6 @@
 
   WillAddClientOrObserver();
   finish_observers_.insert(client);
-  // Despite these being "Finish" observers, what they actually care about is
-  // whether the resource is "Loaded", not "Finished" (e.g. link onload). Hence
-  // we check IsLoaded directly here, rather than IsFinishedInternal.
-  //
-  // TODO(leszeks): Either rename FinishObservers to LoadedObservers, or the
-  // NotifyFinished method of ResourceClient to NotifyProcessed (or similar).
   if (IsLoaded())
     TriggerNotificationForFinishObservers(task_runner);
 }
diff --git a/third_party/blink/renderer/platform/loader/fetch/resource.h b/third_party/blink/renderer/platform/loader/fetch/resource.h
index 01e6ead..4f16c04 100644
--- a/third_party/blink/renderer/platform/loader/fetch/resource.h
+++ b/third_party/blink/renderer/platform/loader/fetch/resource.h
@@ -427,19 +427,6 @@
  protected:
   Resource(const ResourceRequest&, ResourceType, const ResourceLoaderOptions&);
 
-  // Returns true if the resource has finished any processing it wanted to do
-  // after loading. Should only be used to decide whether to call
-  // NotifyFinished.
-  //
-  // By default this is the same as being loaded (i.e. no processing), but it is
-  // used by ScriptResource to signal that streaming JavaScript compilation
-  // completed. Note that classes overloading this method should also overload
-  // NotifyFinished to not call Resource::NotifyFinished until this value
-  // becomes true.
-  // TODO(hiroshige): Remove this when ScriptResourceContent is introduced.
-  virtual bool IsFinishedInternal() const { return IsLoaded(); }
-
-  virtual void NotifyDataReceived(const char* data, size_t size);
   virtual void NotifyFinished();
 
   void MarkClientFinished(ResourceClient*);
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
index 037eefe..467cb8b8 100644
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -319,7 +319,7 @@
       status: "experimental",
     },
     {
-      name: "CSSPseudoIS",
+      name: "CSSPseudoWhere",
       status: "experimental",
     },
     {
@@ -1415,6 +1415,10 @@
       status: "experimental"
     },
     {
+      name: "WorkStealingInScriptRunner",
+      status: "experimental",
+    },
+    {
       name: "WritableFiles",
       status: "experimental",
     },
diff --git a/third_party/blink/tools/blinkpy/web_tests/controllers/layout_test_runner.py b/third_party/blink/tools/blinkpy/web_tests/controllers/layout_test_runner.py
index 446be23..4ae36b8 100644
--- a/third_party/blink/tools/blinkpy/web_tests/controllers/layout_test_runner.py
+++ b/third_party/blink/tools/blinkpy/web_tests/controllers/layout_test_runner.py
@@ -74,13 +74,14 @@
         self._current_run_results = None
 
     def run_tests(self, expectations, test_inputs, tests_to_skip, num_workers, retry_attempt):
+        batch_size = self._options.derived_batch_size
+
         # If we're retrying a test, then it's because we think it might be flaky
         # and rerunning it might provide a different result. We must restart
         # content shell to get a valid result, as otherwise state can leak
         # from previous tests. To do so, we set a batch size of 1, as that
         # prevents content shell reuse.
-        batch_size = self._options.batch_size or 0
-        if retry_attempt >= 1:
+        if not self._options.must_use_derived_batch_size and retry_attempt >= 1:
             batch_size = 1
 
         self._expectations = expectations
diff --git a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
index 244cc0a..2b5875c 100644
--- a/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
+++ b/third_party/blink/tools/blinkpy/web_tests/controllers/single_test_runner.py
@@ -78,20 +78,6 @@
                 not self._port.lookup_virtual_reference_args(self._test_name)):
             self._reference_driver = secondary_driver
 
-        if self._reference_files:
-            # Detect and report a test which has a wrong combination of expectation files.
-            # For example, if 'foo.html' has two expectation files, 'foo-expected.html' and
-            # 'foo-expected.png', we should warn users. One test file must be used exclusively
-            # in either layout tests or reftests, but not in both. Text expectation is an
-            # exception.
-            for suffix in self._port.BASELINE_EXTENSIONS:
-                if suffix == '.txt':
-                    continue
-                expected_filename = self._port.expected_filename(self._test_name, suffix)
-                if self._filesystem.exists(expected_filename):
-                    _log.error('%s is a reftest, but has an unused expectation file. Please remove %s.',
-                               self._test_name, expected_filename)
-
     def _expected_driver_output(self):
         return DriverOutput(self._port.expected_text(self._test_name),
                             self._port.expected_image(self._test_name),
@@ -118,13 +104,6 @@
         if self._options.enable_sanitizer:
             return self._run_sanitized_test()
         if self._options.reset_results or self._options.copy_baselines:
-            if self._reference_files:
-                expected_txt_filename = self._port.expected_filename(self._test_name, '.txt')
-                if not self._filesystem.exists(expected_txt_filename):
-                    reftest_type = set([reference_file[0] for reference_file in self._reference_files])
-                    result = TestResult(self._test_name, reftest_type=reftest_type)
-                    result.type = test_expectations.SKIP
-                    return result
             return self._run_rebaseline()
         if self._reference_files:
             return self._run_reftest()
@@ -160,12 +139,6 @@
         If --reset-results, in the returned result we treat baseline mismatch as success."""
         driver_output = self._driver.run_test(self._driver_input())
         expected_driver_output = self._expected_driver_output()
-        if self._reference_files:
-            # Ignore any image differences of a reftest because we don't actually run
-            # the reference and also can't rebaseline the image result.
-            expected_driver_output.image = driver_output.image
-            expected_driver_output.image_hash = driver_output.image_hash
-
         actual_failures = self._compare_output(expected_driver_output, driver_output).failures
         failures = self._handle_error(driver_output) if self._options.reset_results else actual_failures
         test_result_writer.write_test_result(self._filesystem, self._port, self._results_directory,
@@ -174,8 +147,6 @@
         return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr(),
                           pid=driver_output.pid, crash_site=driver_output.crash_site)
 
-    _render_tree_dump_pattern = re.compile(r"^layer at \(\d+,\d+\) size \d+x\d+\n")
-
     def _update_or_add_new_baselines(self, driver_output, failures):
         """Updates or adds new baselines for the test if necessary."""
         if (test_failures.has_failure_type(test_failures.FailureTimeout, failures) or
@@ -191,18 +162,23 @@
         #    if there are failed assertions we need to create a new baseline.
         #    Note that the created baseline might be redundant, but users can
         #    optimize them later with optimize-baselines.
+        if self._is_all_pass_testharness_text_not_needing_baseline(driver_output.text):
+            driver_output.text = None
         self._save_baseline_data(driver_output.text, '.txt',
                                  test_failures.has_failure_type(test_failures.FailureMissingResult, failures) or
                                  test_failures.has_failure_type(test_failures.FailureTestHarnessAssertion, failures))
         self._save_baseline_data(driver_output.audio, '.wav',
                                  test_failures.has_failure_type(test_failures.FailureMissingAudio, failures))
-        self._save_baseline_data(driver_output.image, '.png',
+
+        expected_png = driver_output.image
+        if self._reference_files:
+            _log.warning('Can not rebaseline the image baseline of reftest %s', self._test_name)
+            # Let _save_baseline_data remove the '-expected.png' if it exists.
+            expected_png = None
+        self._save_baseline_data(expected_png, '.png',
                                  test_failures.has_failure_type(test_failures.FailureMissingImage, failures))
 
     def _save_baseline_data(self, data, extension, force_create_new_baseline):
-        if data is None:
-            return
-
         port = self._port
         fs = self._filesystem
 
@@ -227,23 +203,27 @@
         # avoid extra baseline if the new baseline is the same as the fallback baseline.
         generic_dir = fs.join(port.layout_tests_dir(),
                               fs.dirname(port.lookup_virtual_test_base(self._test_name) or self._test_name))
-        if output_dir != generic_dir and fs.exists(output_path):
+        if (not data or output_dir != generic_dir) and fs.exists(output_path):
             _log.info('Removing the current baseline "%s"', port.relative_test_filename(output_path))
             fs.remove(output_path)
 
+        if not data:
+            _log.info('Not creating new baseline because the test does not need it')
+            return
+
         # Note that current_expected_path may change because of the above file removal.
         current_expected_path = port.expected_filename(self._test_name, extension)
         if fs.exists(current_expected_path) and fs.sha1(current_expected_path) == hashlib.sha1(data).hexdigest():
             if self._options.reset_results:
-                _log.info('Not writing new expected result "%s" because it is the same as the current expected result',
+                _log.info('Not writing new baseline "%s" because it is the same as the current baseline',
                           port.relative_test_filename(output_path))
             else:
-                _log.info('Not copying baseline to "%s" because the actual result is the same as the current expected result',
+                _log.info('Not copying baseline to "%s" because the actual result is the same as the current baseline',
                           port.relative_test_filename(output_path))
             return
 
         if self._options.reset_results:
-            _log.info('Writing new expected result "%s"', port.relative_test_filename(output_path))
+            _log.info('Writing new baseline "%s"', port.relative_test_filename(output_path))
             port.update_baseline(output_path, data)
         else:
             _log.info('Copying baseline to "%s"', port.relative_test_filename(output_path))
@@ -296,40 +276,91 @@
             return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr(),
                               pid=driver_output.pid, crash_site=driver_output.crash_site)
 
-        is_testharness_test, testharness_failures = self._compare_testharness_test(driver_output, expected_driver_output)
-        if is_testharness_test:
+        failures.extend(self._check_extra_and_missing_baselines(expected_driver_output, driver_output))
+
+        testharness_completed, testharness_failures = self._compare_testharness_test(expected_driver_output,
+                                                                                     driver_output)
+        if testharness_completed:
             failures.extend(testharness_failures)
-
-        compare_functions = []
-        compare_image_fn = (self._compare_image, (expected_driver_output, driver_output))
-        compare_txt_fn = (self._compare_text, (expected_driver_output.text, driver_output.text))
-        compare_audio_fn = (self._compare_audio, (expected_driver_output.audio, driver_output.audio))
-
-        if not is_testharness_test:
-            compare_functions.append(compare_txt_fn)
-        compare_functions.append(compare_image_fn)
-        compare_functions.append(compare_audio_fn)
-
-        for func, args in compare_functions:
-            failures.extend(func(*args))
+        else:
+            failures.extend(self._compare_text(expected_driver_output, driver_output))
+            failures.extend(self._compare_image(expected_driver_output, driver_output))
+            failures.extend(self._compare_audio(expected_driver_output, driver_output))
 
         has_repaint_overlay = (repaint_overlay.result_contains_repaint_rects(expected_driver_output.text) or
                                repaint_overlay.result_contains_repaint_rects(driver_output.text))
         return TestResult(self._test_name, failures, driver_output.test_time, driver_output.has_stderr(),
                           pid=driver_output.pid, has_repaint_overlay=has_repaint_overlay)
 
-    def _compare_testharness_test(self, driver_output, expected_driver_output):
+    def _report_extra_baseline(self, driver_output, extension, message):
+        """If the baseline file exists, logs an error and returns True."""
+        expected_file = self._port.expected_filename(self._test_name, extension, return_default=False)
+        if expected_file and not driver_output.crash and not driver_output.timeout:
+            _log.error('%s %s, but has an extra baseline file. Please remove %s' %
+                       (self._test_name, message, expected_file))
+            return True
+        return False
+
+    def _is_all_pass_testharness_text_not_needing_baseline(self, text_result):
+        return (text_result and testharness_results.is_all_pass_testharness_result(text_result) and
+                # An all-pass testharness test doesn't need the test baseline unless
+                # if it is overriding a fallback one.
+                not self._port.fallback_expected_filename(self._test_name, '.txt'))
+
+    def _check_extra_and_missing_baselines(self, expected_driver_output, driver_output):
+        failures = []
+
+        if driver_output.text:
+            if self._is_all_pass_testharness_text_not_needing_baseline(driver_output.text):
+                if self._report_extra_baseline(driver_output, '.txt', 'is a all-pass testharness test'):
+                    # TODO(wangxianzhu): Make this a failure.
+                    pass
+            elif testharness_results.is_testharness_output(driver_output.text):
+                # We only need -expected.txt for a testharness test when we
+                # expect it to fail or produce additional console output (when
+                # -expected.txt is optional), so don't report missing
+                # -expected.txt for testharness tests.
+                pass
+            elif self._reference_files:
+                # A reftest's -expected.txt is optional. TODO(wangxianzhu): May
+                # let reftests use the standard baseline existence rule.
+                pass
+            elif not expected_driver_output.text:
+                failures.append(test_failures.FailureMissingResult())
+        elif self._report_extra_baseline(driver_output, '.txt', 'does not produce text result'):
+            failures.append(test_failures.FailureTextMismatch())
+
+        if driver_output.image_hash:
+            if self._reference_files:
+                if self._report_extra_baseline(driver_output, '.png', 'is a reftest'):
+                    # TODO(wangxianzhu): Make this a failure.
+                    pass
+            else:
+                if not expected_driver_output.image:
+                    failures.append(test_failures.FailureMissingImage())
+                if not expected_driver_output.image_hash:
+                    failures.append(test_failures.FailureMissingImageHash())
+        elif self._report_extra_baseline(driver_output, '.png', 'does not produce image result'):
+            failures.append(test_failures.FailureImageHashMismatch())
+
+        if driver_output.audio:
+            if not expected_driver_output.audio:
+                failures.append(test_failures.FailureMissingAudio())
+        elif self._report_extra_baseline(driver_output, '.wav', 'does not produce audio result'):
+            failures.append(test_failures.FailureAudioMismatch())
+
+        return failures
+
+    def _compare_testharness_test(self, expected_driver_output, driver_output):
+        """Returns (testharness_completed, testharness_failures)."""
+        if not driver_output.text:
+            return False, []
         if expected_driver_output.text:
+            # Will compare text if there is expected text.
             return False, []
-
-        if self._is_render_tree(driver_output.text):
+        if not testharness_results.is_testharness_output(driver_output.text):
             return False, []
-
-        text = driver_output.text or ''
-
-        if not testharness_results.is_testharness_output(text):
-            return False, []
-        if not testharness_results.is_testharness_output_passing(text):
+        if not testharness_results.is_testharness_output_passing(driver_output.text):
             return True, [test_failures.FailureTestHarnessAssertion()]
         return True, []
 
@@ -339,11 +370,11 @@
     def _is_layer_tree(self, text):
         return text and '{\n  "layers": [' in text
 
-    def _compare_text(self, expected_text, actual_text):
-        if not actual_text:
+    def _compare_text(self, expected_driver_output, driver_output):
+        expected_text = expected_driver_output.text
+        actual_text = driver_output.text
+        if not expected_text or not actual_text:
             return []
-        if not expected_text:
-            return [test_failures.FailureMissingResult()]
 
         normalized_actual_text = self._get_normalized_output_text(actual_text)
         # Assuming expected_text is already normalized.
@@ -358,11 +389,11 @@
             return text
 
         def remove_ng_text(results):
-          processed = re.sub(r'LayoutNG(BlockFlow|ListItem|TableCell)', r'Layout\1', results)
-          # LayoutTableCaption doesn't override LayoutBlockFlow::GetName, so
-          # render tree dumps have "LayoutBlockFlow" for captions.
-          processed = re.sub('LayoutNGTableCaption', 'LayoutBlockFlow', processed)
-          return processed
+            processed = re.sub(r'LayoutNG(BlockFlow|ListItem|TableCell)', r'Layout\1', results)
+            # LayoutTableCaption doesn't override LayoutBlockFlow::GetName, so
+            # render tree dumps have "LayoutBlockFlow" for captions.
+            processed = re.sub('LayoutNGTableCaption', 'LayoutBlockFlow', processed)
+            return processed
 
         def is_ng_name_mismatch(expected, actual):
             if not re.search("LayoutNG(BlockFlow|ListItem|TableCaption|TableCell)", actual):
@@ -399,14 +430,12 @@
         # Spaces and newlines
         return [test_failures.FailureSpaceTabLineBreakTextMismatch()]
 
-    def _compare_audio(self, expected_audio, actual_audio):
-        failures = []
-        if (expected_audio and actual_audio and
-                self._port.do_audio_results_differ(expected_audio, actual_audio)):
-            failures.append(test_failures.FailureAudioMismatch())
-        elif actual_audio and not expected_audio:
-            failures.append(test_failures.FailureMissingAudio())
-        return failures
+    def _compare_audio(self, expected_driver_output, driver_output):
+        if not expected_driver_output.audio or not driver_output.audio:
+            return []
+        if self._port.do_audio_results_differ(expected_driver_output.audio, driver_output.audio):
+            return [test_failures.FailureAudioMismatch()]
+        return []
 
     def _get_normalized_output_text(self, output):
         """Returns the normalized text output, i.e. the output in which
@@ -418,57 +447,57 @@
         # the normalized text expectation files.
         return output.replace('\r\r\n', '\r\n').replace('\r\n', '\n')
 
-    # FIXME: This function also creates the image diff. Maybe that work should
-    # be handled elsewhere?
     def _compare_image(self, expected_driver_output, driver_output):
-        failures = []
-        # If we didn't produce a hash file, this test must be text-only.
-        if driver_output.image_hash is None:
-            return failures
-        if not expected_driver_output.image:
-            failures.append(test_failures.FailureMissingImage())
-        elif not expected_driver_output.image_hash:
-            failures.append(test_failures.FailureMissingImageHash())
-        elif driver_output.image_hash != expected_driver_output.image_hash:
+        if not expected_driver_output.image or not expected_driver_output.image_hash:
+            return []
+        if not driver_output.image or not driver_output.image_hash:
+            return []
+
+        if driver_output.image_hash != expected_driver_output.image_hash:
             diff, err_str = self._port.diff_image(expected_driver_output.image, driver_output.image)
             if err_str:
                 _log.warning('  %s : %s', self._test_name, err_str)
-                failures.append(test_failures.FailureImageHashMismatch())
                 driver_output.error = (driver_output.error or '') + err_str
-            else:
-                driver_output.image_diff = diff
-                if driver_output.image_diff:
-                    failures.append(test_failures.FailureImageHashMismatch())
-                else:
-                    # See https://bugs.webkit.org/show_bug.cgi?id=69444 for why this isn't a full failure.
-                    _log.warning('  %s -> pixel hash failed (but diff passed)', self._test_name)
-        return failures
+                return [test_failures.FailureImageHashMismatch()]
+
+            driver_output.image_diff = diff
+            if driver_output.image_diff:
+                return [test_failures.FailureImageHashMismatch()]
+            # See https://bugs.webkit.org/show_bug.cgi?id=69444 for why this isn't a full failure.
+            _log.warning('  %s -> pixel hash failed (but diff passed)', self._test_name)
+
+        return []
 
     def _run_reftest(self):
         test_output = self._driver.run_test(self._driver_input())
         total_test_time = test_output.test_time
-        expected_output = None
-        test_result = None
 
         expected_text = self._port.expected_text(self._test_name)
         expected_text_output = DriverOutput(text=expected_text, image=None, image_hash=None, audio=None)
+        # Compare text only if there the optional text baseline exists.
+        if expected_text is None:
+            test_output.text = None
+        # This _compare_output compares text if expected text exists, ignores
+        # image, checks for extra baselines, and generates crash or timeout
+        # failures if needed.
+        compare_text_result = self._compare_output(expected_text_output, test_output)
 
         # If the test crashed, or timed out, there's no point in running the reference at all.
         # This can save a lot of execution time if we have a lot of crashes or timeouts.
         if test_output.crash or test_output.timeout:
-            test_result = self._compare_output(expected_text_output, test_output)
-
             if test_output.crash:
-                test_result_writer.write_test_result(self._filesystem, self._port, self._results_directory,
-                                                     self._test_name, test_output, expected_text_output, test_result.failures)
-            return test_result
+                test_result_writer.write_test_result(
+                    self._filesystem, self._port, self._results_directory, self._test_name,
+                    test_output, expected_text_output, compare_text_result.failures)
+            return compare_text_result
 
         # A reftest can have multiple match references and multiple mismatch references;
         # the test fails if any mismatch matches and all of the matches don't match.
         # To minimize the number of references we have to check, we run all of the mismatches first,
         # then the matches, and short-circuit out as soon as we can.
         # Note that sorting by the expectation sorts "!=" before "==" so this is easy to do.
-
+        expected_output = None
+        test_result = None
         putAllMismatchBeforeMatch = sorted
         reference_test_names = []
         for expectation, reference_filename in putAllMismatchBeforeMatch(self._reference_files):
@@ -489,13 +518,12 @@
                 break
 
         assert expected_output
+        assert test_result
 
-        if expected_text:
-            text_output = DriverOutput(text=test_output.text, image=None, image_hash=None, audio=None)
-            text_compare_result = self._compare_output(expected_text_output, text_output)
-            test_result.failures.extend(text_compare_result.failures)
-            test_result.has_repaint_overlay = text_compare_result.has_repaint_overlay
-            expected_output.text = expected_text_output.text
+        # Combine compare_text_result and test_result
+        test_result.failures.extend(compare_text_result.failures)
+        test_result.has_repaint_overlay = compare_text_result.has_repaint_overlay
+        expected_output.text = expected_text_output.text
 
         test_result_writer.write_test_result(self._filesystem, self._port, self._results_directory,
                                              self._test_name, test_output, expected_output, test_result.failures)
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/base.py b/third_party/blink/tools/blinkpy/web_tests/port/base.py
index 9115150a..ec9a9731 100644
--- a/third_party/blink/tools/blinkpy/web_tests/port/base.py
+++ b/third_party/blink/tools/blinkpy/web_tests/port/base.py
@@ -297,7 +297,7 @@
             # Relaunching the driver periodically helps keep it under control.
             return 40
         # The default is infinite batch size.
-        return None
+        return 0
 
     def default_child_processes(self):
         """Returns the number of child processes to use for this port."""
@@ -602,7 +602,8 @@
         Returns:
             An absolute path to its expected results, or None if not found.
         """
-        # FIXME: The [0] here is very mysterious, as is the destructured return.
+        # The [0] means the first expected baseline (which is the one to be
+        # used) in the fallback paths.
         platform_dir, baseline_filename = self.expected_baselines(test_name, extension, match=match)[0]
         if platform_dir:
             return self._filesystem.join(platform_dir, baseline_filename)
@@ -616,6 +617,25 @@
             return self._filesystem.join(self.layout_tests_dir(), baseline_filename)
         return None
 
+    def fallback_expected_filename(self, test_name, extension):
+        """Given a test name, returns an absolute path to its next fallback baseline.
+        Args:
+            same as expected_filename()
+        Returns:
+            An absolute path to the next fallback baseline, or None if not found.
+        """
+        baselines = self.expected_baselines(test_name, extension, all_baselines=True)
+        if len(baselines) < 2:
+            actual_test_name = self.lookup_virtual_test_base(test_name)
+            if actual_test_name:
+                return self.fallback_expected_filename(actual_test_name, extension)
+            return None
+
+        platform_dir, baseline_filename = baselines[1]
+        if platform_dir:
+            return self._filesystem.join(platform_dir, baseline_filename)
+        return None
+
     def expected_checksum(self, test_name):
         """Returns the checksum of the image we expect the test to produce,
         or None if it is a text-only test.
diff --git a/third_party/blink/tools/blinkpy/web_tests/port/test.py b/third_party/blink/tools/blinkpy/web_tests/port/test.py
index ea9ee782..03dd7be 100644
--- a/third_party/blink/tools/blinkpy/web_tests/port/test.py
+++ b/third_party/blink/tools/blinkpy/web_tests/port/test.py
@@ -189,12 +189,12 @@
     tests.add('http/tests/ssl/text.html')
     tests.add('passes/args.html')
     tests.add('passes/error.html', error='stuff going to stderr')
-    tests.add('passes/image.html')
+    tests.add('passes/image.html', actual_text=None, expected_text=None)
     tests.add('passes/audio.html',
               actual_audio=base64.b64encode('audio-wav'), expected_audio='audio-wav',
               actual_text=None, expected_text=None,
               actual_image=None, expected_image=None,
-              actual_checksum=None)
+              actual_checksum=None, expected_checksum=None)
     tests.add('passes/platform_image.html')
     tests.add('passes/checksum_in_image.html',
               expected_image='tEXtchecksum\x00checksum_in_image-checksum')
@@ -229,24 +229,24 @@
     tests.add_reftest('failures/unexpected/mismatch.html', 'failures/unexpected/mismatch-expected-mismatch.html', same_image=True)
     tests.add('failures/unexpected/reftest-nopixel.html', actual_checksum=None, actual_image=None, is_reftest=True)
     tests.add('failures/unexpected/reftest-nopixel-expected.html', actual_checksum=None, actual_image=None, is_reftest=True)
-    tests.add('reftests/foo/test.html')
-    tests.add('reftests/foo/test-ref.html')
+    tests.add('reftests/foo/test.html', is_reftest=True)
+    tests.add('reftests/foo/test-ref.html', is_reftest=True)
 
-    tests.add('reftests/foo/multiple-match-success.html', actual_checksum='abc', actual_image='abc')
-    tests.add('reftests/foo/multiple-match-failure.html', actual_checksum='abc', actual_image='abc')
-    tests.add('reftests/foo/multiple-mismatch-success.html', actual_checksum='abc', actual_image='abc')
-    tests.add('reftests/foo/multiple-mismatch-failure.html', actual_checksum='abc', actual_image='abc')
-    tests.add('reftests/foo/multiple-both-success.html', actual_checksum='abc', actual_image='abc')
-    tests.add('reftests/foo/multiple-both-failure.html', actual_checksum='abc', actual_image='abc')
+    tests.add('reftests/foo/multiple-match-success.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
+    tests.add('reftests/foo/multiple-match-failure.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
+    tests.add('reftests/foo/multiple-mismatch-success.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
+    tests.add('reftests/foo/multiple-mismatch-failure.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
+    tests.add('reftests/foo/multiple-both-success.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
+    tests.add('reftests/foo/multiple-both-failure.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
 
-    tests.add('reftests/foo/matching-ref.html', actual_checksum='abc', actual_image='abc')
-    tests.add('reftests/foo/mismatching-ref.html', actual_checksum='def', actual_image='def')
-    tests.add('reftests/foo/second-mismatching-ref.html', actual_checksum='ghi', actual_image='ghi')
+    tests.add('reftests/foo/matching-ref.html', actual_checksum='abc', actual_image='abc', is_reftest=True)
+    tests.add('reftests/foo/mismatching-ref.html', actual_checksum='def', actual_image='def', is_reftest=True)
+    tests.add('reftests/foo/second-mismatching-ref.html', actual_checksum='ghi', actual_image='ghi', is_reftest=True)
 
     # The following files shouldn't be treated as reftests
     tests.add_reftest('reftests/foo/unlistedtest.html', 'reftests/foo/unlistedtest-expected.html', same_image=True)
-    tests.add('reftests/foo/reference/bar/common.html')
-    tests.add('reftests/foo/reftest/bar/shared.html')
+    tests.add('reftests/foo/reference/bar/common.html', is_reftest=True)
+    tests.add('reftests/foo/reftest/bar/shared.html', is_reftest=True)
 
     tests.add('websocket/tests/passes/text.html')
 
@@ -268,13 +268,15 @@
     tests.add('passes/testharness.html',
               actual_text='This is a testharness.js-based test.\nPASS: bah\n'
                           'Harness: the test ran to completion.',
-              actual_image=None,
-              expected_text=None)
+              expected_text=None,
+              actual_checksum=None, actual_image=None,
+              expected_checksum=None, expected_image=None)
     tests.add('failures/unexpected/testharness.html',
               actual_text='This is a testharness.js-based test.\nFAIL: bah\n'
                           'Harness: the test ran to completion.',
-              actual_image=None,
-              expected_text=None)
+              expected_text=None,
+              actual_checksum=None, actual_image=None,
+              expected_checksum=None, expected_image=None)
 
     return tests
 
diff --git a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py
index acebc6a..f31fec0 100644
--- a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py
+++ b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests.py
@@ -336,13 +336,24 @@
                 action='store',
                 help='Output per-test profile information, using the specified profiler.'),
             optparse.make_option(
-                '--reset-shell-between-tests',
+                '--restart-shell-between-tests',
                 action='store_true',
                 default=False,
-                help='Resetting the shell between tests causes the tests to '
+                help='Restarting the shell between tests causes the tests to '
                      'take twice as long to run on average, but provides more '
                      'consistent results. This is automatically enabled if '
-                     '--repeat-each or --gtest_repeat is specified'),
+                     '--repeat-each or --gtest_repeat is specified with '
+                     'iterations > 1. This is equivalent to setting '
+                     '--batch-size=1'),
+            optparse.make_option(
+                '--reuse-shell-between-tests',
+                action='store_true',
+                default=False,
+                help='Reusing the shell between tests causes tests to run more '
+                     'quickly but has less consistent results. This is '
+                     'primarily useful for debugging flakiness that only '
+                     'occurs when content shell is reused. This is equivalent '
+                     'to setting --batch-size=0.'),
             optparse.make_option(
                 '--repeat-each',
                 type='int',
@@ -513,8 +524,36 @@
 
 def _set_up_derived_options(port, options, args):
     """Sets the options values that depend on other options values."""
-    if options.batch_size is None:
-        options.batch_size = port.default_batch_size()
+    if options.restart_shell_between_tests:
+        # --restart-shell-between-tests is identical to setting --batch-size=1.
+        assert not options.reuse_shell_between_tests, (
+            '--restart-shell-between-tests is not compatible with '
+            '--reuse-shell-between-tests.')
+        assert options.batch_size is None, (
+            '--restart-shell-between-tests is not compatible with --batch-size')
+        options.derived_batch_size = 1
+        options.must_use_derived_batch_size = True
+    elif options.reuse_shell_between_tests:
+        # --reuse-shell-between-tests is identical to setting --batch-size=0
+        assert options.batch_size is None, (
+            '--reuse-shell-between-tests is not compatible with --batch-size')
+        options.derived_batch_size = 0
+        options.must_use_derived_batch_size = True
+    elif options.batch_size is not None:
+        options.derived_batch_size = options.batch_size
+        options.must_use_derived_batch_size = True
+    else:
+        # No flag has explicitly set the batch size.
+        # If 'repeat_each' or 'iterations' has been set, then implicitly set the
+        # batch size to 1. If we're already repeating the tests more than once,
+        # then we're not particularly concerned with speed. Restarting content
+        # shell provides more consistent results.
+        if options.repeat_each > 1 or options.iterations > 1:
+            options.derived_batch_size = 1
+            options.must_use_derived_batch_size = True
+        else:
+            options.derived_batch_size = port.default_batch_size()
+            options.must_use_derived_batch_size = False
 
     if not options.child_processes:
         options.child_processes = port.host.environ.get(
diff --git a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py
index edde421..04ba3d3b 100644
--- a/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py
+++ b/third_party/blink/tools/blinkpy/web_tests/run_webkit_tests_unittest.py
@@ -996,6 +996,117 @@
         self.assertEqual(len(test_result.failures), 2)
         self.assertEqual(test_failures.determine_result_type(test_result.failures), test_expectations.IMAGE_PLUS_TEXT)
 
+    def test_extra_baselines(self):
+        host = MockHost()
+        extra_txt = test.LAYOUT_TEST_DIR + '/passes/image-expected.txt'
+        host.filesystem.write_text_file(extra_txt, 'Extra txt')
+        extra_wav = test.LAYOUT_TEST_DIR + '/passes/image-expected.wav'
+        host.filesystem.write_text_file(extra_wav, 'Extra wav')
+        test_name = 'passes/image.html'
+        run_details, log_stream, _ = logging_run([test_name], tests_included=True, host=host)
+        self.assertNotEqual(run_details.exit_code, 0)
+        self.assertEqual(run_details.initial_results.total, 1)
+        test_result = run_details.initial_results.all_results[0]
+        self.assertEqual(test_result.test_name, test_name)
+        self.assertEqual(len(test_result.failures), 2)
+        self.assertTrue(test_failures.has_failure_type(test_failures.FailureTextMismatch, test_result.failures))
+        self.assertTrue(test_failures.has_failure_type(test_failures.FailureAudioMismatch, test_result.failures))
+        self.assert_contains(log_stream, 'Please remove %s' % extra_txt)
+        self.assert_contains(log_stream, 'Please remove %s' % extra_wav)
+
+    def test_reftest_extra_baselines(self):
+        host = MockHost()
+        extra_png = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.png'
+        host.filesystem.write_text_file(extra_png, 'Extra png')
+        extra_wav = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.wav'
+        host.filesystem.write_text_file(extra_wav, 'Extra wav')
+        optional_txt = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.txt'
+        host.filesystem.write_text_file(optional_txt, 'reftest')
+        test_name = 'passes/reftest.html'
+        run_details, log_stream, _ = logging_run([test_name], tests_included=True, host=host)
+        self.assertNotEqual(run_details.exit_code, 0)
+        self.assertEqual(run_details.initial_results.total, 1)
+        test_result = run_details.initial_results.all_results[0]
+        self.assertEqual(test_result.test_name, test_name)
+        self.assertEqual(len(test_result.failures), 1)
+        self.assertTrue(test_failures.has_failure_type(test_failures.FailureAudioMismatch, test_result.failures))
+        # For now extra png baseline is only reported in an error message.
+        self.assert_contains(log_stream, 'Please remove %s' % extra_png)
+        self.assert_contains(log_stream, 'Please remove %s' % extra_wav)
+
+    def test_reftest_extra_png_baseline(self):
+        host = MockHost()
+        extra_png = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.png'
+        host.filesystem.write_text_file(extra_png, 'Extra png')
+        test_name = 'passes/reftest.html'
+        run_details, log_stream, _ = logging_run([test_name], tests_included=True, host=host)
+        self.assertEqual(run_details.exit_code, 0)
+        # For now extra png baseline is only reported in an error message.
+        self.assert_contains(log_stream, 'Please remove %s' % extra_png)
+
+    def test_passing_testharness_extra_baselines(self):
+        host = MockHost()
+        extra_png = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.png'
+        host.filesystem.write_text_file(extra_png, 'Extra png')
+        extra_txt = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.txt'
+        host.filesystem.write_text_file(extra_txt,
+            'This is a testharness.js-based test.\nPASS: bah\nHarness: the test ran to completion.')
+        extra_wav = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.wav'
+        host.filesystem.write_text_file(extra_wav, 'Extra wav')
+        test_name = 'passes/testharness.html'
+        run_details, log_stream, _ = logging_run([test_name], tests_included=True, host=host)
+        self.assertNotEqual(run_details.exit_code, 0)
+        self.assertEqual(run_details.initial_results.total, 1)
+        test_result = run_details.initial_results.all_results[0]
+        self.assertEqual(test_result.test_name, test_name)
+        self.assertEqual(len(test_result.failures), 2)
+        self.assertTrue(test_failures.has_failure_type(test_failures.FailureImageHashMismatch, test_result.failures))
+        self.assertTrue(test_failures.has_failure_type(test_failures.FailureAudioMismatch, test_result.failures))
+        # For now extra txt baseline for all-pass testharness test is only reported in an error message.
+        self.assert_contains(log_stream, 'Please remove %s' % extra_png)
+        self.assert_contains(log_stream, 'Please remove %s' % extra_txt)
+        self.assert_contains(log_stream, 'Please remove %s' % extra_wav)
+
+    def test_passing_testharness_extra_txt_baseline(self):
+        host = MockHost()
+        extra_txt = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.txt'
+        host.filesystem.write_text_file(extra_txt,
+            'This is a testharness.js-based test.\nPASS: bah\nHarness: the test ran to completion.')
+        test_name = 'passes/testharness.html'
+        run_details, log_stream, _ = logging_run([test_name], tests_included=True, host=host)
+        self.assertEqual(run_details.exit_code, 0)
+        # For now extra txt baseline for all-pass testharness test is only reported in an error message.
+        self.assert_contains(log_stream, 'Please remove %s' % extra_txt)
+
+    def test_passing_testharness_extra_mismatching_txt_baseline(self):
+        host = MockHost()
+        extra_txt = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.txt'
+        host.filesystem.write_text_file(extra_txt,
+            'This is a testharness.js-based test.\nFAIL: bah\nHarness: the test ran to completion.')
+        test_name = 'passes/testharness.html'
+        run_details, log_stream, _ = logging_run([test_name], tests_included=True, host=host)
+        self.assertNotEqual(run_details.exit_code, 0)
+        self.assertEqual(run_details.initial_results.total, 1)
+        test_result = run_details.initial_results.all_results[0]
+        self.assertEqual(test_result.test_name, test_name)
+        self.assertEqual(len(test_result.failures), 1)
+        self.assertTrue(test_failures.has_failure_type(test_failures.FailureTextMismatch, test_result.failures))
+        self.assert_contains(log_stream, 'Please remove %s' % extra_txt)
+
+    def test_passing_testharness_overriding_baseline(self):
+        # An all-pass testharness text baseline is necessary when it overrides a fallback baseline.
+        host = MockHost()
+        # The base baseline expects a failure.
+        base_baseline = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.txt'
+        host.filesystem.write_text_file(base_baseline, 'Failure')
+        platform_baseline = test.LAYOUT_TEST_DIR + '/platform/test-mac-mac10.10/passes/testharness-expected.txt'
+        host.filesystem.write_text_file(platform_baseline,
+            'This is a testharness.js-based test.\nPASS: bah\nHarness: the test ran to completion.')
+        run_details, log_stream, _ = logging_run(
+            ['passes/testharness.html'], tests_included=True, host=host)
+        self.assertEqual(run_details.exit_code, 0)
+        self.assertNotIn('Please remove', log_stream.getvalue())
+
     def test_additional_platform_directory(self):
         self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/foo', '--order', 'natural']))
         self.assertTrue(passing_run(['--additional-platform-directory', '/tmp/../foo', '--order', 'natural']))
@@ -1102,9 +1213,9 @@
 
         json_string = host.filesystem.read_text_file('/tmp/layout-test-results/failing_results.json')
         results = parse_full_results(json_string)
-        self.assertTrue('multiple-match-success.html' not in results['tests']['reftests']['foo'])
-        self.assertTrue('multiple-mismatch-success.html' not in results['tests']['reftests']['foo'])
-        self.assertTrue('multiple-both-success.html' not in results['tests']['reftests']['foo'])
+        self.assertNotIn('multiple-match-success.html', results['tests']['reftests']['foo'])
+        self.assertNotIn('multiple-mismatch-success.html', results['tests']['reftests']['foo'])
+        self.assertNotIn('multiple-both-success.html', results['tests']['reftests']['foo'])
 
         self.assertEqual(
             results['tests']['reftests']['foo']['multiple-match-failure.html'],
@@ -1143,11 +1254,11 @@
     which fetch new baselines from elsewhere rather than generating them.
     """
 
-    def assert_baselines(self, file_list, log_stream, expected_file_base, expected_extensions):
-        """Asserts that the file_list contains baselines for one test.
+    def assert_baselines(self, written_files, log_stream, expected_file_base, expected_extensions):
+        """Asserts that the written_files contains baselines for one test.
 
         Args:
-            file_list: List of written files, from FileSystem.written_files.
+            written_files: from FileSystem.written_files.
             log_stream: The log stream from the run.
             expected_file_base: Relative path to the baseline,
                 without the extension, from the layout test directory.
@@ -1156,14 +1267,14 @@
         for ext in expected_extensions:
             baseline = '%s-expected%s' % (expected_file_base, ext)
             baseline_full_path = '%s/%s' % (test.LAYOUT_TEST_DIR, baseline)
-            self.assertIn(baseline_full_path, file_list)
-            baseline_message = 'Writing new expected result "%s"\n' % baseline
+            self.assertIsNotNone(written_files.get(baseline_full_path))
+            baseline_message = 'Writing new baseline "%s"\n' % baseline
             self.assert_contains(log_stream, baseline_message)
         # Assert that baselines with other extensions were not written.
         for ext in ({'.png', '.txt', '.wav'} - set(expected_extensions)):
             baseline = '%s-expected%s' % (expected_file_base, ext)
             baseline_full_path = '%s/%s' % (test.LAYOUT_TEST_DIR, baseline)
-            self.assertNotIn(baseline_full_path, file_list)
+            self.assertIsNone(written_files.get(baseline_full_path))
 
     def test_reset_results_basic(self):
         # Test that we update baselines in place when the test fails
@@ -1172,13 +1283,13 @@
         details, log_stream, _ = logging_run(
             ['--reset-results', 'failures/unexpected/text-image-checksum.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         # The run exit code is 0, indicating success; since we're resetting
         # baselines, it's OK for actual results to not match baselines.
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 7)
+        self.assertEqual(len(written_files.keys()), 7)
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'failures/unexpected/text-image-checksum',
             expected_extensions=['.txt', '.png'])
 
@@ -1189,12 +1300,12 @@
         details, log_stream, _ = logging_run(
             ['failures/unexpected/text-image-checksum.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         # In a normal test run where actual results don't match baselines, the
         # exit code indicates failure.
         self.assertEqual(details.exit_code, 1)
         self.assert_baselines(
-            file_list, log_stream, 'failures/unexpected/text-image-checksum',
+            written_files, log_stream, 'failures/unexpected/text-image-checksum',
             expected_extensions=[])
 
     def test_reset_results_missing_results(self):
@@ -1209,17 +1320,17 @@
                 'failures/unexpected/missing_render_tree_dump.html'
             ],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 8)
+        self.assertEqual(len(written_files.keys()), 8)
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'failures/unexpected/missing_text', ['.txt'])
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'failures/unexpected/missing_image', ['.png'])
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'failures/unexpected/missing_render_tree_dump',
             expected_extensions=['.txt'])
 
@@ -1234,11 +1345,11 @@
                 'passes/testharness.html'
             ],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 6)
-        self.assert_baselines(file_list, log_stream, 'failures/unexpected/testharness', ['.txt'])
-        self.assert_baselines(file_list, log_stream, 'passes/testharness', [])
+        self.assertEqual(len(written_files.keys()), 6)
+        self.assert_baselines(written_files, log_stream, 'failures/unexpected/testharness', ['.txt'])
+        self.assert_baselines(written_files, log_stream, 'passes/testharness', [])
 
     def test_reset_results_testharness_existing_baseline(self):
         # Tests that we update existing baseline for a testharness test.
@@ -1252,9 +1363,9 @@
             ],
             tests_included=True, host=host)
         self.assertEqual(details.exit_code, 0)
-        file_list = host.filesystem.written_files.keys()
-        self.assertEqual(len(file_list), 6)
-        self.assert_baselines(file_list, log_stream, 'failures/unexpected/testharness', ['.txt'])
+        written_files = host.filesystem.written_files
+        self.assertEqual(len(written_files.keys()), 6)
+        self.assert_baselines(written_files, log_stream, 'failures/unexpected/testharness', ['.txt'])
 
     def test_reset_results_image_only(self):
         # Tests that we don't create new text results for an image-only test.
@@ -1266,9 +1377,9 @@
             ],
             tests_included=True, host=host)
         self.assertEqual(details.exit_code, 0)
-        file_list = host.filesystem.written_files.keys()
-        self.assertEqual(len(file_list), 6)
-        self.assert_baselines(file_list, log_stream, 'failures/unexpected/image-only', ['.png'])
+        written_files = host.filesystem.written_files
+        self.assertEqual(len(written_files.keys()), 6)
+        self.assert_baselines(written_files, log_stream, 'failures/unexpected/image-only', ['.png'])
 
     def test_copy_baselines(self):
         # Test that we update the baselines in the version-specific directories
@@ -1287,9 +1398,9 @@
                 'failures/unexpected/text-image-checksum.html'
             ],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 1)
-        self.assertEqual(len(file_list), 11)
+        self.assertEqual(len(written_files.keys()), 11)
         self.assert_contains(
             log_stream,
             'Copying baseline to "platform/test-mac-mac10.10/failures/unexpected/text-image-checksum-expected.png"')
@@ -1314,11 +1425,11 @@
                 'failures/unexpected/text-image-checksum.html'
             ],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 7)
+        self.assertEqual(len(written_files.keys()), 7)
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'platform/test-mac-mac10.10/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
@@ -1329,11 +1440,11 @@
         details, log_stream, _ = logging_run(
             ['--reset-results', 'passes/reftest.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 5)
+        self.assertEqual(len(written_files.keys()), 5)
         self.assert_baselines(
-            file_list, log_stream, 'passes/reftest', expected_extensions=[])
+            written_files, log_stream, 'passes/reftest', expected_extensions=[])
 
     def test_reset_results_reftest_with_baseline_present(self):
         # In this case, there is a text baseline present; a new baseline is
@@ -1344,11 +1455,76 @@
         details, log_stream, _ = logging_run(
             ['--reset-results', 'passes/reftest.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 6)
+        self.assertEqual(len(written_files.keys()), 6)
         self.assert_baselines(
-            file_list, log_stream, 'passes/reftest',
+            written_files, log_stream, 'passes/reftest',
+            expected_extensions=['.txt'])
+
+    def test_reset_results_remove_extra_baselines(self):
+        host = MockHost()
+        extra_txt = test.LAYOUT_TEST_DIR + '/failures/unexpected/image-only-expected.txt'
+        host.filesystem.write_text_file(extra_txt, 'Extra txt')
+        extra_wav = test.LAYOUT_TEST_DIR + '/failures/unexpected/image-only-expected.wav'
+        host.filesystem.write_text_file(extra_wav, 'Extra wav')
+        details, log_stream, _ = logging_run(
+            ['--reset-results', 'failures/unexpected/image-only.html'],
+            tests_included=True, host=host)
+        written_files = host.filesystem.written_files
+        self.assertEqual(details.exit_code, 0)
+        self.assertEqual(len(written_files.keys()), 8)
+        self.assertIsNone(written_files[extra_txt])
+        self.assertIsNone(written_files[extra_wav])
+        self.assert_baselines(
+            written_files, log_stream, 'failures/unexpected/image-only',
+            expected_extensions=['.png'])
+
+    def test_reset_results_reftest_remove_extra_png_baseline(self):
+        host = MockHost()
+        extra_png = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.png'
+        host.filesystem.write_text_file(extra_png, 'Extra png')
+        extra_wav = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.wav'
+        host.filesystem.write_text_file(extra_wav, 'Extra wav')
+        optional_txt = test.LAYOUT_TEST_DIR + '/passes/reftest-expected.txt'
+        host.filesystem.write_text_file(optional_txt, 'reftest')
+        details, _, _ = logging_run(['--reset-results', 'passes/reftest.html'],
+                                    tests_included=True, host=host)
+        written_files = host.filesystem.written_files
+        self.assertEqual(details.exit_code, 0)
+        self.assertEqual(len(written_files.keys()), 8)
+        self.assertIsNone(written_files[extra_png])
+        self.assertIsNone(written_files[extra_wav])
+        self.assertEquals('reftest', written_files[optional_txt])
+
+    def test_reset_results_passing_testharness_remove_extra_baselines(self):
+        host = MockHost()
+        extra_png = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.png'
+        host.filesystem.write_text_file(extra_png, 'Extra png')
+        extra_txt = test.LAYOUT_TEST_DIR + '/passes/testharness-expected.txt'
+        host.filesystem.write_text_file(extra_txt, 'Extra txt')
+        details, log_stream, _ = logging_run(
+            ['--reset-results', 'passes/testharness.html'],
+            tests_included=True, host=host)
+        written_files = host.filesystem.written_files
+        self.assertEqual(details.exit_code, 0)
+        self.assertEqual(len(written_files.keys()), 7)
+        self.assertIsNone(written_files[extra_png])
+        self.assertIsNone(written_files[extra_txt])
+        self.assert_baselines(
+            written_files, log_stream, 'passes/testharness',
+            expected_extensions=[])
+
+    def test_reset_results_failing_testharness(self):
+        host = MockHost()
+        details, log_stream, _ = logging_run(
+            ['--reset-results', 'failures/unexpected/testharness.html'],
+            tests_included=True, host=host)
+        written_files = host.filesystem.written_files
+        self.assertEqual(details.exit_code, 0)
+        self.assertEqual(len(written_files.keys()), 6)
+        self.assert_baselines(
+            written_files, log_stream, 'failures/unexpected/testharness',
             expected_extensions=['.txt'])
 
     def test_new_flag_specific_baseline(self):
@@ -1367,12 +1543,12 @@
              '--reset-results',
              'failures/unexpected/text-image-checksum.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 7)
+        self.assertEqual(len(written_files.keys()), 7)
         # We should create new image baseline only.
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'flag-specific/flag/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
@@ -1392,9 +1568,9 @@
              '--copy-baselines',
              'failures/unexpected/text-image-checksum.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 1)
-        self.assertEqual(len(file_list), 11)
+        self.assertEqual(len(written_files.keys()), 11)
         self.assert_contains(
             log_stream,
             'Copying baseline to "flag-specific/flag/failures/unexpected/text-image-checksum-expected.png"')
@@ -1427,13 +1603,11 @@
             tests_included=True, host=host)
         self.assertEqual(details.exit_code, 0)
         self.assertFalse(host.filesystem.exists(flag_specific_baseline_txt))
-        file_list = host.filesystem.written_files.keys()
-        # Exclude the removed file.
-        file_list.remove(flag_specific_baseline_txt)
-        self.assertEqual(len(file_list), 7)
+        written_files = host.filesystem.written_files
+        self.assertEqual(len(written_files.keys()), 8)
         # We should create new image baseline only.
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'flag-specific/flag/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
@@ -1452,12 +1626,12 @@
             ['--reset-results',
              'virtual/virtual_failures/failures/unexpected/text-image-checksum.html'],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 7)
+        self.assertEqual(len(written_files.keys()), 7)
         # We should create new image baseline only.
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'virtual/virtual_failures/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
@@ -1477,12 +1651,12 @@
                 'failures/unexpected/text-image-checksum.html'
             ],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 7)
+        self.assertEqual(len(written_files.keys()), 7)
         # We should reset the platform image baseline.
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'platform/test-mac-mac10.10/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
@@ -1504,12 +1678,12 @@
                 'failures/unexpected/text-image-checksum.html'
             ],
             tests_included=True, host=host)
-        file_list = host.filesystem.written_files.keys()
+        written_files = host.filesystem.written_files
         self.assertEqual(details.exit_code, 0)
-        self.assertEqual(len(file_list), 8)
+        self.assertEqual(len(written_files.keys()), 8)
         # We should reset the platform image baseline.
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'platform/test-mac-mac10.10/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
@@ -1537,13 +1711,11 @@
             tests_included=True, host=host)
         self.assertEqual(details.exit_code, 0)
         self.assertFalse(host.filesystem.exists(virtual_baseline_txt))
-        file_list = host.filesystem.written_files.keys()
-        # Exclude the removed file.
-        file_list.remove(virtual_baseline_txt)
-        self.assertEqual(len(file_list), 7)
+        written_files = host.filesystem.written_files
+        self.assertEqual(len(written_files.keys()), 8)
         # We should create new image baseline only.
         self.assert_baselines(
-            file_list, log_stream,
+            written_files, log_stream,
             'virtual/virtual_failures/failures/unexpected/text-image-checksum',
             expected_extensions=['.png'])
 
diff --git a/third_party/inspector_protocol/README.chromium b/third_party/inspector_protocol/README.chromium
index b3df1f3..c13caa5 100644
--- a/third_party/inspector_protocol/README.chromium
+++ b/third_party/inspector_protocol/README.chromium
@@ -2,7 +2,7 @@
 Short Name: inspector_protocol
 URL: https://chromium.googlesource.com/deps/inspector_protocol/
 Version: 0
-Revision: 7c91103242e0bc0bbf4120e459506b5f0736cd26
+Revision: 460186cff1f0eead0d418626e7e75f52105182b2
 License: BSD
 License File: LICENSE
 Security Critical: no
diff --git a/third_party/inspector_protocol/check_protocol_compatibility.py b/third_party/inspector_protocol/check_protocol_compatibility.py
index 7e7d9af..e23bd702 100755
--- a/third_party/inspector_protocol/check_protocol_compatibility.py
+++ b/third_party/inspector_protocol/check_protocol_compatibility.py
@@ -168,6 +168,11 @@
     base_type_1 = type_1["type"]
     base_type_2 = type_2["type"]
 
+    # Binary and string have the same wire representation in JSON.
+    if ((base_type_1 == "string" and base_type_2 == "binary") or
+        (base_type_2 == "string" and base_type_1 == "binary")):
+      return
+
     if base_type_1 != base_type_2:
         errors.append("%s: %s base type mismatch, '%s' vs '%s'" % (context, kind, base_type_1, base_type_2))
     elif base_type_1 == "object":
diff --git a/third_party/inspector_protocol/code_generator.py b/third_party/inspector_protocol/code_generator.py
index da220fd..edf8c4de 100755
--- a/third_party/inspector_protocol/code_generator.py
+++ b/third_party/inspector_protocol/code_generator.py
@@ -266,6 +266,21 @@
     }
 
 
+def create_binary_type_definition():
+    # pylint: disable=W0622
+    return {
+        "return_type": "Binary",
+        "pass_type": "const Binary&",
+        "to_pass_type": "%s",
+        "to_raw_type": "%s",
+        "to_rvalue": "%s",
+        "type": "Binary",
+        "raw_type": "Binary",
+        "raw_pass_type": "const Binary&",
+        "raw_return_type": "Binary",
+    }
+
+
 def create_primitive_type_definition(type):
     # pylint: disable=W0622
     typedefs = {
@@ -443,8 +458,10 @@
         self.type_definitions["boolean"] = create_primitive_type_definition("boolean")
         self.type_definitions["object"] = create_object_type_definition()
         self.type_definitions["any"] = create_any_type_definition()
+        self.type_definitions["binary"] = create_binary_type_definition()
         for domain in self.json_api["domains"]:
             self.type_definitions[domain["domain"] + ".string"] = create_string_type_definition()
+            self.type_definitions[domain["domain"] + ".binary"] = create_binary_type_definition()
             if not ("types" in domain):
                 continue
             for type in domain["types"]:
@@ -457,6 +474,8 @@
                     self.type_definitions[type_name] = self.resolve_type(type)
                 elif type["type"] == domain["domain"] + ".string":
                     self.type_definitions[type_name] = create_string_type_definition()
+                elif type["type"] == domain["domain"] + ".binary":
+                    self.type_definitions[type_name] = create_binary_type_definition()
                 else:
                     self.type_definitions[type_name] = create_primitive_type_definition(type["type"])
 
diff --git a/third_party/inspector_protocol/convert_protocol_to_json.py b/third_party/inspector_protocol/convert_protocol_to_json.py
index 2dd6f50..96048f7 100755
--- a/third_party/inspector_protocol/convert_protocol_to_json.py
+++ b/third_party/inspector_protocol/convert_protocol_to_json.py
@@ -3,6 +3,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import argparse
 import collections
 import json
 import os.path
@@ -12,19 +13,22 @@
 import pdl
 
 def main(argv):
-    if len(argv) < 2:
-        sys.stderr.write("Usage: %s <protocol.pdl> <protocol.json>\n" % sys.argv[0])
-        return 1
-    file_name = os.path.normpath(argv[0])
+    parser = argparse.ArgumentParser(description=(
+        "Converts from .pdl to .json by invoking the pdl Python module."))
+    parser.add_argument('--map_binary_to_string', type=bool,
+                        help=('If set, binary in the .pdl is mapped to a '
+                              'string in .json. Client code will have to '
+                              'base64 decode the string to get the payload.'))
+    parser.add_argument("pdl_file", help="The .pdl input file to parse.")
+    parser.add_argument("json_file", help="The .json output file write.")
+    args = parser.parse_args(argv)
+    file_name = os.path.normpath(args.pdl_file)
     input_file = open(file_name, "r")
     pdl_string = input_file.read()
-    protocol = pdl.loads(pdl_string, file_name)
+    protocol = pdl.loads(pdl_string, file_name, args.map_binary_to_string)
     input_file.close()
-    output_file = open(argv[0].replace('.pdl', '.json'), 'wb')
-    json.dump(protocol, output_file, indent=4, separators=(',', ': '))
-    output_file.close()
 
-    output_file = open(os.path.normpath(argv[1]), 'wb')
+    output_file = open(os.path.normpath(args.json_file), 'wb')
     json.dump(protocol, output_file, indent=4, separators=(',', ': '))
     output_file.close()
 
diff --git a/third_party/inspector_protocol/lib/Maybe_h.template b/third_party/inspector_protocol/lib/Maybe_h.template
index 5af6960..15626ab 100644
--- a/third_party/inspector_protocol/lib/Maybe_h.template
+++ b/third_party/inspector_protocol/lib/Maybe_h.template
@@ -116,6 +116,15 @@
     using MaybeBase::operator=;
 };
 
+template<>
+class Maybe<Binary> : public MaybeBase<Binary> {
+public:
+    Maybe() { }
+    Maybe(Binary value) : MaybeBase(value) { }
+    Maybe(Maybe&& other) IP_NOEXCEPT : MaybeBase(std::move(other)) {}
+    using MaybeBase::operator=;
+};
+
 {% for namespace in config.protocol.namespace %}
 } // namespace {{namespace}}
 {% endfor %}
diff --git a/third_party/inspector_protocol/lib/ValueConversions_h.template b/third_party/inspector_protocol/lib/ValueConversions_h.template
index 4d64ec9..6549e5ab 100644
--- a/third_party/inspector_protocol/lib/ValueConversions_h.template
+++ b/third_party/inspector_protocol/lib/ValueConversions_h.template
@@ -100,6 +100,28 @@
 };
 
 template<>
+struct ValueConversions<Binary> {
+    static Binary fromValue(protocol::Value* value, ErrorSupport* errors)
+    {
+        String result;
+        bool success = value ? value->asString(&result) : false;
+        if (!success) {
+            errors->addError("string value expected");
+            return Binary();
+        }
+        Binary out = Binary::fromBase64(result, &success);
+        if (!success)
+          errors->addError("base64 decoding error");
+        return out;
+    }
+
+    static std::unique_ptr<protocol::Value> toValue(const Binary& value)
+    {
+        return StringValue::create(value.toBase64());
+    }
+};
+
+template<>
 struct ValueConversions<Value> {
     static std::unique_ptr<Value> fromValue(protocol::Value* value, ErrorSupport* errors)
     {
diff --git a/third_party/inspector_protocol/pdl.py b/third_party/inspector_protocol/pdl.py
index c8a5c6f..652e99c 100644
--- a/third_party/inspector_protocol/pdl.py
+++ b/third_party/inspector_protocol/pdl.py
@@ -10,18 +10,21 @@
 
 description = ''
 
-primitiveTypes = ['integer', 'number', 'boolean', 'string', 'object', 'any', 'array']
+
+primitiveTypes = ['integer', 'number', 'boolean', 'string', 'object', 'any', 'array', 'binary']
 
 
-def assignType(item, type, isArray=False):
-    if isArray:
+def assignType(item, type, is_array=False, map_binary_to_string=False):
+    if is_array:
         item['type'] = 'array'
         item['items'] = collections.OrderedDict()
-        assignType(item['items'], type)
+        assignType(item['items'], type, False, map_binary_to_string)
         return
 
     if type == 'enum':
         type = 'string'
+    if map_binary_to_string and type == 'binary':
+        type = 'string'
     if type in primitiveTypes:
         item['type'] = type
     else:
@@ -42,7 +45,7 @@
     return result
 
 
-def parse(data, file_name):
+def parse(data, file_name, map_binary_to_string=False):
     protocol = collections.OrderedDict()
     protocol['version'] = collections.OrderedDict()
     protocol['domains'] = []
@@ -88,7 +91,7 @@
             if 'types' not in domain:
                 domain['types'] = []
             item = createItem({'id': match.group(3)}, match.group(1), match.group(2))
-            assignType(item, match.group(5), match.group(4))
+            assignType(item, match.group(5), match.group(4), map_binary_to_string)
             domain['types'].append(item)
             continue
 
@@ -115,7 +118,7 @@
             param = createItem({}, match.group(1), match.group(2), match.group(6))
             if match.group(3):
                 param['optional'] = True
-            assignType(param, match.group(5), match.group(4))
+            assignType(param, match.group(5), match.group(4), map_binary_to_string)
             if match.group(5) == 'enum':
                 enumliterals = param['enum'] = []
             subitems.append(param)
@@ -161,7 +164,7 @@
     return protocol
 
 
-def loads(data, file_name):
+def loads(data, file_name, map_binary_to_string=False):
     if file_name.endswith(".pdl"):
-        return parse(data, file_name)
+        return parse(data, file_name, map_binary_to_string)
     return json.loads(data)
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml
index c57f5aed..7cf42e7 100644
--- a/tools/metrics/histograms/enums.xml
+++ b/tools/metrics/histograms/enums.xml
@@ -20386,7 +20386,7 @@
   <int value="2428" label="ShapeOutsideMarginBox"/>
   <int value="2429" label="PerformanceTimeline"/>
   <int value="2430" label="UserTiming"/>
-  <int value="2431" label="CSSSelectorPseudoIS"/>
+  <int value="2431" label="CSSSelectorPseudoWhere"/>
   <int value="2432" label="KeyboardApiGetLayoutMap"/>
   <int value="2433" label="WebRtcVaapiHWVP8Encoding"/>
   <int value="2434" label="PerformanceResourceTimingInitiatorType"/>
@@ -36314,7 +36314,7 @@
 <enum name="NotStreamingReason">
   <int value="0" label="DEPRECATED: Already loaded"/>
   <int value="1" label="Not HTTP"/>
-  <int value="2" label="Revalidation"/>
+  <int value="2" label="Reload"/>
   <int value="3" label="Context not valid"/>
   <int value="4" label="Encoding not supported"/>
   <int value="5" label="Thread busy"/>
@@ -50495,6 +50495,19 @@
   <int value="0" label="Used Omnibox"/>
 </enum>
 
+<enum name="UserActivationFrameResultEnum">
+  <int value="0" label="NullFailure"/>
+  <int value="1" label="NullSuccess"/>
+  <int value="2" label="SelfFailure"/>
+  <int value="3" label="SelfSuccess"/>
+  <int value="4" label="AncestorFailure"/>
+  <int value="5" label="AncestorSuccess"/>
+  <int value="6" label="DescendantFailure"/>
+  <int value="7" label="DescendantSuccess"/>
+  <int value="8" label="OtherFailure"/>
+  <int value="9" label="OtherSuccess"/>
+</enum>
+
 <enum name="UserCertContentDisposition">
   <int value="0" label="No Content-Disposition"/>
   <int value="1" label="Content-Disposition"/>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 5e53120..7205fc9 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -114010,6 +114010,24 @@
   </summary>
 </histogram>
 
+<histogram name="UserActivation.AvailabilityCheck.FrameResult"
+    enum="UserActivationFrameResultEnum">
+  <owner>mustaq@chromium.org</owner>
+  <summary>
+    Outcomes (success/failure) of transient user activation availability check
+    attempts for each type of caller frame (null, ancestor, descedant, other).
+  </summary>
+</histogram>
+
+<histogram name="UserActivation.Consumption.FrameResult"
+    enum="UserActivationFrameResultEnum">
+  <owner>mustaq@chromium.org</owner>
+  <summary>
+    Outcomes (success/failure) of user activation consumption attempts for each
+    type of caller frame (null, ancestor, descedant, other).
+  </summary>
+</histogram>
+
 <histogram name="UserCert.ContentDisposition" enum="UserCertContentDisposition">
   <obsolete>
     Removed in M57.
@@ -126194,9 +126212,11 @@
 </histogram_suffixes>
 
 <histogram_suffixes name="FileBrowserCrostiniSharedPathsDepth" separator=".">
-  <suffix name="downloads" label="Shared path in Downloads volume."/>
-  <suffix name="drive" label="Shared path in Drive volume."/>
-  <suffix name="other" label="Shared path in any other volume."/>
+  <suffix name="Downloads" label="Shared path in Downloads volume."/>
+  <suffix name="DriveComputers" label="Shared path in Drive Computers volume."/>
+  <suffix name="MyDrive" label="Shared path in My Drive volume."/>
+  <suffix name="Other" label="Shared path in any other volume."/>
+  <suffix name="TeamDrive" label="Shared path in Team Drive volume."/>
   <affected-histogram name="FileBrowser.CrostiniSharedPaths.Depth"/>
 </histogram_suffixes>
 
diff --git a/tools/perf/benchmarks/system_health_smoke_test.py b/tools/perf/benchmarks/system_health_smoke_test.py
index cd11a46..7198394d 100644
--- a/tools/perf/benchmarks/system_health_smoke_test.py
+++ b/tools/perf/benchmarks/system_health_smoke_test.py
@@ -38,6 +38,7 @@
   # and will later be removed.
   'system_health.memory_mobile/browse:tech:discourse_infinite_scroll',
   'system_health.memory_mobile/browse:social:facebook_infinite_scroll',
+  'system_health.memory_mobile/browse:social:tumblr_infinite_scroll',
   'system_health.memory_mobile/browse:news:cnn',
   'system_health.memory_mobile/load:news:cnn',
   'system_health.memory_mobile/load:tools:stackoverflow',
@@ -46,6 +47,7 @@
   'system_health.memory_desktop/load_accessibility:media:wikipedia',
   'system_health.memory_desktop/browse:tech:discourse_infinite_scroll',
   'system_health.memory_desktop/browse:social:facebook_infinite_scroll',
+  'system_health.memory_desktop/browse:social:tumblr_infinite_scroll',
   'system_health.memory_desktop/browse:news:flipboard',
   'system_health.memory_desktop/browse:search:google',
   'system_health.memory_desktop/browse:news:hackernews',
diff --git a/tools/perf/page_sets/data/system_health_desktop.json b/tools/perf/page_sets/data/system_health_desktop.json
index a39449d0..259da26a 100644
--- a/tools/perf/page_sets/data/system_health_desktop.json
+++ b/tools/perf/page_sets/data/system_health_desktop.json
@@ -69,6 +69,9 @@
         "browse:social:tumblr_infinite_scroll": {
             "DEFAULT": "system_health_desktop_056.wprgo"
         },
+        "browse:social:tumblr_infinite_scroll:2018": {
+            "DEFAULT": "system_health_desktop_049d29ed85.wprgo"
+        },
         "browse:social:twitter": {
             "DEFAULT": "system_health_desktop_053.wprgo"
         },
diff --git a/tools/perf/page_sets/data/system_health_desktop_049d29ed85.wprgo.sha1 b/tools/perf/page_sets/data/system_health_desktop_049d29ed85.wprgo.sha1
new file mode 100644
index 0000000..eeaa7135
--- /dev/null
+++ b/tools/perf/page_sets/data/system_health_desktop_049d29ed85.wprgo.sha1
@@ -0,0 +1 @@
+049d29ed851bce5aae1ff138f747d54f25a21e74
\ No newline at end of file
diff --git a/tools/perf/page_sets/data/system_health_mobile.json b/tools/perf/page_sets/data/system_health_mobile.json
index eda5d1c..3033779 100644
--- a/tools/perf/page_sets/data/system_health_mobile.json
+++ b/tools/perf/page_sets/data/system_health_mobile.json
@@ -96,6 +96,9 @@
         "browse:social:tumblr_infinite_scroll": {
             "DEFAULT": "system_health_mobile_062.wprgo"
         },
+        "browse:social:tumblr_infinite_scroll:2018": {
+            "DEFAULT": "system_health_mobile_f6eab4101a.wprgo"
+        },
         "browse:social:twitter": {
             "DEFAULT": "system_health_mobile_023.wprgo"
         },
diff --git a/tools/perf/page_sets/data/system_health_mobile_f6eab4101a.wprgo.sha1 b/tools/perf/page_sets/data/system_health_mobile_f6eab4101a.wprgo.sha1
new file mode 100644
index 0000000..9e29f4d
--- /dev/null
+++ b/tools/perf/page_sets/data/system_health_mobile_f6eab4101a.wprgo.sha1
@@ -0,0 +1 @@
+f6eab4101a26b9b93fab0463dfcf1f9306d58271
\ No newline at end of file
diff --git a/tools/perf/page_sets/system_health/browsing_stories.py b/tools/perf/page_sets/system_health/browsing_stories.py
index 26c5eea..d0528b17 100644
--- a/tools/perf/page_sets/system_health/browsing_stories.py
+++ b/tools/perf/page_sets/system_health/browsing_stories.py
@@ -1130,6 +1130,18 @@
   TAGS = [story_tags.INFINITE_SCROLL, story_tags.JAVASCRIPT_HEAVY,
           story_tags.YEAR_2016]
 
+class TumblrStory2018(_InfiniteScrollStory):
+  NAME = 'browse:social:tumblr_infinite_scroll:2018'
+  URL = 'https://techcrunch.tumblr.com/'
+  TAGS = [story_tags.INFINITE_SCROLL, story_tags.JAVASCRIPT_HEAVY,
+          story_tags.YEAR_2018]
+
+  def _Login(self, action_runner):
+    tumblr_login.LoginDesktopAccount(action_runner, 'tumblr')
+    action_runner.Wait(5)
+    # Without this page reload the mobile version does not correctly
+    # go to the https://techcrunch.tumblr.com
+    action_runner.ReloadPage()
 
 class TwitterScrollDesktopStory(_InfiniteScrollStory):
   NAME = 'browse:social:twitter_infinite_scroll'
diff --git a/ui/android/BUILD.gn b/ui/android/BUILD.gn
index d1dfb990..059fafb7 100644
--- a/ui/android/BUILD.gn
+++ b/ui/android/BUILD.gn
@@ -260,6 +260,7 @@
     "java/src/org/chromium/ui/ViewProvider.java",
     "java/src/org/chromium/ui/VSyncMonitor.java",
     "java/src/org/chromium/ui/base/ActivityAndroidPermissionDelegate.java",
+    "java/src/org/chromium/ui/base/ActivityKeyboardVisibilityDelegate.java",
     "java/src/org/chromium/ui/base/ActivityWindowAndroid.java",
     "java/src/org/chromium/ui/base/AndroidPermissionDelegate.java",
     "java/src/org/chromium/ui/base/Clipboard.java",
diff --git a/ui/android/java/src/org/chromium/ui/KeyboardVisibilityDelegate.java b/ui/android/java/src/org/chromium/ui/KeyboardVisibilityDelegate.java
index 689aa4e..78329b8 100644
--- a/ui/android/java/src/org/chromium/ui/KeyboardVisibilityDelegate.java
+++ b/ui/android/java/src/org/chromium/ui/KeyboardVisibilityDelegate.java
@@ -15,7 +15,7 @@
 import android.view.inputmethod.InputMethodManager;
 
 import org.chromium.base.Log;
-import org.chromium.base.VisibleForTesting;
+import org.chromium.base.ObserverList;
 
 import java.util.concurrent.atomic.AtomicInteger;
 
@@ -38,8 +38,21 @@
     /** The delegate to determine keyboard visibility. */
     private static KeyboardVisibilityDelegate sInstance = new KeyboardVisibilityDelegate();
 
-    /** Set this delegate to replace the keyboard in tests. */
-    private static KeyboardVisibilityDelegate sTestingInstance;
+    /**
+     * An interface to notify listeners of changes in the soft keyboard's visibility.
+     */
+    public interface KeyboardVisibilityListener {
+        /**
+         * Called whenever the keyboard might have changed.
+         * @param isShowing A boolean that's true if the keyboard is now visible.
+         */
+        void keyboardVisibilityChanged(boolean isShowing);
+    }
+    private final ObserverList<KeyboardVisibilityListener> mKeyboardVisibilityListeners =
+            new ObserverList<>();
+
+    protected void registerKeyboardVisibilityCallbacks() {}
+    protected void unregisterKeyboardVisibilityCallbacks() {}
 
     /**
      * Allows setting a new strategy to override the default {@link KeyboardVisibilityDelegate}.
@@ -53,30 +66,11 @@
     }
 
     /**
-     * Setting a test instance of the visibility delegate that won't affect the default instance.
-     *
-     * @param delegate A {@link KeyboardVisibilityDelegate} instance.
-     */
-    @VisibleForTesting
-    public static void setDelegateForTesting(KeyboardVisibilityDelegate delegate) {
-        sTestingInstance = delegate;
-    }
-
-    /**
-     * Clears any previously set test instance.
-     */
-    @VisibleForTesting
-    public static void clearDelegateForTesting() {
-        sTestingInstance = null;
-    }
-
-    /**
      * Prefer using {@link org.chromium.ui.base.WindowAndroid#getKeyboardDelegate()} over this
      * method. Both return a delegate which allows checking and influencing the keyboard state.
      * @return the global {@link KeyboardVisibilityDelegate}.
      */
     public static KeyboardVisibilityDelegate getInstance() {
-        if (sTestingInstance != null) return sTestingInstance;
         return sInstance;
     }
 
@@ -121,11 +115,21 @@
     }
 
     /**
-     * Hides the soft keyboard by using the {@link Context#INPUT_METHOD_SERVICE}.
+     * Hides the soft keyboard.
      * @param view The {@link View} that is currently accepting input.
      * @return Whether the keyboard was visible before.
      */
     public boolean hideKeyboard(View view) {
+        return hideAndroidSoftKeyboard(view);
+    }
+
+    /**
+     * Hides the soft keyboard by using the {@link Context#INPUT_METHOD_SERVICE}.
+     * This template method simplifies mocking and the access to the soft keyboard in subclasses.
+     * @param view The {@link View} that is currently accepting input.
+     * @return Whether the keyboard was visible before.
+     */
+    protected boolean hideAndroidSoftKeyboard(View view) {
         InputMethodManager imm = (InputMethodManager) view.getContext().getSystemService(
                 Context.INPUT_METHOD_SERVICE);
         return imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
@@ -134,11 +138,10 @@
     /**
      * Calculates the keyboard height based on the bottom margin it causes for the given
      * rootView. It is used to determine whether the keyboard is visible.
-     * @param context A {@link Context} instance.
      * @param rootView A {@link View}.
      * @return The size of the bottom margin which most likely is exactly the keyboard size.
      */
-    public int calculateKeyboardHeight(Context context, View rootView) {
+    public int calculateKeyboardHeight(View rootView) {
         Rect appRect = new Rect();
         rootView.getWindowVisibleDisplayFrame(appRect);
 
@@ -186,16 +189,60 @@
     }
 
     /**
-     * Detects whether or not the keyboard is showing. This is a best guess based on the height
-     * of the keyboard as there is no standardized/foolproof way to do this.
+     * Returns whether the keyboard is showing.
      * @param context A {@link Context} instance.
      * @param view    A {@link View}.
      * @return        Whether or not the software keyboard is visible.
      */
     public boolean isKeyboardShowing(Context context, View view) {
+        return isAndroidSoftKeyboardShowing(context, view);
+    }
+
+    /**
+     * Detects whether or not the keyboard is showing. This is a best guess based on the height
+     * of the keyboard as there is no standardized/foolproof way to do this.
+     * This template method simplifies mocking and the access to the soft keyboard in subclasses.
+     * @param context A {@link Context} instance.
+     * @param view    A {@link View}.
+     * @return        Whether or not the software keyboard is visible.
+     */
+    protected boolean isAndroidSoftKeyboardShowing(Context context, View view) {
         View rootView = view.getRootView();
         return rootView != null
-                && calculateKeyboardHeight(context, rootView)
+                && calculateKeyboardHeight(rootView)
                 > calculateKeyboardDetectionThreshold(context, rootView);
     }
+
+    /**
+     * To be called when the keyboard visibility state might have changed. Informs listeners of the
+     * state change IFF there actually was a change.
+     * @param isShowing The current (guesstimated) state of the keyboard.
+     */
+    protected void notifyListeners(boolean isShowing) {
+        for (KeyboardVisibilityListener listener : mKeyboardVisibilityListeners) {
+            listener.keyboardVisibilityChanged(isShowing);
+        }
+    }
+
+    /**
+     * Adds a listener that is updated of keyboard visibility changes. This works as a best guess.
+     *
+     * @see org.chromium.ui.KeyboardVisibilityDelegate#isKeyboardShowing(Context, View)
+     */
+    public void addKeyboardVisibilityListener(KeyboardVisibilityListener listener) {
+        if (mKeyboardVisibilityListeners.isEmpty()) {
+            registerKeyboardVisibilityCallbacks();
+        }
+        mKeyboardVisibilityListeners.addObserver(listener);
+    }
+
+    /**
+     * @see #addKeyboardVisibilityListener(KeyboardVisibilityListener)
+     */
+    public void removeKeyboardVisibilityListener(KeyboardVisibilityListener listener) {
+        mKeyboardVisibilityListeners.removeObserver(listener);
+        if (mKeyboardVisibilityListeners.isEmpty()) {
+            unregisterKeyboardVisibilityCallbacks();
+        }
+    }
 }
diff --git a/ui/android/java/src/org/chromium/ui/base/ActivityKeyboardVisibilityDelegate.java b/ui/android/java/src/org/chromium/ui/base/ActivityKeyboardVisibilityDelegate.java
new file mode 100644
index 0000000..121caaa8
--- /dev/null
+++ b/ui/android/java/src/org/chromium/ui/base/ActivityKeyboardVisibilityDelegate.java
@@ -0,0 +1,64 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.ui.base;
+
+import android.app.Activity;
+import android.support.annotation.Nullable;
+import android.view.View;
+
+import org.chromium.ui.KeyboardVisibilityDelegate;
+
+import java.lang.ref.WeakReference;
+
+/**
+ * A {@link KeyboardVisibilityDelegate} that listens to a given activity for layout changes. It
+ * notifies {@link KeyboardVisibilityDelegate.KeyboardVisibilityListener} whenever the layout change
+ * is suspected to be caused by a keyboard.
+ */
+public class ActivityKeyboardVisibilityDelegate
+        extends KeyboardVisibilityDelegate implements View.OnLayoutChangeListener {
+    private boolean mIsKeyboardShowing;
+    private WeakReference<Activity> mActivity;
+
+    /**
+     * Creates a new delegate listening to the given activity. If the activity is destroyed, it will
+     * continue to work as a regular {@link KeyboardVisibilityDelegate}.
+     * @param activity A {@link WeakReference} to an {@link Activity}.
+     */
+    public ActivityKeyboardVisibilityDelegate(WeakReference<Activity> activity) {
+        mActivity = activity;
+    }
+
+    public @Nullable Activity getActivity() {
+        return mActivity.get();
+    }
+
+    @Override
+    public void registerKeyboardVisibilityCallbacks() {
+        Activity activity = getActivity();
+        if (activity == null) return;
+        View content = activity.findViewById(android.R.id.content);
+        mIsKeyboardShowing = isKeyboardShowing(activity, content);
+        content.addOnLayoutChangeListener(this);
+    }
+
+    @Override
+    public void unregisterKeyboardVisibilityCallbacks() {
+        Activity activity = getActivity();
+        if (activity == null) return;
+        activity.findViewById(android.R.id.content).removeOnLayoutChangeListener(this);
+    }
+
+    @Override
+    public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft,
+            int oldTop, int oldRight, int oldBottom) {
+        Activity activity = getActivity();
+        if (activity == null) return;
+        boolean isShowing = isKeyboardShowing(activity, v);
+        if (mIsKeyboardShowing == isShowing) return;
+        mIsKeyboardShowing = isShowing;
+        notifyListeners(isShowing);
+    }
+}
\ No newline at end of file
diff --git a/ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java
index 94d0658..57f2eec 100644
--- a/ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java
+++ b/ui/android/java/src/org/chromium/ui/base/ActivityWindowAndroid.java
@@ -10,7 +10,6 @@
 import android.content.Context;
 import android.content.Intent;
 import android.content.IntentSender.SendIntentException;
-import android.view.View;
 
 import org.chromium.base.ActivityState;
 import org.chromium.base.ApplicationStatus;
@@ -25,8 +24,7 @@
  * Only instantiate this class when you need the implemented features.
  */
 public class ActivityWindowAndroid
-        extends WindowAndroid
-        implements ApplicationStatus.ActivityStateListener, View.OnLayoutChangeListener {
+        extends WindowAndroid implements ApplicationStatus.ActivityStateListener {
     // Constants used for intent request code bounding.
     private static final int REQUEST_CODE_PREFIX = 1000;
     private static final int REQUEST_CODE_RANGE_SIZE = 100;
@@ -61,6 +59,7 @@
             ApplicationStatus.registerStateListenerForActivity(this, activity);
         }
 
+        setKeyboardDelegate(createKeyboardVisibilityDelegate());
         setAndroidPermissionDelegate(createAndroidPermissionDelegate());
     }
 
@@ -68,20 +67,13 @@
         return new ActivityAndroidPermissionDelegate(getActivity());
     }
 
-    @Override
-    protected void registerKeyboardVisibilityCallbacks() {
-        Activity activity = getActivity().get();
-        if (activity == null) return;
-        View content = activity.findViewById(android.R.id.content);
-        mIsKeyboardShowing = getKeyboardDelegate().isKeyboardShowing(getActivity().get(), content);
-        content.addOnLayoutChangeListener(this);
+    protected ActivityKeyboardVisibilityDelegate createKeyboardVisibilityDelegate() {
+        return new ActivityKeyboardVisibilityDelegate(getActivity());
     }
 
     @Override
-    protected void unregisterKeyboardVisibilityCallbacks() {
-        Activity activity = getActivity().get();
-        if (activity == null) return;
-        activity.findViewById(android.R.id.content).removeOnLayoutChangeListener(this);
+    public ActivityKeyboardVisibilityDelegate getKeyboardDelegate() {
+        return (ActivityKeyboardVisibilityDelegate) super.getKeyboardDelegate();
     }
 
     @Override
@@ -167,7 +159,7 @@
 
     @Override
     public WeakReference<Activity> getActivity() {
-        return new WeakReference<Activity>(activityFromContext(getContext().get()));
+        return new WeakReference<>(activityFromContext(getContext().get()));
     }
 
     @Override
@@ -190,13 +182,6 @@
                                       : super.getActivityState();
     }
 
-    @Override
-    public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft,
-            int oldTop, int oldRight, int oldBottom) {
-        keyboardVisibilityPossiblyChanged(
-                getKeyboardDelegate().isKeyboardShowing(getActivity().get(), v));
-    }
-
     private int generateNextRequestCode() {
         int requestCode = REQUEST_CODE_PREFIX + mNextRequestCode;
         mNextRequestCode = (mNextRequestCode + 1) % REQUEST_CODE_RANGE_SIZE;
diff --git a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
index c4abae2..54a015c 100644
--- a/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
+++ b/ui/android/java/src/org/chromium/ui/base/WindowAndroid.java
@@ -51,6 +51,8 @@
 @JNINamespace("ui")
 public class WindowAndroid implements AndroidPermissionDelegate {
     private static final String TAG = "WindowAndroid";
+    private KeyboardVisibilityDelegate mKeyboardVisibilityDelegate =
+            KeyboardVisibilityDelegate.getInstance();
 
     @TargetApi(Build.VERSION_CODES.KITKAT)
     private class TouchExplorationMonitor {
@@ -100,8 +102,6 @@
     private HashSet<Animator> mAnimationsOverContent = new HashSet<>();
     private View mAnimationPlaceholderView;
 
-    protected boolean mIsKeyboardShowing;
-
     // System accessibility service.
     private final AccessibilityManager mAccessibilityManager;
 
@@ -119,15 +119,6 @@
     private boolean mVSyncPaused;
 
     /**
-     * An interface to notify listeners of changes in the soft keyboard's visibility.
-     */
-    public interface KeyboardVisibilityListener {
-        public void keyboardVisibilityChanged(boolean isShowing);
-    }
-    private ObserverList<KeyboardVisibilityListener> mKeyboardVisibilityListeners =
-            new ObserverList<>();
-
-    /**
      * An interface to notify listeners that a context menu is closed.
      */
     public interface OnCloseContextMenuListener {
@@ -691,40 +682,19 @@
         }
     }
 
-    protected void registerKeyboardVisibilityCallbacks() {
-    }
-
-    protected void unregisterKeyboardVisibilityCallbacks() {
-    }
-
-    /**
-     * Adds a listener that is updated of keyboard visibility changes. This works as a best guess.
-     *
-     * @see org.chromium.ui.KeyboardVisibilityDelegate#isKeyboardShowing(Context, View)
-     */
-    public void addKeyboardVisibilityListener(KeyboardVisibilityListener listener) {
-        if (mKeyboardVisibilityListeners.isEmpty()) {
-            registerKeyboardVisibilityCallbacks();
-        }
-        mKeyboardVisibilityListeners.addObserver(listener);
-    }
-
-    /**
-     * @see #addKeyboardVisibilityListener(KeyboardVisibilityListener)
-     */
-    public void removeKeyboardVisibilityListener(KeyboardVisibilityListener listener) {
-        mKeyboardVisibilityListeners.removeObserver(listener);
-        if (mKeyboardVisibilityListeners.isEmpty()) {
-            unregisterKeyboardVisibilityCallbacks();
-        }
-    }
-
     /**
      * The returned {@link KeyboardVisibilityDelegate} can read and influence the soft keyboard.
      * @return a {@link KeyboardVisibilityDelegate} specific for this window.
      */
     public KeyboardVisibilityDelegate getKeyboardDelegate() {
-        return KeyboardVisibilityDelegate.getInstance();
+        return mKeyboardVisibilityDelegate;
+    }
+
+    @VisibleForTesting
+    public void setKeyboardDelegate(KeyboardVisibilityDelegate keyboardDelegate) {
+        mKeyboardVisibilityDelegate = keyboardDelegate;
+        // TODO(fhorschig): Remove - every caller should use the window to get the delegate.
+        KeyboardVisibilityDelegate.setInstance(keyboardDelegate);
     }
 
     /**
@@ -754,20 +724,6 @@
     }
 
     /**
-     * To be called when the keyboard visibility state might have changed. Informs listeners of the
-     * state change IFF there actually was a change.
-     * @param isShowing The current (guesstimated) state of the keyboard.
-     */
-    protected void keyboardVisibilityPossiblyChanged(boolean isShowing) {
-        if (mIsKeyboardShowing == isShowing) return;
-        mIsKeyboardShowing = isShowing;
-
-        for (KeyboardVisibilityListener listener : mKeyboardVisibilityListeners) {
-            listener.keyboardVisibilityChanged(isShowing);
-        }
-    }
-
-    /**
      * Start a post-layout animation on top of web content.
      *
      * By default, Android optimizes what it shows on top of SurfaceViews (saves power).
diff --git a/ui/aura/local/window_port_local.cc b/ui/aura/local/window_port_local.cc
index e7977ba..9dcc7d8 100644
--- a/ui/aura/local/window_port_local.cc
+++ b/ui/aura/local/window_port_local.cc
@@ -193,11 +193,6 @@
   UpdateLocalSurfaceId();
 }
 
-bool WindowPortLocal::IsLocalSurfaceIdAllocationSuppressed() const {
-  return parent_local_surface_id_allocator_ &&
-         parent_local_surface_id_allocator_->is_allocation_suppressed();
-}
-
 viz::ScopedSurfaceIdAllocator WindowPortLocal::GetSurfaceIdAllocator(
     base::OnceCallback<void()> allocation_task) {
   return viz::ScopedSurfaceIdAllocator(
diff --git a/ui/aura/local/window_port_local.h b/ui/aura/local/window_port_local.h
index f71c859..7c81448 100644
--- a/ui/aura/local/window_port_local.h
+++ b/ui/aura/local/window_port_local.h
@@ -49,7 +49,6 @@
                          std::unique_ptr<ui::PropertyData> data) override;
   std::unique_ptr<cc::LayerTreeFrameSink> CreateLayerTreeFrameSink() override;
   void AllocateLocalSurfaceId() override;
-  bool IsLocalSurfaceIdAllocationSuppressed() const override;
   viz::ScopedSurfaceIdAllocator GetSurfaceIdAllocator(
       base::OnceCallback<void()> allocation_task) override;
   void UpdateLocalSurfaceIdFromEmbeddedClient(
diff --git a/ui/aura/mus/window_port_mus.cc b/ui/aura/mus/window_port_mus.cc
index e711055..3bf4e272 100644
--- a/ui/aura/mus/window_port_mus.cc
+++ b/ui/aura/mus/window_port_mus.cc
@@ -463,10 +463,6 @@
     local_layer_tree_frame_sink_->SetLocalSurfaceId(local_surface_id_);
 }
 
-bool WindowPortMus::IsLocalSurfaceIdAllocationSuppressed() const {
-  return parent_local_surface_id_allocator_.is_allocation_suppressed();
-}
-
 viz::ScopedSurfaceIdAllocator WindowPortMus::GetSurfaceIdAllocator(
     base::OnceCallback<void()> allocation_task) {
   return viz::ScopedSurfaceIdAllocator(&parent_local_surface_id_allocator_,
diff --git a/ui/aura/mus/window_port_mus.h b/ui/aura/mus/window_port_mus.h
index 006ea615..53ca3a3 100644
--- a/ui/aura/mus/window_port_mus.h
+++ b/ui/aura/mus/window_port_mus.h
@@ -290,7 +290,6 @@
                          std::unique_ptr<ui::PropertyData> data) override;
   std::unique_ptr<cc::LayerTreeFrameSink> CreateLayerTreeFrameSink() override;
   void AllocateLocalSurfaceId() override;
-  bool IsLocalSurfaceIdAllocationSuppressed() const override;
   viz::ScopedSurfaceIdAllocator GetSurfaceIdAllocator(
       base::OnceCallback<void()> allocation_task) override;
   const viz::LocalSurfaceId& GetLocalSurfaceId() override;
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index bb4f7a6..31072e7 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -1119,10 +1119,6 @@
   port_->AllocateLocalSurfaceId();
 }
 
-bool Window::IsLocalSurfaceIdAllocationSuppressed() const {
-  return port_->IsLocalSurfaceIdAllocationSuppressed();
-}
-
 viz::ScopedSurfaceIdAllocator Window::GetSurfaceIdAllocator(
     base::OnceCallback<void()> allocation_task) {
   return port_->GetSurfaceIdAllocator(std::move(allocation_task));
diff --git a/ui/aura/window.h b/ui/aura/window.h
index a3effa5..79b2560 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -401,10 +401,6 @@
   // that does not involve a resize or a device scale factor change.
   void AllocateLocalSurfaceId();
 
-  // When a child-allocated viz::LocalSurfaceId is being processed, this returns
-  // true.
-  bool IsLocalSurfaceIdAllocationSuppressed() const;
-
   viz::ScopedSurfaceIdAllocator GetSurfaceIdAllocator(
       base::OnceCallback<void()> allocation_task);
 
diff --git a/ui/aura/window_port.h b/ui/aura/window_port.h
index 8f7ebfe..d1d28c0 100644
--- a/ui/aura/window_port.h
+++ b/ui/aura/window_port.h
@@ -106,10 +106,6 @@
   // that does not involve a resize or a device scale factor change.
   virtual void AllocateLocalSurfaceId() = 0;
 
-  // When a child-allocated viz::LocalSurfaceId is being processed, this returns
-  // true.
-  virtual bool IsLocalSurfaceIdAllocationSuppressed() const = 0;
-
   // When a ScopedSurfaceIdAllocator is alive, it prevents the
   // allocator from actually allocating. Instead, it triggers its
   // |allocation_task| upon destruction. This allows us to issue only one
diff --git a/ui/aura/window_port_for_shutdown.cc b/ui/aura/window_port_for_shutdown.cc
index 8f01bef..983abe4 100644
--- a/ui/aura/window_port_for_shutdown.cc
+++ b/ui/aura/window_port_for_shutdown.cc
@@ -62,10 +62,6 @@
     const viz::LocalSurfaceId& embedded_client_local_surface_id,
     base::TimeTicks embedded_client_local_surface_id_allocation_time) {}
 
-bool WindowPortForShutdown::IsLocalSurfaceIdAllocationSuppressed() const {
-  return false;
-}
-
 viz::ScopedSurfaceIdAllocator WindowPortForShutdown::GetSurfaceIdAllocator(
     base::OnceCallback<void()> allocation_task) {
   return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
diff --git a/ui/aura/window_port_for_shutdown.h b/ui/aura/window_port_for_shutdown.h
index c6c8c8f1..3849597 100644
--- a/ui/aura/window_port_for_shutdown.h
+++ b/ui/aura/window_port_for_shutdown.h
@@ -41,7 +41,6 @@
                          std::unique_ptr<ui::PropertyData> data) override;
   std::unique_ptr<cc::LayerTreeFrameSink> CreateLayerTreeFrameSink() override;
   void AllocateLocalSurfaceId() override;
-  bool IsLocalSurfaceIdAllocationSuppressed() const override;
   viz::ScopedSurfaceIdAllocator GetSurfaceIdAllocator(
       base::OnceCallback<void()> allocation_task) override;
   void UpdateLocalSurfaceIdFromEmbeddedClient(
diff --git a/ui/file_manager/file_manager/foreground/js/crostini.js b/ui/file_manager/file_manager/foreground/js/crostini.js
index 05cf08b2..1d625d1f 100644
--- a/ui/file_manager/file_manager/foreground/js/crostini.js
+++ b/ui/file_manager/file_manager/foreground/js/crostini.js
@@ -13,15 +13,17 @@
 /**
  * Keep in sync with histograms.xml:FileBrowserCrostiniSharedPathsDepth
  * histogram_suffix.
- * @private {!Array<VolumeManagerCommon.RootType>}
+ * @private {!Map<VolumeManagerCommon.RootType, string>}
  */
-Crostini.UMA_VALID_ROOT_TYPES = [
-  VolumeManagerCommon.RootType.DOWNLOADS,
-  VolumeManagerCommon.RootType.DRIVE,
-];
+Crostini.VALID_ROOT_TYPES_FOR_SHARE = new Map([
+  [VolumeManagerCommon.RootType.COMPUTERS_GRAND_ROOT, 'DriveComputers'],
+  [VolumeManagerCommon.RootType.DOWNLOADS, 'Downloads'],
+  [VolumeManagerCommon.RootType.DRIVE, 'MyDrive'],
+  [VolumeManagerCommon.RootType.TEAM_DRIVE, 'TeamDrive'],
+]);
 
 /** @private {string} */
-Crostini.UMA_ROOT_TYPE_OTHER = 'other';
+Crostini.UMA_ROOT_TYPE_OTHER = 'Other';
 
 /**
  * Maintains a list of paths shared with the crostini container.
@@ -48,9 +50,8 @@
   paths[entry.fullPath] = true;
 
   // Record UMA.
-  let suffix = info.rootType;
-  if (!Crostini.UMA_VALID_ROOT_TYPES.includes(info.rootType))
-    suffix = Crostini.UMA_ROOT_TYPE_OTHER;
+  let suffix = Crostini.VALID_ROOT_TYPES_FOR_SHARE.get(info.rootType) ||
+      Crostini.UMA_ROOT_TYPE_OTHER;
   metrics.recordSmallCount(
       'CrostiniSharedPaths.Depth.' + suffix,
       entry.fullPath.split('/').length - 1);
@@ -110,21 +111,22 @@
  * @param {!VolumeManager} volumeManager
  */
 Crostini.canSharePath = function(entry, persist, volumeManager) {
+
   // Check crostini-files flag and valid volume.
-  if (!Crostini.IS_CROSTINI_FILES_ENABLED ||
-      volumeManager.getLocationInfo(entry).rootType !==
-          VolumeManagerCommon.RootType.DOWNLOADS) {
+  if (!Crostini.IS_CROSTINI_FILES_ENABLED)
     return false;
-  }
 
   // Root of volume not allowed.
   if (entry.fullPath === '/')
     return false;
 
   // Only directories for persistent shares.
-  if (persist && !entry.isDirectory) {
+  if (persist && !entry.isDirectory)
     return false;
-  }
 
-  return true;
+  // Allow Downloads, and Drive if DriveFS is enabled.
+  const rootType = volumeManager.getLocationInfo(entry).rootType;
+  return rootType === VolumeManagerCommon.RootType.DOWNLOADS ||
+      (loadTimeData.getBoolean('DRIVE_FS_ENABLED') &&
+       Crostini.VALID_ROOT_TYPES_FOR_SHARE.has(rootType));
 };
diff --git a/ui/file_manager/file_manager/foreground/js/crostini_unittest.js b/ui/file_manager/file_manager/foreground/js/crostini_unittest.js
index b7964f64..1373a9f6 100644
--- a/ui/file_manager/file_manager/foreground/js/crostini_unittest.js
+++ b/ui/file_manager/file_manager/foreground/js/crostini_unittest.js
@@ -6,6 +6,12 @@
   recordSmallCount: function() {},
 };
 
+window.loadTimeData = {
+  getBoolean: function() {
+    return true;
+  }
+};
+
 const volumeManagerTest = {
   getLocationInfo: (entry) => {
     return {rootType: 'testroot'};
diff --git a/ui/file_manager/file_manager/test/crostini_share.js b/ui/file_manager/file_manager/test/crostini_share.js
index e669eb9..068d0243 100644
--- a/ui/file_manager/file_manager/test/crostini_share.js
+++ b/ui/file_manager/file_manager/test/crostini_share.js
@@ -47,7 +47,7 @@
         // Validate UMAs.
         assertEquals(1, chrome.metricsPrivate.smallCounts_.length);
         assertArrayEquals(
-            ['FileBrowser.CrostiniSharedPaths.Depth.downloads', 1],
+            ['FileBrowser.CrostiniSharedPaths.Depth.Downloads', 1],
             chrome.metricsPrivate.smallCounts_[0]);
         const lastEnumUma = chrome.metricsPrivate.values_.pop();
         assertEquals('FileBrowser.MenuItemSelected', lastEnumUma[0].metricName);
@@ -60,17 +60,21 @@
 };
 
 // Verify right-click menu with 'Share with Linux' is not shown for:
-// * Files (not directory)
-// * Any folder already shared
-// * Root Downloads folder
-// * Any folder outside of downloads (e.g. crostini or orive)
-crostiniShare.testSharePathNotShown = (done) => {
+// * Files (not directory).
+// * Any folder already shared.
+// * Root Downloads folder.
+// * Any folder outside of downloads (e.g. crostini or drive).
+// * Is shown for drive if DriveFS is enabled.
+crostiniShare.testSharePathShown = (done) => {
   const myFiles = '#directory-tree .tree-item [root-type-icon="my_files"]';
   const downloads = '#file-list li [file-type-icon="downloads"]';
   const linuxFiles = '#directory-tree .tree-item [root-type-icon="crostini"]';
   const googleDrive = '#directory-tree .tree-item [volume-type-icon="drive"]';
+  const menuHidden = '#file-context-menu[hidden]';
   const menuNoShareWithLinux = '#file-context-menu:not([hidden]) ' +
       '[command="#share-with-linux"][hidden][disabled="disabled"]';
+  const menuShareWithLinux = '#file-context-menu:not([hidden]) ' +
+      '[command="#share-with-linux"]:not([hidden]):not([disabled])';
   let alreadySharedPhotosDir;
 
   test.setupAndWaitUntilReady()
@@ -140,12 +144,28 @@
         return test.waitForElement(menuNoShareWithLinux);
       })
       .then(() => {
+        // Close menu by clicking file-list.
+        assertTrue(test.fakeMouseClick('#file-list'));
+        return test.waitForElement(menuHidden);
+      })
+      .then(() => {
+        // Set DRIVE_FS_ENABLED, and check that 'Share with Linux' is shown.
+        loadTimeData.data_['DRIVE_FS_ENABLED'] = true;
+        // Check 'Share with Linux' is not shown in menu.
+        assertTrue(
+            test.fakeMouseRightClick('#file-list [file-name="photos"]'),
+            'right-click photos');
+        return test.waitForElement(menuShareWithLinux);
+      })
+      .then(() => {
         // Reset Linux files back to unmounted.
         chrome.fileManagerPrivate.removeMount('crostini');
         return test.waitForElement(
             '#directory-tree .tree-item [root-type-icon="crostini"]');
       })
       .then(() => {
+        // Unset DRIVE_FS_ENABLED.
+        loadTimeData.data_['DRIVE_FS_ENABLED'] = false;
         // Clear Crostini shared folders.
         Crostini.unregisterSharedPath(
             alreadySharedPhotosDir, mockVolumeManager);
diff --git a/ui/file_manager/file_manager/test/js/strings.js b/ui/file_manager/file_manager/test/js/strings.js
index 1c2460a..ddbf998b 100644
--- a/ui/file_manager/file_manager/test/js/strings.js
+++ b/ui/file_manager/file_manager/test/js/strings.js
@@ -10,6 +10,7 @@
 // Extend with additional fields not found in grdp files.
 Object.setPrototypeOf(loadTimeData.data_, {
   'CHROMEOS_RELEASE_BOARD': 'unknown',
+  'DRIVE_FS_ENABLED': false,
   'GOOGLE_DRIVE_REDEEM_URL': 'http://www.google.com/intl/en/chrome/devices' +
       '/goodies.html?utm_source=filesapp&utm_medium=banner&utm_campaign=gsg',
   'HIDE_SPACE_INFO': false,
diff --git a/ui/gfx/blit_unittest.cc b/ui/gfx/blit_unittest.cc
index 98a80a3..1d70915 100644
--- a/ui/gfx/blit_unittest.cc
+++ b/ui/gfx/blit_unittest.cc
@@ -4,7 +4,7 @@
 
 #include <stdint.h>
 
-#include "base/memory/shared_memory.h"
+#include "base/memory/platform_shared_memory_region.h"
 #include "build/build_config.h"
 #include "skia/ext/platform_canvas.h"
 #include "testing/gtest/include/gtest/gtest.h"
@@ -148,15 +148,17 @@
 TEST(Blit, WithSharedMemory) {
   const int kCanvasWidth = 5;
   const int kCanvasHeight = 5;
-  base::SharedMemory shared_mem;
-  ASSERT_TRUE(shared_mem.CreateAnonymous(kCanvasWidth * kCanvasHeight));
-  base::SharedMemoryHandle section = shared_mem.handle();
+  base::subtle::PlatformSharedMemoryRegion section =
+      base::subtle::PlatformSharedMemoryRegion::CreateWritable(kCanvasWidth *
+                                                               kCanvasHeight);
+  ASSERT_TRUE(section.IsValid());
   std::unique_ptr<SkCanvas> canvas =
-      skia::CreatePlatformCanvasWithSharedSection(kCanvasWidth, kCanvasHeight,
-                                                  false, section.GetHandle(),
-                                                  skia::RETURN_NULL_ON_FAILURE);
+      skia::CreatePlatformCanvasWithSharedSection(
+          kCanvasWidth, kCanvasHeight, false, section.GetPlatformHandle(),
+          skia::RETURN_NULL_ON_FAILURE);
   ASSERT_TRUE(canvas);
-  shared_mem.Close();
+  // Closes a HANDLE associated with |section|, |canvas| must remain valid.
+  section = base::subtle::PlatformSharedMemoryRegion();
 
   uint8_t initial_values[kCanvasHeight][kCanvasWidth] = {
       {0x00, 0x01, 0x02, 0x03, 0x04},
diff --git a/ui/message_center/views/message_view.cc b/ui/message_center/views/message_view.cc
index a3782fe..c99255b 100644
--- a/ui/message_center/views/message_view.cc
+++ b/ui/message_center/views/message_view.cc
@@ -398,12 +398,10 @@
 }
 
 void MessageView::OnSettingsButtonPressed(const ui::Event& event) {
-  slide_out_controller_.CloseSwipeControl();
   MessageCenter::Get()->ClickOnSettingsButton(notification_id_);
 }
 
 void MessageView::OnSnoozeButtonPressed(const ui::Event& event) {
-  slide_out_controller_.CloseSwipeControl();
   // No default implementation for snooze.
 }
 
diff --git a/ui/message_center/views/message_view.h b/ui/message_center/views/message_view.h
index 3e6e0fc4..34a9dfa 100644
--- a/ui/message_center/views/message_view.h
+++ b/ui/message_center/views/message_view.h
@@ -152,11 +152,6 @@
   std::string notification_id() const { return notification_id_; }
 
  protected:
-  // Creates and add close button to view hierarchy when necessary. Derived
-  // classes should call this after its view hierarchy is populated to ensure
-  // it is on top of other views.
-  void CreateOrUpdateCloseButtonView(const Notification& notification);
-
   virtual void UpdateControlButtonsVisibility() = 0;
 
   // Changes the background color and schedules a paint.
diff --git a/ui/message_center/views/notification_view_md.cc b/ui/message_center/views/notification_view_md.cc
index ee5c757..49275ab 100644
--- a/ui/message_center/views/notification_view_md.cc
+++ b/ui/message_center/views/notification_view_md.cc
@@ -1274,11 +1274,6 @@
 }
 
 void NotificationViewMD::OnSettingsButtonPressed(const ui::Event& event) {
-  // TODO(yamaguchi): remove this line and call CloseSwipeControl() from parent
-  // view of this view. The parent view should activate the swipe control of
-  // the slider attached to this view.
-  CloseSwipeControl();
-
   if (settings_row_)
     ToggleInlineSettings(event);
   else
diff --git a/ui/message_center/views/slide_out_controller.h b/ui/message_center/views/slide_out_controller.h
index 6104858..767169a 100644
--- a/ui/message_center/views/slide_out_controller.h
+++ b/ui/message_center/views/slide_out_controller.h
@@ -40,7 +40,10 @@
   SlideOutController(ui::EventTarget* target, Delegate* delegate);
   ~SlideOutController() override;
 
-  void set_slide_mode(SlideMode mode) { mode_ = mode; }
+  void set_slide_mode(SlideMode mode) {
+    // TODO(yoshiki): Close the slide when the slide mode sets to NO_SLIDE.
+    mode_ = mode;
+  }
   float gesture_amount() const { return gesture_amount_; }
   SlideMode mode() const { return mode_; }
 
diff --git a/ui/views/touchui/touch_selection_controller_impl.cc b/ui/views/touchui/touch_selection_controller_impl.cc
index b5a08c77..050064b9 100644
--- a/ui/views/touchui/touch_selection_controller_impl.cc
+++ b/ui/views/touchui/touch_selection_controller_impl.cc
@@ -4,6 +4,8 @@
 
 #include "ui/views/touchui/touch_selection_controller_impl.h"
 
+#include <set>
+
 #include "base/metrics/histogram_macros.h"
 #include "base/time/time.h"
 #include "ui/aura/client/cursor_client.h"